36 static const unsigned __nan_bytes = 0x7fc00000;
37 return *(
const float *)&__nan_bytes;
39#define NAN __port_nan()
44#define TRACECALLBACK if(winetest_debug > 1) trace
46#define admitted_error 0.0001f
48#define compare_vertex_sizes(type, exp) \
49 got=D3DXGetFVFVertexSize(type); \
50 ok(got==exp, "Expected: %d, Got: %d\n", exp, got);
52#define compare_float(got, exp) \
56 ok(_got == _exp, "Expected: %g, Got: %g\n", _exp, _got); \
74#define check_floats(got, exp, dim) check_floats_(__LINE__, "", got, exp, dim)
78 char exp_buffer[256] =
"";
79 char got_buffer[256] =
"";
80 char *exp_buffer_ptr = exp_buffer;
81 char *got_buffer_ptr = got_buffer;
84 for (
i = 0;
i < dim;
i++) {
86 exp_buffer_ptr +=
sprintf(exp_buffer_ptr,
", ");
87 got_buffer_ptr +=
sprintf(got_buffer_ptr,
", ");
90 exp_buffer_ptr +=
sprintf(exp_buffer_ptr,
"%g", *
exp);
91 got_buffer_ptr +=
sprintf(got_buffer_ptr,
"%g", *got);
94 ok_(__FILE__,
line)(
equal,
"%sExpected (%s), got (%s)",
prefix, exp_buffer, got_buffer);
107 return (
a[0]==
b[0] &&
a[1] ==
b[1] &&
a[2] ==
b[2]);
133 skip(
"Couldn't create application window\n");
140 skip(
"Couldn't create IDirect3D9 object\n");
144 memset(&d3dpp, 0,
sizeof(d3dpp));
151 skip(
"Couldn't create IDirect3DDevice9 object %#x\n",
hr);
158 skip(
"Couldn't allocate memory for test_context\n");
238 DWORD number_of_vertices, number_of_faces;
240 IDirect3DIndexBuffer9 *index_buffer;
247 number_of_vertices = d3dxmesh->lpVtbl->GetNumVertices(d3dxmesh);
251 number_of_faces = d3dxmesh->lpVtbl->GetNumFaces(d3dxmesh);
261 skip(
"Couldn't get vertex buffer\n");
270 skip(
"Couldn't get vertex buffer description\n");
278 ok(vertex_buffer_description.
Usage == 0,
"Test %s, result %x, expected %x\n",
name, vertex_buffer_description.
Usage, 0);
279 ok(vertex_buffer_description.
Pool ==
D3DPOOL_MANAGED,
"Test %s, result %x, expected %x (D3DPOOL_MANAGED)\n",
281 ok(vertex_buffer_description.
FVF ==
mesh->
fvf,
"Test %s, result %x, expected %x\n",
291 ok(vertex_buffer_description.
Size ==
expected,
"Test %s, result %x, expected %x\n",
302 skip(
"Couldn't lock vertex buffer\n");
306 for (
i = 0;
i < number_of_vertices;
i++)
309 "Test %s, vertex position %d, result (%g, %g, %g), expected (%g, %g, %g)\n",
name,
i,
310 vertices[
i].position.x, vertices[
i].position.y, vertices[
i].position.z,
313 "Test %s, vertex normal %d, result (%g, %g, %g), expected (%g, %g, %g)\n",
name,
i,
314 vertices[
i].normal.x, vertices[
i].normal.y, vertices[
i].normal.z,
325 hr = d3dxmesh->lpVtbl->GetIndexBuffer(d3dxmesh, &index_buffer);
330 skip(
"Couldn't get index buffer\n");
339 skip(
"Couldn't get index buffer description\n");
343 ok(index_buffer_description.
Format ==
D3DFMT_INDEX16,
"Test %s, result %x, expected %x (D3DFMT_INDEX16)\n",
347 ok(index_buffer_description.
Usage == 0,
"Test %s, result %#x, expected %#x.\n",
348 name, index_buffer_description.
Usage, 0);
349 ok(index_buffer_description.
Pool ==
D3DPOOL_MANAGED,
"Test %s, result %x, expected %x (D3DPOOL_MANAGED)\n",
352 ok(index_buffer_description.
Size ==
expected,
"Test %s, result %x, expected %x\n",
363 skip(
"Couldn't lock index buffer\n");
367 for (
i = 0;
i < number_of_faces;
i++)
370 "Test %s, face %d, result (%u, %u, %u), expected (%u, %u, %u)\n",
name,
i,
371 faces[
i][0], faces[
i][1], faces[
i][2],
385 D3DXVECTOR3 bottom_point, center, top_point, raydirection, rayposition;
389 bottom_point.
x = -3.0f; bottom_point.
y = -2.0f; bottom_point.
z = -1.0f;
390 top_point.
x = 7.0f; top_point.
y = 8.0f; top_point.
z = 9.0f;
392 raydirection.
x = -4.0f; raydirection.
y = -5.0f; raydirection.
z = -6.0f;
393 rayposition.
x = 5.0f; rayposition.
y = 5.0f; rayposition.
z = 11.0f;
397 raydirection.
x = 4.0f; raydirection.
y = 5.0f; raydirection.
z = 6.0f;
398 rayposition.
x = 5.0f; rayposition.
y = 5.0f; rayposition.
z = 11.0f;
402 rayposition.
x = -4.0f; rayposition.
y = 1.0f; rayposition.
z = -2.0f;
406 bottom_point.
x = 1.0f; bottom_point.
y = 0.0f; bottom_point.
z = 0.0f;
407 top_point.
x = 1.0f; top_point.
y = 0.0f; top_point.
z = 0.0f;
408 rayposition.
x = 0.0f; rayposition.
y = 1.0f; rayposition.
z = 0.0f;
409 raydirection.
x = 0.0f; raydirection.
y = 3.0f; raydirection.
z = 0.0f;
413 bottom_point.
x = 1.0f; bottom_point.
y = 2.0f; bottom_point.
z = 3.0f;
414 top_point.
x = 10.0f; top_point.
y = 15.0f; top_point.
z = 20.0f;
416 raydirection.
x = 7.0f; raydirection.
y = 8.0f; raydirection.
z = 9.0f;
417 rayposition.
x = 3.0f; rayposition.
y = 7.0f; rayposition.
z = -6.0f;
421 bottom_point.
x = 0.0f; bottom_point.
y = 0.0f; bottom_point.
z = 0.0f;
422 top_point.
x = 1.0f; top_point.
y = 1.0f; top_point.
z = 1.0f;
424 raydirection.
x = 0.0f; raydirection.
y = 1.0f; raydirection.
z = .0f;
425 rayposition.
x = -3.0f; rayposition.
y = 0.0f; rayposition.
z = 0.0f;
429 raydirection.
x = 1.0f; raydirection.
y = 0.0f; raydirection.
z = .0f;
430 rayposition.
x = -3.0f; rayposition.
y = 0.0f; rayposition.
z = 0.0f;
435 radius =
sqrt(77.0f);
436 center.
x = 1.0f; center.
y = 2.0f; center.
z = 3.0f;
437 raydirection.
x = 2.0f; raydirection.
y = -4.0f; raydirection.
z = 2.0f;
438 rayposition.
x = 5.0f; rayposition.
y = 5.0f; rayposition.
z = 9.0f;
442 rayposition.
x = 45.0f; rayposition.
y = -75.0f; rayposition.
z = 49.0f;
446 raydirection.
x = -2.0f; raydirection.
y = 4.0f; raydirection.
z = -2.0f;
450 rayposition.
x = 5.0f; rayposition.
y = 11.0f; rayposition.
z = 9.0f;
454 raydirection.
x = 2.0f; raydirection.
y = -4.0f; raydirection.
z = 2.0f;
459 rayposition.
x = 2.0f; rayposition.
y = 2.0f; rayposition.
z = 3.0f;
463 raydirection.
x = 0.0f; raydirection.
y = 0.0f; raydirection.
z = 1.0f;
487 exp_min.
x = 1.0f; exp_min.
y = 1.0f; exp_min.
z = 1.0f;
488 exp_max.
x = 9.0f; exp_max.
y = 9.0f; exp_max.
z = 9.0f;
493 ok(
compare_vec3(exp_min,got_min),
"Expected min: (%f, %f, %f), got: (%f, %f, %f)\n", exp_min.
x,exp_min.
y,exp_min.
z,got_min.
x,got_min.
y,got_min.
z);
494 ok(
compare_vec3(exp_max,got_max),
"Expected max: (%f, %f, %f), got: (%f, %f, %f)\n", exp_max.
x,exp_max.
y,exp_max.
z,got_max.
x,got_max.
y,got_max.
z);
504 exp_min.
x = -6.92f; exp_min.
y = -8.1f; exp_min.
z = -3.80f;
505 exp_max.
x = 11.4f; exp_max.
y = 7.90f; exp_max.
z = 11.9f;
510 ok(
compare_vec3(exp_min,got_min),
"Expected min: (%f, %f, %f), got: (%f, %f, %f)\n", exp_min.
x,exp_min.
y,exp_min.
z,got_min.
x,got_min.
y,got_min.
z);
511 ok(
compare_vec3(exp_max,got_max),
"Expected max: (%f, %f, %f), got: (%f, %f, %f)\n", exp_max.
x,exp_max.
y,exp_max.
z,got_max.
x,got_max.
y,got_max.
z);
521 exp_min.
x = -6.92f; exp_min.
y = -0.9f; exp_min.
z = -3.8f;
522 exp_max.
x = 7.43f; exp_max.
y = 7.90f; exp_max.
z = 11.9f;
527 ok(
compare_vec3(exp_min,got_min),
"Expected min: (%f, %f, %f), got: (%f, %f, %f)\n", exp_min.
x,exp_min.
y,exp_min.
z,got_min.
x,got_min.
y,got_min.
z);
528 ok(
compare_vec3(exp_max,got_max),
"Expected max: (%f, %f, %f), got: (%f, %f, %f)\n", exp_max.
x,exp_max.
y,exp_max.
z,got_max.
x,got_max.
y,got_max.
z);
546 FLOAT exp_rad, got_rad;
556 exp_cen.
x = 5.0; exp_cen.
y = 5.0; exp_cen.
z = 5.0;
561 ok(
compare(exp_rad, got_rad),
"Expected radius: %f, got radius: %f\n", exp_rad, got_rad);
562 ok(
compare_vec3(exp_cen,got_cen),
"Expected center: (%f, %f, %f), got center: (%f, %f, %f)\n", exp_cen.
x,exp_cen.
y,exp_cen.
z,got_cen.
x,got_cen.
y,got_cen.
z);
572 exp_rad = 13.707883f;
573 exp_cen.
x = 2.408f; exp_cen.
y = 2.22f; exp_cen.
z = 3.76f;
578 ok(
compare(exp_rad, got_rad),
"Expected radius: %f, got radius: %f\n", exp_rad, got_rad);
579 ok(
compare_vec3(exp_cen,got_cen),
"Expected center: (%f, %f, %f), got center: (%f, %f, %f)\n", exp_cen.
x,exp_cen.
y,exp_cen.
z,got_cen.
x,got_cen.
y,got_cen.
z);
603 "[Element %d] Stream = %d, Offset = %d, Type = %d, Method = %d, Usage = %d, UsageIndex = %d\n",
611 unsigned int line,
unsigned int test_id)
622 if (!end1 && !end2)
break;
625 ok(!
status,
"Line %u, test %u: Mismatch in size, test declaration is %s than expected.\n",
626 line, test_id, end1 ?
"shorter" :
"longer");
634 ok(!
status,
"Line %u, test %u: Mismatch in element %u.\n",
line, test_id,
i);
644 HRESULT expected_hr,
unsigned int line,
unsigned int test_id)
650 ok(
hr == expected_hr,
651 "Line %u, test %u: D3DXDeclaratorFromFVF returned %#x, expected %#x.\n",
652 line, test_id,
hr, expected_hr);
657 HRESULT expected_hr,
unsigned int line,
unsigned int test_id)
660 DWORD result_fvf = 0xdeadbeef;
663 ok(
hr == expected_hr,
664 "Line %u, test %u: D3DXFVFFromDeclarator returned %#x, expected %#x.\n",
665 line, test_id,
hr, expected_hr);
668 ok(expected_fvf == result_fvf,
"Line %u, test %u: Got FVF %#x, expected %#x.\n",
669 line, test_id, result_fvf, expected_fvf);
897 decl,
D3D_OK, __LINE__, 0);
1117 BOOL exp_res, got_res;
1119 FLOAT exp_dist, got_dist, exp_u, got_u, exp_v, got_v;
1127 ray.
x = 2.0f; ray.
y = 3.0f; ray.
z = 4.0f;
1129 exp_res =
TRUE; exp_u = 0.5f; exp_v = 0.25f; exp_dist = 8.0f;
1132 ok(got_res == exp_res,
"Expected result %d, got %d.\n", exp_res, got_res);
1133 ok(
compare(exp_u, got_u),
"Expected u %f, got %f.\n", exp_u, got_u);
1134 ok(
compare(exp_v, got_v),
"Expected v %f, got %f.\n", exp_v, got_v);
1135 ok(
compare(exp_dist, got_dist),
"Expected distance %f, got %f.\n", exp_dist, got_dist);
1138 ok(got_res == exp_res,
"Expected result %d, got %d.\n", exp_res, got_res);
1144 got_u = got_v = got_dist = 0.0f;
1146 ok(got_res == exp_res,
"Expected result %d, got %d.\n", exp_res, got_res);
1147 ok(
compare(exp_u, got_u),
"Expected u %f, got %f.\n", exp_u, got_u);
1148 ok(
compare(exp_v, got_v),
"Expected v %f, got %f.\n", exp_v, got_v);
1149 ok(
compare(exp_dist, got_dist),
"Expected distance %f, got %f.\n", exp_dist, got_dist);
1157 got_u = got_v = got_dist = 0.0f;
1159 ok(got_res == exp_res,
"Expected result %d, got %d.\n", exp_res, got_res);
1160 ok(
compare(exp_u, got_u),
"Expected u %f, got %f.\n", exp_u, got_u);
1161 ok(
compare(exp_v, got_v),
"Expected v %f, got %f.\n", exp_v, got_v);
1162 ok(
compare(exp_dist, got_dist),
"Expected distance %f, got %f.\n", exp_dist, got_dist);
1173 ray.
x = 2.0f; ray.
y = 3.0f; ray.
z = 4.0f;
1178 ok( got_res == exp_res,
"Expected result = %d, got %d\n",exp_res,got_res);
1181 ok(got_res == exp_res,
"Expected result = %d, got %d\n", exp_res, got_res);
1191 ray.
x = 1.0f; ray.
y = 0.0f; ray.
z = 0.0f;
1196 ok( got_res == exp_res,
"Expected result = %d, got %d\n",exp_res,got_res);
1199 ok(got_res == exp_res,
"Expected result = %d, got %d\n", exp_res, got_res);
1205 IDirect3DDevice9 *
device, *test_device;
1206 ID3DXMesh *d3dxmesh;
1248 skip(
"Couldn't create test context\n");
1264 d3dxmesh->lpVtbl->Release(d3dxmesh);
1274 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
1279 hr = d3dxmesh->lpVtbl->GetDevice(d3dxmesh,
NULL);
1282 hr = d3dxmesh->lpVtbl->GetDevice(d3dxmesh, &test_device);
1284 ok(test_device ==
device,
"Got result %p, expected %p\n", test_device,
device);
1292 hr = d3dxmesh->lpVtbl->GetDeclaration(d3dxmesh,
NULL);
1295 hr = d3dxmesh->lpVtbl->GetDeclaration(d3dxmesh, test_decl);
1296 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
1301 for (
i = 0;
i <
size - 1;
i++)
1304 ok(test_decl[
i].
Type == decl1[
i].
Type,
"Returned type %d, expected %d\n", test_decl[
i].
Type, decl1[
i].
Type);
1305 ok(test_decl[
i].Method == decl1[
i].Method,
"Returned method %d, expected %d\n", test_decl[
i].Method, decl1[
i].Method);
1307 ok(test_decl[
i].UsageIndex == decl1[
i].UsageIndex,
"Returned usage index %d, expected %d\n", test_decl[
i].UsageIndex, decl1[
i].UsageIndex);
1310 ok(decl1[
size-1].
Stream == 0xFF,
"Returned too long vertex declaration\n");
1314 options = d3dxmesh->lpVtbl->GetOptions(d3dxmesh);
1320 skip(
"Couldn't create mesh\n");
1333 d3dxmesh->lpVtbl->Release(d3dxmesh);
1338 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
1343 hr = d3dxmesh->lpVtbl->GetDevice(d3dxmesh,
NULL);
1346 hr = d3dxmesh->lpVtbl->GetDevice(d3dxmesh, &test_device);
1348 ok(test_device ==
device,
"Got result %p, expected %p\n", test_device,
device);
1356 hr = d3dxmesh->lpVtbl->GetDeclaration(d3dxmesh, test_decl);
1357 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
1362 for (
i = 0;
i <
size - 1;
i++)
1365 ok(test_decl[
i].
Type == decl2[
i].
Type,
"Returned type %d, expected %d\n", test_decl[
i].
Type, decl2[
i].
Type);
1366 ok(test_decl[
i].Method == decl2[
i].Method,
"Returned method %d, expected %d\n", test_decl[
i].Method, decl2[
i].Method);
1368 ok(test_decl[
i].UsageIndex == decl2[
i].UsageIndex,
"Returned usage index %d, expected %d\n", test_decl[
i].UsageIndex, decl2[
i].UsageIndex);
1371 ok(decl2[
size-1].
Stream == 0xFF,
"Returned too long vertex declaration\n");
1375 options = d3dxmesh->lpVtbl->GetOptions(d3dxmesh);
1381 skip(
"Couldn't create mesh\n");
1398 d3dxmesh->lpVtbl->Release(d3dxmesh);
1411 IDirect3DDevice9 *
device, *test_device;
1412 ID3DXMesh *d3dxmesh;
1435 skip(
"Couldn't create test context\n");
1451 d3dxmesh->lpVtbl->Release(d3dxmesh);
1461 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
1466 hr = d3dxmesh->lpVtbl->GetDevice(d3dxmesh,
NULL);
1469 hr = d3dxmesh->lpVtbl->GetDevice(d3dxmesh, &test_device);
1471 ok(test_device ==
device,
"Got result %p, expected %p\n", test_device,
device);
1479 hr = d3dxmesh->lpVtbl->GetDeclaration(d3dxmesh,
NULL);
1482 hr = d3dxmesh->lpVtbl->GetDeclaration(d3dxmesh, test_decl);
1483 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
1488 for (
i = 0;
i <
size - 1;
i++)
1491 ok(test_decl[
i].
Type == decl[
i].
Type,
"Returned type %d, expected %d\n", test_decl[
i].
Type, decl[
i].
Type);
1492 ok(test_decl[
i].Method == decl[
i].Method,
"Returned method %d, expected %d\n", test_decl[
i].Method, decl[
i].Method);
1494 ok(test_decl[
i].UsageIndex == decl[
i].UsageIndex,
"Returned usage index %d, expected %d\n",
1495 test_decl[
i].UsageIndex, decl[
i].UsageIndex);
1498 ok(decl[
size-1].
Stream == 0xFF,
"Returned too long vertex declaration\n");
1502 options = d3dxmesh->lpVtbl->GetOptions(d3dxmesh);
1508 skip(
"Couldn't create mesh\n");
1521 d3dxmesh->lpVtbl->Release(d3dxmesh);
1527#define check_vertex_buffer(mesh, vertices, num_vertices, fvf) \
1528 check_vertex_buffer_(__LINE__, mesh, vertices, num_vertices, fvf)
1531 DWORD mesh_num_vertices =
mesh->lpVtbl->GetNumVertices(
mesh);
1533 const void *mesh_vertices;
1536 ok_(__FILE__,
line)(fvf == mesh_fvf,
"expected FVF %x, got %x\n", fvf, mesh_fvf);
1537 ok_(__FILE__,
line)(num_vertices == mesh_num_vertices,
1538 "Expected %u vertices, got %u\n", num_vertices, mesh_num_vertices);
1545 if (mesh_fvf == fvf) {
1548 for (
i = 0;
i <
min(num_vertices, mesh_num_vertices);
i++)
1550 const FLOAT *exp_float = vertices;
1551 const FLOAT *got_float = mesh_vertices;
1570 last_beta_dword =
TRUE;
1577 exp_float += pos_dim;
1578 got_float += pos_dim;
1580 if (last_beta_dword) {
1582 "Vertex[%u]: Expected last beta %08x, got %08x\n",
i, *(
DWORD*)exp_float, *(
DWORD*)got_float);
1595 "Vertex[%u]: Expected psize %g, got %g\n",
i, *exp_float, *got_float);
1601 "Vertex[%u]: Expected diffuse %08x, got %08x\n",
i, *(
DWORD*)exp_float, *(
DWORD*)got_float);
1607 "Vertex[%u]: Expected specular %08x, got %08x\n",
i, *(
DWORD*)exp_float, *(
DWORD*)got_float);
1613 for (
j = 0;
j < texcount;
j++) {
1614 DWORD dim = (((fvf >> (16 + 2 *
j)) + 1) & 0x03) + 1;
1621 vertices = (
BYTE*)vertices + vertex_size;
1622 mesh_vertices = (
BYTE*)mesh_vertices + vertex_size;
1626 mesh->lpVtbl->UnlockVertexBuffer(
mesh);
1629#define check_index_buffer(mesh, indices, num_indices, index_size) \
1630 check_index_buffer_(__LINE__, mesh, indices, num_indices, index_size)
1634 DWORD mesh_num_indices =
mesh->lpVtbl->GetNumFaces(
mesh) * 3;
1635 const void *mesh_indices;
1639 ok_(__FILE__,
line)(index_size == mesh_index_size,
1640 "Expected index size %u, got %u\n", index_size, mesh_index_size);
1641 ok_(__FILE__,
line)(num_indices == mesh_num_indices,
1642 "Expected %u indices, got %u\n", num_indices, mesh_num_indices);
1649 if (mesh_index_size == index_size) {
1650 for (
i = 0;
i <
min(num_indices, mesh_num_indices);
i++)
1652 if (index_size == 4)
1657 "Index[%u]: expected %u, got %u\n",
i, *(
WORD*)
indices, *(
WORD*)mesh_indices);
1659 mesh_indices = (
BYTE*)mesh_indices + index_size;
1662 mesh->lpVtbl->UnlockIndexBuffer(
mesh);
1665#define check_matrix(got, expected) check_matrix_(__LINE__, got, expected)
1669 for (
i = 0;
i < 4;
i++) {
1670 for (
j = 0;
j < 4;
j++) {
1672 "matrix[%u][%u]: expected %g, got %g\n",
1673 i,
j,
U(*expected).m[
i][
j],
U(*got).m[
i][
j]);
1681 "%sExpected (%g, %g, %g, %g), got (%g, %g, %g, %g)\n",
prefix,
1685#define check_materials(got, got_count, expected, expected_count) \
1686 check_materials_(__LINE__, got, got_count, expected, expected_count)
1692 ok_(__FILE__,
line)(got ==
NULL,
"Expected NULL material ptr, got %p\n", got);
1712#define check_generated_adjacency(mesh, got, epsilon) check_generated_adjacency_(__LINE__, mesh, got, epsilon)
1721 skip_(__FILE__,
line)(
"Out of memory\n");
1729 for (
i = 0;
i < num_faces;
i++)
1734 "Face %u adjacencies: Expected (%u, %u, %u), got (%u, %u, %u)\n",
i,
1736 got[
i * 3], got[
i * 3 + 1], got[
i * 3 + 2]);
1742#define check_generated_effects(materials, num_materials, effects) \
1743 check_generated_effects_(__LINE__, materials, num_materials, effects)
1747 static const struct {
1753#define EFFECT_TABLE_ENTRY(str, field) \
1754 {str, sizeof(str), sizeof(materials->MatD3D.field), offsetof(D3DXMATERIAL, MatD3D.field)}
1760#undef EFFECT_TABLE_ENTRY
1763 if (!num_materials) {
1764 ok_(__FILE__,
line)(effects ==
NULL,
"Expected NULL effects, got %p\n", effects);
1767 for (
i = 0;
i < num_materials;
i++)
1773 "effect[%u] NumDefaults: Expected %u, got %u\n",
i,
1780 "effect[%u].pDefaults[%u].pParamName: Expected '%s', got '%s'\n",
i,
j,
1783 "effect[%u].pDefaults[%u].Type: Expected %u, got %u\n",
i,
j,
1786 "effect[%u].pDefaults[%u].NumBytes: Expected %u, got %u\n",
i,
j,
1793 "effect[%u].pDefaults[%u] float value %u: Expected %g, got %g\n",
i,
j,
k,
expected, got);
1798 static const char *expected_name =
"Texture0@Name";
1801 "effect[%u].pDefaults[%u].pParamName: Expected '%s', got '%s'\n",
i,
j,
1804 "effect[%u].pDefaults[%u].Type: Expected %u, got %u\n",
i,
j,
1806 if (materials[
i].pTextureFilename) {
1808 "effect[%u] texture filename length: Expected %u, got %u\n",
i,
1811 "effect[%u] texture filename: Expected '%s', got '%s'\n",
i,
1821 if (!
p)
return NULL;
1829 TRACECALLBACK(
"ID3DXAllocateHierarchyImpl_DestroyFrame(%p, %p)\n", iface, frame);
1842 TRACECALLBACK(
"ID3DXAllocateHierarchyImpl_CreateFrame(%p, '%s', %p)\n", iface,
name, new_frame);
1906 TRACECALLBACK(
"ID3DXAllocateHierarchyImpl_CreateMeshContainer(%p, '%s', %u, %p, %p, %p, %d, %p, %p, %p)\n",
1907 iface,
name,
mesh_data->Type,
U(*mesh_data).pMesh, materials, effects,
1908 num_materials, adjacency, skin_info, *new_mesh_container);
1921 if (num_materials) {
1927 for (
i = 0;
i < num_materials;
i++)
1929 for (
i = 0;
i < num_materials;
i++) {
1930 if (materials[
i].pTextureFilename) {
1940 for (
i = 0;
i < num_materials;
i++) {
1965 default_dest->
Type = default_src->
Type;
1972 ok(adjacency !=
NULL,
"Expected non-NULL adjacency, got NULL\n");
1975 ID3DXBaseMesh *basemesh = (ID3DXBaseMesh*)
U(*mesh_data).pMesh;
1976 DWORD num_faces = basemesh->lpVtbl->GetNumFaces(basemesh);
1977 size_t size = num_faces *
sizeof(
DWORD) * 3;
1985 trace(
"FIXME: copying adjacency data for patch mesh not implemented\n");
1990 if (
U(*mesh_data).pMesh)
1991 IUnknown_AddRef(
U(*mesh_data).pMesh);
1994 skin_info->lpVtbl->AddRef(skin_info);
2012#define test_LoadMeshFromX(device, xfile_str, vertex_array, fvf, index_array, materials_array, check_adjacency) \
2013 test_LoadMeshFromX_(__LINE__, device, xfile_str, sizeof(xfile_str) - 1, vertex_array, ARRAY_SIZE(vertex_array), fvf, \
2014 index_array, ARRAY_SIZE(index_array), sizeof(*index_array), materials_array, ARRAY_SIZE(materials_array), \
2017 const void *vertices,
DWORD num_vertices,
DWORD fvf,
const void *
indices,
DWORD num_indices,
size_t index_size,
2025 DWORD num_materials = 0;
2032 check_adjacency ? &adjacency :
NULL, &materials, &effects, &num_materials, &
mesh);
2041 check_materials_(
line, materials_ptr, num_materials, expected_materials, expected_num_materials);
2043 if (check_adjacency)
2049 IUnknown_Release(
mesh);
2055 static const char empty_xfile[] =
"xof 0303txt 0032";
2057 static const char simple_xfile[] =
2067 static const WORD simple_index_buffer[] = {0, 1, 2};
2068 static const D3DXVECTOR3 simple_vertex_buffer[] = {
2069 {0.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {1.0, 1.0, 0.0}
2072 static const char framed_xfile[] =
2075 "Mesh { 3; 0.0; 0.0; 0.0;, 0.0; 1.0; 0.0;, 1.0; 1.0; 0.0;; 1; 3; 0, 1, 2;; }"
2076 "FrameTransformMatrix {"
2077 "1.0, 0.0, 0.0, 0.0,"
2078 "0.0, 1.0, 0.0, 0.0,"
2079 "0.0, 0.0, 1.0, 0.0,"
2080 "0.0, 0.0, 2.0, 1.0;;"
2082 "Mesh { 3; 0.0; 0.0; 0.0;, 0.0; 1.0; 0.0;, 2.0; 1.0; 0.0;; 1; 3; 0, 1, 2;; }"
2083 "FrameTransformMatrix {"
2084 "1.0, 0.0, 0.0, 0.0,"
2085 "0.0, 1.0, 0.0, 0.0,"
2086 "0.0, 0.0, 1.0, 0.0,"
2087 "0.0, 0.0, 3.0, 1.0;;"
2089 "Mesh { 3; 0.0; 0.0; 0.0;, 0.0; 1.0; 0.0;, 3.0; 1.0; 0.0;; 1; 3; 0, 1, 2;; }"
2091 static const WORD framed_index_buffer[] = { 0, 1, 2 };
2092 static const D3DXVECTOR3 framed_vertex_buffers[3][3] = {
2093 {{0.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {1.0, 1.0, 0.0}},
2094 {{0.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {2.0, 1.0, 0.0}},
2095 {{0.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {3.0, 1.0, 0.0}},
2097 static const WORD merged_index_buffer[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
2099 static const D3DXVECTOR3 merged_vertex_buffer[] = {
2100 {0.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {1.0, 1.0, 0.0},
2101 {0.0, 0.0, 2.0}, {0.0, 1.0, 2.0}, {2.0, 1.0, 2.0},
2102 {0.0, 0.0, 5.0}, {0.0, 1.0, 5.0}, {3.0, 1.0, 5.0},
2106 static const char box_xfile[] =
2145 "MeshMaterialList materials {"
2149 "0, 0, 0, 1, 1, 1;;"
2152 "0.0; 0.0; 1.0; 1.0;;"
2162 "1.0; 1.0; 1.0; 1.0;;"
2169 "TextureFilename { \"texture.jpg\"; }"
2172 "MeshVertexColors {"
2175 "0; 0.0; 0.0; 0.0; 0.0;;"
2176 "1; 0.0; 0.0; 1.0; 0.1;;"
2177 "2; 0.0; 1.0; 0.0; 0.2;;"
2178 "3; 0.0; 1.0; 1.0; 0.3;;"
2179 "4; 1.0; 0.0; 0.0; 0.4;;"
2180 "5; 1.0; 0.0; 1.0; 0.5;;"
2181 "6; 1.0; 1.0; 0.0; 0.6;;"
2182 "7; 1.0; 1.0; 1.0; 0.7;;"
2184 "MeshTextureCoords {"
2197 static const WORD box_index_buffer[] = {
2211 static const struct {
2216 } box_vertex_buffer[] = {
2217 {{0.0, 0.0, 0.0}, {-1.0, 0.0, 0.0}, 0x00000000, {0.0, 1.0}},
2218 {{0.0, 0.0, 1.0}, {-1.0, 0.0, 0.0}, 0x1a0000ff, {1.0, 1.0}},
2219 {{0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0}, 0x3300ff00, {0.0, 0.0}},
2220 {{0.0, 1.0, 1.0}, {-1.0, 0.0, 0.0}, 0x4d00ffff, {1.0, 0.0}},
2221 {{1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, 0x66ff0000, {1.0, 1.0}},
2222 {{1.0, 0.0, 1.0}, {1.0, 0.0, 0.0}, 0x80ff00ff, {0.0, 1.0}},
2223 {{1.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, 0x99ffff00, {1.0, 0.0}},
2224 {{1.0, 1.0, 1.0}, {0.0, 1.0, 0.0}, 0xb3ffffff, {0.0, 0.0}},
2225 {{0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, 0x3300ff00, {0.0, 0.0}},
2226 {{0.0, 1.0, 1.0}, {0.0, 1.0, 0.0}, 0x4d00ffff, {1.0, 0.0}},
2227 {{1.0, 1.0, 0.0}, {1.0, 0.0, 0.0}, 0x99ffff00, {1.0, 0.0}},
2228 {{1.0, 1.0, 1.0}, {1.0, 0.0, 0.0}, 0xb3ffffff, {0.0, 0.0}},
2229 {{0.0, 0.0, 1.0}, {0.0, -1.0, 0.0}, 0x1a0000ff, {1.0, 1.0}},
2230 {{0.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, 0x00000000, {0.0, 1.0}},
2231 {{1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, 0x66ff0000, {1.0, 1.0}},
2232 {{1.0, 0.0, 1.0}, {0.0, -1.0, 0.0}, 0x80ff00ff, {0.0, 1.0}},
2233 {{0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, 0x1a0000ff, {1.0, 1.0}},
2234 {{1.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, 0x80ff00ff, {0.0, 1.0}},
2235 {{1.0, 1.0, 1.0}, {0.0, 0.0, 1.0}, 0xb3ffffff, {0.0, 0.0}},
2236 {{0.0, 1.0, 1.0}, {0.0, 0.0, 1.0}, 0x4d00ffff, {1.0, 0.0}},
2237 {{0.0, 0.0, 0.0}, {0.0, 0.0, -1.0}, 0x00000000, {0.0, 1.0}},
2238 {{0.0, 1.0, 0.0}, {0.0, 0.0, -1.0}, 0x3300ff00, {0.0, 0.0}},
2239 {{1.0, 1.0, 0.0}, {0.0, 0.0, -1.0}, 0x99ffff00, {1.0, 0.0}},
2240 {{1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}, 0x66ff0000, {1.0, 1.0}},
2245 {0.0, 0.0, 1.0, 1.0},
2246 {0.0, 0.0, 0.0, 1.0},
2247 {1.0, 1.0, 1.0, 1.0},
2248 {0.0, 0.0, 0.0, 1.0},
2255 {1.0, 1.0, 1.0, 1.0},
2256 {0.0, 0.0, 0.0, 1.0},
2257 {1.0, 1.0, 1.0, 1.0},
2258 {0.0, 0.0, 0.0, 1.0},
2261 (
char *)
"texture.jpg",
2264 static const char box_anim_xfile[] =
2303 "MeshMaterialList materials {"
2307 "0, 0, 0, 1, 1, 1;;"
2310 "0.0; 0.0; 1.0; 1.0;;"
2320 "1.0; 1.0; 1.0; 1.0;;"
2327 "TextureFilename { \"texture.jpg\"; }"
2330 "MeshVertexColors {"
2333 "0; 0.0; 0.0; 0.0; 0.0;;"
2334 "1; 0.0; 0.0; 1.0; 0.1;;"
2335 "2; 0.0; 1.0; 0.0; 0.2;;"
2336 "3; 0.0; 1.0; 1.0; 0.3;;"
2337 "4; 1.0; 0.0; 0.0; 0.4;;"
2338 "5; 1.0; 0.0; 1.0; 0.5;;"
2339 "6; 1.0; 1.0; 0.0; 0.6;;"
2340 "7; 1.0; 1.0; 1.0; 0.7;;"
2342 "MeshTextureCoords {"
2356 "FrameTransformMatrix {"
2358 "1.0, 0.0, 0.0, 0.0,"
2359 "0.0, 1.0, 0.0, 0.0,"
2360 "0.0, 0.0, 1.0, 0.0,"
2361 "0.0, 0.0, 0.0, 1.0;;"
2365 "AnimationSet AnimationSet0 {"
2366 "Animation Animation0 {"
2372 "10; 3; -100.0, 0.0, 0.0;;,"
2373 "20; 3; -75.0, 0.0, 0.0;;,"
2374 "30; 3; -50.0, 0.0, 0.0;;,"
2375 "40; 3; -25.5, 0.0, 0.0;;,"
2376 "50; 3; 0.0, 0.0, 0.0;;,"
2377 "60; 3; 25.5, 0.0, 0.0;;,"
2378 "70; 3; 50.0, 0.0, 0.0;;,"
2379 "80; 3; 75.5, 0.0, 0.0;;,"
2380 "90; 3; 100.0, 0.0, 0.0;;;"
2390 {0.5, 0.5, 0.5, 0.0},
2391 {0.0, 0.0, 0.0, 0.0},
2392 {0.5, 0.5, 0.5, 0.0},
2393 {0.0, 0.0, 0.0, 0.0},
2405 ID3DXAnimationController *controller;
2409 skip(
"Couldn't create test context\n");
2444 ok(frame_hier->
Name ==
NULL,
"Expected NULL, got '%s'\n", frame_hier->
Name);
2462 controller = (ID3DXAnimationController *)0xdeadbeef;
2468 ok(controller !=
NULL,
"Animation Controller NULL.\n");
2473 controller->lpVtbl->Release(controller);
2478 controller = (ID3DXAnimationController *)0xdeadbeef;
2486 ok(!controller,
"Animation Controller returned.\n");
2487 ok(frame_hier->
Name ==
NULL,
"Expected NULL, got '%s'\n", frame_hier->
Name);
2512 ok(!
strcmp(frame_hier->
Name,
""),
"Expected '', got '%s'\n", frame_hier->
Name);
2518 for (
i = 0;
i < 3;
i++) {
2565 IUnknown_Release(
mesh);
2576 unsigned int i,
face;
2579 {-1.0f, -1.0f, -1.0f}, {-1.0f, -1.0f, 1.0f}, {-1.0f, 1.0f, 1.0f}, {-1.0f, 1.0f, -1.0f},
2580 {-1.0f, 1.0f, -1.0f}, {-1.0f, 1.0f, 1.0f}, { 1.0f, 1.0f, 1.0f}, { 1.0f, 1.0f, -1.0f},
2581 { 1.0f, 1.0f, -1.0f}, { 1.0f, 1.0f, 1.0f}, { 1.0f, -1.0f, 1.0f}, { 1.0f, -1.0f, -1.0f},
2582 {-1.0f, -1.0f, 1.0f}, {-1.0f, -1.0f, -1.0f}, { 1.0f, -1.0f, -1.0f}, { 1.0f, -1.0f, 1.0f},
2583 {-1.0f, -1.0f, 1.0f}, { 1.0f, -1.0f, 1.0f}, { 1.0f, 1.0f, 1.0f}, {-1.0f, 1.0f, 1.0f},
2584 {-1.0f, -1.0f, -1.0f}, {-1.0f, 1.0f, -1.0f}, { 1.0f, 1.0f, -1.0f}, { 1.0f, -1.0f, -1.0f}
2588 {-1.0f, 0.0f, 0.0f}, { 0.0f, 1.0f, 0.0f}, { 1.0f, 0.0f, 0.0f},
2589 { 0.0f, -1.0f, 0.0f}, { 0.0f, 0.0f, 1.0f}, { 0.0f, 0.0f, -1.0f}
2601 for (
i = 0;
i < 24;
i++)
2612 for (
i = 0;
i < 12;
i++)
2630 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
2633 skip(
"Couldn't create box\n");
2639 skip(
"Couldn't create mesh\n");
2640 box->lpVtbl->Release(
box);
2651 box->lpVtbl->Release(
box);
2656 IDirect3DDevice9*
device;
2660 static const DWORD adjacency[36]=
2666 1, 3, 11, 5, 6, 10};
2672 skip(
"Couldn't create test context\n");
2698 ok(adjacency[
i]==
buffer[
i],
"expected adjacency %d: %#x, received %#x\n",
i,adjacency[
i],
buffer[
i]);
2700 box->lpVtbl->Release(
box);
2727 for (
i = 0;
i < sides; ++
i)
2754 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
2757 skip(
"Couldn't create polygon\n");
2763 skip(
"Couldn't create mesh\n");
2764 polygon->lpVtbl->Release(polygon);
2775 polygon->lpVtbl->Release(polygon);
2781 IDirect3DDevice9 *
device;
2790 skip(
"Couldn't create test context\n");
2804 polygon = (
void *)0xdeadbeef;
2805 adjacency = (
void *)0xdeadbeef;
2808 ok(polygon == (
void *)0xdeadbeef,
"Polygon was changed to %p\n", polygon);
2809 ok(adjacency == (
void *)0xdeadbeef,
"Adjacency was changed to %p\n", adjacency);
2816 ok(
hr ==
D3D_OK,
"Expected D3D_OK, received %#x\n",
hr);
2822 for (
i = 0;
i < 11; ++
i)
2829 polygon->lpVtbl->Release(polygon);
2872 angle = angle_start;
2873 for (
i = 0;
i <
n;
i++)
2877 angle += angle_step;
2891 float theta_step, theta_start;
2893 float phi_step, phi_start;
2895 DWORD number_of_vertices, number_of_faces;
2900 theta_step =
D3DX_PI / stacks;
2901 theta_start = theta_step;
2904 phi_step = -2 *
D3DX_PI / slices;
2917 number_of_vertices = 2 + slices * (stacks-1);
2918 number_of_faces = 2 * slices + (stacks - 2) * (2 * slices);
2920 if (!
new_mesh(
mesh, number_of_vertices, number_of_faces))
3031 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
3034 skip(
"Couldn't create sphere\n");
3040 skip(
"Couldn't create mesh\n");
3041 sphere->lpVtbl->Release(sphere);
3047 sprintf(
name,
"sphere (%g, %u, %u)", radius, slices, stacks);
3052 sphere->lpVtbl->Release(sphere);
3058 IDirect3DDevice9*
device;
3059 ID3DXMesh* sphere =
NULL;
3076 skip(
"Couldn't create test context\n");
3106 float theta_step, theta_start;
3108 FLOAT delta_radius, radius, radius_step;
3109 FLOAT z, z_step, z_normal;
3110 DWORD number_of_vertices, number_of_faces;
3115 theta_step = -2 *
D3DX_PI / slices;
3123 number_of_vertices = 2 + (slices * (3 + stacks));
3124 number_of_faces = 2 * slices + stacks * (2 * slices);
3126 if (!
new_mesh(
mesh, number_of_vertices, number_of_faces))
3135 delta_radius = radius1 - radius2;
3137 radius_step = delta_radius / stacks;
3140 z_step =
length / stacks;
3141 z_normal = delta_radius /
length;
3142 if (
isnan(z_normal))
3210 if (
stack < stacks + 1)
3213 radius -= radius_step;
3258 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
3261 skip(
"Couldn't create cylinder\n");
3267 skip(
"Couldn't create mesh\n");
3274 sprintf(
name,
"cylinder (%g, %g, %g, %u, %u)", radius1, radius2,
length, slices, stacks);
3285 IDirect3DDevice9*
device;
3297 skip(
"Couldn't create test context\n");
3306 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
3317 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
3329 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
3357 float phi, phi_step, sin_phi, cos_phi;
3358 float theta, theta_step, sin_theta, cos_theta;
3359 unsigned int numvert, numfaces,
i,
j;
3361 numvert = sides * rings;
3362 numfaces = numvert * 2;
3367 phi_step =
D3DX_PI / sides * 2.0f;
3368 theta_step =
D3DX_PI / rings * -2.0f;
3372 for (
i = 0;
i < rings; ++
i)
3376 cos_theta =
cosf(theta);
3377 sin_theta =
sinf(theta);
3379 for (
j = 0;
j < sides; ++
j)
3381 sin_phi =
sinf(phi);
3382 cos_phi =
cosf(phi);
3384 mesh->
vertices[
i * sides +
j].position.x = (innerradius * cos_phi + outerradius) * cos_theta;
3385 mesh->
vertices[
i * sides +
j].position.y = (innerradius * cos_phi + outerradius) * sin_theta;
3386 mesh->
vertices[
i * sides +
j].position.z = innerradius * sin_phi;
3394 theta += theta_step;
3397 for (
i = 0;
i < numfaces - sides * 2; ++
i)
3400 mesh->
faces[
i][1] = (
i / 2 + 1) % sides ?
i / 2 + 1 :
i / 2 + 1 - sides;
3401 mesh->
faces[
i][2] = (
i + 1) % (sides * 2) ? (
i + 1) / 2 + sides : (
i + 1) / 2;
3404 for (
j = 0;
i < numfaces; ++
i, ++
j)
3407 mesh->
faces[
i][1] = (
i / 2 + 1) % sides ?
i / 2 + 1 :
i / 2 + 1 - sides;
3408 mesh->
faces[
i][2] =
i == numfaces - 1 ? 0 : (
j + 1) / 2;
3422 ok(
hr ==
D3D_OK,
"Got result %#x, expected 0 (D3D_OK)\n",
hr);
3425 skip(
"Couldn't create torus\n");
3431 skip(
"Couldn't create mesh\n");
3432 torus->lpVtbl->Release(torus);
3438 sprintf(
name,
"torus (%g, %g, %u, %u)", innerradius, outerradius, sides, rings);
3443 torus->lpVtbl->Release(torus);
3449 IDirect3DDevice9*
device;
3450 ID3DXMesh* torus =
NULL;
3455 skip(
"Couldn't create test context\n");
3544 array->items = new_buffer;
3545 array->capacity = new_capacity;
3588 float max_deviation)
3593 D3DXVec2Scale(&split1, D3DXVec2Add(&split1, p1, p2), 0.5f);
3594 D3DXVec2Scale(&split2, D3DXVec2Add(&split2, p2, p3), 0.5f);
3595 D3DXVec2Scale(&middle, D3DXVec2Add(&middle, &split1, &split2), 0.5f);
3597 deviation = D3DXVec2Length(D3DXVec2Subtract(&
vec, &middle, p2));
3598 if (deviation < max_deviation) {
3619 return D3DXVec2Dot(dir1, dir2) > cos_theta;
3672 float max_deviation,
float emsquare)
3698 trace(
"Unknown header type %d\n",
header->dwType);
3724 D3DXVec2Scale(&bezier_end, D3DXVec2Add(&bezier_end, &pt_flt[
j], &pt_flt[
j+1]), 0.5f);
3728 bezier_start = bezier_end;
3740 pt->pos = pt_flt[
j];
3743 for (
j = 0;
j < curve->
cpfx;
j++)
3748 pt->pos = pt_flt[
j];
3762 if (
pt->pos.x == lastpt->
pos.
x &&
pt->pos.y == lastpt->
pos.
y) {
3834 float deviation,
float extrusion,
float otmEMSquare,
const struct glyphinfo *
glyphs)
3836 DWORD nb_vertices, nb_faces;
3837 DWORD nb_corners, nb_outline_points;
3840 struct vertex *vertex_ptr;
3847 nb_outline_points = 0;
3848 for (
i = 0;
i < textlen;
i++)
3851 for (
j = 0;
j <
glyphs[
i].outlines.count;
j++)
3863 nb_vertices = (nb_outline_points + nb_corners) * 2 + textlen;
3864 nb_faces = nb_outline_points * 2;
3866 ok(
new_mesh(
mesh, nb_vertices, nb_faces),
"Failed to create reference text mesh.\n");
3871 for (
i = 0;
i < textlen;
i++)
3876 for (
j = 0;
j <
glyphs[
i].outlines.count;
j++)
3878 struct vertex *outline_vertices = vertex_ptr;
3892 D3DXVec2Subtract(&
vec, &
pt->pos, &prevpt->
pos);
3893 else if (
pt->corner)
3894 D3DXVec2Subtract(&
vec, &nextpt->
pos, &
pt->pos);
3896 D3DXVec2Subtract(&
vec, &nextpt->
pos, &prevpt->
pos);
3905 *vertex_ptr++ = vtx;
3908 *vertex_ptr++ = vtx;
3914 *vertex_ptr++ = vtx;
3916 *vertex_ptr++ = vtx;
3918 (*face_ptr)[0] = vtx_idx;
3919 (*face_ptr)[1] = vtx_idx + 2;
3920 (*face_ptr)[2] = vtx_idx + 1;
3923 (*face_ptr)[0] = vtx_idx;
3924 (*face_ptr)[1] = vtx_idx + 3;
3925 (*face_ptr)[2] = vtx_idx + 2;
3931 D3DXVec2Subtract(&
vec, &nextpt2->
pos, &nextpt->
pos);
3933 D3DXVec2Subtract(&
vec, &nextpt->
pos, &
pt->pos);
3940 *vertex_ptr++ = vtx;
3942 *vertex_ptr++ = vtx;
3945 (*face_ptr)[0] = vtx_idx;
3946 (*face_ptr)[1] = vtx_idx + 3;
3947 (*face_ptr)[2] = vtx_idx + 1;
3950 (*face_ptr)[0] = vtx_idx;
3951 (*face_ptr)[1] = vtx_idx + 2;
3952 (*face_ptr)[2] = vtx_idx + 3;
3960 *vertex_ptr++ = *outline_vertices++;
3961 *vertex_ptr++ = *outline_vertices++;
3981 DWORD number_of_vertices, number_of_faces;
3983 IDirect3DIndexBuffer9 *index_buffer =
NULL;
3989 int vtx_idx1, face_idx1, vtx_idx2, face_idx2;
3991 number_of_vertices = d3dxmesh->lpVtbl->GetNumVertices(d3dxmesh);
3992 number_of_faces = d3dxmesh->lpVtbl->GetNumFaces(d3dxmesh);
4001 name, vertex_buffer_description.
Type);
4002 ok(!vertex_buffer_description.
Usage,
"Test %s, unexpected usage %#x.\n",
name, vertex_buffer_description.
Usage);
4004 name, vertex_buffer_description.
Pool);
4005 ok(vertex_buffer_description.
FVF ==
mesh->
fvf,
"Test %s, unexpected FVF %#x (expected %#x).\n",
4011 ok(vertex_buffer_description.
Size ==
expected,
"Test %s, unexpected size %u (expected %u).\n",
4014 hr = d3dxmesh->lpVtbl->GetIndexBuffer(d3dxmesh, &index_buffer);
4021 name, index_buffer_description.
Type);
4022 ok(!index_buffer_description.
Usage,
"Test %s, unexpected usage %#x.\n",
4025 name, index_buffer_description.
Pool);
4027 ok(index_buffer_description.
Size ==
expected,
"Test %s, unexpected size %u.\n",
4028 name, index_buffer_description.
Size);
4040 for (
i = 0;
i < textlen;
i++)
4042 int nb_outline_vertices1, nb_outline_faces1;
4043 int nb_outline_vertices2, nb_outline_faces2;
4044 int nb_back_vertices, nb_back_faces;
4045 int first_vtx1, first_vtx2;
4046 int first_face1, first_face2;
4049 first_vtx1 = vtx_idx1;
4050 first_vtx2 = vtx_idx2;
4052 if (
glyphs[
i].outlines.count > 0)
4054 for (; vtx_idx1 < number_of_vertices; vtx_idx1++)
4056 if (vertices[vtx_idx1].
normal.z != 0)
4066 nb_outline_vertices1 = vtx_idx1 - first_vtx1;
4067 nb_outline_vertices2 = vtx_idx2 - first_vtx2;
4068 ok(nb_outline_vertices1 == nb_outline_vertices2,
4069 "Test %s, glyph %d, outline vertex count result %d, expected %d\n",
name,
i,
4070 nb_outline_vertices1, nb_outline_vertices2);
4072 for (
j = 0;
j <
min(nb_outline_vertices1, nb_outline_vertices2);
j++)
4074 vtx_idx1 = first_vtx1 +
j;
4075 vtx_idx2 = first_vtx2 +
j;
4077 "Test %s, glyph %d, vertex position %d, result (%g, %g, %g), expected (%g, %g, %g)\n",
name,
i, vtx_idx1,
4081 "Test %s, glyph %d, vertex normal %d, result (%g, %g, %g), expected (%g, %g, %g)\n",
name,
i, vtx_idx1,
4085 vtx_idx1 = first_vtx1 + nb_outline_vertices1;
4086 vtx_idx2 = first_vtx2 + nb_outline_vertices2;
4088 first_face1 = face_idx1;
4089 first_face2 = face_idx2;
4090 for (; face_idx1 < number_of_faces; face_idx1++)
4092 if (faces[face_idx1][0] >= vtx_idx1 ||
4093 faces[face_idx1][1] >= vtx_idx1 ||
4094 faces[face_idx1][2] >= vtx_idx1)
4099 if (
mesh->
faces[face_idx2][0] >= vtx_idx2 ||
4100 mesh->
faces[face_idx2][1] >= vtx_idx2 ||
4104 nb_outline_faces1 = face_idx1 - first_face1;
4105 nb_outline_faces2 = face_idx2 - first_face2;
4106 ok(nb_outline_faces1 == nb_outline_faces2,
4107 "Test %s, glyph %d, outline face count result %d, expected %d\n",
name,
i,
4108 nb_outline_faces1, nb_outline_faces2);
4110 for (
j = 0;
j <
min(nb_outline_faces1, nb_outline_faces2);
j++)
4112 face_idx1 = first_face1 +
j;
4113 face_idx2 = first_face2 +
j;
4114 ok(faces[face_idx1][0] - first_vtx1 ==
mesh->
faces[face_idx2][0] - first_vtx2 &&
4115 faces[face_idx1][1] - first_vtx1 ==
mesh->
faces[face_idx2][1] - first_vtx2 &&
4116 faces[face_idx1][2] - first_vtx1 ==
mesh->
faces[face_idx2][2] - first_vtx2,
4117 "Test %s, glyph %d, face %d, result (%d, %d, %d), expected (%d, %d, %d)\n",
name,
i, face_idx1,
4118 faces[face_idx1][0], faces[face_idx1][1], faces[face_idx1][2],
4119 mesh->
faces[face_idx2][0] - first_vtx2 + first_vtx1,
4120 mesh->
faces[face_idx2][1] - first_vtx2 + first_vtx1,
4121 mesh->
faces[face_idx2][2] - first_vtx2 + first_vtx1);
4123 face_idx1 = first_face1 + nb_outline_faces1;
4124 face_idx2 = first_face2 + nb_outline_faces2;
4127 first_vtx1 = vtx_idx1;
4128 for (; vtx_idx1 < number_of_vertices; vtx_idx1++) {
4131 if (vertices[vtx_idx1].
normal.z != 1.0f)
4139 "Test %s, glyph %d, vertex position.z %d, result %g, expected %g\n",
name,
i, vtx_idx1,
4142 "Test %s, glyph %d, vertex normal %d, result (%g, %g, %g), expected (%g, %g, %g)\n",
name,
i, vtx_idx1,
4146 nb_back_vertices = vtx_idx1 - first_vtx1;
4147 first_face1 = face_idx1;
4148 for (; face_idx1 < number_of_faces; face_idx1++)
4156 if (faces[face_idx1][0] >= vtx_idx1 ||
4157 faces[face_idx1][1] >= vtx_idx1 ||
4158 faces[face_idx1][2] >= vtx_idx1)
4161 vtx1 = &vertices[faces[face_idx1][0]].
position;
4162 vtx2 = &vertices[faces[face_idx1][1]].
position;
4163 vtx3 = &vertices[faces[face_idx1][2]].
position;
4165 D3DXVec3Subtract(&
v1, vtx2, vtx1);
4166 D3DXVec3Subtract(&
v2, vtx3, vtx2);
4170 "Test %s, glyph %d, face %d normal, result (%g, %g, %g), expected (%g, %g, %g)\n",
name,
i, face_idx1,
4173 nb_back_faces = face_idx1 - first_face1;
4176 if (extrusion == 0.0f) {
4178 nb_back_vertices /= 2;
4180 face_idx1 -= nb_back_faces;
4181 vtx_idx1 -= nb_back_vertices;
4183 for (
j = 0;
j < nb_back_vertices;
j++)
4185 struct vertex vtx = vertices[first_vtx1];
4189 vtx.
normal.
z = extrusion == 0.0f ? 1.0f : -1.0f;
4191 "Test %s, glyph %d, vertex position %d, result (%g, %g, %g), expected (%g, %g, %g)\n",
name,
i, vtx_idx1,
4195 "Test %s, glyph %d, vertex normal %d, result (%g, %g, %g), expected (%g, %g, %g)\n",
name,
i, vtx_idx1,
4201 for (
j = 0;
j < nb_back_faces;
j++)
4204 if (extrusion == 0.0f) {
4211 ok(faces[face_idx1][0] == faces[first_face1][0] + nb_back_vertices &&
4212 faces[face_idx1][1] == faces[first_face1][
f1] + nb_back_vertices &&
4213 faces[face_idx1][2] == faces[first_face1][
f2] + nb_back_vertices,
4214 "Test %s, glyph %d, face %d, result (%d, %d, %d), expected (%d, %d, %d)\n",
name,
i, face_idx1,
4215 faces[face_idx1][0], faces[face_idx1][1], faces[face_idx1][2],
4216 faces[first_face1][0] - nb_back_faces,
4217 faces[first_face1][
f1] - nb_back_faces,
4218 faces[first_face1][
f2] - nb_back_faces);
4230 if (
mesh->
faces[face_idx2][0] >= vtx_idx2 ||
4231 mesh->
faces[face_idx2][1] >= vtx_idx2 ||
4232 mesh->
faces[face_idx2][2] >= vtx_idx2)
break;
4244 static const MAT2 identity = {{0, 1}, {0, 0}, {0, 0}, {0, 1}};
4246 ID3DXMesh *d3dxmesh =
NULL;
4263 ok(
hr ==
D3D_OK,
"Got result %x, expected 0 (D3D_OK)\n",
hr);
4277 for (
i = 0;
i < textlen;
i++)
4288 if (deviation == 0.0f)
4292 for (
i = 0;
i < textlen;
i++)
4317 d3dxmesh->lpVtbl->Release(d3dxmesh);
4321 for (
i = 0;
i < textlen;
i++)
4330 IDirect3DDevice9*
device;
4331 ID3DXMesh* d3dxmesh =
NULL;
4334 int number_of_vertices;
4335 int number_of_faces;
4340 skip(
"Couldn't create test context\n");
4347 hFont =
CreateFontA(12, 0, 0, 0,
FW_NORMAL,
FALSE,
FALSE,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
4381 number_of_vertices = d3dxmesh->lpVtbl->GetNumVertices(d3dxmesh);
4382 number_of_faces = d3dxmesh->lpVtbl->GetNumFaces(d3dxmesh);
4383 d3dxmesh->lpVtbl->Release(d3dxmesh);
4387 ok(number_of_vertices == d3dxmesh->lpVtbl->GetNumVertices(d3dxmesh),
4388 "Got %d vertices, expected %d\n",
4389 d3dxmesh->lpVtbl->GetNumVertices(d3dxmesh), number_of_vertices);
4390 ok(number_of_faces == d3dxmesh->lpVtbl->GetNumFaces(d3dxmesh),
4391 "Got %d faces, expected %d\n",
4392 d3dxmesh->lpVtbl->GetNumVertices(d3dxmesh), number_of_faces);
4393 d3dxmesh->lpVtbl->Release(d3dxmesh);
4398 trace(
"Waiting for D3DXCreateText to finish with deviation = FLT_MIN ...\n");
4401 if (
SUCCEEDED(
hr) && d3dxmesh) d3dxmesh->lpVtbl->Release(d3dxmesh);
4402 trace(
"D3DXCreateText finish with deviation = FLT_MIN\n");
4407 if (
SUCCEEDED(
hr) && d3dxmesh) d3dxmesh->lpVtbl->Release(d3dxmesh);
4468 ok(
size == 15,
"Got size %u, expected 15.\n",
size);
4471 ok(
size == 16,
"Got size %u, expected 16.\n",
size);
4515 static const UINT sizes1[] =
4522 static const UINT sizes2[] =
4531 ok(
size == 0,
"Got size %#x, expected 0.\n",
size);
4533 for (
i = 0;
i < 16; ++
i)
4536 ok(
size == sizes1[
i],
"Got size %u for stream %u, expected %u.\n",
size,
i, sizes1[
i]);
4539 for (
i = 0;
i < 8; ++
i)
4542 ok(
size == sizes2[
i],
"Got size %u for stream %u, expected %u.\n",
size,
i, sizes2[
i]);
4549 IDirect3DDevice9 *
device;
4550 ID3DXMesh *d3dxmesh =
NULL;
4560 DWORD adjacency[3 * 3];
4563 4, {{0.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0.0, 1.0, 0.0}},
4564 2, {0, 1, 2, 0, 2, 3},
4566 {-1, -1, 1, 0, -1, -1},
4569 6, {{0.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0.0, 1.0, 0.0}},
4570 2, {0, 1, 2, 3, 4, 5},
4572 {-1, -1, -1, -1, -1, -1},
4575 6, {{0.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0.0, 1.0, 0.0}},
4576 2, {0, 1, 2, 3, 4, 5},
4578 {-1, -1, 1, 0, -1, -1},
4581 6, {{0.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0.0, 0.0, 0.25}, {1.0, 1.0, 0.25}, {0.0, 1.0, 0.25}},
4582 2, {0, 1, 2, 3, 4, 5},
4584 {-1, -1, -1, -1, -1, -1},
4587 6, {{0.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0.0, 0.0, 0.25}, {1.0, 1.0, 0.25}, {0.0, 1.0, 0.25}},
4588 2, {0, 1, 2, 3, 4, 5},
4590 {-1, -1, 1, 0, -1, -1},
4593 6, {{0.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0.0, 0.25, 0.25}, {1.0, 1.25, 0.25}, {0.0, 1.25, 0.25}},
4594 2, {0, 1, 2, 3, 4, 5},
4596 {-1, -1, -1, -1, -1, -1},
4599 6, {{0.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0.0, 0.25, 0.25}, {1.0, 1.25, 0.25}, {0.0, 1.25, 0.25}},
4600 2, {0, 1, 2, 3, 4, 5},
4602 {-1, -1, 1, 0, -1, -1},
4605 4, {{0.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0.0, 1.0, 0.0}},
4606 2, {0, 1, 2, 0, 3, 2},
4608 {-1, -1, -1, -1, -1, -1},
4615 skip(
"Couldn't create test context\n");
4625 if (d3dxmesh) d3dxmesh->lpVtbl->
Release(d3dxmesh);
4631 hr = d3dxmesh->lpVtbl->LockVertexBuffer(d3dxmesh,
D3DLOCK_DISCARD, (
void**)&vertices);
4635 d3dxmesh->lpVtbl->UnlockVertexBuffer(d3dxmesh);
4641 d3dxmesh->lpVtbl->UnlockIndexBuffer(d3dxmesh);
4644 hr = d3dxmesh->lpVtbl->GenerateAdjacency(d3dxmesh, 0.0f,
NULL);
4648 hr = d3dxmesh->lpVtbl->GenerateAdjacency(d3dxmesh,
test_data[
i].epsilon, adjacency);
4654 "Test %d adjacency %d: Got result %u, expected %u\n",
i,
j,
4657 if (d3dxmesh) d3dxmesh->lpVtbl->Release(d3dxmesh);
4735 { { 0.0f, 1.0f, 0.f}, { 1.0f, 0.0f, 0.f}, {0.0f, 0.0f, 1.0f}, 0xffff0000 },
4736 { { 1.0f, -1.0f, 0.f}, {-1.0f, -1.0f, 0.f}, {0.0f, 0.0f, 1.0f}, 0xff00ff00 },
4737 { {-1.0f, -1.0f, 0.f}, {-1.0f, 1.0f, 0.f}, {0.0f, 0.0f, 1.0f}, 0xff0000ff },
4739 unsigned int faces[] = {0, 1, 2};
4740 unsigned int attributes[] = {0};
4741 unsigned int num_faces =
ARRAY_SIZE(faces) / 3;
4742 unsigned int num_vertices =
ARRAY_SIZE(vertices);
4747 DWORD *attributes_buffer;
4750 DWORD exp_vertex_size =
sizeof(*vertices);
4751 DWORD vertex_size = 0;
4755 int filler_a = 0xaaaaaaaa;
4756 int filler_b = 0xbbbbbbbb;
4761 skip(
"Couldn't create a test_context\n");
4769 skip(
"Couldn't create test mesh %#x\n",
hr);
4775 mesh->lpVtbl->UnlockVertexBuffer(
mesh);
4777 mesh->lpVtbl->LockIndexBuffer(
mesh, 0, &index_buffer);
4778 memcpy(index_buffer, faces,
sizeof(faces));
4779 mesh->lpVtbl->UnlockIndexBuffer(
mesh);
4781 mesh->lpVtbl->LockAttributeBuffer(
mesh, 0, &attributes_buffer);
4782 memcpy(attributes_buffer, attributes,
sizeof(attributes));
4783 mesh->lpVtbl->UnlockAttributeBuffer(
mesh);
4789 skip(
"Couldn't get vertex declaration %#x\n",
hr);
4793 ok(
equal == 0,
"Vertex declarations were not equal\n");
4812 skip(
"Couldn't get vertex declaration %#x\n",
hr);
4820 ok(decl_ptr->
Offset ==
offset,
"Test UpdateSemantics, got offset %d expected %d\n",
4832 "got %#x expected D3D_OK\n",
hr);
4835 ok(
hr ==
D3D_OK,
"Couldn't get vertex declaration. Got %#x, expected D3D_OK\n",
hr);
4837 for (
i =
sizeof(declaration0)/
sizeof(*decl_mem);
i <
sizeof(
declaration)/
sizeof(*decl_mem);
i++)
4839 equal =
memcmp(&decl_mem[
i], &filler_b,
sizeof(filler_b));
4841 "GetDeclaration wrote past the D3DDECL_END() marker. "
4842 "Got %#x, expected %#x\n", decl_mem[
i], filler_b);
4843 if (
equal != 0)
break;
4851 skip(
"Couldn't get vertex declaration %#x\n",
hr);
4864 ok(
hr ==
D3D_OK,
"Test UpdateSemantics for overlapping fields, "
4865 "got %#x expected D3D_OK\n",
hr);
4868 hr =
mesh->lpVtbl->UpdateSemantics(
mesh, declaration_pos_type_color);
4869 ok(
hr ==
D3D_OK,
"Test UpdateSemantics position type color, "
4870 "got %#x expected D3D_OK\n",
hr);
4880 mesh->lpVtbl->UpdateSemantics(
mesh, declaration0);
4883 "got %#x expected D3DERR_INVALIDCALL\n",
hr);
4884 vertex_size =
mesh->lpVtbl->GetNumBytesPerVertex(
mesh);
4885 ok(vertex_size == exp_vertex_size,
"Got vertex declaration size %u, expected %u\n",
4886 vertex_size, exp_vertex_size);
4889 ok(
hr ==
D3D_OK,
"Couldn't get vertex declaration. Got %#x, expected D3D_OK\n",
hr);
4891 ok(
equal == 0,
"Vertex declarations were not equal\n");
4894 mesh->lpVtbl->UpdateSemantics(
mesh, declaration0);
4895 hr =
mesh->lpVtbl->UpdateSemantics(
mesh, declaration_smaller);
4897 "got %#x expected D3DERR_INVALIDCALL\n",
hr);
4898 vertex_size =
mesh->lpVtbl->GetNumBytesPerVertex(
mesh);
4899 ok(vertex_size == exp_vertex_size,
"Got vertex declaration size %u, expected %u\n",
4900 vertex_size, exp_vertex_size);
4903 ok(
hr ==
D3D_OK,
"Couldn't get vertex declaration. Got %#x, expected D3D_OK\n",
hr);
4905 ok(
equal == 0,
"Vertex declarations were not equal\n");
4908 mesh->lpVtbl->UpdateSemantics(
mesh, declaration0);
4909 hr =
mesh->lpVtbl->UpdateSemantics(
mesh, declaration_larger);
4911 "got %#x expected D3DERR_INVALIDCALL\n",
hr);
4912 vertex_size =
mesh->lpVtbl->GetNumBytesPerVertex(
mesh);
4913 ok(vertex_size == exp_vertex_size,
"Got vertex declaration size %u, expected %u\n",
4914 vertex_size, exp_vertex_size);
4917 ok(
hr ==
D3D_OK,
"Couldn't get vertex declaration. Got %#x, expected D3D_OK\n",
hr);
4919 ok(
equal == 0,
"Vertex declarations were not equal\n");
4922 mesh->lpVtbl->UpdateSemantics(
mesh, declaration0);
4923 hr =
mesh->lpVtbl->UpdateSemantics(
mesh, declaration_multiple_streams);
4925 "got %#x expected D3DERR_INVALIDCALL\n",
hr);
4926 vertex_size =
mesh->lpVtbl->GetNumBytesPerVertex(
mesh);
4927 ok(vertex_size == exp_vertex_size,
"Got vertex declaration size %u, expected %u\n",
4928 vertex_size, exp_vertex_size);
4931 ok(
hr ==
D3D_OK,
"Couldn't get vertex declaration. Got %#x, expected D3D_OK\n",
hr);
4933 ok(
equal == 0,
"Vertex declarations were not equal\n");
4942 mesh->lpVtbl->UpdateSemantics(
mesh, declaration0);
4943 hr =
mesh->lpVtbl->UpdateSemantics(
mesh, declaration_double_usage);
4944 ok(
hr ==
D3D_OK,
"Test UpdateSemantics double usage, "
4945 "got %#x expected D3D_OK\n",
hr);
4946 vertex_size =
mesh->lpVtbl->GetNumBytesPerVertex(
mesh);
4947 ok(vertex_size == exp_vertex_size,
"Got vertex declaration size %u, expected %u\n",
4948 vertex_size, exp_vertex_size);
4951 ok(
hr ==
D3D_OK,
"Couldn't get vertex declaration. Got %#x, expected D3D_OK\n",
hr);
4953 ok(
equal == 0,
"Vertex declarations were not equal\n");
4956 mesh->lpVtbl->UpdateSemantics(
mesh, declaration0);
4957 hr =
mesh->lpVtbl->UpdateSemantics(
mesh, declaration_undefined_type);
4958 ok(
hr ==
D3D_OK,
"Test UpdateSemantics undefined type, "
4959 "got %#x expected D3D_OK\n",
hr);
4960 vertex_size =
mesh->lpVtbl->GetNumBytesPerVertex(
mesh);
4961 ok(vertex_size == exp_vertex_size,
"Got vertex declaration size %u, expected %u\n",
4962 vertex_size, exp_vertex_size);
4965 ok(
hr ==
D3D_OK,
"Couldn't get vertex declaration. Got %#x, expected D3D_OK\n",
hr);
4967 ok(
equal == 0,
"Vertex declarations were not equal\n");
4970 mesh->lpVtbl->UpdateSemantics(
mesh, declaration0);
4971 hr =
mesh->lpVtbl->UpdateSemantics(
mesh, declaration_not_4_byte_aligned_offset);
4972 ok(
hr ==
D3D_OK,
"Test UpdateSemantics not 4 byte aligned offset, "
4973 "got %#x expected D3D_OK\n",
hr);
4974 vertex_size =
mesh->lpVtbl->GetNumBytesPerVertex(
mesh);
4975 ok(vertex_size == exp_vertex_size,
"Got vertex declaration size %u, expected %u\n",
4976 vertex_size, exp_vertex_size);
4979 ok(
hr ==
D3D_OK,
"Couldn't get vertex declaration. Got %#x, expected D3D_OK\n",
hr);
4981 sizeof(declaration_not_4_byte_aligned_offset));
4982 ok(
equal == 0,
"Vertex declarations were not equal\n");
5000 DWORD exp_vertices[2], vertices[2];
5001 float exp_weights[2],
weights[2];
5002 const char *exp_string, *
string;
5003 ID3DXSkinInfo *skininfo =
NULL;
5010 if (skininfo) IUnknown_Release(skininfo);
5023 ID3DXSkinInfo *clone =
NULL;
5026 const char *string_result;
5031 hr = skininfo->lpVtbl->GetDeclaration(skininfo, declaration_out);
5036 dword_result = skininfo->lpVtbl->GetNumBones(skininfo);
5037 ok(dword_result == 1,
"Expected 1, got %u\n", dword_result);
5039 flt_result = skininfo->lpVtbl->GetMinBoneInfluence(skininfo);
5040 ok(flt_result == 0.0f,
"Expected 0.0, got %g\n", flt_result);
5042 string_result = skininfo->lpVtbl->GetBoneName(skininfo, 0);
5043 ok(string_result ==
NULL,
"Expected NULL, got %p\n", string_result);
5045 dword_result = skininfo->lpVtbl->GetFVF(skininfo);
5046 ok(dword_result == 0,
"Expected 0, got %u\n", dword_result);
5048 dword_result = skininfo->lpVtbl->GetNumBoneInfluences(skininfo, 0);
5049 ok(dword_result == 0,
"Expected 0, got %u\n", dword_result);
5051 dword_result = skininfo->lpVtbl->GetNumBoneInfluences(skininfo, 1);
5052 ok(dword_result == 0,
"Expected 0, got %u\n", dword_result);
5054 transform = skininfo->lpVtbl->GetBoneOffsetMatrix(skininfo, -1);
5057 hr = skininfo->lpVtbl->Clone(skininfo, &clone);
5059 IUnknown_Release(clone);
5063 hr = skininfo->lpVtbl->SetBoneOffsetMatrix(skininfo, 1, &identity_matrix);
5066 hr = skininfo->lpVtbl->SetBoneOffsetMatrix(skininfo, 0,
NULL);
5069 D3DXMatrixIdentity(&identity_matrix);
5070 hr = skininfo->lpVtbl->SetBoneOffsetMatrix(skininfo, 0, &identity_matrix);
5073 transform = skininfo->lpVtbl->GetBoneOffsetMatrix(skininfo, 0);
5079 const char *name_in =
"testBoneName";
5080 const char *string_result2;
5082 hr = skininfo->lpVtbl->SetBoneName(skininfo, 1, name_in);
5085 hr = skininfo->lpVtbl->SetBoneName(skininfo, 0,
NULL);
5088 hr = skininfo->lpVtbl->SetBoneName(skininfo, 0, name_in);
5091 string_result = skininfo->lpVtbl->GetBoneName(skininfo, 0);
5092 ok(string_result !=
NULL,
"Expected non-NULL string, got %p\n", string_result);
5093 ok(!
strcmp(string_result, name_in),
"Expected '%s', got '%s'\n", name_in, string_result);
5095 string_result2 = skininfo->lpVtbl->GetBoneName(skininfo, 0);
5096 ok(string_result == string_result2,
"Expected %p, got %p\n", string_result, string_result2);
5098 string_result = skininfo->lpVtbl->GetBoneName(skininfo, 1);
5099 ok(string_result ==
NULL,
"Expected NULL, got %p\n", string_result);
5104 DWORD num_influences;
5107 vertices[0] = 0xdeadbeef;
5109 hr = skininfo->lpVtbl->GetBoneInfluence(skininfo, 0, vertices,
weights);
5111 ok(vertices[0] == 0xdeadbeef,
"expected 0xdeadbeef, got %#x\n", vertices[0]);
5114 hr = skininfo->lpVtbl->GetBoneInfluence(skininfo, 1, vertices,
weights);
5117 hr = skininfo->lpVtbl->GetBoneInfluence(skininfo, 0,
NULL,
NULL);
5120 hr = skininfo->lpVtbl->GetBoneInfluence(skininfo, 0, vertices,
NULL);
5123 hr = skininfo->lpVtbl->GetBoneInfluence(skininfo, 0,
NULL,
weights);
5128 exp_vertices[0] = 0;
5129 exp_vertices[1] = 0x87654321;
5130 exp_weights[0] = 0.5;
5131 exp_weights[1] =
NAN;
5134 hr = skininfo->lpVtbl->SetBoneInfluence(skininfo, 1, num_influences, vertices,
weights);
5137 hr = skininfo->lpVtbl->SetBoneInfluence(skininfo, 0, num_influences,
NULL,
weights);
5140 hr = skininfo->lpVtbl->SetBoneInfluence(skininfo, 0, num_influences, vertices,
NULL);
5143 hr = skininfo->lpVtbl->SetBoneInfluence(skininfo, 0, num_influences,
NULL,
NULL);
5146 hr = skininfo->lpVtbl->SetBoneInfluence(skininfo, 0, num_influences, exp_vertices, exp_weights);
5149 memset(vertices, 0,
sizeof(vertices));
5151 hr = skininfo->lpVtbl->GetBoneInfluence(skininfo, 0, vertices,
weights);
5153 for (
i = 0;
i < num_influences;
i++) {
5154 ok(exp_vertices[
i] == vertices[
i],
5155 "influence[%d]: expected vertex %u, got %u\n",
i, exp_vertices[
i], vertices[
i]);
5157 "influence[%d]: expected weights %g, got %g\n",
i, exp_weights[
i],
weights[
i]);
5161 memset(vertices, 0,
sizeof(vertices));
5163 hr = skininfo->lpVtbl->SetBoneInfluence(skininfo, 0, 0, vertices,
weights);
5166 vertices[0] = 0xdeadbeef;
5168 hr = skininfo->lpVtbl->GetBoneInfluence(skininfo, 0, vertices,
weights);
5170 ok(vertices[0] == 0xdeadbeef,
"expected vertex 0xdeadbeef, got %u\n", vertices[0]);
5173 hr = skininfo->lpVtbl->SetBoneInfluence(skininfo, 0, num_influences, exp_vertices, exp_weights);
5183 hr = skininfo->lpVtbl->SetDeclaration(skininfo,
NULL);
5186 hr = skininfo->lpVtbl->SetDeclaration(skininfo, declaration_with_nonzero_stream);
5189 hr = skininfo->lpVtbl->SetFVF(skininfo, 0);
5194 hr = skininfo->lpVtbl->SetDeclaration(skininfo, declaration_in);
5196 got_fvf = skininfo->lpVtbl->GetFVF(skininfo);
5197 ok(fvf == got_fvf,
"Expected %#x, got %#x\n", fvf, got_fvf);
5198 hr = skininfo->lpVtbl->GetDeclaration(skininfo, declaration_out);
5202 hr = skininfo->lpVtbl->SetDeclaration(skininfo, empty_declaration);
5204 got_fvf = skininfo->lpVtbl->GetFVF(skininfo);
5205 ok(got_fvf == 0,
"Expected 0, got %#x\n", got_fvf);
5206 hr = skininfo->lpVtbl->GetDeclaration(skininfo, declaration_out);
5210 hr = skininfo->lpVtbl->SetFVF(skininfo, fvf);
5212 got_fvf = skininfo->lpVtbl->GetFVF(skininfo);
5213 ok(fvf == got_fvf,
"Expected %#x, got %#x\n", fvf, got_fvf);
5214 hr = skininfo->lpVtbl->GetDeclaration(skininfo, declaration_out);
5220 hr = skininfo->lpVtbl->Clone(skininfo,
NULL);
5224 hr = skininfo->lpVtbl->Clone(skininfo, &clone);
5233 fvf = clone->lpVtbl->GetFVF(clone);
5234 ok(fvf == exp_fvf,
"Got unexpected fvf %#x.\n", fvf);
5236 exp_string = skininfo->lpVtbl->GetBoneName(skininfo, 0);
5237 string = clone->lpVtbl->GetBoneName(clone, 0);
5238 ok(!
strcmp(
string, exp_string),
"Got unexpected bone 0 name %s.\n",
debugstr_a(
string));
5240 transform = clone->lpVtbl->GetBoneOffsetMatrix(clone, 0);
5243 hr = skininfo->lpVtbl->GetBoneInfluence(skininfo, 0, exp_vertices, exp_weights);
5245 hr = clone->lpVtbl->GetBoneInfluence(clone, 0, vertices,
weights);
5250 ok(vertices[
i] == exp_vertices[
i],
"influence[%u]: got unexpected vertex %u, expected %u.\n",
5251 i, vertices[
i], exp_vertices[
i]);
5253 "influence[%u]: got unexpected weight %.8e, expected %.8e.\n",
i,
weights[
i], exp_weights[
i]);
5256 IUnknown_Release(clone);
5258 if (skininfo) IUnknown_Release(skininfo);
5270 static DWORD bone0_vertices[2] = { 1, 3 };
5271 static FLOAT bone0_weights[2] = { 1.0f, 0.5f };
5272 static DWORD bone1_vertices[2] = { 2, 3 };
5273 static FLOAT bone1_weights[2] = { 1.0f, 0.5f };
5276 1.0f, 0.0f, 0.0f, 0.0f,
5277 0.0f, 1.0f, 0.0f, 0.0f,
5278 0.0f, 0.0f, 1.0f, 0.0f,
5279 2.0f, 2.0f, 4.0f, 1.0f
5282 1.0f, 0.0f, 0.0f, 0.0f,
5283 0.0f, 1.0f, 0.0f, 0.0f,
5284 0.0f, 0.0f, 1.0f, 0.0f,
5285 -4.0f, -4.0f, 4.0f, 1.0f
5287 static D3DVECTOR vertices_src[] = {{ 1.0f, 1.0f, 1.0f },
5288 { 1.0f, 0.0f, 0.0f },
5289 { 1.0f, 1.0f, -1.0f },
5290 { 0.0f, 1.0f, 0.0f },
5291 { -1.0f, -1.0f, 1.0f },
5292 { 0.0f, 0.0f, 1.0f },
5293 { -1.0f, -1.0f, -1.0f },
5294 { -1.0f, 0.0f, 0.0f },
5296 static D3DVECTOR vertices_ref[] = {{ 0.0f, 0.0f, 0.0f },
5297 { 0.0f, 0.0f, 0.0f },
5298 { 3.0f, 3.0f, 3.0f },
5299 { 0.0f, 1.0f, 0.0f },
5300 { -5.0f, -5.0f, 5.0f },
5301 { 0.0f, 0.0f, 1.0f },
5302 { -2.0f, -2.0f, 3.0f },
5303 { -1.0f, 0.0f, 0.0f },
5307 ID3DXSkinInfo *skin_info;
5311 D3DXMatrixIdentity(&
matrix);
5312 for (
i = 0;
i < 8;
i++)
5314 vertices_dest[
i].
x = 10000.0f;
5315 vertices_dest[
i].
y = 10000.0f;
5316 vertices_dest[
i].
z = 10000.0f;
5322 skin_info->lpVtbl->SetBoneInfluence(skin_info, 0, 2, bone0_vertices, bone0_weights);
5324 skin_info->lpVtbl->SetBoneOffsetMatrix(skin_info, 0, &
matrix);
5326 skin_info->lpVtbl->SetBoneInfluence(skin_info, 1, 2, bone1_vertices, bone1_weights);
5328 skin_info->lpVtbl->SetBoneOffsetMatrix(skin_info, 1, &
matrix);
5330 skin_info->lpVtbl->UpdateSkinnedMesh(skin_info, bones_matrix,
NULL, vertices_src, vertices_dest);
5332 for (
i = 0;
i < 4;
i++)
5334 ok(
compare(vertices_dest[
i*2].
x, vertices_ref[
i*2].
x),
"Vertex[%d].position.x: got %g, expected %g\n",
5335 i, vertices_dest[
i*2].
x, vertices_ref[
i*2].
x);
5336 ok(
compare(vertices_dest[
i*2].
y, vertices_ref[
i*2].
y),
"Vertex[%d].position.y: got %g, expected %g\n",
5337 i, vertices_dest[
i*2].
y, vertices_ref[
i*2].
y);
5338 ok(
compare(vertices_dest[
i*2].
z, vertices_ref[
i*2].
z),
"Vertex[%d].position.z: got %g, expected %g\n",
5339 i, vertices_dest[
i*2].
z, vertices_ref[
i*2].
z);
5340 ok(
compare(vertices_dest[
i*2+1].
x, vertices_ref[
i*2+1].
x),
"Vertex[%d].normal.x: got %g, expected %g\n",
5341 i, vertices_dest[
i*2+1].
x, vertices_ref[
i*2+1].
x);
5342 ok(
compare(vertices_dest[
i*2+1].
y, vertices_ref[
i*2+1].
y),
"Vertex[%d].normal.y: got %g, expected %g\n",
5343 i, vertices_dest[
i*2+1].
y, vertices_ref[
i*2+1].
y);
5344 ok(
compare(vertices_dest[
i*2+1].
z, vertices_ref[
i*2+1].
z),
"Vertex[%d].normal.z: got %g, expected %g\n",
5345 i, vertices_dest[
i*2+1].
z, vertices_ref[
i*2+1].
z);
5347 skin_info->lpVtbl->Release(skin_info);
5363 const unsigned int VERTS_PER_FACE = 3;
5366 DWORD *attributes_buffer;
5378#define up {0.0f, 0.0f, 1.0f}
5387 const struct vertex_pnc vertices0[] =
5389 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5390 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5391 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5393 const DWORD indices0[] = {0, 1, 2};
5394 const unsigned int num_vertices0 =
ARRAY_SIZE(vertices0);
5395 const unsigned int num_faces0 =
ARRAY_SIZE(indices0) / VERTS_PER_FACE;
5396 const DWORD adjacency0[] = {-1, -1, -1};
5397 const DWORD exp_point_rep0[] = {0, 1, 2};
5405 const struct vertex_pnc vertices1[] =
5407 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5408 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5409 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5411 {{ 3.0f, 3.0f, 0.f},
up,
GREEN},
5412 {{ 3.0f, 0.0f, 0.f},
up,
RED},
5413 {{ 1.0f, 0.0f, 0.f},
up,
BLUE},
5415 const DWORD indices1[] = {0, 1, 2, 3, 4, 5};
5416 const unsigned int num_vertices1 =
ARRAY_SIZE(vertices1);
5417 const unsigned int num_faces1 =
ARRAY_SIZE(indices1) / VERTS_PER_FACE;
5418 const DWORD adjacency1[] = {-1, 1, -1, -1, -1, 0};
5419 const DWORD exp_point_rep1[] = {0, 1, 2, 1, 4, 2};
5427 const struct vertex_pnc vertices2[] =
5429 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5430 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5431 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5433 {{-1.0f, 3.0f, 0.f},
up,
RED},
5434 {{-1.0f, 0.0f, 0.f},
up,
GREEN},
5435 {{-3.0f, 0.0f, 0.f},
up,
BLUE},
5437 const DWORD indices2[] = {0, 1, 2, 3, 4, 5};
5438 const unsigned int num_vertices2 =
ARRAY_SIZE(vertices2);
5439 const unsigned int num_faces2 =
ARRAY_SIZE(indices2) / VERTS_PER_FACE;
5440 const DWORD adjacency2[] = {-1, -1, 1, 0, -1, -1};
5441 const DWORD exp_point_rep2[] = {0, 1, 2, 0, 2, 5};
5453 struct vertex_pnc vertices3[] =
5455 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5456 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5457 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5459 {{ 2.0f, 7.0f, 0.f},
up,
BLUE},
5460 {{ 2.0f, 4.0f, 0.f},
up,
GREEN},
5461 {{ 0.0f, 4.0f, 0.f},
up,
RED},
5463 const DWORD indices3[] = {0, 1, 2, 3, 4, 5};
5464 const unsigned int num_vertices3 =
ARRAY_SIZE(vertices3);
5465 const unsigned int num_faces3 =
ARRAY_SIZE(indices3) / VERTS_PER_FACE;
5466 const DWORD adjacency3[] = {1, -1, -1, -1, 0, -1};
5467 const DWORD exp_point_rep3[] = {0, 1, 2, 3, 1, 0};
5479 struct vertex_pnc vertices4[] =
5481 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5482 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5483 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5485 {{ 0.0f, -4.0f, 0.f},
up,
BLUE},
5486 {{ 2.0f, -7.0f, 0.f},
up,
GREEN},
5487 {{ 0.0f, -7.0f, 0.f},
up,
RED},
5489 const DWORD indices4[] = {0, 1, 2, 3, 4, 5};
5490 const unsigned int num_vertices4 =
ARRAY_SIZE(vertices4);
5491 const unsigned int num_faces4 =
ARRAY_SIZE(indices4) / VERTS_PER_FACE;
5492 const DWORD adjacency4[] = {-1, -1, -1, -1, -1, -1};
5493 const DWORD exp_point_rep4[] = {0, 1, 2, 3, 4, 5};
5506 const struct vertex_pnc vertices5[] =
5508 {{ 0.0f, 1.0f, 0.f},
up,
RED},
5509 {{ 1.0f, -1.0f, 0.f},
up,
GREEN},
5510 {{-1.0f, -1.0f, 0.f},
up,
BLUE},
5512 {{ 0.1f, 1.0f, 0.f},
up,
RED},
5513 {{ 2.1f, 1.0f, 0.f},
up,
BLUE},
5514 {{ 1.1f, -1.0f, 0.f},
up,
GREEN},
5516 {{-1.0f, -1.1f, 0.f},
up,
BLUE},
5517 {{ 1.0f, -1.1f, 0.f},
up,
GREEN},
5518 {{ 0.0f, -3.1f, 0.f},
up,
RED},
5520 {{ 1.1f, -1.1f, 0.f},
up,
GREEN},
5521 {{ 2.1f, -3.1f, 0.f},
up,
BLUE},
5522 {{ 0.1f, -3.1f, 0.f},
up,
RED},
5524 {{ 1.2f, -1.1f, 0.f},
up,
GREEN},
5525 {{ 3.2f, -1.1f, 0.f},
up,
RED},
5526 {{ 2.2f, -3.1f, 0.f},
up,
BLUE},
5528 {{ 2.2f, 1.0f, 0.f},
up,
BLUE},
5529 {{ 3.2f, -1.0f, 0.f},
up,
RED},
5530 {{ 1.2f, -1.0f, 0.f},
up,
GREEN},
5532 const DWORD indices5[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
5533 const unsigned int num_vertices5 =
ARRAY_SIZE(vertices5);
5534 const unsigned int num_faces5 =
ARRAY_SIZE(indices5) / VERTS_PER_FACE;
5535 const DWORD adjacency5[] = {-1, 2, -1, -1, 5, -1, 0, -1, -1, 4, -1, -1, 5, -1, 3, -1, 4, 1};
5536 const DWORD exp_point_rep5[] = {0, 1, 2, 3, 4, 5, 2, 1, 8, 5, 10, 11, 5, 13, 10, 4, 13, 5};
5537 const WORD indices5_16bit[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
5545 const struct vertex_pnc vertices6[] =
5547 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5548 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5549 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5551 {{ 3.0f, 3.0f, 0.f},
up,
GREEN},
5552 {{ 3.0f, 0.0f, 0.f},
up,
RED},
5553 {{ 1.0f, 0.0f, 0.f},
up,
BLUE},
5555 {{ 4.0f, 3.0f, 0.f},
up,
GREEN},
5556 {{ 6.0f, 0.0f, 0.f},
up,
BLUE},
5557 {{ 4.0f, 0.0f, 0.f},
up,
RED},
5559 const DWORD indices6[] = {0, 1, 2, 6, 7, 8, 3, 4, 5};
5560 const unsigned int num_vertices6 =
ARRAY_SIZE(vertices6);
5561 const unsigned int num_faces6 =
ARRAY_SIZE(indices6) / VERTS_PER_FACE;
5562 const DWORD adjacency6[] = {-1, 1, -1, 2, -1, 0, -1, -1, 1};
5563 const DWORD exp_point_rep6[] = {0, 1, 2, 1, 4, 5, 1, 5, 2};
5571 const struct vertex_pnc vertices7[] =
5573 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5574 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5575 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5577 {{ 3.0f, 3.0f, 0.f},
up,
GREEN},
5578 {{ 3.0f, 0.0f, 0.f},
up,
RED},
5579 {{ 1.0f, 0.0f, 0.f},
up,
BLUE},
5581 const DWORD indices7[] = {0, 1, 2, 3, 3, 3};
5582 const unsigned int num_vertices7 =
ARRAY_SIZE(vertices7);
5583 const unsigned int num_faces7 =
ARRAY_SIZE(indices7) / VERTS_PER_FACE;
5584 const DWORD adjacency7[] = {-1, -1, -1, -1, -1, -1};
5585 const DWORD exp_point_rep7[] = {0, 1, 2, 3, 4, 5};
5597 const struct vertex_pnc vertices8[] =
5599 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5600 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5601 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5603 {{ 4.0, -4.0, 0.f},
up,
RED},
5604 {{ 6.0, -4.0, 0.f},
up,
BLUE},
5605 {{ 4.0, -7.0, 0.f},
up,
GREEN},
5607 {{ 4.0f, 3.0f, 0.f},
up,
GREEN},
5608 {{ 6.0f, 0.0f, 0.f},
up,
BLUE},
5609 {{ 4.0f, 0.0f, 0.f},
up,
RED},
5611 {{ 3.0f, 3.0f, 0.f},
up,
GREEN},
5612 {{ 3.0f, 0.0f, 0.f},
up,
RED},
5613 {{ 1.0f, 0.0f, 0.f},
up,
BLUE},
5615 const DWORD indices8[] = {0, 1, 2, 9, 10, 11, 6, 7, 8, 3, 4, 5};
5616 const unsigned int num_vertices8 =
ARRAY_SIZE(vertices8);
5617 const unsigned int num_faces8 =
ARRAY_SIZE(indices8) / VERTS_PER_FACE;
5618 const DWORD adjacency8[] = {-1, 1, -1, 2, -1, 0, -1, 3, 1, 2, -1, -1};
5619 const DWORD exp_point_rep8[] = {0, 1, 2, 3, 4, 5, 1, 4, 3, 1, 3, 2};
5627 const struct vertex_pnc vertices9[] =
5629 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5630 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5631 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5633 {{ 2.0f, 0.0f, 0.f},
up,
RED},
5635 const DWORD indices9[] = {0, 1, 2, 1, 3, 2};
5636 const unsigned int num_vertices9 =
ARRAY_SIZE(vertices9);
5637 const unsigned int num_faces9 =
ARRAY_SIZE(indices9) / VERTS_PER_FACE;
5638 const DWORD adjacency9[] = {-1, 1, -1, -1, -1, 0};
5639 const DWORD exp_point_rep9[] = {0, 1, 2, 3};
5642 ID3DXMesh *mesh_null_check =
NULL;
5643 unsigned int attributes[] = {0};
5646 const struct vertex_pnc *vertices;
5648 const DWORD num_vertices;
5649 const DWORD num_faces;
5650 const DWORD *adjacency;
5651 const DWORD *exp_point_reps;
5748 (
DWORD*)indices5_16bit,
5761 skip(
"Couldn't create test context\n");
5771 skip(
"Couldn't create mesh %d. Got %x expected D3D_OK\n",
i,
hr);
5776 mesh_null_check =
mesh;
5781 skip(
"Couldn't allocate point reps array.\n");
5788 skip(
"Couldn't lock vertex buffer.\n");
5795 skip(
"Couldn't unlock vertex buffer.\n");
5799 hr =
mesh->lpVtbl->LockIndexBuffer(
mesh, 0, &index_buffer);
5802 skip(
"Couldn't lock index buffer.\n");
5815 skip(
"Couldn't unlock index buffer.\n");
5819 hr =
mesh->lpVtbl->LockAttributeBuffer(
mesh, 0, &attributes_buffer);
5822 skip(
"Couldn't lock attributes buffer.\n");
5825 memcpy(attributes_buffer, attributes,
sizeof(attributes));
5826 hr =
mesh->lpVtbl->UnlockAttributeBuffer(
mesh);
5829 skip(
"Couldn't unlock attributes buffer.\n");
5834 for (
j = 0;
j <
tc[
i].num_vertices;
j++) point_reps[
j] = -1;
5835 hr =
mesh->lpVtbl->ConvertAdjacencyToPointReps(
mesh,
tc[
i].adjacency, point_reps);
5836 ok(
hr ==
D3D_OK,
"ConvertAdjacencyToPointReps failed case %d. "
5837 "Got %x expected D3D_OK\n",
i,
hr);
5840 for (
j = 0;
j <
tc[
i].num_vertices;
j++)
5842 ok(point_reps[
j] ==
tc[
i].exp_point_reps[
j],
5843 "Unexpected point representation at (%d, %d)."
5844 " Got %d expected %d\n",
5845 i,
j, point_reps[
j],
tc[
i].exp_point_reps[
j]);
5856 hr = mesh_null_check->lpVtbl->ConvertAdjacencyToPointReps(mesh_null_check,
tc[0].adjacency,
NULL);
5858 "Got %x expected D3DERR_INVALIDCALL\n",
hr);
5859 hr = mesh_null_check->lpVtbl->ConvertAdjacencyToPointReps(mesh_null_check,
NULL,
NULL);
5861 "Got %x expected D3DERR_INVALIDCALL\n",
hr);
5864 if (mesh_null_check)
5865 mesh_null_check->lpVtbl->
Release(mesh_null_check);
5886 const unsigned int VERTS_PER_FACE = 3;
5889 DWORD *attributes_buffer;
5901#define up {0.0f, 0.0f, 1.0f}
5911 const struct vertex_pnc vertices0[] =
5913 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5914 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5915 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5917 const DWORD indices0[] = {0, 1, 2};
5918 const unsigned int num_vertices0 =
ARRAY_SIZE(vertices0);
5919 const unsigned int num_faces0 = num_vertices0 / VERTS_PER_FACE;
5920 const DWORD exp_adjacency0[] = {-1, -1, -1};
5921 const DWORD exp_id_adjacency0[] = {-1, -1, -1};
5922 const DWORD point_rep0[] = {0, 1, 2};
5930 const struct vertex_pnc vertices1[] =
5932 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5933 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5934 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5936 {{ 3.0f, 3.0f, 0.f},
up,
GREEN},
5937 {{ 3.0f, 0.0f, 0.f},
up,
RED},
5938 {{ 1.0f, 0.0f, 0.f},
up,
BLUE},
5940 const DWORD indices1[] = {0, 1, 2, 3, 4, 5};
5941 const unsigned int num_vertices1 =
ARRAY_SIZE(vertices1);
5942 const unsigned int num_faces1 = num_vertices1 / VERTS_PER_FACE;
5943 const DWORD exp_adjacency1[] = {-1, 1, -1, -1, -1, 0};
5944 const DWORD exp_id_adjacency1[] = {-1, -1, -1, -1, -1, -1};
5945 const DWORD point_rep1[] = {0, 1, 2, 1, 4, 2};
5953 const struct vertex_pnc vertices2[] =
5955 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5956 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5957 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5959 {{-1.0f, 3.0f, 0.f},
up,
RED},
5960 {{-1.0f, 0.0f, 0.f},
up,
GREEN},
5961 {{-3.0f, 0.0f, 0.f},
up,
BLUE},
5963 const DWORD indices2[] = {0, 1, 2, 3, 4, 5};
5964 const unsigned int num_vertices2 =
ARRAY_SIZE(vertices2);
5965 const unsigned int num_faces2 = num_vertices2 / VERTS_PER_FACE;
5966 const DWORD exp_adjacency2[] = {-1, -1, 1, 0, -1, -1};
5967 const DWORD exp_id_adjacency2[] = {-1, -1, -1, -1, -1, -1};
5968 const DWORD point_rep2[] = {0, 1, 2, 0, 2, 5};
5980 struct vertex_pnc vertices3[] =
5982 {{ 0.0f, 3.0f, 0.f},
up,
RED},
5983 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
5984 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
5986 {{ 2.0f, 7.0f, 0.f},
up,
BLUE},
5987 {{ 2.0f, 4.0f, 0.f},
up,
GREEN},
5988 {{ 0.0f, 4.0f, 0.f},
up,
RED},
5990 const DWORD indices3[] = {0, 1, 2, 3, 4, 5};
5991 const unsigned int num_vertices3 =
ARRAY_SIZE(vertices3);
5992 const unsigned int num_faces3 = num_vertices3 / VERTS_PER_FACE;
5993 const DWORD exp_adjacency3[] = {1, -1, -1, -1, 0, -1};
5994 const DWORD exp_id_adjacency3[] = {-1, -1, -1, -1, -1, -1};
5995 const DWORD point_rep3[] = {0, 1, 2, 3, 1, 0};
6007 struct vertex_pnc vertices4[] =
6009 {{ 0.0f, 3.0f, 0.f},
up,
RED},
6010 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
6011 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
6013 {{ 0.0f, -4.0f, 0.f},
up,
BLUE},
6014 {{ 2.0f, -7.0f, 0.f},
up,
GREEN},
6015 {{ 0.0f, -7.0f, 0.f},
up,
RED},
6017 const DWORD indices4[] = {0, 1, 2, 3, 4, 5};
6018 const unsigned int num_vertices4 =
ARRAY_SIZE(vertices4);
6019 const unsigned int num_faces4 = num_vertices4 / VERTS_PER_FACE;
6020 const DWORD exp_adjacency4[] = {-1, -1, -1, -1, -1, -1};
6021 const DWORD exp_id_adjacency4[] = {-1, -1, -1, -1, -1, -1};
6022 const DWORD point_rep4[] = {0, 1, 2, 3, 4, 5};
6035 const struct vertex_pnc vertices5[] =
6037 {{ 0.0f, 1.0f, 0.f},
up,
RED},
6038 {{ 1.0f, -1.0f, 0.f},
up,
GREEN},
6039 {{-1.0f, -1.0f, 0.f},
up,
BLUE},
6041 {{ 0.1f, 1.0f, 0.f},
up,
RED},
6042 {{ 2.1f, 1.0f, 0.f},
up,
BLUE},
6043 {{ 1.1f, -1.0f, 0.f},
up,
GREEN},
6045 {{-1.0f, -1.1f, 0.f},
up,
BLUE},
6046 {{ 1.0f, -1.1f, 0.f},
up,
GREEN},
6047 {{ 0.0f, -3.1f, 0.f},
up,
RED},
6049 {{ 1.1f, -1.1f, 0.f},
up,
GREEN},
6050 {{ 2.1f, -3.1f, 0.f},
up,
BLUE},
6051 {{ 0.1f, -3.1f, 0.f},
up,
RED},
6053 {{ 1.2f, -1.1f, 0.f},
up,
GREEN},
6054 {{ 3.2f, -1.1f, 0.f},
up,
RED},
6055 {{ 2.2f, -3.1f, 0.f},
up,
BLUE},
6057 {{ 2.2f, 1.0f, 0.f},
up,
BLUE},
6058 {{ 3.2f, -1.0f, 0.f},
up,
RED},
6059 {{ 1.2f, -1.0f, 0.f},
up,
GREEN},
6061 const DWORD indices5[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
6062 const unsigned int num_vertices5 =
ARRAY_SIZE(vertices5);
6063 const unsigned int num_faces5 = num_vertices5 / VERTS_PER_FACE;
6064 const DWORD exp_adjacency5[] = {-1, 2, -1, -1, 5, -1, 0, -1, -1, 4, -1, -1, 5, -1, 3, -1, 4, 1};
6065 const DWORD exp_id_adjacency5[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
6066 const DWORD point_rep5[] = {0, 1, 2, 3, 4, 5, 2, 1, 8, 5, 10, 11, 5, 13, 10, 4, 13, 5};
6074 const struct vertex_pnc vertices6[] =
6076 {{ 0.0f, 3.0f, 0.f},
up,
RED},
6077 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
6078 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
6080 {{ 3.0f, 3.0f, 0.f},
up,
GREEN},
6081 {{ 3.0f, 0.0f, 0.f},
up,
RED},
6082 {{ 1.0f, 0.0f, 0.f},
up,
BLUE},
6084 {{ 4.0f, 3.0f, 0.f},
up,
GREEN},
6085 {{ 6.0f, 0.0f, 0.f},
up,
BLUE},
6086 {{ 4.0f, 0.0f, 0.f},
up,
RED},
6088 const DWORD indices6[] = {0, 1, 2, 6, 7, 8, 3, 4, 5};
6089 const unsigned int num_vertices6 =
ARRAY_SIZE(vertices6);
6090 const unsigned int num_faces6 = num_vertices6 / VERTS_PER_FACE;
6091 const DWORD exp_adjacency6[] = {-1, 1, -1, 2, -1, 0, -1, -1, 1};
6092 const DWORD exp_id_adjacency6[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1};
6093 const DWORD point_rep6[] = {0, 1, 2, 1, 4, 5, 1, 5, 2};
6101 const struct vertex_pnc vertices7[] =
6103 {{ 0.0f, 3.0f, 0.f},
up,
RED},
6104 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
6105 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
6107 {{ 3.0f, 3.0f, 0.f},
up,
GREEN},
6108 {{ 3.0f, 0.0f, 0.f},
up,
RED},
6109 {{ 1.0f, 0.0f, 0.f},
up,
BLUE},
6111 const DWORD indices7[] = {0, 1, 2, 3, 3, 3};
6112 const unsigned int num_vertices7 =
ARRAY_SIZE(vertices7);
6113 const unsigned int num_faces7 = num_vertices7 / VERTS_PER_FACE;
6114 const DWORD exp_adjacency7[] = {-1, -1, -1, -1, -1, -1};
6115 const DWORD exp_id_adjacency7[] = {-1, -1, -1, -1, -1, -1};
6116 const DWORD point_rep7[] = {0, 1, 2, 3, 4, 5};
6128 const struct vertex_pnc vertices8[] =
6130 {{ 0.0f, 3.0f, 0.f},
up,
RED},
6131 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
6132 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
6134 {{ 4.0, -4.0, 0.f},
up,
RED},
6135 {{ 6.0, -4.0, 0.f},
up,
BLUE},
6136 {{ 4.0, -7.0, 0.f},
up,
GREEN},
6138 {{ 4.0f, 3.0f, 0.f},
up,
GREEN},
6139 {{ 6.0f, 0.0f, 0.f},
up,
BLUE},
6140 {{ 4.0f, 0.0f, 0.f},
up,
RED},
6142 {{ 3.0f, 3.0f, 0.f},
up,
GREEN},
6143 {{ 3.0f, 0.0f, 0.f},
up,
RED},
6144 {{ 1.0f, 0.0f, 0.f},
up,
BLUE},
6146 const DWORD indices8[] = {0, 1, 2, 9, 10, 11, 6, 7, 8, 3, 4, 5};
6147 const WORD indices8_16bit[] = {0, 1, 2, 9, 10, 11, 6, 7, 8, 3, 4, 5};
6148 const unsigned int num_vertices8 =
ARRAY_SIZE(vertices8);
6149 const unsigned int num_faces8 = num_vertices8 / VERTS_PER_FACE;
6150 const DWORD exp_adjacency8[] = {-1, 1, -1, 2, -1, 0, -1, 3, 1, 2, -1, -1};
6151 const DWORD exp_id_adjacency8[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
6152 const DWORD point_rep8[] = {0, 1, 2, 3, 4, 5, 1, 4, 3, 1, 3, 2};
6160 const struct vertex_pnc vertices9[] =
6162 {{ 0.0f, 3.0f, 0.f},
up,
RED},
6163 {{ 2.0f, 3.0f, 0.f},
up,
GREEN},
6164 {{ 0.0f, 0.0f, 0.f},
up,
BLUE},
6166 {{ 2.0f, 0.0f, 0.f},
up,
RED},
6168 const DWORD indices9[] = {0, 1, 2, 1, 3, 2};
6169 const unsigned int num_vertices9 =
ARRAY_SIZE(vertices9);
6170 const unsigned int num_faces9 = 2;
6171 const DWORD exp_adjacency9[] = {-1, 1, -1, -1, -1, 0};
6172 const DWORD exp_id_adjacency9[] = {-1, 1, -1, -1, -1, 0};
6173 const DWORD point_rep9[] = {0, 1, 2, 3};
6176 ID3DXMesh *mesh_null_check =
NULL;
6177 unsigned int attributes[] = {0};
6180 const struct vertex_pnc *vertices;
6182 const DWORD num_vertices;
6183 const DWORD num_faces;
6184 const DWORD *point_reps;
6185 const DWORD *exp_adjacency;
6186 const DWORD *exp_id_adjacency;
6293 (
DWORD*)indices8_16bit,
6310 skip(
"Couldn't create test context\n");
6320 skip(
"Couldn't create mesh %d. Got %x expected D3D_OK\n",
i,
hr);
6325 mesh_null_check =
mesh;
6330 skip(
"Couldn't allocate adjacency array.\n");
6337 skip(
"Couldn't lock vertex buffer.\n");
6344 skip(
"Couldn't unlock vertex buffer.\n");
6347 hr =
mesh->lpVtbl->LockIndexBuffer(
mesh, 0, &index_buffer);
6350 skip(
"Couldn't lock index buffer.\n");
6363 skip(
"Couldn't unlock index buffer.\n");
6367 hr =
mesh->lpVtbl->LockAttributeBuffer(
mesh, 0, &attributes_buffer);
6370 skip(
"Couldn't lock attributes buffer.\n");
6373 memcpy(attributes_buffer, attributes,
sizeof(attributes));
6374 hr =
mesh->lpVtbl->UnlockAttributeBuffer(
mesh);
6377 skip(
"Couldn't unlock attributes buffer.\n");
6382 for (
j = 0;
j < VERTS_PER_FACE *
tc[
i].num_faces;
j++) adjacency[
j] = -2;
6384 hr =
mesh->lpVtbl->ConvertPointRepsToAdjacency(
mesh,
tc[
i].point_reps, adjacency);
6385 ok(
hr ==
D3D_OK,
"ConvertPointRepsToAdjacency failed case %d. "
6386 "Got %x expected D3D_OK\n",
i,
hr);
6388 for (
j = 0;
j < VERTS_PER_FACE *
tc[
i].num_faces;
j++)
6390 ok(adjacency[
j] ==
tc[
i].exp_adjacency[
j],
6391 "Unexpected adjacency information at (%d, %d)."
6392 " Got %d expected %d\n",
6393 i,
j, adjacency[
j],
tc[
i].exp_adjacency[
j]);
6397 for (
j = 0;
j < VERTS_PER_FACE *
tc[
i].num_faces;
j++) adjacency[
j] = -2;
6398 hr = mesh_null_check->lpVtbl->ConvertPointRepsToAdjacency(
mesh,
NULL, adjacency);
6399 ok(
hr ==
D3D_OK,
"ConvertPointRepsToAdjacency NULL point_reps. "
6400 "Got %x expected D3D_OK\n",
hr);
6401 for (
j = 0;
j < VERTS_PER_FACE *
tc[
i].num_faces;
j++)
6403 ok(adjacency[
j] ==
tc[
i].exp_id_adjacency[
j],
6404 "Unexpected adjacency information (id) at (%d, %d)."
6405 " Got %d expected %d\n",
6406 i,
j, adjacency[
j],
tc[
i].exp_id_adjacency[
j]);
6416 hr = mesh_null_check->lpVtbl->ConvertPointRepsToAdjacency(mesh_null_check,
tc[0].point_reps,
NULL);
6418 "Got %x expected D3DERR_INVALIDCALL\n",
hr);
6419 hr = mesh_null_check->lpVtbl->ConvertPointRepsToAdjacency(mesh_null_check,
NULL,
NULL);
6421 "Got %x expected D3DERR_INVALIDCALL\n",
hr);
6424 if (mesh_null_check)
6425 mesh_null_check->lpVtbl->
Release(mesh_null_check);
6433 IDirect3DDevice9 *
device, ID3DXMesh **mesh_ptr,
6434 const void *vertices,
const DWORD vertex_size,
6440 DWORD *attributes_buffer;
6446 skip(
"Couldn't create mesh. Got %x expected D3D_OK\n",
hr);
6454 skip(
"Couldn't lock vertex buffer.\n");
6461 skip(
"Couldn't unlock vertex buffer.\n");
6465 hr =
mesh->lpVtbl->LockIndexBuffer(
mesh, 0, &index_buffer);
6468 skip(
"Couldn't lock index buffer.\n");
6480 for (
i = 0;
i < 3 * num_faces;
i++)
6481 indices_32bit[
i] =
i;
6491 WORD *indices_16bit = (
WORD*)index_buffer;
6493 for (
i = 0;
i < 3 * num_faces;
i++)
6494 indices_16bit[
i] =
i;
6499 skip(
"Couldn't unlock index buffer.\n");
6503 hr =
mesh->lpVtbl->LockAttributeBuffer(
mesh, 0, &attributes_buffer);
6506 skip(
"Couldn't lock attributes buffer.\n");
6511 memcpy(attributes_buffer, attributes, num_faces *
sizeof(*attributes));
6513 memset(attributes_buffer, 0, num_faces *
sizeof(*attributes));
6515 hr =
mesh->lpVtbl->UnlockAttributeBuffer(
mesh);
6518 skip(
"Couldn't unlock attributes buffer.\n");
6549 d |= (
y << 10) & 0xffc00;
6550 d |= (
z << 20) & 0x3ff00000;
6551 d |= (
w << 30) & 0xc0000000;
6561 d |= (
y << 10) & 0xffc00;
6562 d |= (
z << 20) & 0x3ff00000;
6563 d |= (
w << 30) & 0xc0000000;
6573 v.y = (
d & 0xffc00) >> 10;
6574 v.z = (
d & 0x3ff00000) >> 20;
6575 v.w = (
d & 0xc0000000) >> 30;
6585 v.y = (
d & 0xffc00) >> 10;
6586 v.z = (
d & 0x3ff00000) >> 20;
6587 v.w = (
d & 0xc0000000) >> 30;
6594 const char *usage_strings[] =
6601 "texture coordinates",
6604 "tessellation factor",
6605 "position transformed",
6616 switch (decl_ptr->
Type)
6623 ok_(__FILE__,
line)(diff <=
PRECISION,
"Mesh %d: Got %f for vertex %d %s, expected %f.\n",
6624 mesh_number, *got, vertex_number, usage_strings[decl_ptr->
Usage], *
exp);
6632 ok_(__FILE__,
line)(diff <=
PRECISION,
"Mesh %d: Got (%f, %f) for vertex %d %s, expected (%f, %f).\n",
6633 mesh_number, got->
x, got->
y, vertex_number, usage_strings[decl_ptr->
Usage],
exp->x,
exp->y);
6642 ok_(__FILE__,
line)(diff <=
PRECISION,
"Mesh %d: Got (%f, %f, %f) for vertex %d %s, expected (%f, %f, %f).\n",
6643 mesh_number, got->
x, got->
y, got->
z, vertex_number, usage_strings[decl_ptr->
Usage],
exp->x,
exp->y,
exp->z);
6653 ok_(__FILE__,
line)(diff <=
PRECISION,
"Mesh %d: Got (%f, %f, %f, %f) for vertex %d %s, expected (%f, %f, %f, %f).\n",
6654 mesh_number, got->
x, got->
y, got->
z, got->
w, vertex_number, usage_strings[decl_ptr->
Usage],
exp->x,
exp->y,
exp->z, got->
w);
6661 BOOL same_color = got[0] ==
exp[0] && got[1] ==
exp[1]
6662 && got[2] ==
exp[2] && got[3] ==
exp[3];
6663 const char *color_types[] = {
"diffuse",
"specular",
"undefined color"};
6665 if (usage_index > 1) usage_index = 2;
6666 ok_(__FILE__,
line)(same_color,
"Mesh %d: Got (%u, %u, %u, %u) for vertex %d %s, expected (%u, %u, %u, %u).\n",
6667 mesh_number, got[0], got[1], got[2], got[3], vertex_number, color_types[usage_index],
exp[0],
exp[1],
exp[2],
exp[3]);
6675 BOOL same = got[0] ==
exp[0] && got[1] ==
exp[1]
6676 && got[2] ==
exp[2] && got[3] ==
exp[3];
6677 ok_(__FILE__,
line)(same,
"Mesh %d: Got (%u, %u, %u, %u) for vertex %d %s, expected (%u, %u, %u, %u).\n",
6678 mesh_number, got[0], got[1], got[2], got[3], vertex_number, usage_strings[decl_ptr->
Usage],
exp[0],
exp[1],
exp[2],
exp[3]);
6686 BOOL same = got[0] ==
exp[0] && got[1] ==
exp[1];
6687 ok_(__FILE__,
line)(same,
"Mesh %d: Got (%hd, %hd) for vertex %d %s, expected (%hd, %hd).\n",
6688 mesh_number, got[0], got[1], vertex_number, usage_strings[decl_ptr->
Usage],
exp[0],
exp[1]);
6696 BOOL same = got[0] ==
exp[0] && got[1] ==
exp[1]
6697 && got[2] ==
exp[2] && got[3] ==
exp[3];
6698 ok_(__FILE__,
line)(same,
"Mesh %d: Got (%hd, %hd, %hd, %hd) for vertex %d %s, expected (%hd, %hd, %hd, %hd).\n",
6699 mesh_number, got[0], got[1], got[2], got[3], vertex_number, usage_strings[decl_ptr->
Usage],
exp[0],
exp[1],
exp[2],
exp[3]);
6706 BOOL same = got[0] ==
exp[0] && got[1] ==
exp[1];
6707 ok_(__FILE__,
line)(same,
"Mesh %d: Got (%hu, %hu) for vertex %d %s, expected (%hu, %hu).\n",
6708 mesh_number, got[0], got[1], vertex_number, usage_strings[decl_ptr->
Usage],
exp[0],
exp[1]);
6715 BOOL same = got[0] ==
exp[0] && got[1] ==
exp[1]
6716 && got[2] ==
exp[2] && got[3] ==
exp[3];
6717 ok_(__FILE__,
line)(same,
"Mesh %d: Got (%hu, %hu, %hu, %hu) for vertex %d %s, expected (%hu, %hu, %hu, %hu).\n",
6718 mesh_number, got[0], got[1], got[2], got[3], vertex_number, usage_strings[decl_ptr->
Usage],
exp[0],
exp[1],
exp[2],
exp[3]);
6728 ok_(__FILE__,
line)(same,
"Mesh %d: Got (%u, %u, %u, %u) for vertex %d %s, expected (%u, %u, %u, %u).\n",
6729 mesh_number, got_udec3.
x, got_udec3.
y, got_udec3.
z, got_udec3.
w, vertex_number, usage_strings[decl_ptr->
Usage], exp_udec3.
x, exp_udec3.
y, exp_udec3.
z, exp_udec3.
w);
6740 ok_(__FILE__,
line)(same,
"Mesh %d: Got (%d, %d, %d, %d) for vertex %d %s, expected (%d, %d, %d, %d).\n",
6741 mesh_number, got_dec3n.
x, got_dec3n.
y, got_dec3n.
z, got_dec3n.
w, vertex_number, usage_strings[decl_ptr->
Usage], exp_dec3n.
x, exp_dec3n.
y, exp_dec3n.
z, exp_dec3n.
w);
6748 BOOL same = got[0] ==
exp[0] && got[1] ==
exp[1];
6749 ok_(__FILE__,
line)(same,
"Mesh %d: Got (%hx, %hx) for vertex %d %s, expected (%hx, %hx).\n",
6750 mesh_number, got[0], got[1], vertex_number, usage_strings[decl_ptr->
Usage],
exp[0],
exp[1]);
6757 BOOL same = got[0] ==
exp[0] && got[1] ==
exp[1]
6758 && got[2] ==
exp[2] && got[3] ==
exp[3];
6759 ok_(__FILE__,
line)(same,
"Mesh %d: Got (%hx, %hx, %hx, %hx) for vertex %d %s, expected (%hx, %hx, %hx, %hx).\n",
6760 mesh_number, got[0], got[1], got[2], got[3], vertex_number, usage_strings[decl_ptr->
Usage],
exp[0],
exp[1],
exp[3],
exp[4]);
6779 const UINT VERTS_PER_FACE = 3;
6783#define up {0.0f, 0.0f, 1.0f}
6785 struct vertex_normal
6790 struct vertex_blendweight
6795 struct vertex_texcoord
6805 struct vertex_color_ubyte4
6810 struct vertex_texcoord_short2
6815 struct vertex_texcoord_ushort2n
6820 struct vertex_normal_short4
6825 struct vertex_texcoord_float16_2
6830 struct vertex_texcoord_float16_4
6835 struct vertex_normal_udec3
6840 struct vertex_normal_dec3n
6845 UINT vertex_size_normal =
sizeof(
struct vertex_normal);
6846 UINT vertex_size_blendweight =
sizeof(
struct vertex_blendweight);
6847 UINT vertex_size_texcoord =
sizeof(
struct vertex_texcoord);
6848 UINT vertex_size_color =
sizeof(
struct vertex_color);
6849 UINT vertex_size_color_ubyte4 =
sizeof(
struct vertex_color_ubyte4);
6850 UINT vertex_size_texcoord_short2 =
sizeof(
struct vertex_texcoord_short2);
6851 UINT vertex_size_normal_short4 =
sizeof(
struct vertex_normal_short4);
6852 UINT vertex_size_texcoord_float16_2 =
sizeof(
struct vertex_texcoord_float16_2);
6853 UINT vertex_size_texcoord_float16_4 =
sizeof(
struct vertex_texcoord_float16_4);
6854 UINT vertex_size_normal_udec3 =
sizeof(
struct vertex_normal_udec3);
6855 UINT vertex_size_normal_dec3n =
sizeof(
struct vertex_normal_dec3n);
6983 const struct vertex vertices0[] =
6985 {{ 0.0f, 3.0f, 0.f},
up},
6986 {{ 2.0f, 3.0f, 0.f},
up},
6987 {{ 0.0f, 0.0f, 0.f},
up},
6989 const DWORD indices0[] = {0, 1, 2};
6990 const DWORD attributes0[] = {0};
6991 const DWORD exp_indices0[] = {0, 1, 2};
6996 const DWORD adjacency0[] = {-1, -1, -1};
6997 const struct vertex exp_vertices0[] =
6999 {{ 0.0f, 3.0f, 0.f},
up},
7000 {{ 2.0f, 3.0f, 0.f},
up},
7001 {{ 0.0f, 0.0f, 0.f},
up},
7003 const DWORD exp_face_remap0[] = {0};
7004 const DWORD exp_vertex_remap0[] = {0, 1, 2};
7013 const struct vertex_normal vertices1[] =
7015 {{ 0.0f, 3.0f, 0.f},
up},
7016 {{ 2.0f, 3.0f, 0.f},
up},
7017 {{ 0.0f, 0.0f, 0.f},
up},
7019 {{ 3.0f, 3.0f, 0.f},
up},
7020 {{ 3.0f, 0.0f, 0.f},
up},
7021 {{ 1.0f, 0.0f, 0.f},
up},
7023 const DWORD indices1[] = {0, 1, 2, 3, 4, 5};
7024 const DWORD attributes1[] = {0, 0};
7029 const DWORD adjacency1[] = {-1, 1, -1, -1, -1, 0};
7030 const struct vertex_normal exp_vertices1[] =
7032 {{ 0.0f, 3.0f, 0.f},
up},
7033 {{ 2.0f, 3.0f, 0.f},
up},
7034 {{ 0.0f, 0.0f, 0.f},
up},
7036 {{ 3.0f, 0.0f, 0.f},
up}
7038 const DWORD exp_indices1[] = {0, 1, 2, 1, 3, 2};
7039 const DWORD exp_face_remap1[] = {0, 1};
7040 const DWORD exp_vertex_remap1[] = {0, 1, 2, 4, -1, -1};
7044 const struct vertex_normal vertices2[] =
7046 {{ 0.0f, 3.0f, 0.f},
up},
7047 {{ 2.0f, 3.0f, 0.f},
up},
7048 {{ 0.0f, 0.0f, 0.f},
up},
7050 {{ 3.0f, 3.0f, 0.f}, {0.0f, 0.5f, 0.5f}},
7051 {{ 3.0f, 0.0f, 0.f},
up},
7052 {{ 1.0f, 0.0f, 0.f}, {0.2f, 0.4f, 0.4f}},
7054 const DWORD indices2[] = {0, 1, 2, 3, 4, 5};
7055 const DWORD attributes2[] = {0, 0};
7059 const D3DXWELDEPSILONS epsilons2 = {1.0f, 0.0f, 0.499999f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7060 const DWORD adjacency2[] = {-1, 1, -1, -1, -1, 0};
7061 const struct vertex_normal exp_vertices2[] =
7063 {{ 0.0f, 3.0f, 0.f},
up},
7064 {{ 2.0f, 3.0f, 0.f},
up},
7065 {{ 0.0f, 0.0f, 0.f},
up},
7067 {{ 2.0f, 3.0f, 0.f}, {0.0f, 0.5f, 0.5f}},
7068 {{ 3.0f, 0.0f, 0.f},
up},
7069 {{ 0.0f, 0.0f, 0.f}, {0.2f, 0.4f, 0.4f}},
7071 const DWORD exp_indices2[] = {0, 1, 2, 3, 4, 5};
7072 const DWORD exp_face_remap2[] = {0, 1};
7073 const DWORD exp_vertex_remap2[] = {0, 1, 2, 3, 4, 5};
7076 const struct vertex_normal vertices3[] =
7078 {{ 0.0f, 3.0f, 0.f},
up},
7079 {{ 2.0f, 3.0f, 0.f},
up},
7080 {{ 0.0f, 0.0f, 0.f},
up},
7082 {{ 3.0f, 3.0f, 0.f}, {0.0f, 0.5f, 0.5f}},
7083 {{ 3.0f, 0.0f, 0.f},
up},
7084 {{ 1.0f, 0.0f, 0.f}, {0.2f, 0.4f, 0.4f}},
7086 const DWORD indices3[] = {0, 1, 2, 3, 4, 5};
7087 const DWORD attributes3[] = {0, 0};
7091 const D3DXWELDEPSILONS epsilons3 = {1.0f, 0.0f, 0.5f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7092 const DWORD adjacency3[] = {-1, 1, -1, -1, -1, 0};
7093 const struct vertex_normal exp_vertices3[] =
7095 {{ 0.0f, 3.0f, 0.f},
up},
7096 {{ 2.0f, 3.0f, 0.f},
up},
7097 {{ 0.0f, 0.0f, 0.f},
up},
7099 {{ 3.0f, 0.0f, 0.f},
up},
7100 {{ 0.0f, 0.0f, 0.f}, {0.2f, 0.4f, 0.4f}},
7102 const DWORD exp_indices3[] = {0, 1, 2, 1, 3, 4};
7103 const DWORD exp_face_remap3[] = {0, 1};
7104 const DWORD exp_vertex_remap3[] = {0, 1, 2, 4, 5, -1};
7107 const struct vertex_normal vertices4[] =
7109 {{ 0.0f, 3.0f, 0.f},
up},
7110 {{ 2.0f, 3.0f, 0.f},
up},
7111 {{ 0.0f, 0.0f, 0.f},
up},
7113 {{ 3.0f, 3.0f, 0.f}, {0.0f, 0.5f, 0.5f}},
7114 {{ 3.0f, 0.0f, 0.f},
up},
7115 {{ 1.0f, 0.0f, 0.f}, {0.2f, 0.4f, 0.4f}},
7117 const DWORD indices4[] = {0, 1, 2, 3, 4, 5};
7118 const DWORD attributes4[] = {0, 0};
7122 const D3DXWELDEPSILONS epsilons4 = {1.0f, 0.0f, 0.6f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7123 const DWORD adjacency4[] = {-1, 1, -1, -1, -1, 0};
7124 const struct vertex_normal exp_vertices4[] =
7126 {{ 0.0f, 3.0f, 0.f},
up},
7127 {{ 2.0f, 3.0f, 0.f},
up},
7128 {{ 0.0f, 0.0f, 0.f},
up},
7130 {{ 3.0f, 0.0f, 0.f},
up},
7132 const DWORD exp_indices4[] = {0, 1, 2, 1, 3, 2};
7133 const DWORD exp_face_remap4[] = {0, 1};
7134 const DWORD exp_vertex_remap4[] = {0, 1, 2, 4, -1, -1};
7143 const struct vertex_normal vertices5[] =
7145 {{ 0.0f, 3.0f, 0.f},
up},
7146 {{ 2.0f, 3.0f, 0.f},
up},
7147 {{ 0.0f, 0.0f, 0.f},
up},
7149 {{ 3.0f, 3.0f, 0.f},
up},
7150 {{ 3.0f, 0.0f, 0.f},
up},
7151 {{ 1.0f, 0.0f, 0.f},
up},
7153 {{ 4.0f, 3.0f, 0.f},
up},
7154 {{ 6.0f, 0.0f, 0.f},
up},
7155 {{ 4.0f, 0.0f, 0.f},
up},
7157 const DWORD indices5[] = {0, 1, 2, 6, 7, 8, 3, 4, 5};
7158 const DWORD exp_indices5[] = {0, 1, 2, 1, 4, 2, 1, 3, 4};
7159 const DWORD attributes5[] = {0, 0, 0};
7163 const DWORD adjacency5[] = {-1, 1, -1, 2, -1, 0, -1, -1, 1};
7164 const struct vertex_normal exp_vertices5[] =
7166 {{ 0.0f, 3.0f, 0.f},
up},
7167 {{ 2.0f, 3.0f, 0.f},
up},
7168 {{ 0.0f, 0.0f, 0.f},
up},
7170 {{ 3.0f, 0.0f, 0.f},
up},
7171 {{ 1.0f, 0.0f, 0.f},
up},
7173 const DWORD exp_face_remap5[] = {0, 1, 2};
7174 const DWORD exp_vertex_remap5[] = {0, 1, 2, 4, 5, -1, -1, -1, -1};
7178 const struct vertex_normal vertices6[] =
7180 {{ 0.0f, 3.0f, 0.f},
up},
7181 {{ 2.0f, 3.0f, 0.f},
up},
7182 {{ 0.0f, 0.0f, 0.f},
up},
7184 {{ 3.0f, 3.0f, 0.f}, {0.0f, 0.5f, 0.5f}},
7185 {{ 3.0f, 0.0f, 0.f},
up},
7186 {{ 1.0f, 0.0f, 0.f}, {0.2f, 0.4f, 0.4f}},
7188 const DWORD indices6[] = {0, 1, 2, 3, 4, 5};
7189 const DWORD attributes6[] = {0, 0};
7193 const D3DXWELDEPSILONS epsilons6 = {1.0f, 0.0f, 0.6f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7194 const DWORD adjacency6[] = {-1, 1, -1, -1, -1, 0};
7195 const struct vertex_normal exp_vertices6[] =
7197 {{ 0.0f, 3.0f, 0.f},
up},
7198 {{ 2.0f, 3.0f, 0.f},
up},
7199 {{ 0.0f, 0.0f, 0.f},
up},
7201 {{ 2.0f, 3.0f, 0.f},
up},
7202 {{ 3.0f, 0.0f, 0.f},
up},
7203 {{ 0.0f, 0.0f, 0.f},
up},
7206 const DWORD exp_indices6[] = {0, 1, 2, 3, 4, 5};
7207 const DWORD exp_face_remap6[] = {0, 1};
7208 const DWORD exp_vertex_remap6[] = {0, 1, 2, 3, 4, 5};
7211 const WORD indices6_16bit[] = {0, 1, 2, 3, 4, 5};
7213 const struct vertex_normal vertices8[] =
7215 {{ 0.0f, 3.0f, 0.f},
up},
7216 {{ 2.0f, 3.0f, 0.f},
up},
7217 {{ 0.0f, 0.0f, 0.f},
up},
7219 {{ 3.0f, 3.0f, 0.f}, {0.0f, 0.5f, 0.5f}},
7220 {{ 3.0f, 0.0f, 0.f},
up},
7221 {{ 1.0f, 0.0f, 0.f}, {0.2f, 0.4f, 0.4f}},
7223 const DWORD indices8[] = {0, 1, 2, 1, 3, 4};
7224 const DWORD attributes8[] = {0, 0};
7228 const D3DXWELDEPSILONS epsilons8 = {1.0f, 0.0f, 0.5f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7229 const DWORD adjacency8[] = {-1, 1, -1, -1, -1, 0};
7230 const struct vertex_normal exp_vertices8[] =
7232 {{ 0.0f, 3.0f, 0.f},
up},
7233 {{ 2.0f, 3.0f, 0.f},
up},
7234 {{ 0.0f, 0.0f, 0.f},
up},
7236 {{ 3.0f, 3.0f, 0.f}, {0.0f, 0.5f, 0.5f}},
7237 {{ 3.0f, 0.0f, 0.f},
up},
7239 const DWORD exp_indices8[] = {0, 1, 2, 1, 3, 4};
7240 const DWORD exp_face_remap8[] = {0, 1};
7241 const DWORD exp_vertex_remap8[] = {0, 1, 2, 3, 4, -1};
7245 const struct vertex_normal vertices9[] =
7247 {{ 0.0f, 3.0f, 0.f},
up},
7248 {{ 2.0f, 3.0f, 0.f},
up},
7249 {{ 0.0f, 0.0f, 0.f},
up},
7251 {{ 3.0f, 3.0f, 0.f}, {0.0f, 0.5f, 0.5f}},
7252 {{ 3.0f, 0.0f, 0.f},
up},
7253 {{ 1.0f, 0.0f, 0.f}, {0.2f, 0.4f, 0.4f}},
7255 const DWORD indices9[] = {0, 1, 2, 3, 4, 5};
7256 const DWORD attributes9[] = {0, 1};
7260 const D3DXWELDEPSILONS epsilons9 = {1.0f, 0.0f, 0.6f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7261 const DWORD adjacency9[] = {-1, 1, -1, -1, -1, 0};
7262 const struct vertex_normal exp_vertices9[] =
7264 {{ 0.0f, 3.0f, 0.f},
up},
7265 {{ 2.0f, 3.0f, 0.f},
up},
7266 {{ 0.0f, 0.0f, 0.f},
up},
7268 {{ 3.0f, 0.0f, 0.f},
up},
7270 const DWORD exp_indices9[] = {0, 1, 2, 1, 3, 2};
7271 const DWORD exp_face_remap9[] = {0, 1};
7272 const DWORD exp_vertex_remap9[] = {0, 1, 2, 4, -1, -1};
7275 const struct vertex_blendweight vertices10[] =
7277 {{ 0.0f, 3.0f, 0.f}, 1.0f},
7278 {{ 2.0f, 3.0f, 0.f}, 1.0f},
7279 {{ 0.0f, 0.0f, 0.f}, 1.0f},
7281 {{ 3.0f, 3.0f, 0.f}, 0.9},
7282 {{ 3.0f, 0.0f, 0.f}, 1.0},
7283 {{ 1.0f, 0.0f, 0.f}, 0.4},
7285 const DWORD indices10[] = {0, 1, 2, 3, 4, 5};
7286 const DWORD attributes10[] = {0, 0};
7290 const D3DXWELDEPSILONS epsilons10 = {1.0f, 0.1f +
FLT_EPSILON, 0.0f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7291 const DWORD adjacency10[] = {-1, 1, -1, -1, -1, 0};
7292 const struct vertex_blendweight exp_vertices10[] =
7294 {{ 0.0f, 3.0f, 0.f}, 1.0f},
7295 {{ 2.0f, 3.0f, 0.f}, 1.0f},
7296 {{ 0.0f, 0.0f, 0.f}, 1.0f},
7298 {{ 3.0f, 0.0f, 0.f}, 1.0},
7299 {{ 0.0f, 0.0f, 0.f}, 0.4},
7301 const DWORD exp_indices10[] = {0, 1, 2, 1, 3, 4};
7302 const DWORD exp_face_remap10[] = {0, 1};
7303 const DWORD exp_vertex_remap10[] = {0, 1, 2, 4, 5, -1};
7306 const struct vertex_texcoord vertices11[] =
7308 {{ 0.0f, 3.0f, 0.f}, {1.0f, 1.0f}},
7309 {{ 2.0f, 3.0f, 0.f}, {0.5f, 0.7f}},
7310 {{ 0.0f, 0.0f, 0.f}, {-0.2f, -0.3f}},
7312 {{ 3.0f, 3.0f, 0.f}, {0.2f, 0.3f}},
7313 {{ 3.0f, 0.0f, 0.f}, {1.0f, 1.0f}},
7314 {{ 1.0f, 0.0f, 0.f}, {0.1f, 0.2f}}
7316 const DWORD indices11[] = {0, 1, 2, 3, 4, 5};
7317 const DWORD attributes11[] = {0, 0};
7321 const D3DXWELDEPSILONS epsilons11 = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, {0.4f +
FLT_EPSILON, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7322 const DWORD adjacency11[] = {-1, 1, -1, -1, -1, 0};
7323 const struct vertex_texcoord exp_vertices11[] =
7325 {{ 0.0f, 3.0f, 0.f}, {1.0f, 1.0f}},
7326 {{ 2.0f, 3.0f, 0.f}, {0.5f, 0.7f}},
7327 {{ 0.0f, 0.0f, 0.f}, {-0.2f, -0.3f}},
7329 {{ 3.0f, 0.0f, 0.f}, {1.0f, 1.0f}},
7330 {{ 0.0f, 0.0f, 0.f}, {0.1f, 0.2f}},
7332 const DWORD exp_indices11[] = {0, 1, 2, 1, 3, 4};
7333 const DWORD exp_face_remap11[] = {0, 1};
7334 const DWORD exp_vertex_remap11[] = {0, 1, 2, 4, 5, -1};
7337 const struct vertex_color vertices12[] =
7339 {{ 0.0f, 3.0f, 0.f}, 0xFFFFFFFF},
7340 {{ 2.0f, 3.0f, 0.f}, 0xFFFFFFFF},
7341 {{ 0.0f, 0.0f, 0.f}, 0xFFFFFFFF},
7343 {{ 3.0f, 3.0f, 0.f}, 0x00000000},
7344 {{ 3.0f, 0.0f, 0.f}, 0xFFFFFFFF},
7345 {{ 1.0f, 0.0f, 0.f}, 0x88888888},
7347 const DWORD indices12[] = {0, 1, 2, 3, 4, 5};
7348 const DWORD attributes12[] = {0, 0};
7352 const D3DXWELDEPSILONS epsilons12 = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7353 const DWORD adjacency12[] = {-1, 1, -1, -1, -1, 0};
7354 const struct vertex_color exp_vertices12[] =
7356 {{ 0.0f, 3.0f, 0.f}, 0xFFFFFFFF},
7357 {{ 2.0f, 3.0f, 0.f}, 0xFFFFFFFF},
7358 {{ 0.0f, 0.0f, 0.f}, 0xFFFFFFFF},
7360 {{ 2.0f, 3.0f, 0.f}, 0x00000000},
7361 {{ 3.0f, 0.0f, 0.f}, 0xFFFFFFFF},
7363 const DWORD exp_indices12[] = {0, 1, 2, 3, 4, 2};
7364 const DWORD exp_face_remap12[] = {0, 1};
7365 const DWORD exp_vertex_remap12[] = {0, 1, 2, 3, 4, -1};
7370 const struct vertex_normal vertices13[] =
7372 {{ 0.0f, 3.0f, 0.f},
up},
7373 {{ 2.0f, 3.0f, 0.f},
up},
7374 {{ 0.0f, 0.0f, 0.f},
up},
7376 {{ 3.0f, 3.0f, 0.f}, {0.0f, 0.5f, 0.5f}},
7377 {{ 3.0f, 0.0f, 0.f},
up},
7378 {{ 1.0f, 0.0f, 0.f}, {0.2f, 0.4f, 0.4f}},
7380 const DWORD indices13[] = {0, 1, 2, 3, 4, 5};
7381 const DWORD attributes13[] = {0, 0};
7385 const D3DXWELDEPSILONS epsilons13 = {1.0f, 0.0f, 0.5f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7386 const DWORD adjacency13[] = {-1, 1, -1, -1, -1, 0};
7387 const struct vertex_normal exp_vertices13[] =
7389 {{ 0.0f, 3.0f, 0.f},
up},
7390 {{ 2.0f, 3.0f, 0.f},
up},
7391 {{ 0.0f, 0.0f, 0.f},
up},
7393 {{ 3.0f, 0.0f, 0.f},
up},
7394 {{ 0.0f, 0.0f, 0.f}, {0.2f, 0.4f, 0.4f}},
7396 const DWORD exp_indices13[] = {0, 1, 2, 1, 3, 4};
7397 const DWORD exp_face_remap13[] = {0, 1};
7398 const DWORD exp_vertex_remap13[] = {0, 1, 2, 4, 5, -1};
7401 const struct vertex_color vertices14[] =
7403 {{ 0.0f, 3.0f, 0.f}, 0xFFFFFFFF},
7404 {{ 2.0f, 3.0f, 0.f}, 0xFFFFFFFF},
7405 {{ 0.0f, 0.0f, 0.f}, 0xFFFFFFFF},
7407 {{ 3.0f, 3.0f, 0.f}, 0x00000000},
7408 {{ 3.0f, 0.0f, 0.f}, 0xFFFFFFFF},
7409 {{ 1.0f, 0.0f, 0.f}, 0x01010101},
7411 const DWORD indices14[] = {0, 1, 2, 3, 4, 5};
7412 const DWORD attributes14[] = {0, 0};
7416 const D3DXWELDEPSILONS epsilons14 = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 254.0f/255.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7417 const DWORD adjacency14[] = {-1, 1, -1, -1, -1, 0};
7418 const struct vertex_color exp_vertices14[] =
7420 {{ 0.0f, 3.0f, 0.f}, 0xFFFFFFFF},
7421 {{ 2.0f, 3.0f, 0.f}, 0xFFFFFFFF},
7422 {{ 0.0f, 0.0f, 0.f}, 0xFFFFFFFF},
7424 {{ 2.0f, 3.0f, 0.f}, 0x00000000},
7425 {{ 3.0f, 0.0f, 0.f}, 0xFFFFFFFF},
7427 const DWORD exp_indices14[] = {0, 1, 2, 3, 4, 2};
7428 const DWORD exp_face_remap14[] = {0, 1};
7429 const DWORD exp_vertex_remap14[] = {0, 1, 2, 3, 4, -1};
7434 const struct vertex_color_ubyte4 vertices15[] =
7436 {{ 0.0f, 3.0f, 0.f}, {255, 255, 255, 255}},
7437 {{ 2.0f, 3.0f, 0.f}, {255, 255, 255, 255}},
7438 {{ 0.0f, 0.0f, 0.f}, {255, 255, 255, 255}},
7440 {{ 3.0f, 3.0f, 0.f}, { 0, 0, 0, 0}},
7441 {{ 3.0f, 0.0f, 0.f}, {255, 255, 255, 255}},
7442 {{ 1.0f, 0.0f, 0.f}, { 1, 1, 1, 1}},
7444 const DWORD indices15[] = {0, 1, 2, 3, 4, 5};
7445 const DWORD attributes15[] = {0, 0};
7449 const D3DXWELDEPSILONS epsilons15 = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 254.0f/255.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7450 const DWORD adjacency15[] = {-1, 1, -1, -1, -1, 0};
7451 const struct vertex_color_ubyte4 exp_vertices15[] =
7453 {{ 0.0f, 3.0f, 0.f}, {255, 255, 255, 255}},
7454 {{ 2.0f, 3.0f, 0.f}, {255, 255, 255, 255}},
7455 {{ 0.0f, 0.0f, 0.f}, {255, 255, 255, 255}},
7457 {{ 2.0f, 3.0f, 0.f}, { 0, 0, 0, 0}},
7458 {{ 3.0f, 0.0f, 0.f}, {255, 255, 255, 255}},
7460 const DWORD exp_indices15[] = {0, 1, 2, 3, 4, 2};
7461 const DWORD exp_face_remap15[] = {0, 1};
7462 const DWORD exp_vertex_remap15[] = {0, 1, 2, 3, 4, -1};
7468 const struct vertex_color_ubyte4 vertices16[] =
7470 {{ 0.0f, 3.0f, 0.f}, {255, 255, 255, 255}},
7471 {{ 2.0f, 3.0f, 0.f}, {255, 255, 255, 255}},
7472 {{ 0.0f, 0.0f, 0.f}, {255, 255, 255, 255}},
7474 {{ 3.0f, 3.0f, 0.f}, { 0, 0, 0, 0}},
7475 {{ 3.0f, 0.0f, 0.f}, {255, 255, 255, 255}},
7476 {{ 1.0f, 0.0f, 0.f}, { 1, 1, 1, 1}},
7478 const DWORD indices16[] = {0, 1, 2, 3, 4, 5};
7479 const DWORD attributes16[] = {0, 0};
7483 const D3DXWELDEPSILONS epsilons16 = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 254.9f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7484 const DWORD adjacency16[] = {-1, 1, -1, -1, -1, 0};
7485 const struct vertex_color_ubyte4 exp_vertices16[] =
7487 {{ 0.0f, 3.0f, 0.f}, {255, 255, 255, 255}},
7488 {{ 2.0f, 3.0f, 0.f}, {255, 255, 255, 255}},
7489 {{ 0.0f, 0.0f, 0.f}, {255, 255, 255, 255}},
7491 {{ 2.0f, 3.0f, 0.f}, { 0, 0, 0, 0}},
7492 {{ 3.0f, 0.0f, 0.f}, {255, 255, 255, 255}},
7494 const DWORD exp_indices16[] = {0, 1, 2, 3, 4, 2};
7495 const DWORD exp_face_remap16[] = {0, 1};
7496 const DWORD exp_vertex_remap16[] = {0, 1, 2, 3, 4, -1};
7499 const struct vertex_texcoord_short2 vertices17[] =
7501 {{ 0.0f, 3.0f, 0.f}, { 0, 0}},
7502 {{ 2.0f, 3.0f, 0.f}, { 0, 0}},
7503 {{ 0.0f, 0.0f, 0.f}, { 0, 0}},
7505 {{ 3.0f, 3.0f, 0.f}, {32767, 32767}},
7506 {{ 3.0f, 0.0f, 0.f}, {0, 0}},
7507 {{ 1.0f, 0.0f, 0.f}, {32766, 32766}},
7509 const DWORD indices17[] = {0, 1, 2, 3, 4, 5};
7510 const DWORD attributes17[] = {0, 0};
7514 const D3DXWELDEPSILONS epsilons17 = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, {32766.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7515 const DWORD adjacency17[] = {-1, 1, -1, -1, -1, 0};
7516 const struct vertex_texcoord_short2 exp_vertices17[] =
7518 {{ 0.0f, 3.0f, 0.f}, { 0, 0}},
7519 {{ 2.0f, 3.0f, 0.f}, { 0, 0}},
7520 {{ 0.0f, 0.0f, 0.f}, { 0, 0}},
7522 {{ 2.0f, 3.0f, 0.f}, {32767, 32767}},
7523 {{ 3.0f, 0.0f, 0.f}, {0, 0}},
7525 const DWORD exp_indices17[] = {0, 1, 2, 3, 4, 2};
7526 const DWORD exp_face_remap17[] = {0, 1};
7527 const DWORD exp_vertex_remap17[] = {0, 1, 2, 3, 4, -1};
7530 const struct vertex_texcoord_short2 vertices18[] =
7532 {{ 0.0f, 3.0f, 0.f}, { 0, 0}},
7533 {{ 2.0f, 3.0f, 0.f}, { 0, 0}},
7534 {{ 0.0f, 0.0f, 0.f}, { 0, 0}},
7536 {{ 3.0f, 3.0f, 0.f}, {32767, 32767}},
7537 {{ 3.0f, 0.0f, 0.f}, {0, 0}},
7538 {{ 1.0f, 0.0f, 0.f}, {32766, 32766}},
7540 const DWORD indices18[] = {0, 1, 2, 3, 4, 5};
7541 const DWORD attributes18[] = {0, 0};
7545 const D3DXWELDEPSILONS epsilons18 = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, {32766.0f/32767.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7546 const DWORD adjacency18[] = {-1, 1, -1, -1, -1, 0};
7547 const struct vertex_texcoord_short2 exp_vertices18[] =
7549 {{ 0.0f, 3.0f, 0.f}, { 0, 0}},
7550 {{ 2.0f, 3.0f, 0.f}, { 0, 0}},
7551 {{ 0.0f, 0.0f, 0.f}, { 0, 0}},
7553 {{ 2.0f, 3.0f, 0.f}, {32767, 32767}},
7554 {{ 3.0f, 0.0f, 0.f}, {0, 0}},
7556 const DWORD exp_indices18[] = {0, 1, 2, 3, 4, 2};
7557 const DWORD exp_face_remap18[] = {0, 1};
7558 const DWORD exp_vertex_remap18[] = {0, 1, 2, 3, 4, -1};
7561 const struct vertex_texcoord_ushort2n vertices19[] =
7563 {{ 0.0f, 3.0f, 0.f}, { 0, 0}},
7564 {{ 2.0f, 3.0f, 0.f}, { 0, 0}},
7565 {{ 0.0f, 0.0f, 0.f}, { 0, 0}},
7567 {{ 3.0f, 3.0f, 0.f}, {65535, 65535}},
7568 {{ 3.0f, 0.0f, 0.f}, {0, 0}},
7569 {{ 1.0f, 0.0f, 0.f}, {65534, 65534}},
7571 const DWORD indices19[] = {0, 1, 2, 3, 4, 5};
7572 const DWORD attributes19[] = {0, 0};
7576 const D3DXWELDEPSILONS epsilons19 = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, {65534.0f/65535.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7577 const DWORD adjacency19[] = {-1, 1, -1, -1, -1, 0};
7578 const struct vertex_texcoord_ushort2n exp_vertices19[] =
7580 {{ 0.0f, 3.0f, 0.f}, { 0, 0}},
7581 {{ 2.0f, 3.0f, 0.f}, { 0, 0}},
7582 {{ 0.0f, 0.0f, 0.f}, { 0, 0}},
7584 {{ 2.0f, 3.0f, 0.f}, {65535, 65535}},
7585 {{ 3.0f, 0.0f, 0.f}, {0, 0}},
7587 const DWORD exp_indices19[] = {0, 1, 2, 3, 4, 2};
7588 const DWORD exp_face_remap19[] = {0, 1};
7589 const DWORD exp_vertex_remap19[] = {0, 1, 2, 3, 4, -1};
7592 const struct vertex_normal_short4 vertices20[] =
7594 {{ 0.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
7595 {{ 2.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
7596 {{ 0.0f, 0.0f, 0.f}, {0, 0, 0, 0}},
7598 {{ 3.0f, 3.0f, 0.f}, {32767, 32767, 32767, 32767}},
7599 {{ 3.0f, 0.0f, 0.f}, {0, 0, 0, 0}},
7600 {{ 1.0f, 0.0f, 0.f}, {32766, 32766, 32766, 32766}},
7602 const DWORD indices20[] = {0, 1, 2, 3, 4, 5};
7603 const DWORD attributes20[] = {0, 0};
7607 const D3DXWELDEPSILONS epsilons20 = {1.0f, 0.0f, 32766.0f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7608 const DWORD adjacency20[] = {-1, 1, -1, -1, -1, 0};
7609 const struct vertex_normal_short4 exp_vertices20[] =
7611 {{ 0.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
7612 {{ 2.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
7613 {{ 0.0f, 0.0f, 0.f}, {0, 0, 0, 0}},
7615 {{ 2.0f, 3.0f, 0.f}, {32767, 32767, 32767, 32767}},
7616 {{ 3.0f, 0.0f, 0.f}, {0, 0, 0, 0}},
7618 const DWORD exp_indices20[] = {0, 1, 2, 3, 4, 2};
7619 const DWORD exp_face_remap20[] = {0, 1};
7620 const DWORD exp_vertex_remap20[] = {0, 1, 2, 3, 4, -1};
7623 const struct vertex_normal_short4 vertices21[] =
7625 {{ 0.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
7626 {{ 2.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
7627 {{ 0.0f, 0.0f, 0.f}, {0, 0, 0, 0}},
7629 {{ 3.0f, 3.0f, 0.f}, {32767, 32767, 32767, 32767}},
7630 {{ 3.0f, 0.0f, 0.f}, {0, 0, 0, 0}},
7631 {{ 1.0f, 0.0f, 0.f}, {32766, 32766, 32766, 32766}},
7633 const DWORD indices21[] = {0, 1, 2, 3, 4, 5};
7634 const DWORD attributes21[] = {0, 0};
7638 const D3DXWELDEPSILONS epsilons21 = {1.0f, 0.0f, 32766.0f/32767.0f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7639 const DWORD adjacency21[] = {-1, 1, -1, -1, -1, 0};
7640 const struct vertex_normal_short4 exp_vertices21[] =
7642 {{ 0.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
7643 {{ 2.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
7644 {{ 0.0f, 0.0f, 0.f}, {0, 0, 0, 0}},
7646 {{ 2.0f, 3.0f, 0.f}, {32767, 32767, 32767, 32767}},
7647 {{ 3.0f, 0.0f, 0.f}, {0, 0, 0, 0}},
7649 const DWORD exp_indices21[] = {0, 1, 2, 3, 4, 2};
7650 const DWORD exp_face_remap21[] = {0, 1};
7651 const DWORD exp_vertex_remap21[] = {0, 1, 2, 3, 4, -1};
7654 const struct vertex_normal_short4 vertices22[] =
7656 {{ 0.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
7657 {{ 2.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
7658 {{ 0.0f, 0.0f, 0.f}, {0, 0, 0, 0}},
7660 {{ 3.0f, 3.0f, 0.f}, {-1, -1, -1, -1}},
7661 {{ 3.0f, 0.0f, 0.f}, {0, 0, 0, 0}},
7662 {{ 1.0f, 0.0f, 0.f}, {-2, -2, -2, -2}},
7664 const DWORD indices22[] = {0, 1, 2, 3, 4, 5};
7665 const DWORD attributes22[] = {0, 0};
7669 const D3DXWELDEPSILONS epsilons22 = {1.0f, 0.0f, 65534.0f/65535.0f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7670 const DWORD adjacency22[] = {-1, 1, -1, -1, -1, 0};
7671 const struct vertex_normal_short4 exp_vertices22[] =
7673 {{ 0.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
7674 {{ 2.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
7675 {{ 0.0f, 0.0f, 0.f}, {0, 0, 0, 0}},
7677 {{ 2.0f, 3.0f, 0.f}, {-1, -1, -1, -1}},
7678 {{ 3.0f, 0.0f, 0.f}, {0, 0, 0, 0}},
7680 const DWORD exp_indices22[] = {0, 1, 2, 3, 4, 2};
7681 const DWORD exp_face_remap22[] = {0, 1};
7682 const DWORD exp_vertex_remap22[] = {0, 1, 2, 3, 4, -1};
7686 const struct vertex_texcoord_float16_2 vertices23[] =
7688 {{ 0.0f, 3.0f, 0.f}, {0x3c00, 0x3c00}},
7689 {{ 2.0f, 3.0f, 0.f}, {0x3800, 0x399a}},
7690 {{ 0.0f, 0.0f, 0.f}, {0xb266, 0xb4cd}},
7692 {{ 3.0f, 3.0f, 0.f}, {0x3266, 0x34cd}},
7693 {{ 3.0f, 0.0f, 0.f}, {0x3c00, 0x3c00}},
7694 {{ 1.0f, 0.0f, 0.f}, {0x2e66, 0x3266}},
7696 const DWORD indices23[] = {0, 1, 2, 3, 4, 5};
7697 const DWORD attributes23[] = {0, 0};
7701 const D3DXWELDEPSILONS epsilons23 = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, {0.41f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7702 const DWORD adjacency23[] = {-1, 1, -1, -1, -1, 0};
7703 const struct vertex_texcoord_float16_2 exp_vertices23[] =
7705 {{ 0.0f, 3.0f, 0.f}, {0x3c00, 0x3c00}},
7706 {{ 2.0f, 3.0f, 0.f}, {0x3800, 0x399a}},
7707 {{ 0.0f, 0.0f, 0.f}, {0xb266, 0xb4cd}},
7709 {{ 3.0f, 0.0f, 0.f}, {0x3c00, 0x3c00}},
7710 {{ 0.0f, 0.0f, 0.f}, {0x2e66, 0x3266}},
7712 const DWORD exp_indices23[] = {0, 1, 2, 1, 3, 4};
7713 const DWORD exp_face_remap23[] = {0, 1};
7714 const DWORD exp_vertex_remap23[] = {0, 1, 2, 4, 5, -1};
7717 const struct vertex_texcoord_float16_4 vertices24[] =
7719 {{ 0.0f, 3.0f, 0.f}, {0x3c00, 0x3c00, 0x3c00, 0x3c00}},
7720 {{ 2.0f, 3.0f, 0.f}, {0x3800, 0x399a, 0x3800, 0x399a}},
7721 {{ 0.0f, 0.0f, 0.f}, {0xb266, 0xb4cd, 0xb266, 0xb4cd}},
7723 {{ 3.0f, 3.0f, 0.f}, {0x3266, 0x34cd, 0x3266, 0x34cd}},
7724 {{ 3.0f, 0.0f, 0.f}, {0x3c00, 0x3c00, 0x3c00, 0x3c00}},
7725 {{ 1.0f, 0.0f, 0.f}, {0x2e66, 0x3266, 0x2e66, 0x3266}},
7727 const DWORD indices24[] = {0, 1, 2, 3, 4, 5};
7728 const DWORD attributes24[] = {0, 0};
7732 const D3DXWELDEPSILONS epsilons24 = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, {0.41f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7733 const DWORD adjacency24[] = {-1, 1, -1, -1, -1, 0};
7734 const struct vertex_texcoord_float16_4 exp_vertices24[] =
7736 {{ 0.0f, 3.0f, 0.f}, {0x3c00, 0x3c00, 0x3c00, 0x3c00}},
7737 {{ 2.0f, 3.0f, 0.f}, {0x3800, 0x399a, 0x3800, 0x399a}},
7738 {{ 0.0f, 0.0f, 0.f}, {0xb266, 0xb4cd, 0xb266, 0xb4cd}},
7740 {{ 3.0f, 0.0f, 0.f}, {0x3c00, 0x3c00, 0x3c00, 0x3c00}},
7741 {{ 0.0f, 0.0f, 0.f}, {0x2e66, 0x3266, 0x2e66, 0x3266}},
7743 const DWORD exp_indices24[] = {0, 1, 2, 1, 3, 4};
7744 const DWORD exp_face_remap24[] = {0, 1};
7745 const DWORD exp_vertex_remap24[] = {0, 1, 2, 4, 5, -1};
7750 const struct vertex_texcoord vertices25[] =
7752 {{ 0.0f, 3.0f, 0.f}, {1.0f, 1.0f}},
7753 {{ 2.0f, 3.0f, 0.f}, {0.5f, 0.7f}},
7754 {{ 0.0f, 0.0f, 0.f}, {-0.2f, -0.3f}},
7756 {{ 3.0f, 3.0f, 0.f}, {0.2f, 0.3f}},
7757 {{ 3.0f, 0.0f, 0.f}, {1.0f, 1.0f}},
7758 {{ 1.0f, 0.0f, 0.f}, {0.1f, 0.2f}}
7760 const DWORD indices25[] = {0, 1, 2, 3, 4, 5};
7761 const DWORD attributes25[] = {0, 0};
7765 const D3DXWELDEPSILONS epsilons25 = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.4f +
FLT_EPSILON}, 0.0f, 0.0f, 0.0f};
7766 const DWORD adjacency25[] = {-1, 1, -1, -1, -1, 0};
7767 const struct vertex_texcoord exp_vertices25[] =
7769 {{ 0.0f, 3.0f, 0.f}, {1.0f, 1.0f}},
7770 {{ 2.0f, 3.0f, 0.f}, {0.5f, 0.7f}},
7771 {{ 0.0f, 0.0f, 0.f}, {-0.2f, -0.3f}},
7773 {{ 3.0f, 0.0f, 0.f}, {1.0f, 1.0f}},
7774 {{ 0.0f, 0.0f, 0.f}, {0.1f, 0.2f}},
7776 const DWORD exp_indices25[] = {0, 1, 2, 1, 3, 4};
7777 const DWORD exp_face_remap25[] = {0, 1};
7778 const DWORD exp_vertex_remap25[] = {0, 1, 2, 4, 5, -1};
7782 const struct vertex_color vertices26[] =
7784 {{ 0.0f, 3.0f, 0.f}, 0xFFFFFFFF},
7785 {{ 2.0f, 3.0f, 0.f}, 0xFFFFFFFF},
7786 {{ 0.0f, 0.0f, 0.f}, 0xFFFFFFFF},
7788 {{ 3.0f, 3.0f, 0.f}, 0x00000000},
7789 {{ 3.0f, 0.0f, 0.f}, 0xFFFFFFFF},
7790 {{ 1.0f, 0.0f, 0.f}, 0x01010101},
7792 const DWORD indices26[] = {0, 1, 2, 3, 4, 5};
7793 const DWORD attributes26[] = {0, 0};
7797 const D3DXWELDEPSILONS epsilons26 = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}, 1.0f, 1.0f, 1.0f};
7798 const DWORD adjacency26[] = {-1, 1, -1, -1, -1, 0};
7799 const struct vertex_color exp_vertices26[] =
7801 {{ 0.0f, 3.0f, 0.f}, 0xFFFFFFFF},
7802 {{ 2.0f, 3.0f, 0.f}, 0xFFFFFFFF},
7803 {{ 0.0f, 0.0f, 0.f}, 0xFFFFFFFF},
7805 {{ 2.0f, 3.0f, 0.f}, 0x00000000},
7806 {{ 3.0f, 0.0f, 0.f}, 0xFFFFFFFF},
7807 {{ 0.0f, 0.0f, 0.f}, 0x01010101},
7809 const DWORD exp_indices26[] = {0, 1, 2, 3, 4, 5};
7810 const DWORD exp_face_remap26[] = {0, 1};
7811 const DWORD exp_vertex_remap26[] = {0, 1, 2, 3, 4, 5};
7817 const struct vertex_color vertices27[] =
7819 {{ 0.0f, 3.0f, 0.0f}, 0x00000000},
7820 {{ 2.0f, 3.0f, 0.0f}, 0x10203040},
7821 {{ 0.0f, 0.0f, 0.0f}, 0x50607080},
7823 {{ 3.0f, 3.0f, 0.0f}, 0x11213141},
7824 {{ 3.0f, 0.0f, 0.0f}, 0xffffffff},
7825 {{ 1.0f, 0.0f, 0.0f}, 0x51617181},
7827 const DWORD indices27[] = {0, 1, 2, 3, 4, 5};
7828 const DWORD attributes27[] = {0, 0};
7834 1.1f, 0.0f, 0.0f, 0.0f, 2.0f / 255.0f, 0.0f,
7835 {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f
7837 const DWORD adjacency27[] = {-1, 1, -1, -1, -1, 0};
7838 const struct vertex_color exp_vertices27[] =
7840 {{ 0.0f, 3.0f, 0.0f}, 0x00000000},
7841 {{ 2.0f, 3.0f, 0.0f}, 0x10203040},
7842 {{ 0.0f, 0.0f, 0.0f}, 0x50607080},
7844 {{ 3.0f, 0.0f, 0.0f}, 0xffffffff},
7846 const DWORD exp_indices27[] = {0, 1, 2, 1, 3, 2};
7847 const DWORD exp_face_remap27[] = {0, 1};
7848 const DWORD exp_vertex_remap27[] = {0, 1, 2, 4, -1, -1};
7854 const struct vertex_normal_udec3 vertices28[] =
7856 {{ 0.0f, 3.0f, 0.f}, dword_udec3_zero},
7857 {{ 2.0f, 3.0f, 0.f}, dword_udec3_zero},
7858 {{ 0.0f, 0.0f, 0.f}, dword_udec3_zero},
7860 {{ 3.0f, 3.0f, 0.f}, dword_udec3_1023},
7861 {{ 3.0f, 0.0f, 0.f}, dword_udec3_zero},
7862 {{ 1.0f, 0.0f, 0.f}, dword_udec3_1022},
7864 const DWORD indices28[] = {0, 1, 2, 3, 4, 5};
7865 const DWORD attributes28[] = {0, 0};
7869 const D3DXWELDEPSILONS epsilons28 = {1.0f, 0.0f, 1022.0f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f};
7870 const DWORD adjacency28[] = {-1, 1, -1, -1, -1, 0};
7871 const struct vertex_normal_udec3 exp_vertices28[] =
7873 {{ 0.0f, 3.0f, 0.f}, dword_udec3_zero},
7874 {{ 2.0f, 3.0f, 0.f}, dword_udec3_zero},
7875 {{ 0.0f, 0.0f, 0.f}, dword_udec3_zero},
7877 {{ 2.0f, 3.0f, 0.f}, dword_udec3_1023},
7878 {{ 3.0f, 0.0f, 0.f}, dword_udec3_zero},
7880 const DWORD exp_indices28[] = {0, 1, 2, 3, 4, 2};
7881 const DWORD exp_face_remap28[] = {0, 1};
7882 const DWORD exp_vertex_remap28[] = {0, 1, 2, 3, 4, -1};
7888 const struct vertex_normal_dec3n vertices29[] =
7890 {{ 0.0f, 3.0f, 0.f}, dword_dec3n_zero},
7891 {{ 2.0f, 3.0f, 0.f}, dword_dec3n_zero},
7892 {{ 0.0f, 0.0f, 0.f}, dword_dec3n_zero},
7894 {{ 3.0f, 3.0f, 0.f}, dword_dec3n_511},
7895 {{ 3.0f, 0.0f, 0.f}, dword_dec3n_zero},
7896 {{ 1.0f, 0.0f, 0.f}, dword_dec3n_510},
7898 const DWORD indices29[] = {0, 1, 2, 3, 4, 5};
7899 const DWORD attributes29[] = {0, 0};
7903 const D3DXWELDEPSILONS epsilons29 = {1.0f, 0.0f, 510.0f/511.0f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, .0f}, 0.0f, 0.0f, 0.0f};
7904 const DWORD adjacency29[] = {-1, 1, -1, -1, -1, 0};
7905 const struct vertex_normal_dec3n exp_vertices29[] =
7907 {{ 0.0f, 3.0f, 0.f}, dword_dec3n_zero},
7908 {{ 2.0f, 3.0f, 0.f}, dword_dec3n_zero},
7909 {{ 0.0f, 0.0f, 0.f}, dword_dec3n_zero},
7911 {{ 2.0f, 3.0f, 0.f}, dword_dec3n_511},
7912 {{ 3.0f, 0.0f, 0.f}, dword_dec3n_zero},
7914 const DWORD exp_indices29[] = {0, 1, 2, 3, 4, 2};
7915 const DWORD exp_face_remap29[] = {0, 1};
7916 const DWORD exp_vertex_remap29[] = {0, 1, 2, 3, 4, -1};
7925 const BYTE *vertices;
7927 const DWORD *attributes;
7928 const DWORD num_vertices;
7929 const DWORD num_faces;
7932 const UINT vertex_size;
7935 const DWORD *adjacency;
7936 const BYTE *exp_vertices;
7937 const DWORD *exp_indices;
7938 const DWORD *exp_face_remap;
7939 const DWORD *exp_vertex_remap;
7940 const DWORD exp_new_num_vertices;
7956 (
BYTE*)exp_vertices0,
7960 exp_new_num_vertices0
7974 (
BYTE*)exp_vertices1,
7978 exp_new_num_vertices1
7992 (
BYTE*)exp_vertices2,
7996 exp_new_num_vertices2
8010 (
BYTE*)exp_vertices3,
8014 exp_new_num_vertices3
8028 (
BYTE*)exp_vertices4,
8032 exp_new_num_vertices4
8047 (
BYTE*)exp_vertices5,
8051 exp_new_num_vertices5
8065 (
BYTE*)exp_vertices6,
8069 exp_new_num_vertices6
8073 (
DWORD*)indices6_16bit,
8083 (
BYTE*)exp_vertices6,
8087 exp_new_num_vertices6
8101 (
BYTE*)exp_vertices8,
8105 exp_new_num_vertices8
8119 (
BYTE*)exp_vertices9,
8123 exp_new_num_vertices9
8132 declaration_blendweight,
8133 vertex_size_blendweight,
8137 (
BYTE*)exp_vertices10,
8141 exp_new_num_vertices10
8150 declaration_texcoord,
8151 vertex_size_texcoord,
8155 (
BYTE*)exp_vertices11,
8159 exp_new_num_vertices11
8173 (
BYTE*)exp_vertices12,
8177 exp_new_num_vertices12
8186 declaration_normal3,
8191 (
BYTE*)exp_vertices13,
8195 exp_new_num_vertices13
8209 (
BYTE*)exp_vertices14,
8213 exp_new_num_vertices14
8222 declaration_color_ubyte4n,
8223 vertex_size_color_ubyte4,
8227 (
BYTE*)exp_vertices15,
8231 exp_new_num_vertices15
8240 declaration_color_ubyte4,
8241 vertex_size_color_ubyte4,
8245 (
BYTE*)exp_vertices16,
8249 exp_new_num_vertices16
8258 declaration_texcoord_short2,
8259 vertex_size_texcoord_short2,
8263 (
BYTE*)exp_vertices17,
8267 exp_new_num_vertices17
8276 declaration_texcoord_short2n,
8277 vertex_size_texcoord_short2,
8281 (
BYTE*)exp_vertices18,
8285 exp_new_num_vertices18
8294 declaration_texcoord_ushort2n,
8295 vertex_size_texcoord_short2,
8299 (
BYTE*)exp_vertices19,
8303 exp_new_num_vertices19
8312 declaration_normal_short4,
8313 vertex_size_normal_short4,
8317 (
BYTE*)exp_vertices20,
8321 exp_new_num_vertices20
8330 declaration_normal_short4n,
8331 vertex_size_normal_short4,
8335 (
BYTE*)exp_vertices21,
8339 exp_new_num_vertices21
8348 declaration_normal_ushort4n,
8349 vertex_size_normal_short4,
8353 (
BYTE*)exp_vertices22,
8357 exp_new_num_vertices22
8366 declaration_texcoord_float16_2,
8367 vertex_size_texcoord_float16_2,
8371 (
BYTE*)exp_vertices23,
8375 exp_new_num_vertices23
8384 declaration_texcoord_float16_4,
8385 vertex_size_texcoord_float16_4,
8389 (
BYTE*)exp_vertices24,
8393 exp_new_num_vertices24
8402 declaration_texcoord10,
8403 vertex_size_texcoord,
8407 (
BYTE*)exp_vertices25,
8411 exp_new_num_vertices25
8425 (
BYTE*)exp_vertices26,
8429 exp_new_num_vertices26
8443 (
BYTE*)exp_vertices27,
8447 exp_new_num_vertices27
8456 declaration_normal_udec3,
8457 vertex_size_normal_udec3,
8461 (
BYTE*)exp_vertices28,
8465 exp_new_num_vertices28
8474 declaration_normal_dec3n,
8475 vertex_size_normal_dec3n,
8479 (
BYTE*)exp_vertices29,
8483 exp_new_num_vertices29
8493 skip(
"Couldn't create test context\n");
8500 DWORD *vertex_remap_ptr;
8501 DWORD new_num_vertices;
8506 tc[
i].indices,
tc[
i].attributes);
8509 skip(
"Couldn't initialize test mesh %d.\n",
i);
8517 skip(
"Couldn't allocate adjacency_out array.\n");
8523 skip(
"Couldn't allocate face_remap array.\n");
8528 adjacency_out, face_remap, &vertex_remap);
8531 new_num_vertices =
mesh->lpVtbl->GetNumVertices(
mesh);
8532 ok(new_num_vertices ==
tc[
i].exp_new_num_vertices,
8533 "Mesh %d: new_num_vertices == %d, expected %d.\n",
8534 i, new_num_vertices,
tc[
i].exp_new_num_vertices);
8541 skip(
"Couldn't lock index buffer.\n");
8544 for (
j = 0;
j < VERTS_PER_FACE *
tc[
i].num_faces;
j++)
8547 "Mesh %d: indices[%d] == %d, expected %d\n",
8553 hr =
mesh->lpVtbl->LockIndexBuffer(
mesh, 0, (
void**)&indices_16bit);
8556 skip(
"Couldn't lock index buffer.\n");
8559 for (
j = 0;
j < VERTS_PER_FACE *
tc[
i].num_faces;
j++)
8561 ok(indices_16bit[
j] ==
tc[
i].exp_indices[
j],
8562 "Mesh %d: indices_16bit[%d] == %d, expected %d\n",
8563 i,
j, indices_16bit[
j],
tc[
i].exp_indices[
j]);
8566 mesh->lpVtbl->UnlockIndexBuffer(
mesh);
8568 indices_16bit =
NULL;
8570 for (
j = 0;
j < VERTS_PER_FACE *
tc[
i].num_faces;
j++)
8572 ok(adjacency_out[
j] ==
tc[
i].adjacency[
j],
8573 "Mesh %d: adjacency_out[%d] == %d, expected %d\n",
8574 i,
j, adjacency_out[
j],
tc[
i].adjacency[
j]);
8577 for (
j = 0;
j <
tc[
i].num_faces;
j++)
8579 ok(face_remap[
j] ==
tc[
i].exp_face_remap[
j],
8580 "Mesh %d: face_remap[%d] == %d, expected %d\n",
8581 i,
j, face_remap[
j],
tc[
i].exp_face_remap[
j]);
8584 vertex_remap_ptr = vertex_remap->lpVtbl->GetBufferPointer(vertex_remap);
8585 for (
j = 0;
j < VERTS_PER_FACE *
tc[
i].num_faces;
j++)
8587 ok(vertex_remap_ptr[
j] ==
tc[
i].exp_vertex_remap[
j],
8588 "Mesh %d: vertex_remap_ptr[%d] == %d, expected %d\n",
8589 i,
j, vertex_remap_ptr[
j],
tc[
i].exp_vertex_remap[
j]);
8592 hr =
mesh->lpVtbl->LockVertexBuffer(
mesh, 0, (
void*)&vertices);
8595 skip(
"Couldn't lock vertex buffer.\n");
8599 for (
j = 0;
j <
tc[
i].exp_new_num_vertices;
j++)
8604 mesh->lpVtbl->UnlockVertexBuffer(
mesh);
8609 adjacency_out =
NULL;
8612 vertex_remap->lpVtbl->Release(vertex_remap);
8613 vertex_remap =
NULL;
8622 if (indices_16bit)
mesh->lpVtbl->UnlockIndexBuffer(
mesh);
8624 if (vertex_remap) vertex_remap->lpVtbl->Release(vertex_remap);
8625 if (vertices)
mesh->lpVtbl->UnlockVertexBuffer(
mesh);
8757 const unsigned int VERTS_PER_FACE = 3;
8782 struct vertex_ptc_float16_2
8787 struct vertex_ptc_float16_4
8792 struct vertex_ptc_float1
8797 struct vertex_ptc_float3
8802 struct vertex_ptc_float4
8807 struct vertex_ptc_d3dcolor
8812 struct vertex_ptc_ubyte4
8817 struct vertex_ptc_ubyte4n
8822 struct vertex_ptc_short2
8827 struct vertex_ptc_short4
8832 struct vertex_ptc_ushort2n
8837 struct vertex_ptc_ushort4n
8842 struct vertex_ptc_udec3
8847 struct vertex_ptc_dec3n
8856#define up {0.0f, 0.0f, 1.0f}
8857#define zero_vec2 {0.0f, 0.0f}
8867 const struct vertex_pn vertices0[] =
8869 {{ 0.0f, 3.0f, 0.f},
up},
8870 {{ 2.0f, 3.0f, 0.f},
up},
8871 {{ 0.0f, 0.0f, 0.f},
up},
8873 {{ 3.0f, 3.0f, 0.f},
up},
8874 {{ 3.0f, 0.0f, 0.f},
up},
8875 {{ 1.0f, 0.0f, 0.f},
up},
8879 const UINT vertex_size0 =
sizeof(*vertices0);
8885 const struct vertex_pntc exp_vertices2[] =
8887 {{ 0.0f, 3.0f, 0.f},
up, zero_vec2},
8888 {{ 2.0f, 3.0f, 0.f},
up, zero_vec2},
8889 {{ 0.0f, 0.0f, 0.f},
up, zero_vec2},
8891 {{ 3.0f, 3.0f, 0.f},
up, zero_vec2},
8892 {{ 3.0f, 0.0f, 0.f},
up, zero_vec2},
8893 {{ 1.0f, 0.0f, 0.f},
up, zero_vec2},
8895 const UINT exp_vertex_size2 =
sizeof(*exp_vertices2);
8900 const struct vertex_ptcn exp_vertices3[] =
8902 {{ 0.0f, 3.0f, 0.f}, zero_vec2,
up},
8903 {{ 2.0f, 3.0f, 0.f}, zero_vec2,
up},
8904 {{ 0.0f, 0.0f, 0.f}, zero_vec2,
up},
8906 {{ 3.0f, 3.0f, 0.f}, zero_vec2,
up},
8907 {{ 3.0f, 0.0f, 0.f}, zero_vec2,
up},
8908 {{ 1.0f, 0.0f, 0.f}, zero_vec2,
up},
8910 const UINT exp_vertex_size3 =
sizeof(*exp_vertices3);
8912 const struct vertex_ptc vertices4[] =
8914 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 1.0f}},
8915 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.7f}},
8916 {{ 0.0f, 0.0f, 0.f}, {-0.2f, -0.3f}},
8918 {{ 3.0f, 3.0f, 0.f}, { 0.2f, 0.3f}},
8919 {{ 3.0f, 0.0f, 0.f}, { 1.0f, 1.0f}},
8920 {{ 1.0f, 0.0f, 0.f}, { 0.1f, 0.2f}},
8924 const UINT vertex_size4 =
sizeof(*vertices4);
8925 const struct vertex_ptc_float16_2 exp_vertices4[] =
8927 {{ 0.0f, 3.0f, 0.f}, {0x3c00, 0x3c00}},
8928 {{ 2.0f, 3.0f, 0.f}, {0x3800, 0x399a}},
8929 {{ 0.0f, 0.0f, 0.f}, {0xb266, 0xb4cd}},
8931 {{ 3.0f, 3.0f, 0.f}, {0x3266, 0x34cd}},
8932 {{ 3.0f, 0.0f, 0.f}, {0x3c00, 0x3c00}},
8933 {{ 1.0f, 0.0f, 0.f}, {0x2e66, 0x3266}},
8935 const UINT exp_vertex_size4 =
sizeof(*exp_vertices4);
8937 const struct vertex_ptc vertices5[] =
8939 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 1.0f}},
8940 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.7f}},
8941 {{ 0.0f, 0.0f, 0.f}, {-0.2f, -0.3f}},
8943 {{ 3.0f, 3.0f, 0.f}, { 0.2f, 0.3f}},
8944 {{ 3.0f, 0.0f, 0.f}, { 1.0f, 1.0f}},
8945 {{ 1.0f, 0.0f, 0.f}, { 0.1f, 0.2f}},
8949 const UINT vertex_size5 =
sizeof(*vertices5);
8950 const struct vertex_ptc_float16_4 exp_vertices5[] =
8952 {{ 0.0f, 3.0f, 0.f}, {0x3c00, 0x3c00, 0, 0x3c00}},
8953 {{ 2.0f, 3.0f, 0.f}, {0x3800, 0x399a, 0, 0x3c00}},
8954 {{ 0.0f, 0.0f, 0.f}, {0xb266, 0xb4cd, 0, 0x3c00}},
8956 {{ 3.0f, 3.0f, 0.f}, {0x3266, 0x34cd, 0, 0x3c00}},
8957 {{ 3.0f, 0.0f, 0.f}, {0x3c00, 0x3c00, 0, 0x3c00}},
8958 {{ 1.0f, 0.0f, 0.f}, {0x2e66, 0x3266, 0, 0x3c00}},
8960 const UINT exp_vertex_size5 =
sizeof(*exp_vertices5);
8962 const struct vertex_ptc vertices6[] =
8964 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 1.0f}},
8965 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.7f}},
8966 {{ 0.0f, 0.0f, 0.f}, {-0.2f, -0.3f}},
8968 {{ 3.0f, 3.0f, 0.f}, { 0.2f, 0.3f}},
8969 {{ 3.0f, 0.0f, 0.f}, { 1.0f, 1.0f}},
8970 {{ 1.0f, 0.0f, 0.f}, { 0.1f, 0.2f}},
8974 const UINT vertex_size6 =
sizeof(*vertices6);
8975 const struct vertex_ptc_float1 exp_vertices6[] =
8977 {{ 0.0f, 3.0f, 0.f}, 1.0f},
8978 {{ 2.0f, 3.0f, 0.f}, 0.5f},
8979 {{ 0.0f, 0.0f, 0.f}, -0.2f},
8981 {{ 3.0f, 3.0f, 0.f}, 0.2f},
8982 {{ 3.0f, 0.0f, 0.f}, 1.0f},
8983 {{ 1.0f, 0.0f, 0.f}, 0.1f},
8985 const UINT exp_vertex_size6 =
sizeof(*exp_vertices6);
8987 const struct vertex_ptc vertices7[] =
8989 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 1.0f}},
8990 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.7f}},
8991 {{ 0.0f, 0.0f, 0.f}, {-0.2f, -0.3f}},
8993 {{ 3.0f, 3.0f, 0.f}, { 0.2f, 0.3f}},
8994 {{ 3.0f, 0.0f, 0.f}, { 1.0f, 1.0f}},
8995 {{ 1.0f, 0.0f, 0.f}, { 0.1f, 0.2f}},
8999 const UINT vertex_size7 =
sizeof(*vertices7);
9000 const struct vertex_ptc_float3 exp_vertices7[] =
9002 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 1.0f, 0.0f}},
9003 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.7f, 0.0f}},
9004 {{ 0.0f, 0.0f, 0.f}, {-0.2f, -0.3f, 0.0f}},
9006 {{ 3.0f, 3.0f, 0.f}, { 0.2f, 0.3f, 0.0f}},
9007 {{ 3.0f, 0.0f, 0.f}, { 1.0f, 1.0f, 0.0f}},
9008 {{ 1.0f, 0.0f, 0.f}, { 0.1f, 0.2f, 0.0f}},
9010 const UINT exp_vertex_size7 =
sizeof(*exp_vertices7);
9012 const struct vertex_ptc vertices8[] =
9014 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 1.0f}},
9015 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.7f}},
9016 {{ 0.0f, 0.0f, 0.f}, {-0.2f, -0.3f}},
9018 {{ 3.0f, 3.0f, 0.f}, { 0.2f, 0.3f}},
9019 {{ 3.0f, 0.0f, 0.f}, { 1.0f, 1.0f}},
9020 {{ 1.0f, 0.0f, 0.f}, { 0.1f, 0.2f}},
9024 const UINT vertex_size8 =
sizeof(*vertices8);
9025 const struct vertex_ptc_float4 exp_vertices8[] =
9027 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 1.0f, 0.0f, 1.0f}},
9028 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.7f, 0.0f, 1.0f}},
9029 {{ 0.0f, 0.0f, 0.f}, {-0.2f, -0.3f, 0.0f, 1.0f}},
9031 {{ 3.0f, 3.0f, 0.f}, { 0.2f, 0.3f, 0.0f, 1.0f}},
9032 {{ 3.0f, 0.0f, 0.f}, { 1.0f, 1.0f, 0.0f, 1.0f}},
9033 {{ 1.0f, 0.0f, 0.f}, { 0.1f, 0.2f, 0.0f, 1.0f}},
9035 const UINT exp_vertex_size8 =
sizeof(*exp_vertices8);
9037 const struct vertex_ptc vertices9[] =
9039 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 1.0f}},
9040 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.7f}},
9041 {{ 0.0f, 0.0f, 0.f}, {-0.4f, -0.6f}},
9043 {{ 3.0f, 3.0f, 0.f}, { 0.2f, 0.3f}},
9044 {{ 3.0f, 0.0f, 0.f}, { 2.0f, 256.0f}},
9045 {{ 1.0f, 0.0f, 0.f}, { 0.11f, 0.2f}},
9049 const UINT vertex_size9 =
sizeof(*vertices9);
9050 const struct vertex_ptc_d3dcolor exp_vertices9[] =
9052 {{ 0.0f, 3.0f, 0.f}, {0, 255, 255, 255}},
9053 {{ 2.0f, 3.0f, 0.f}, {0, 179, 128, 255}},
9054 {{ 0.0f, 0.0f, 0.f}, {0, 0, 0, 255}},
9056 {{ 3.0f, 3.0f, 0.f}, {0, 77, 51, 255}},
9057 {{ 3.0f, 0.0f, 0.f}, {0, 255, 255, 255}},
9058 {{ 1.0f, 0.0f, 0.f}, {0, 51, 28, 255}},
9060 const UINT exp_vertex_size9 =
sizeof(*exp_vertices9);
9062 const struct vertex_ptc vertices10[] =
9064 {{ 0.0f, 3.0f, 0.f}, { 0.0f, 1.0f}},
9065 {{ 2.0f, 3.0f, 0.f}, { 2.0f, 3.0f}},
9066 {{ 0.0f, 0.0f, 0.f}, { 254.0f, 255.0f}},
9068 {{ 3.0f, 3.0f, 0.f}, { 256.0f, 257.0f}},
9069 {{ 3.0f, 0.0f, 0.f}, { 1.4f, 1.5f}},
9070 {{ 1.0f, 0.0f, 0.f}, {-4.0f, -5.0f}},
9073 const UINT num_faces10 =
ARRAY_SIZE(vertices10) / VERTS_PER_FACE;
9074 const UINT vertex_size10 =
sizeof(*vertices10);
9075 const struct vertex_ptc_ubyte4 exp_vertices10[] =
9077 {{ 0.0f, 3.0f, 0.f}, {0, 1, 0, 1}},
9078 {{ 2.0f, 3.0f, 0.f}, {2, 3, 0, 1}},
9079 {{ 0.0f, 0.0f, 0.f}, {254, 255, 0, 1}},
9081 {{ 3.0f, 3.0f, 0.f}, {0, 1, 0, 1}},
9082 {{ 3.0f, 0.0f, 0.f}, {1, 2, 0, 1}},
9083 {{ 1.0f, 0.0f, 0.f}, {0, 0, 0, 1}},
9085 const UINT exp_vertex_size10 =
sizeof(*exp_vertices10);
9087 const struct vertex_ptc vertices11[] =
9089 {{ 0.0f, 3.0f, 0.f}, { 1.0f, -1.0f}},
9090 {{ 2.0f, 3.0f, 0.f}, { 0.4f, 0.5f}},
9091 {{ 0.0f, 0.0f, 0.f}, {-0.5f, -5.0f}},
9102 const UINT num_faces11 =
ARRAY_SIZE(vertices11) / VERTS_PER_FACE;
9103 const UINT vertex_size11 =
sizeof(*vertices11);
9104 const struct vertex_ptc_short2 exp_vertices11[] =
9106 {{ 0.0f, 3.0f, 0.f}, {1, 0}},
9107 {{ 2.0f, 3.0f, 0.f}, {0, 1}},
9108 {{ 0.0f, 0.0f, 0.f}, {0, -4}},
9114 {{ 4.0f, 3.0f, 0.f}, {-2, 1}},
9115 {{ 6.0f, 0.0f, 0.f}, {32765, -32767}},
9116 {{ 4.0f, 0.0f, 0.f}, {-4, 1}},
9118 const UINT exp_vertex_size11 =
sizeof(*exp_vertices11);
9120 const struct vertex_ptc vertices12[] =
9122 {{ 0.0f, 3.0f, 0.f}, { 1.0f, -1.0f}},
9123 {{ 2.0f, 3.0f, 0.f}, { 0.4f, 0.5f}},
9124 {{ 0.0f, 0.0f, 0.f}, {-0.5f, -5.0f}},
9135 const UINT num_faces12 =
ARRAY_SIZE(vertices12) / VERTS_PER_FACE;
9136 const UINT vertex_size12 =
sizeof(*vertices12);
9137 const struct vertex_ptc_short4 exp_vertices12[] =
9139 {{ 0.0f, 3.0f, 0.f}, {1, 0, 0, 1}},
9140 {{ 2.0f, 3.0f, 0.f}, {0, 1, 0, 1}},
9141 {{ 0.0f, 0.0f, 0.f}, {0, -4, 0, 1}},
9147 {{ 4.0f, 3.0f, 0.f}, {-2, 1, 0, 1}},
9148 {{ 6.0f, 0.0f, 0.f}, {32765, -32767, 0, 1}},
9149 {{ 4.0f, 0.0f, 0.f}, {-4, 1, 0, 1}},
9151 const UINT exp_vertex_size12 =
sizeof(*exp_vertices12);
9153 const struct vertex_ptc vertices13[] =
9155 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 2.0f}},
9156 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.7f}},
9157 {{ 0.0f, 0.0f, 0.f}, {-0.4f, -0.5f}},
9159 {{ 3.0f, 3.0f, 0.f}, {-0.6f, -1.0f}},
9164 const UINT num_faces13 =
ARRAY_SIZE(vertices13) / VERTS_PER_FACE;
9165 const UINT vertex_size13 =
sizeof(*vertices13);
9166 const struct vertex_ptc_ubyte4n exp_vertices13[] =
9168 {{ 0.0f, 3.0f, 0.f}, {255, 255, 0, 255}},
9169 {{ 2.0f, 3.0f, 0.f}, {128, 179, 0, 255}},
9170 {{ 0.0f, 0.0f, 0.f}, {0, 0, 0, 255}},
9172 {{ 3.0f, 3.0f, 0.f}, {0, 0, 0, 255}},
9173 {{ 3.0f, 0.0f, 0.f}, {255, 255, 0, 255}},
9174 {{ 1.0f, 0.0f, 0.f}, {255, 0, 0, 255}},
9176 const UINT exp_vertex_size13 =
sizeof(*exp_vertices13);
9178 const struct vertex_ptc vertices14[] =
9180 {{ 0.0f, 3.0f, 0.f}, {1.0f, 2.0f}},
9181 {{ 2.0f, 3.0f, 0.f}, {0.4f, 0.5f}},
9182 {{ 0.0f, 0.0f, 0.f}, {0.6f, -1.0f}},
9184 {{ 3.0f, 3.0f, 0.f}, {-0.4f, -0.5f}},
9185 {{ 3.0f, 0.0f, 0.f}, {-0.9f, -0.99997}},
9189 const UINT num_faces14 =
ARRAY_SIZE(vertices14) / VERTS_PER_FACE;
9190 const UINT vertex_size14 =
sizeof(*vertices14);
9191 const struct vertex_ptc_short2 exp_vertices14[] =
9194 {{ 2.0f, 3.0f, 0.f}, {13107, 16384}},
9195 {{ 0.0f, 0.0f, 0.f}, {19660,
SHRT_MIN + 2}},
9197 {{ 3.0f, 3.0f, 0.f}, {-13106, -16383}},
9198 {{ 3.0f, 0.0f, 0.f}, {-29489,
SHRT_MIN + 3}},
9201 const UINT exp_vertex_size14 =
sizeof(*exp_vertices14);
9203 const struct vertex_ptc vertices15[] =
9205 {{ 0.0f, 3.0f, 0.f}, {1.0f, 2.0f}},
9206 {{ 2.0f, 3.0f, 0.f}, {0.4f, 0.5f}},
9207 {{ 0.0f, 0.0f, 0.f}, {0.6f, -1.0f}},
9209 {{ 3.0f, 3.0f, 0.f}, {-0.4f, -0.5f}},
9210 {{ 3.0f, 0.0f, 0.f}, {-0.9f, -0.99997}},
9214 const UINT num_faces15 =
ARRAY_SIZE(vertices15) / VERTS_PER_FACE;
9215 const UINT vertex_size15 =
sizeof(*vertices15);
9216 const struct vertex_ptc_short4 exp_vertices15[] =
9219 {{ 2.0f, 3.0f, 0.f}, {13107, 16384, 0,
SHRT_MAX}},
9222 {{ 3.0f, 3.0f, 0.f}, {-13106, -16383, 0,
SHRT_MAX}},
9226 const UINT exp_vertex_size15 =
sizeof(*exp_vertices15);
9228 const struct vertex_ptc vertices16[] =
9230 {{ 0.0f, 3.0f, 0.f}, {1.0f, 2.0f}},
9231 {{ 2.0f, 3.0f, 0.f}, {0.4f, 0.5f}},
9232 {{ 0.0f, 0.0f, 0.f}, {0.6f, -1.0f}},
9234 {{ 3.0f, 3.0f, 0.f}, {-0.4f, -0.5f}},
9235 {{ 3.0f, 0.0f, 0.f}, {-0.9f, 0.99998f}},
9236 {{ 1.0f, 0.0f, 0.f}, {
USHRT_MAX, 0.0f}},
9239 const UINT num_faces16 =
ARRAY_SIZE(vertices16) / VERTS_PER_FACE;
9240 const UINT vertex_size16 =
sizeof(*vertices16);
9241 const struct vertex_ptc_ushort2n exp_vertices16[] =
9244 {{ 2.0f, 3.0f, 0.f}, {26214, 32768}},
9245 {{ 0.0f, 0.0f, 0.f}, {39321, 0}},
9247 {{ 3.0f, 3.0f, 0.f}, {0, 0}},
9248 {{ 3.0f, 0.0f, 0.f}, {0,
USHRT_MAX - 1}},
9251 const UINT exp_vertex_size16 =
sizeof(*exp_vertices16);
9253 const struct vertex_ptc vertices17[] =
9255 {{ 0.0f, 3.0f, 0.f}, {1.0f, 2.0f}},
9256 {{ 2.0f, 3.0f, 0.f}, {0.4f, 0.5f}},
9257 {{ 0.0f, 0.0f, 0.f}, {0.6f, -1.0f}},
9259 {{ 3.0f, 3.0f, 0.f}, {-0.4f, -0.5f}},
9260 {{ 3.0f, 0.0f, 0.f}, {-0.9f, 0.99998f}},
9261 {{ 1.0f, 0.0f, 0.f}, {
USHRT_MAX, 0.0f}},
9264 const UINT num_faces17 =
ARRAY_SIZE(vertices17) / VERTS_PER_FACE;
9265 const UINT vertex_size17 =
sizeof(*vertices17);
9266 const struct vertex_ptc_ushort4n exp_vertices17[] =
9269 {{ 2.0f, 3.0f, 0.f}, {26214, 32768, 0,
USHRT_MAX}},
9270 {{ 0.0f, 0.0f, 0.f}, {39321, 0, 0,
USHRT_MAX}},
9272 {{ 3.0f, 3.0f, 0.f}, {0, 0, 0,
USHRT_MAX}},
9276 const UINT exp_vertex_size17 =
sizeof(*exp_vertices17);
9280 const struct vertex_ptc vertices18[] =
9282 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 1.0f}},
9283 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.7f}},
9284 {{ 0.0f, 0.0f, 0.f}, {-0.2f, -0.3f}},
9286 {{ 3.0f, 3.0f, 0.f}, { 0.2f, 0.3f}},
9287 {{ 3.0f, 0.0f, 0.f}, { 1.0f, 1.0f}},
9288 {{ 1.0f, 0.0f, 0.f}, { 0.1f, 0.2f}},
9291 const UINT num_faces18 =
ARRAY_SIZE(vertices18) / VERTS_PER_FACE;
9292 const UINT vertex_size18 =
sizeof(*vertices18);
9293 const struct vertex_ptc_float16_2 exp_vertices18[] =
9295 {{ 0.0f, 3.0f, 0.f}, {0x3c00, 0x3c00}},
9296 {{ 2.0f, 3.0f, 0.f}, {0x3800, 0x399a}},
9297 {{ 0.0f, 0.0f, 0.f}, {0xb266, 0xb4cd}},
9299 {{ 3.0f, 3.0f, 0.f}, {0x3266, 0x34cd}},
9300 {{ 3.0f, 0.0f, 0.f}, {0x3c00, 0x3c00}},
9301 {{ 1.0f, 0.0f, 0.f}, {0x2e66, 0x3266}},
9303 const UINT exp_vertex_size18 =
sizeof(*exp_vertices18);
9306 const struct vertex_pntc vertices19[] =
9308 {{ 0.0f, 3.0f, 0.f},
up, { 1.0f, 1.0f}},
9309 {{ 2.0f, 3.0f, 0.f},
up, { 0.5f, 0.7f}},
9310 {{ 0.0f, 0.0f, 0.f},
up, {-0.2f, -0.3f}},
9312 {{ 3.0f, 3.0f, 0.f},
up, { 0.2f, 0.3f}},
9313 {{ 3.0f, 0.0f, 0.f},
up, { 1.0f, 1.0f}},
9314 {{ 1.0f, 0.0f, 0.f},
up, { 0.1f, 0.2f}},
9317 const UINT num_faces19 =
ARRAY_SIZE(vertices19) / VERTS_PER_FACE;
9318 const UINT vertex_size19 =
sizeof(*vertices19);
9319 const struct vertex_pntc exp_vertices19[] =
9321 {{ 0.0f, 3.0f, 0.f},
up, zero_vec2},
9322 {{ 2.0f, 3.0f, 0.f},
up, zero_vec2},
9323 {{ 0.0f, 0.0f, 0.f},
up, zero_vec2},
9325 {{ 3.0f, 3.0f, 0.f},
up, zero_vec2},
9326 {{ 3.0f, 0.0f, 0.f},
up, zero_vec2},
9327 {{ 1.0f, 0.0f, 0.f},
up, zero_vec2},
9329 const UINT exp_vertex_size19 =
sizeof(*exp_vertices19);
9332 const struct vertex_pntc vertices20[] =
9334 {{ 0.0f, 3.0f, 0.f},
up, { 1.0f, 1.0f}},
9335 {{ 2.0f, 3.0f, 0.f},
up, { 0.5f, 0.7f}},
9336 {{ 0.0f, 0.0f, 0.f},
up, {-0.2f, -0.3f}},
9338 {{ 3.0f, 3.0f, 0.f},
up, { 0.2f, 0.3f}},
9339 {{ 3.0f, 0.0f, 0.f},
up, { 1.0f, 1.0f}},
9340 {{ 1.0f, 0.0f, 0.f},
up, { 0.1f, 0.2f}},
9343 const UINT num_faces20 =
ARRAY_SIZE(vertices20) / VERTS_PER_FACE;
9344 const UINT vertex_size20 =
sizeof(*vertices20);
9345 const struct vertex_pntc exp_vertices20[] =
9347 {{ 0.0f, 3.0f, 0.f},
up, zero_vec2},
9348 {{ 2.0f, 3.0f, 0.f},
up, zero_vec2},
9349 {{ 0.0f, 0.0f, 0.f},
up, zero_vec2},
9351 {{ 3.0f, 3.0f, 0.f},
up, zero_vec2},
9352 {{ 3.0f, 0.0f, 0.f},
up, zero_vec2},
9353 {{ 1.0f, 0.0f, 0.f},
up, zero_vec2},
9355 const UINT exp_vertex_size20 =
sizeof(*exp_vertices20);
9357 const struct vertex_ptc_float1 vertices21[] =
9359 {{ 0.0f, 3.0f, 0.f}, 1.0f},
9360 {{ 2.0f, 3.0f, 0.f}, 0.5f},
9361 {{ 0.0f, 0.0f, 0.f}, -0.2f},
9363 {{ 3.0f, 3.0f, 0.f}, 0.2f},
9364 {{ 3.0f, 0.0f, 0.f}, 1.0f},
9365 {{ 1.0f, 0.0f, 0.f}, 0.1f},
9368 const UINT num_faces21 =
ARRAY_SIZE(vertices21) / VERTS_PER_FACE;
9369 const UINT vertex_size21 =
sizeof(*vertices21);
9370 const struct vertex_ptc exp_vertices21[] =
9372 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 0.0f}},
9373 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.0f}},
9374 {{ 0.0f, 0.0f, 0.f}, {-0.2f, 0.0f}},
9376 {{ 3.0f, 3.0f, 0.f}, { 0.2f, 0.0f}},
9377 {{ 3.0f, 0.0f, 0.f}, { 1.0f, 0.0f}},
9378 {{ 1.0f, 0.0f, 0.f}, { 0.1f, 0.0f}},
9380 const UINT exp_vertex_size21 =
sizeof(*exp_vertices21);
9382 const struct vertex_ptc_float1 vertices22[] =
9384 {{ 0.0f, 3.0f, 0.f}, 1.0f},
9385 {{ 2.0f, 3.0f, 0.f}, 0.5f},
9386 {{ 0.0f, 0.0f, 0.f}, -0.2f},
9388 {{ 3.0f, 3.0f, 0.f}, 0.2f},
9389 {{ 3.0f, 0.0f, 0.f}, 1.0f},
9390 {{ 1.0f, 0.0f, 0.f}, 0.1f},
9393 const UINT num_faces22 =
ARRAY_SIZE(vertices22) / VERTS_PER_FACE;
9394 const UINT vertex_size22 =
sizeof(*vertices22);
9395 const struct vertex_ptc_float3 exp_vertices22[] =
9397 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 0.0f, 0.0f}},
9398 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.0f, 0.0f}},
9399 {{ 0.0f, 0.0f, 0.f}, {-0.2f, 0.0f, 0.0f}},
9401 {{ 3.0f, 3.0f, 0.f}, { 0.2f, 0.0f, 0.0f}},
9402 {{ 3.0f, 0.0f, 0.f}, { 1.0f, 0.0f, 0.0f}},
9403 {{ 1.0f, 0.0f, 0.f}, { 0.1f, 0.0f, 0.0f}},
9405 const UINT exp_vertex_size22 =
sizeof(*exp_vertices22);
9407 const struct vertex_ptc_float1 vertices23[] =
9409 {{ 0.0f, 3.0f, 0.f}, 1.0f},
9410 {{ 2.0f, 3.0f, 0.f}, 0.5f},
9411 {{ 0.0f, 0.0f, 0.f}, -0.2f},
9413 {{ 3.0f, 3.0f, 0.f}, 0.2f},
9414 {{ 3.0f, 0.0f, 0.f}, 1.0f},
9415 {{ 1.0f, 0.0f, 0.f}, 0.1f},
9418 const UINT num_faces23 =
ARRAY_SIZE(vertices23) / VERTS_PER_FACE;
9419 const UINT vertex_size23 =
sizeof(*vertices23);
9420 const struct vertex_ptc_float4 exp_vertices23[] =
9422 {{ 0.0f, 3.0f, 0.f}, { 1.0f, 0.0f, 0.0f, 1.0f}},
9423 {{ 2.0f, 3.0f, 0.f}, { 0.5f, 0.0f, 0.0f, 1.0f}},
9424 {{ 0.0f, 0.0f, 0.f}, {-0.2f, 0.0f, 0.0f, 1.0f}},
9426 {{ 3.0f, 3.0f, 0.f}, { 0.2f, 0.0f, 0.0f, 1.0f}},
9427 {{ 3.0f, 0.0f, 0.f}, { 1.0f, 0.0f, 0.0f, 1.0f}},
9428 {{ 1.0f, 0.0f, 0.f}, { 0.1f, 0.0f, 0.0f, 1.0f}},
9430 const UINT exp_vertex_size23 =
sizeof(*exp_vertices23);
9432 const struct vertex_ptc_float1 vertices24[] =
9434 {{ 0.0f, 3.0f, 0.f}, 1.0f},
9435 {{ 2.0f, 3.0f, 0.f}, 0.5f},
9436 {{ 0.0f, 0.0f, 0.f}, -0.2f},
9438 {{ 3.0f, 3.0f, 0.f}, 0.2f},
9439 {{ 3.0f, 0.0f, 0.f}, 1.0f},
9440 {{ 1.0f, 0.0f, 0.f}, 0.11f},
9443 const UINT num_faces24 =
ARRAY_SIZE(vertices24) / VERTS_PER_FACE;
9444 const UINT vertex_size24 =
sizeof(*vertices24);
9445 const struct vertex_ptc_d3dcolor exp_vertices24[] =
9447 {{ 0.0f, 3.0f, 0.f}, {0, 0, 255, 255}},
9448 {{ 2.0f, 3.0f, 0.f}, {0, 0, 128, 255}},
9449 {{ 0.0f, 0.0f, 0.f}, {0, 0, 0, 255}},
9451 {{ 3.0f, 3.0f, 0.f}, {0, 0, 51, 255}},
9452 {{ 3.0f, 0.0f, 0.f}, {0, 0, 255, 255}},
9453 {{ 1.0f, 0.0f, 0.f}, {0, 0, 28, 255}},
9455 const UINT exp_vertex_size24 =
sizeof(*exp_vertices24);
9457 const struct vertex_ptc_float1 vertices25[] =
9459 {{ 0.0f, 3.0f, 0.f}, 0.0f},
9460 {{ 2.0f, 3.0f, 0.f}, 1.4f},
9461 {{ 0.0f, 0.0f, 0.f}, 1.5f},
9463 {{ 3.0f, 3.0f, 0.f}, 255.0f},
9464 {{ 3.0f, 0.0f, 0.f}, 256.0f},
9465 {{ 1.0f, 0.0f, 0.f}, -1.0f},
9468 const UINT num_faces25 =
ARRAY_SIZE(vertices25) / VERTS_PER_FACE;
9469 const UINT vertex_size25 =
sizeof(*vertices25);
9470 const struct vertex_ptc_ubyte4 exp_vertices25[] =
9472 {{ 0.0f, 3.0f, 0.f}, {0, 0, 0, 1}},
9473 {{ 2.0f, 3.0f, 0.f}, {1, 0, 0, 1}},
9474 {{ 0.0f, 0.0f, 0.f}, {2, 0, 0, 1}},
9476 {{ 3.0f, 3.0f, 0.f}, {255, 0, 0, 1}},
9477 {{ 3.0f, 0.0f, 0.f}, {0, 0, 0, 1}},
9478 {{ 1.0f, 0.0f, 0.f}, {0, 0, 0, 1}},
9480 const UINT exp_vertex_size25 =
sizeof(*exp_vertices25);
9482 const struct vertex_ptc_float4 vertices26[] =
9484 {{ 0.0f, 3.0f, 0.f}, {0.0f, 1.0f, 0.4f, 0.5f}},
9485 {{ 2.0f, 3.0f, 0.f}, {-0.4f, -0.5f, -1.0f, -2.0f}},
9486 {{ 0.0f, 0.0f, 0.f}, {254.0f, 255.0f, 256.0f, 257.0f}},
9488 {{ 3.0f, 3.0f, 0.f}, {0.1f, 0.2f, 0.3f, 0.4f}},
9489 {{ 3.0f, 0.0f, 0.f}, {0.5f, 0.6f, 0.7f, 0.8f}},
9490 {{ 1.0f, 0.0f, 0.f}, {0.9f, 0.99f, 0.995f, 0.999f}},
9493 const UINT num_faces26 =
ARRAY_SIZE(vertices26) / VERTS_PER_FACE;
9494 const UINT vertex_size26 =
sizeof(*vertices26);
9495 const struct vertex_ptc_d3dcolor exp_vertices26[] =
9497 {{ 0.0f, 3.0f, 0.f}, {102, 255, 0, 128}},
9498 {{ 2.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
9499 {{ 0.0f, 0.0f, 0.f}, {255, 255, 255, 255}},
9501 {{ 3.0f, 3.0f, 0.f}, {77, 51, 26, 102}},
9502 {{ 3.0f, 0.0f, 0.f}, {179, 153, 128, 204}},
9503 {{ 1.0f, 0.0f, 0.f}, {254, 252, 230, 255}},
9505 const UINT exp_vertex_size26 =
sizeof(*exp_vertices26);
9507 const struct vertex_ptc_d3dcolor vertices27[] =
9509 {{ 0.0f, 3.0f, 0.f}, {102, 255, 0, 128}},
9510 {{ 2.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
9511 {{ 0.0f, 0.0f, 0.f}, {255, 255, 255, 255}},
9513 {{ 3.0f, 3.0f, 0.f}, {77, 51, 26, 102}},
9514 {{ 3.0f, 0.0f, 0.f}, {179, 153, 128, 204}},
9515 {{ 1.0f, 0.0f, 0.f}, {254, 252, 230, 255}},
9518 const UINT num_faces27 =
ARRAY_SIZE(vertices27) / VERTS_PER_FACE;
9519 const UINT vertex_size27 =
sizeof(*vertices27);
9520 const struct vertex_ptc_float4 exp_vertices27[] =
9522 {{ 0.0f, 3.0f, 0.f}, {0.0f, 1.0f, 0.4f, 0.501961f}},
9523 {{ 2.0f, 3.0f, 0.f}, {0.0f, 0.0f, 0.0f, 0.0f}},
9524 {{ 0.0f, 0.0f, 0.f}, {1.0f, 1.0f, 1.0f, 1.0f}},
9526 {{ 3.0f, 3.0f, 0.f}, {0.101961f, 0.2f, 0.301961f, 0.4f}},
9527 {{ 3.0f, 0.0f, 0.f}, {0.501961f, 0.6f, 0.701961f, 0.8f}},
9528 {{ 1.0f, 0.0f, 0.f}, {0.901961f, 0.988235f, 0.996078f, 1.0f}},
9530 const UINT exp_vertex_size27 =
sizeof(*exp_vertices27);
9532 const struct vertex_ptc_ubyte4 vertices28[] =
9534 {{ 0.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
9535 {{ 2.0f, 3.0f, 0.f}, {1, 1, 1, 1}},
9536 {{ 0.0f, 0.0f, 0.f}, {1, 0, 1, 0}},
9538 {{ 3.0f, 3.0f, 0.f}, {0, 1, 0, 1}},
9539 {{ 3.0f, 0.0f, 0.f}, {10, 20, 30, 40}},
9540 {{ 1.0f, 0.0f, 0.f}, {50, 60, 127, 255}},
9543 const UINT num_faces28 =
ARRAY_SIZE(vertices28) / VERTS_PER_FACE;
9544 const UINT vertex_size28 =
sizeof(*vertices28);
9545 const struct vertex_ptc_float4 exp_vertices28[] =
9547 {{ 0.0f, 3.0f, 0.f}, {0.0f, 0.0f, 0.0f, 0.0f}},
9548 {{ 2.0f, 3.0f, 0.f}, {1.0f, 1.0f, 1.0f, 1.0f}},
9549 {{ 0.0f, 0.0f, 0.f}, {1.0f, 0.0f, 1.0f, 0.0f}},
9551 {{ 3.0f, 3.0f, 0.f}, {0.0f, 1.0f, 0.0f, 1.0f}},
9552 {{ 3.0f, 0.0f, 0.f}, {10.0f, 20.0f, 30.0f, 40.0f}},
9553 {{ 1.0f, 0.0f, 0.f}, {50.0f, 60.0f, 127.0f, 255.0f}},
9555 const UINT exp_vertex_size28 =
sizeof(*exp_vertices28);
9557 const struct vertex_ptc_short2 vertices29[] =
9559 {{ 0.0f, 3.0f, 0.f}, {0, 0}},
9560 {{ 2.0f, 3.0f, 0.f}, {0, 1}},
9561 {{ 0.0f, 0.0f, 0.f}, {1, 0}},
9563 {{ 3.0f, 3.0f, 0.f}, {1, 1}},
9565 {{ 1.0f, 0.0f, 0.f}, {-42, 42}},
9568 const UINT num_faces29 =
ARRAY_SIZE(vertices29) / VERTS_PER_FACE;
9569 const UINT vertex_size29 =
sizeof(*vertices29);
9570 const struct vertex_ptc_float4 exp_vertices29[] =
9572 {{ 0.0f, 3.0f, 0.f}, {0.0f, 0.0f, 0.0f, 1.0f}},
9573 {{ 2.0f, 3.0f, 0.f}, {0.0f, 1.0f, 0.0f, 1.0f }},
9574 {{ 0.0f, 0.0f, 0.f}, {1.0f, 0.0f, 0.0f, 1.0f}},
9576 {{ 3.0f, 3.0f, 0.f}, {1.0f, 1.0f, 0.0f, 1.0f}},
9578 {{ 1.0f, 0.0f, 0.f}, {-42.0f, 42.0f, 0.0f, 1.0f}},
9580 const UINT exp_vertex_size29 =
sizeof(*exp_vertices29);
9582 const struct vertex_ptc_short4 vertices30[] =
9584 {{ 0.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
9585 {{ 2.0f, 3.0f, 0.f}, {0, 1, 0, 1}},
9586 {{ 0.0f, 0.0f, 0.f}, {1, 0, 1, 0}},
9588 {{ 3.0f, 3.0f, 0.f}, {1, 1, 1, 1}},
9593 const UINT num_faces30 =
ARRAY_SIZE(vertices30) / VERTS_PER_FACE;
9594 const UINT vertex_size30 =
sizeof(*vertices30);
9595 const struct vertex_ptc_float4 exp_vertices30[] =
9597 {{ 0.0f, 3.0f, 0.f}, {0.0f, 0.0f, 0.0f, 0.0f}},
9598 {{ 2.0f, 3.0f, 0.f}, {0.0f, 1.0f, 0.0f, 1.0f }},
9599 {{ 0.0f, 0.0f, 0.f}, {1.0f, 0.0f, 1.0f, 0.0f}},
9601 {{ 3.0f, 3.0f, 0.f}, {1.0f, 1.0f, 1.0f, 1.0f}},
9605 const UINT exp_vertex_size30 =
sizeof(*exp_vertices30);
9607 const struct vertex_ptc_ubyte4n vertices31[] =
9609 {{ 0.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
9610 {{ 2.0f, 3.0f, 0.f}, {1, 1, 1, 1}},
9611 {{ 0.0f, 0.0f, 0.f}, {1, 0, 1, 0}},
9613 {{ 3.0f, 3.0f, 0.f}, {0, 1, 0, 1}},
9614 {{ 3.0f, 0.0f, 0.f}, {10, 20, 30, 40}},
9615 {{ 1.0f, 0.0f, 0.f}, {50, 60, 70,
UCHAR_MAX}},
9618 const UINT num_faces31 =
ARRAY_SIZE(vertices31) / VERTS_PER_FACE;
9619 const UINT vertex_size31 =
sizeof(*vertices31);
9620 const struct vertex_ptc_float4 exp_vertices31[] =
9622 {{ 0.0f, 3.0f, 0.f}, {0.0f, 0.0f, 0.0f, 0.0f}},
9630 const UINT exp_vertex_size31 =
sizeof(*exp_vertices31);
9632 const struct vertex_ptc_short2 vertices32[] =
9634 {{ 0.0f, 3.0f, 0.f}, {0, 0}},
9635 {{ 2.0f, 3.0f, 0.f}, {0, 1}},
9636 {{ 0.0f, 0.0f, 0.f}, {1, 0}},
9638 {{ 3.0f, 3.0f, 0.f}, {1, 1}},
9640 {{ 1.0f, 0.0f, 0.f}, {-42, 42}},
9643 const UINT num_faces32 =
ARRAY_SIZE(vertices32) / VERTS_PER_FACE;
9644 const UINT vertex_size32 =
sizeof(*vertices32);
9645 const struct vertex_ptc_float4 exp_vertices32[] =
9647 {{ 0.0f, 3.0f, 0.f}, {0.0f, 0.0f, 0.0f, 1.0f}},
9648 {{ 2.0f, 3.0f, 0.f}, {0.0f, 1.0f/
SHRT_MAX, 0.0f, 1.0f}},
9649 {{ 0.0f, 0.0f, 0.f}, {1.0f/
SHRT_MAX, 0.0f, 0.0f, 1.0f}},
9652 {{ 3.0f, 0.0f, 0.f}, {-1.0f, 1.0f, 0.0f, 1.0f}},
9655 const UINT exp_vertex_size32 =
sizeof(*exp_vertices32);
9657 const struct vertex_ptc_short4 vertices33[] =
9659 {{ 0.0f, 3.0f, 0.f}, {0, 0, 0, 0}},
9660 {{ 2.0f, 3.0f, 0.f}, {0, 1, 0, 1}},
9661 {{ 0.0f, 0.0f, 0.f}, {1, 0, 1, 0}},
9663 {{ 3.0f, 3.0f, 0.f}, {1, 1, 1, 1}},
9665 {{ 1.0f, 0.0f, 0.f}, {-42, 42, 1, 1}},
9668 const UINT num_faces33 =
ARRAY_SIZE(vertices33) / VERTS_PER_FACE;
9669 const UINT vertex_size33 =
sizeof(*vertices33);
9670 const struct vertex_ptc_float4 exp_vertices33[] =
9672 {{ 0.0f, 3.0f, 0.f}, {0.0f, 0.0f, 0.0f, 0.0f}},
9677 {{ 3.0f, 0.0f, 0.f}, {-1.0f, 1.0f, -1.0f, 1.0f}},
9680 const UINT exp_vertex_size33 =
sizeof(*exp_vertices33);
9682 const struct vertex_ptc_float16_2 vertices34[] =
9684 {{ 0.0f, 3.0f, 0.f}, {0x3c00, 0x3c00}},
9685 {{ 2.0f, 3.0f, 0.f}, {0x3800, 0x399a}},
9686 {{ 0.0f, 0.0f, 0.f}, {0xb266, 0xb4cd}},
9688 {{ 3.0f, 3.0f, 0.f}, {0x3266, 0x34cd}},
9689 {{ 3.0f, 0.0f, 0.f}, {0x3c00, 0x3c00}},
9690 {{ 1.0f, 0.0f, 0.f}, {0x2e66, 0x3266}},
9693 const UINT num_faces34 =
ARRAY_SIZE(vertices34) / VERTS_PER_FACE;
9694 const UINT vertex_size34 =
sizeof(*vertices34);
9695 const struct vertex_ptc_float4 exp_vertices34[] =
9697 {{ 0.0f, 3.0f, 0.f}, {1.0f, 1.0f, 0.0f, 1.0f}},
9698 {{ 2.0f, 3.0f, 0.f}, {0.5f, 0.700195f, 0.0f, 1.0f}},
9699 {{ 0.0f, 0.0f, 0.f}, {-0.199951f, -0.300049f, 0.0f, 1.0f}},
9701 {{ 3.0f, 3.0f, 0.f}, {0.199951f, 0.300049f, 0.0f, 1.0f}},
9702 {{ 3.0f, 0.0f, 0.f}, {1.0f, 1.0f, 0.0f, 1.0f}},
9703 {{ 1.0f, 0.0f, 0.f}, {0.099976f, 0.199951f, 0.0f, 1.0f}},
9705 const UINT exp_vertex_size34 =
sizeof(*exp_vertices34);
9707 const struct vertex_ptc_float16_4 vertices35[] =
9709 {{ 0.0f, 3.0f, 0.f}, {0x0000, 0x0000, 0x0000, 0x0000}},
9710 {{ 2.0f, 3.0f, 0.f}, {0x3c00, 0x3c00, 0x3c00, 0x3c00}},
9711 {{ 0.0f, 0.0f, 0.f}, {0x3c00, 0x0000, 0x3c00, 0x0000}},
9713 {{ 3.0f, 3.0f, 0.f}, {0x0000, 0x3c00, 0x0000, 0x3c00}},
9714 {{ 3.0f, 0.0f, 0.f}, {0x3800, 0x399a, 0xb266, 0xb4cd}},
9715 {{ 1.0f, 0.0f, 0.f}, {0x2e66, 0x3266, 0x2e66, 0x3266}},
9718 const UINT num_faces35 =
ARRAY_SIZE(vertices35) / VERTS_PER_FACE;
9719 const UINT vertex_size35 =
sizeof(*vertices35);
9720 const struct vertex_ptc_float4 exp_vertices35[] =
9722 {{ 0.0f, 3.0f, 0.f}, {0.0f, 0.0f, 0.0f, 0.0f}},
9723 {{ 2.0f, 3.0f, 0.f}, {1.0f, 1.0f, 1.0f, 1.0f}},
9724 {{ 0.0f, 0.0f, 0.f}, {1.0f, 0.0f, 1.0f, 0.0f}},
9726 {{ 3.0f, 3.0f, 0.f}, {0.0f, 1.0f, 0.0f, 1.0f}},
9727 {{ 3.0f, 0.0f, 0.f}, {0.5f, 0.700195f, -0.199951f, -0.300049f}},
9728 {{ 1.0f, 0.0f, 0.f}, {0.099976f, 0.199951f, 0.099976f, 0.199951f}},
9730 const UINT exp_vertex_size35 =
sizeof(*exp_vertices35);
9732 const struct vertex_pn vertices36[] =
9734 {{ 0.0f, 3.0f, 0.f},
up},
9735 {{ 2.0f, 3.0f, 0.f},
up},
9736 {{ 0.0f, 0.0f, 0.f},
up},
9739 const UINT num_faces36 =
ARRAY_SIZE(vertices36) / VERTS_PER_FACE;
9740 const UINT vertex_size36 =
sizeof(*vertices36);
9744 ID3DXMesh *mesh_clone =
NULL;
9747 const BYTE *vertices;
9749 const DWORD *attributes;
9750 const UINT num_vertices;
9751 const UINT num_faces;
9752 const UINT vertex_size;
9753 const DWORD create_options;
9754 const DWORD clone_options;
9757 const BYTE *exp_vertices;
9758 const UINT exp_vertex_size;
9801 (
BYTE*)exp_vertices2,
9815 (
BYTE*)exp_vertices3,
9828 declaration_ptc_float16_2,
9829 (
BYTE*)exp_vertices4,
9842 declaration_ptc_float16_4,
9843 (
BYTE*)exp_vertices5,
9856 declaration_ptc_float1,
9857 (
BYTE*)exp_vertices6,
9870 declaration_ptc_float3,
9871 (
BYTE*)exp_vertices7,
9884 declaration_ptc_float4,
9885 (
BYTE*)exp_vertices8,
9898 declaration_ptc_d3dcolor,
9899 (
BYTE*)exp_vertices9,
9912 declaration_ptc_ubyte4,
9913 (
BYTE*)exp_vertices10,
9926 declaration_ptc_short2,
9927 (
BYTE*)exp_vertices11,
9940 declaration_ptc_short4,
9941 (
BYTE*)exp_vertices12,
9954 declaration_ptc_ubyte4n,
9955 (
BYTE*)exp_vertices13,
9968 declaration_ptc_short2n,
9969 (
BYTE*)exp_vertices14,
9982 declaration_ptc_short4n,
9983 (
BYTE*)exp_vertices15,
9996 declaration_ptc_ushort2n,
9997 (
BYTE*)exp_vertices16,
10010 declaration_ptc_ushort4n,
10011 (
BYTE*)exp_vertices17,
10024 declaration_ptc_float16_2_partialu,
10025 (
BYTE*)exp_vertices18,
10039 (
BYTE*)exp_vertices19,
10053 (
BYTE*)exp_vertices20,
10065 declaration_ptc_float1,
10067 (
BYTE*)exp_vertices21,
10079 declaration_ptc_float1,
10080 declaration_ptc_float3,
10081 (
BYTE*)exp_vertices22,
10093 declaration_ptc_float1,
10094 declaration_ptc_float4,
10095 (
BYTE*)exp_vertices23,
10107 declaration_ptc_float1,
10108 declaration_ptc_d3dcolor,
10109 (
BYTE*)exp_vertices24,
10121 declaration_ptc_float1,
10122 declaration_ptc_ubyte4,
10123 (
BYTE*)exp_vertices25,
10135 declaration_ptc_float4,
10136 declaration_ptc_d3dcolor,
10137 (
BYTE*)exp_vertices26,
10149 declaration_ptc_d3dcolor,
10150 declaration_ptc_float4,
10151 (
BYTE*)exp_vertices27,
10163 declaration_ptc_ubyte4,
10164 declaration_ptc_float4,
10165 (
BYTE*)exp_vertices28,
10177 declaration_ptc_short2,
10178 declaration_ptc_float4,
10179 (
BYTE*)exp_vertices29,
10191 declaration_ptc_short4,
10192 declaration_ptc_float4,
10193 (
BYTE*)exp_vertices30,
10205 declaration_ptc_ubyte4n,
10206 declaration_ptc_float4,
10207 (
BYTE*)exp_vertices31,
10219 declaration_ptc_short2n,
10220 declaration_ptc_float4,
10221 (
BYTE*)exp_vertices32,
10233 declaration_ptc_short4n,
10234 declaration_ptc_float4,
10235 (
BYTE*)exp_vertices33,
10247 declaration_ptc_float16_2,
10248 declaration_ptc_float4,
10249 (
BYTE*)exp_vertices34,
10261 declaration_ptc_float16_4,
10262 declaration_ptc_float4,
10263 (
BYTE*)exp_vertices35,
10289 skip(
"Couldn't create test context\n");
10297 UINT exp_new_decl_length, new_decl_length;
10298 UINT exp_new_decl_size, new_decl_size;
10301 tc[
i].create_options,
10305 tc[
i].indices,
tc[
i].attributes);
10308 skip(
"Couldn't initialize test mesh %d. Got %x expected D3D_OK\n",
i,
hr);
10312 hr =
mesh->lpVtbl->CloneMesh(
mesh,
tc[
i].clone_options,
tc[
i].new_declaration,
10314 ok(
hr ==
D3D_OK,
"Test %u, got unexpected hr %#x.\n",
i,
hr);
10316 hr = mesh_clone->lpVtbl->GetDeclaration(mesh_clone, new_declaration);
10317 ok(
hr ==
D3D_OK,
"Test %u, got unexpected hr %#x.\n",
i,
hr);
10319 for (
j = 0;
tc[
i].new_declaration[
j].Stream != 0xFF;
j++)
10321 ok(
memcmp(&
tc[
i].new_declaration[
j], &new_declaration[
j],
sizeof(*new_declaration)) == 0,
10322 "Test case %d failed. Declaration element %d did not match.\n",
i,
j);
10328 ok(new_decl_length == exp_new_decl_length,
10329 "Test case %d failed. Got new declaration length %d, expected %d\n",
10330 i, new_decl_length, exp_new_decl_length);
10335 ok(new_decl_size == exp_new_decl_size,
10336 "Test case %d failed. Got new declaration size %d, expected %d\n",
10337 i, new_decl_size, exp_new_decl_size);
10340 hr = mesh_clone->lpVtbl->LockVertexBuffer(mesh_clone, 0, (
void**)&vertices);
10343 skip(
"Couldn't lock cloned vertex buffer.\n");
10346 for (
j = 0;
j <
tc[
i].num_vertices;
j++)
10351 hr = mesh_clone->lpVtbl->UnlockVertexBuffer(mesh_clone);
10354 skip(
"Couldn't unlock vertex buffer.\n");
10360 mesh_clone->lpVtbl->Release(mesh_clone);
10369 tc[2].create_options,
10373 tc[2].indices,
tc[2].attributes);
10376 skip(
"Couldn't initialize test mesh for D3DXMESH_VB_SHARE case."
10377 " Got %x expected D3D_OK\n",
hr);
10385 " declaration. Got %x, expected D3DERR_INVALIDCALL\n",
10392 if (vertices)
mesh->lpVtbl->UnlockVertexBuffer(
mesh);
10394 if (mesh_clone) mesh_clone->lpVtbl->Release(mesh_clone);
10409 const unsigned int VERTS_PER_FACE = 3;
10419 { 0.0f, 3.0f, 0.f},
10420 { 2.0f, 3.0f, 0.f},
10421 { 0.0f, 0.0f, 0.f},
10423 const DWORD indices0[] = {0, 1, 2};
10424 const unsigned int num_vertices0 =
ARRAY_SIZE(vertices0);
10425 const unsigned int num_faces0 =
ARRAY_SIZE(indices0) / VERTS_PER_FACE;
10426 const DWORD adjacency0[] = {-1, -1, -1};
10437 { 0.0f, 3.0f, 0.f},
10438 { 2.0f, 3.0f, 0.f},
10439 { 0.0f, 0.0f, 0.f},
10441 { 4.0f, 3.0f, 0.f},
10442 { 4.0f, 0.0f, 0.f},
10444 const DWORD indices1[] = {0, 1, 2, 1, 3, 4};
10445 const unsigned int num_vertices1 =
ARRAY_SIZE(vertices1);
10446 const unsigned int num_faces1 =
ARRAY_SIZE(indices1) / VERTS_PER_FACE;
10447 const DWORD adjacency1[] = {-1, -1, -1, -1, -1, -1};
10457 const UINT num_vertices;
10458 const UINT num_faces;
10459 const DWORD *adjacency;
10485 skip(
"Couldn't create test context\n");
10498 skip(
"Couldn't initialize test mesh %d. Got %x expected D3D_OK\n",
i,
hr);
10503 todo_wine ok(
hr ==
tc[
i].exp_hr,
"Test %u, got unexpected hr %#x, expected %#x.\n",
i,
hr,
tc[
i].exp_hr);
10507 if (errors_and_warnings)
10510 errors_and_warnings =
NULL;
10524 DWORD vertex_remap[3];
10526 const UINT num_faces = 1;
10527 const UINT num_vertices = 3;
10530 num_vertices,
FALSE,
10532 ok(
hr ==
D3D_OK,
"D3DXOptimizeVertices failed. Got %x, expected D3D_OK.\n",
hr);
10536 num_vertices,
FALSE,
10539 "pointer. Got %x, expected D3DERR_INVALIDCALL.\n",
hr);
10546 DWORD smallest_face_remap;
10554 const DWORD indices0[] = {0, 1, 2};
10555 const UINT num_faces0 = 1;
10556 const UINT num_vertices0 = 3;
10557 const DWORD exp_face_remap0[] = {0};
10565 const DWORD indices1[] = {0, 1, 2, 3, 4, 5};
10566 const UINT num_faces1 = 2;
10567 const UINT num_vertices1 = 6;
10568 const DWORD exp_face_remap1[] = {1, 0};
10576 const DWORD indices2[] = {0, 1, 2, 1, 3, 2};
10577 const UINT num_faces2 = 2;
10578 const UINT num_vertices2 = 4;
10579 const DWORD exp_face_remap2[] = {1, 0};
10590 const DWORD indices3[] = {0, 1, 2, 1, 3, 2, 2, 3, 4, 3, 4, 5};
10591 const UINT num_faces3 = 4;
10592 const UINT num_vertices3 = 6;
10593 const DWORD exp_face_remap3[] = {3, 2, 1, 0};
10604 const WORD indices4[] = {0, 1, 2, 1, 3, 2, 2, 3, 4, 3, 4, 5};
10605 const UINT num_faces4 = 4;
10606 const UINT num_vertices4 = 6;
10607 const DWORD exp_face_remap4[] = {3, 2, 1, 0};
10612 const UINT num_faces;
10613 const UINT num_vertices;
10614 const BOOL indices_are_32bit;
10615 const DWORD *exp_face_remap;
10662 tc[
i].num_faces*
sizeof(*face_remap));
10665 tc[
i].num_vertices,
tc[
i].indices_are_32bit,
10667 ok(
hr ==
D3D_OK,
"Test %u, got unexpected hr %#x.\n",
i,
hr);
10670 for (
j = 0;
j <
tc[
i].num_faces;
j++)
10672 ok(
tc[
i].exp_face_remap[
j] == face_remap[
j],
10673 "Test case %d: Got face %d at %d, expected %d\n",
i,
10674 face_remap[
j],
j,
tc[
i].exp_face_remap[
j]);
10682 tc[0].num_vertices,
tc[0].indices_are_32bit,
10689 &smallest_face_remap);
10697 size_t normal_size;
10698 DWORD i, num_vertices, vertex_stride;
10715 if (!normal_declaration)
10728 trace(
"Cannot clear normals\n");
10732 num_vertices =
mesh->lpVtbl->GetNumVertices(
mesh);
10733 vertex_stride =
mesh->lpVtbl->GetNumBytesPerVertex(
mesh);
10735 if (
FAILED(
hr =
mesh->lpVtbl->LockVertexBuffer(
mesh, 0, (
void **)&vertices)))
10738 vertices += normal_declaration->
Offset;
10740 for (
i = 0;
i < num_vertices;
i++, vertices += vertex_stride)
10743 return mesh->lpVtbl->UnlockVertexBuffer(
mesh);
10747 ID3DXMesh *
mesh,
const D3DXVECTOR3 *normals,
unsigned int num_normals)
10751 DWORD num_vertices, vertex_stride;
10770 if (!normal_declaration)
10782 num_vertices =
mesh->lpVtbl->GetNumVertices(
mesh);
10783 vertex_stride =
mesh->lpVtbl->GetNumBytesPerVertex(
mesh);
10785 ok_(__FILE__,
line)(num_vertices == num_normals,
"%s: Expected %u vertices, got %u\n",
test_name,
10786 num_normals, num_vertices);
10788 if (
FAILED(
mesh->lpVtbl->LockVertexBuffer(
mesh, 0, (
void **)&vertices)))
10794 vertices += normal_declaration->
Offset;
10796 for (
i = 0;
i <
min(num_vertices, num_normals);
i++, vertices += vertex_stride)
10802 "%s: normal %2u, expected (%f, %f, %f), got (%f, %f, %f)\n",
10810 "%s: normal %2u, expected (%f, %f, %f, %f), got (%f, %f, %f, %f)\n",
10812 n->x,
n->y,
n->z,
n->w);
10816 mesh->lpVtbl->UnlockVertexBuffer(
mesh);
10828 adjacency, -1.01f, -0.01f, -1.01f,
NULL,
NULL);
10835 ID3DXMesh *
mesh, *cloned_mesh;
10837 IDirect3DDevice9 *
device;
10841 static const struct compute_normals_func
10846 compute_normals_funcs[] =
10854 {-1.0f, 0.0f, 0.0f}, {-1.0f, 0.0f, 0.0f}, {-1.0f, 0.0f, 0.0f}, {-1.0f, 0.0f, 0.0f},
10855 { 0.0f, 1.0f, 0.0f}, { 0.0f, 1.0f, 0.0f}, { 0.0f, 1.0f, 0.0f}, { 0.0f, 1.0f, 0.0f},
10856 { 1.0f, 0.0f, 0.0f}, { 1.0f, 0.0f, 0.0f}, { 1.0f, 0.0f, 0.0f}, { 1.0f, 0.0f, 0.0f},
10857 { 0.0f,-1.0f, 0.0f}, { 0.0f,-1.0f, 0.0f}, { 0.0f,-1.0f, 0.0f}, { 0.0f,-1.0f, 0.0f},
10858 { 0.0f, 0.0f, 1.0f}, { 0.0f, 0.0f, 1.0f}, { 0.0f, 0.0f, 1.0f}, { 0.0f, 0.0f, 1.0f},
10859 { 0.0f, 0.0f,-1.0f}, { 0.0f, 0.0f,-1.0f}, { 0.0f, 0.0f,-1.0f}, { 0.0f, 0.0f,-1.0f}
10861 const float box_normal_component = 1.0f /
sqrtf(3.0f);
10864 {-box_normal_component, -box_normal_component, -box_normal_component},
10865 {-box_normal_component, -box_normal_component, box_normal_component},
10866 {-box_normal_component, box_normal_component, box_normal_component},
10867 {-box_normal_component, box_normal_component, -box_normal_component},
10868 {-box_normal_component, box_normal_component, -box_normal_component},
10869 {-box_normal_component, box_normal_component, box_normal_component},
10870 { box_normal_component, box_normal_component, box_normal_component},
10871 { box_normal_component, box_normal_component, -box_normal_component},
10872 { box_normal_component, box_normal_component, -box_normal_component},
10873 { box_normal_component, box_normal_component, box_normal_component},
10874 { box_normal_component, -box_normal_component, box_normal_component},
10875 { box_normal_component, -box_normal_component, -box_normal_component},
10876 {-box_normal_component, -box_normal_component, box_normal_component},
10877 {-box_normal_component, -box_normal_component, -box_normal_component},
10878 { box_normal_component, -box_normal_component, -box_normal_component},
10879 { box_normal_component, -box_normal_component, box_normal_component},
10880 {-box_normal_component, -box_normal_component, box_normal_component},
10881 { box_normal_component, -box_normal_component, box_normal_component},
10882 { box_normal_component, box_normal_component, box_normal_component},
10883 {-box_normal_component, box_normal_component, box_normal_component},
10884 {-box_normal_component, -box_normal_component, -box_normal_component},
10885 {-box_normal_component, box_normal_component, -box_normal_component},
10886 { box_normal_component, box_normal_component, -box_normal_component},
10887 { box_normal_component, -box_normal_component, -box_normal_component}
10889 static const D3DXVECTOR3 box_normals_adjacency_area[24] =
10891 {-0.666667f, -0.333333f, -0.666667f}, {-0.333333f, -0.666667f, 0.666667f},
10892 {-0.816496f, 0.408248f, 0.408248f}, {-0.408248f, 0.816496f, -0.408248f},
10893 {-0.408248f, 0.816496f, -0.408248f}, {-0.816496f, 0.408248f, 0.408248f},
10894 { 0.333333f, 0.666667f, 0.666667f}, { 0.666667f, 0.333333f, -0.666667f},
10895 { 0.666667f, 0.333333f, -0.666667f}, { 0.333333f, 0.666667f, 0.666667f},
10896 { 0.816496f, -0.408248f, 0.408248f}, { 0.408248f, -0.816496f, -0.408248f},
10897 {-0.333333f, -0.666667f, 0.666667f}, {-0.666667f, -0.333333f, -0.666667f},
10898 { 0.408248f, -0.816496f, -0.408248f}, { 0.816496f, -0.408248f, 0.408248f},
10899 {-0.333333f, -0.666667f, 0.666667f}, { 0.816497f, -0.408248f, 0.408248f},
10900 { 0.333333f, 0.666667f, 0.666667f}, {-0.816497f, 0.408248f, 0.408248f},
10901 {-0.666667f, -0.333333f, -0.666667f}, {-0.408248f, 0.816497f, -0.408248f},
10902 { 0.666667f, 0.333333f, -0.666667f}, { 0.408248f, -0.816496f, -0.408248f}
10904 static const D3DXVECTOR3 box_normals_position1f[24] = {{0}};
10905 static const D3DXVECTOR3 box_normals_position2f[24] =
10907 {0.0f, 0.0f, -1.0f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 1.0f},
10908 {0.0f, 0.0f, -1.0f}, {0.0f, 0.0f, -1.0f}, {0.0f, 0.0f, 1.0f},
10909 {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, -1.0f}, {0.0f, 0.0f, -1.0f},
10910 {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, -1.0f},
10911 {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, -1.0f}, {0.0f, 0.0f, -1.0f},
10912 {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 1.0f},
10913 {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, -1.0f},
10914 {0.0f, 0.0f, -1.0f}, {0.0f, 0.0f, -1.0f}, {0.0f, 0.0f, -1.0f}
10919 { 0.000000f, -0.000000f, 1.000000f}, { 0.000000f, 0.582244f, 0.813014f},
10920 { 0.582244f, -0.000000f, 0.813014f}, {-0.000000f, -0.582244f, 0.813014f},
10921 {-0.582244f, 0.000000f, 0.813014f}, {-0.000000f, 0.890608f, 0.454772f},
10922 { 0.890608f, 0.000000f, 0.454772f}, { 0.000000f, -0.890608f, 0.454772f},
10923 {-0.890608f, -0.000000f, 0.454772f}, { 0.000000f, 1.000000f, -0.000000f},
10924 { 1.000000f, -0.000000f, -0.000000f}, {-0.000000f, -1.000000f, -0.000000f},
10925 {-1.000000f, 0.000000f, -0.000000f}, { 0.000000f, 0.890608f, -0.454773f},
10926 { 0.890608f, -0.000000f, -0.454772f}, {-0.000000f, -0.890608f, -0.454773f},
10927 {-0.890608f, 0.000000f, -0.454773f}, { 0.000000f, 0.582244f, -0.813015f},
10928 { 0.582244f, -0.000000f, -0.813015f}, { 0.000000f, -0.582244f, -0.813015f},
10929 {-0.582243f, 0.000000f, -0.813015f}, { 0.000000f, 0.000000f, -1.000000f}
10931 static const D3DXVECTOR3 sphere_normals_area[22] =
10933 { 0.000000f, -0.000000f, 1.000000f}, {-0.215311f, 0.554931f, 0.803550f},
10934 { 0.554931f, 0.215311f, 0.803550f}, { 0.215311f, -0.554931f, 0.803550f},
10935 {-0.554931f, -0.215311f, 0.803550f}, {-0.126638f, 0.872121f, 0.472618f},
10936 { 0.872121f, 0.126638f, 0.472618f}, { 0.126638f, -0.872121f, 0.472618f},
10937 {-0.872121f, -0.126637f, 0.472618f}, { 0.000000f, 1.000000f, -0.000000f},
10938 { 1.000000f, -0.000000f, -0.000000f}, {-0.000000f, -1.000000f, -0.000000f},
10939 {-1.000000f, 0.000000f, -0.000000f}, { 0.126638f, 0.872121f, -0.472618f},
10940 { 0.872121f, -0.126638f, -0.472618f}, {-0.126638f, -0.872121f, -0.472618f},
10941 {-0.872121f, 0.126638f, -0.472618f}, { 0.215311f, 0.554931f, -0.803550f},
10942 { 0.554931f, -0.215311f, -0.803550f}, {-0.215311f, -0.554931f, -0.803550f},
10943 {-0.554931f, 0.215311f, -0.803550f}, { 0.000000f, 0.000000f, -1.000000f}
10945 static const D3DXVECTOR3 sphere_normals_equal[22] =
10947 { 0.000000f, -0.000000f, 1.000000f}, {-0.134974f, 0.522078f, 0.842150f},
10948 { 0.522078f, 0.134974f, 0.842150f}, { 0.134974f, -0.522078f, 0.842150f},
10949 {-0.522078f, -0.134974f, 0.842150f}, {-0.026367f, 0.857121f, 0.514440f},
10950 { 0.857121f, 0.026367f, 0.514440f}, { 0.026367f, -0.857121f, 0.514440f},
10951 {-0.857121f, -0.026367f, 0.514440f}, { 0.000000f, 1.000000f, -0.000000f},
10952 { 1.000000f, -0.000000f, -0.000000f}, {-0.000000f, -1.000000f, -0.000000f},
10953 {-1.000000f, 0.000000f, -0.000000f}, { 0.026367f, 0.857121f, -0.514440f},
10954 { 0.857121f, -0.026367f, -0.514440f}, {-0.026367f, -0.857121f, -0.514440f},
10955 {-0.857121f, 0.026367f, -0.514440f}, { 0.134975f, 0.522078f, -0.842150f},
10956 { 0.522078f, -0.134975f, -0.842150f}, {-0.134974f, -0.522078f, -0.842150f},
10957 {-0.522078f, 0.134974f, -0.842150f}, { 0.000000f, 0.000000f, -1.000000f}
11005 skip(
"Couldn't create test context\n");
11044 const struct compute_normals_func *
func = &compute_normals_funcs[
i];
11053 refcount = cloned_mesh->lpVtbl->Release(cloned_mesh);
11054 ok(!refcount,
"Mesh has %u references left\n", refcount);
11063 refcount = cloned_mesh->lpVtbl->Release(cloned_mesh);
11064 ok(!refcount,
"Mesh has %u references left\n", refcount);
11067 hr =
mesh->lpVtbl->CloneMesh(
mesh, 0, position3f_normal1f_declaration,
device, &cloned_mesh);
11073 refcount = cloned_mesh->lpVtbl->Release(cloned_mesh);
11074 ok(!refcount,
"Mesh has %u references left\n", refcount);
11077 hr =
mesh->lpVtbl->CloneMesh(
mesh, 0, position3f_normal2f_declaration,
device, &cloned_mesh);
11083 refcount = cloned_mesh->lpVtbl->Release(cloned_mesh);
11084 ok(!refcount,
"Mesh has %u references left\n", refcount);
11105 hr =
mesh->lpVtbl->CloneMesh(
mesh, 0, normal4f_position3f_declaration,
device, &cloned_mesh);
11116 refcount = cloned_mesh->lpVtbl->Release(cloned_mesh);
11117 ok(!refcount,
"Mesh has %u references left\n", refcount);
11120 hr =
mesh->lpVtbl->CloneMesh(
mesh, 0, position1f_normal3f_declaration,
device, &cloned_mesh);
11131 refcount = cloned_mesh->lpVtbl->Release(cloned_mesh);
11132 ok(!refcount,
"Mesh has %u references left\n", refcount);
11135 hr =
mesh->lpVtbl->CloneMesh(
mesh, 0, position2f_normal3f_declaration,
device, &cloned_mesh);
11146 refcount = cloned_mesh->lpVtbl->Release(cloned_mesh);
11147 ok(!refcount,
"Mesh has %u references left\n", refcount);
11150 hr =
mesh->lpVtbl->CloneMesh(
mesh, 0, position4f_normal3f_declaration,
device, &cloned_mesh);
11161 refcount = cloned_mesh->lpVtbl->Release(cloned_mesh);
11162 ok(!refcount,
"Mesh has %u references left\n", refcount);
11168 ok(
hr ==
D3D_OK,
"D3DXComputeTangentFrameEx returned %#x, expected D3D_OK\n",
hr);
11175 ok(
hr ==
D3D_OK,
"D3DXComputeTangentFrameEx returned %#x, expected D3D_OK\n",
hr);
11182 ok(
hr ==
D3D_OK,
"D3DXComputeTangentFrameEx returned %#x, expected D3D_OK\n",
hr);
11189 ok(
hr ==
D3D_OK,
"D3DXComputeTangentFrameEx returned %#x, expected D3D_OK\n",
hr);
11193 refcount =
mesh->lpVtbl->Release(
mesh);
11194 ok(!refcount,
"Mesh has %u references left\n", refcount);
11196 ok(!refcount,
"Buffer has %u references left\n", refcount);
11203 const struct compute_normals_func *
func = &compute_normals_funcs[
i];
11227 ok(
hr ==
D3D_OK,
"D3DXComputeTangentFrameEx returned %#x, expected D3D_OK\n",
hr);
11234 ok(
hr ==
D3D_OK,
"D3DXComputeTangentFrameEx returned %#x, expected D3D_OK\n",
hr);
11241 ok(
hr ==
D3D_OK,
"D3DXComputeTangentFrameEx returned %#x, expected D3D_OK\n",
hr);
11248 ok(
hr ==
D3D_OK,
"D3DXComputeTangentFrameEx returned %#x, expected D3D_OK\n",
hr);
11252 refcount =
mesh->lpVtbl->Release(
mesh);
11253 ok(!refcount,
"Mesh has %u references left\n", refcount);
11255 ok(!refcount,
"Buffer has %u references left\n", refcount);
11263 ID3DXAnimationController *animation;
11267 ok(
hr ==
D3D_OK,
"Got unexpected hr returned %#x.\n",
hr);
11269 animation = (
void*)0xdeadbeef;
11271 ok(
hr ==
D3D_OK,
"Got unexpected hr returned %#x.\n",
hr);
11272 ok(animation == (
void*)0xdeadbeef,
"Got unexpected animation %p.\n", animation);
11274 animation = (
void*)0xdeadbeef;
11276 ok(
hr ==
D3D_OK,
"Got unexpected hr returned %#x.\n",
hr);
11277 ok(animation == (
void*)0xdeadbeef,
"Got unexpected animation %p.\n", animation);
11279 animation = (
void*)0xdeadbeef;
11281 ok(
hr ==
D3D_OK,
"Got unexpected hr returned %#x.\n",
hr);
11282 ok(animation == (
void*)0xdeadbeef,
"Got unexpected animation %p.\n", animation);
11284 animation = (
void*)0xdeadbeef;
11286 ok(
hr ==
D3D_OK,
"Got unexpected hr returned %#x.\n",
hr);
11287 ok(animation == (
void*)0xdeadbeef,
"Got unexpected animation %p.\n", animation);
11290 ok(
hr ==
D3D_OK,
"Got unexpected hr returned %#x.\n",
hr);
11292 value = animation->lpVtbl->GetMaxNumAnimationOutputs(animation);
11295 value = animation->lpVtbl->GetMaxNumAnimationSets(animation);
11298 value = animation->lpVtbl->GetMaxNumTracks(animation);
11301 value = animation->lpVtbl->GetMaxNumEvents(animation);
11304 animation->lpVtbl->Release(animation);
11307 ok(
hr ==
D3D_OK,
"Got unexpected hr returned %#x.\n",
hr);
11309 value = animation->lpVtbl->GetMaxNumAnimationOutputs(animation);
11310 ok(
value == 100,
"Got unexpected value %u.\n",
value);
11312 value = animation->lpVtbl->GetMaxNumAnimationSets(animation);
11313 ok(
value == 101,
"Got unexpected value %u.\n",
value);
11315 value = animation->lpVtbl->GetMaxNumTracks(animation);
11316 ok(
value == 102,
"Got unexpected value %u.\n",
value);
11318 value = animation->lpVtbl->GetMaxNumEvents(animation);
11319 ok(
value == 103,
"Got unexpected value %u.\n",
value);
11321 animation->lpVtbl->Release(animation);
11326 ID3DXKeyframedAnimationSet *
set;
11328 unsigned int count;
11347 set->lpVtbl->Release(
set);
11352 static char n1[] =
"name1";
11353 static char n2[] =
"name2";
11354 static char n3[] =
"name3";
11355 static char n4[] =
"name4";
11356 static char n5[] =
"name5";
11357 static char n6[] =
"name6";
11358 static char N1[] =
"Name1";
11384 memset(&sibling, 0,
sizeof(sibling));
11386 root.pFrameSibling = &sibling;
11388 ok(
ret == &sibling,
"Unexpected frame, %p.\n",
ret);
11390 memset(&sibling2, 0,
sizeof(sibling2));
11394 ok(
ret == &sibling,
"Unexpected frame, %p.\n",
ret);
11398 ok(
ret == &sibling2,
"Unexpected frame, %p.\n",
ret);
11405 ok(
ret == &sibling,
"Unexpected frame, %p.\n",
ret);
11412 memset(&child2, 0,
sizeof(child2));
11413 memset(&child3, 0,
sizeof(child3));
11416 child.pFrameFirstChild = &child3;
11418 ok(
ret == &child2,
"Unexpected frame, %p.\n",
ret);
11422 ok(
ret == &child3,
"Unexpected frame, %p.\n",
ret);
11427 ID3DXFileData *file_data, *
ret =
NULL;
11428 ID3DXFileEnumObject *enum_obj =
NULL;
11445 if (
FAILED(enum_obj->lpVtbl->GetChildren(enum_obj, &
count)))
11450 if (
FAILED(enum_obj->lpVtbl->GetChild(enum_obj,
i, &file_data)))
11453 if (
SUCCEEDED(file_data->lpVtbl->GetType(file_data, &
guid))
11461 file_data->lpVtbl->Release(file_data);
11467 enum_obj->lpVtbl->
Release(enum_obj);
11475 static const char simple_xfile[] =
11494 IDirect3DDevice9 *
device;
11495 ID3DXSkinInfo *skin_info;
11496 ID3DXFileData *file_data;
11497 const char *bone_name;
11509 skip(
"Failed to create application window.\n");
11516 skip(
"Failed to create d3d object.\n");
11521 memset(&d3dpp, 0,
sizeof(d3dpp));
11530 skip(
"Failed to create device, hr %#x.\n",
hr);
11535 file_data =
get_mesh_data(simple_xfile,
sizeof(simple_xfile) - 1);
11536 ok(!!file_data,
"Failed to load mesh data.\n");
11538 adjacency = materials = effects = (
void *)0xdeadbeef;
11540 skin_info = (
void *)0xdeadbeef;
11541 mesh = (
void *)0xdeadbeef;
11544 &skin_info, &
mesh);
11546 ok(!!adjacency,
"Got unexpected value %p.\n", adjacency);
11547 ok(!materials,
"Got unexpected value %p.\n", materials);
11548 ok(!effects,
"Got unexpected value %p.\n", effects);
11550 ok(!!skin_info,
"Got unexpected value %p.\n", skin_info);
11551 ok(!!
mesh,
"Got unexpected value %p.\n",
mesh);
11557 hr = skin_info->lpVtbl->GetDeclaration(skin_info,
declaration);
11561 fvf = skin_info->lpVtbl->GetFVF(skin_info);
11562 ok(fvf ==
D3DFVF_XYZ,
"Got unexpected value %u.\n", fvf);
11564 count = skin_info->lpVtbl->GetNumBones(skin_info);
11567 influence = skin_info->lpVtbl->GetMinBoneInfluence(skin_info);
11568 ok(!influence,
"Got unexpected value %.8e.\n", influence);
11570 memset(max_influences, 0x55,
sizeof(max_influences));
11571 hr = skin_info->lpVtbl->GetMaxVertexInfluences(skin_info, max_influences);
11573 todo_wine ok(!max_influences[0],
"Got unexpected value %u.\n", max_influences[0]);
11574 ok(max_influences[1] == 0x55555555,
"Got unexpected value %u.\n", max_influences[1]);
11575 ok(max_influences[2] == 0x55555555,
"Got unexpected value %u.\n", max_influences[2]);
11577 bone_name = skin_info->lpVtbl->GetBoneName(skin_info, 0);
11578 ok(!bone_name,
"Got unexpected value %p.\n", bone_name);
11580 count = skin_info->lpVtbl->GetNumBoneInfluences(skin_info, 0);
11583 count = skin_info->lpVtbl->GetNumBoneInfluences(skin_info, 1);
11586 matrix = skin_info->lpVtbl->GetBoneOffsetMatrix(skin_info, -1);
11589 matrix = skin_info->lpVtbl->GetBoneOffsetMatrix(skin_info, 0);
11592 skin_info->lpVtbl->Release(skin_info);
11594 adjacency->lpVtbl->Release(adjacency);
11595 file_data->lpVtbl->Release(file_data);
11597 ok(!refcount,
"Device has %u references left.\n", refcount);
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
HRESULT WINAPI D3DXCreateKeyframedAnimationSet(const char *name, double ticks_per_second, D3DXPLAYBACK_TYPE playback_type, UINT animation_count, UINT callback_key_count, const D3DXKEY_CALLBACK *callback_keys, ID3DXKeyframedAnimationSet **animation_set)
HRESULT WINAPI D3DXCreateAnimationController(UINT max_outputs, UINT max_sets, UINT max_tracks, UINT max_events, ID3DXAnimationController **controller)
#define D3DFVF_TEXCOUNT_SHIFT
#define D3DFVF_LASTBETA_UBYTE4
#define D3DFVF_TEXCOUNT_MASK
#define D3DFVF_TEXCOORDSIZE4(CoordIndex)
#define D3DFVF_TEXCOORDSIZE3(CoordIndex)
#define D3DFVF_TEXCOORDSIZE2(CoordIndex)
#define D3DFVF_TEXCOORDSIZE1(CoordIndex)
#define D3DFVF_POSITION_MASK
IDirect3D9 *WINAPI Direct3DCreate9(UINT SDKVersion)
#define IDirect3DIndexBuffer9_Unlock(p)
#define IDirect3DVertexBuffer9_Unlock(p)
#define IDirect3DVertexBuffer9_Release(p)
#define IDirect3D9_CreateDevice(p, a, b, c, d, e, f)
#define IDirect3DVertexBuffer9_Lock(p, a, b, c, d)
#define IDirect3DVertexBuffer9_GetDesc(p, a)
#define IDirect3DIndexBuffer9_GetDesc(p, a)
#define IDirect3D9_Release(p)
#define IDirect3DDevice9_Release(p)
#define IDirect3DIndexBuffer9_Lock(p, a, b, c, d)
#define IDirect3DIndexBuffer9_Release(p)
@ D3DDECLUSAGE_BLENDWEIGHT
@ D3DDECLUSAGE_BLENDINDICES
#define D3DFVF_LASTBETA_D3DCOLOR
#define D3DERR_INVALIDCALL
#define D3DXERR_INVALIDMESH
struct ID3DXBuffer ID3DXBuffer
enum _D3DXPLAYBACK_TYPE D3DXPLAYBACK_TYPE
#define ID3DXBuffer_GetBufferSize(p)
#define ID3DXBuffer_GetBufferPointer(p)
#define ID3DXBuffer_Release(p)
struct _D3DVECTOR D3DXVECTOR3
#define D3DXToRadian(degree)
@ D3DXTANGENT_WEIGHT_BY_AREA
@ D3DXTANGENT_CALCULATE_NORMALS
@ D3DXTANGENT_WEIGHT_EQUAL
@ D3DXTANGENT_GENERATE_IN_PLACE
@ D3DXWELDEPSILONS_DONOTREMOVEVERTICES
@ D3DXWELDEPSILONS_DONOTSPLIT
@ D3DXWELDEPSILONS_WELDALL
@ D3DXWELDEPSILONS_WELDPARTIALMATCHES
#define D3DXF_FILELOAD_FROMMEMORY
D3DXVECTOR2 *WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv)
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
BOOL WINAPI D3DXIntersectTri(const D3DXVECTOR3 *p0, const D3DXVECTOR3 *p1, const D3DXVECTOR3 *p2, const D3DXVECTOR3 *praypos, const D3DXVECTOR3 *praydir, float *pu, float *pv, float *pdist)
HRESULT WINAPI D3DXCreateBox(struct IDirect3DDevice9 *device, float width, float height, float depth, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency)
static BOOL is_direction_similar(D3DXVECTOR2 *dir1, D3DXVECTOR2 *dir2, float cos_theta)
UINT WINAPI D3DXGetDeclLength(const D3DVERTEXELEMENT9 *decl)
HRESULT WINAPI D3DXCreatePolygon(struct IDirect3DDevice9 *device, float length, UINT sides, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency)
UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF)
static HRESULT create_outline(struct glyphinfo *glyph, void *raw_outline, int datasize, float max_deviation_sq, unsigned int emsquare, const struct cos_table *cos_table)
HRESULT WINAPI D3DXDeclaratorFromFVF(DWORD fvf, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE])
HRESULT WINAPI D3DXCreateCylinder(struct IDirect3DDevice9 *device, float radius1, float radius2, float length, UINT slices, UINT stacks, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency)
static D3DXVECTOR2 * convert_fixed_to_float(POINTFX *pt, int count, unsigned int emsquare)
HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *mesh, DWORD texture_in_semantic, DWORD texture_in_index, DWORD u_partial_out_semantic, DWORD u_partial_out_index, DWORD v_partial_out_semantic, DWORD v_partial_out_index, DWORD normal_out_semantic, DWORD normal_out_index, DWORD options, const DWORD *adjacency, float partial_edge_threshold, float singular_point_threshold, float normal_edge_threshold, ID3DXMesh **mesh_out, ID3DXBuffer **vertex_mapping)
HRESULT WINAPI D3DXOptimizeVertices(const void *indices, UINT num_faces, UINT num_vertices, BOOL indices_are_32bit, DWORD *vertex_remap)
static HRESULT add_bezier_points(struct outline *outline, const D3DXVECTOR2 *p1, const D3DXVECTOR2 *p2, const D3DXVECTOR2 *p3, float max_deviation_sq)
#define EFFECT_TABLE_ENTRY(str, field)
HRESULT WINAPI D3DXLoadMeshHierarchyFromXInMemory(const void *memory, DWORD memory_size, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXAllocateHierarchy *alloc_hier, struct ID3DXLoadUserData *load_user_data, D3DXFRAME **frame_hierarchy, struct ID3DXAnimationController **anim_controller)
static void free_sincos_table(struct sincos_table *sincos_table)
HRESULT WINAPI D3DXCreateTextA(struct IDirect3DDevice9 *device, HDC hdc, const char *text, float deviation, float extrusion, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency, GLYPHMETRICSFLOAT *glyphmetrics)
HRESULT WINAPI D3DXFVFFromDeclarator(const D3DVERTEXELEMENT9 *declaration, DWORD *fvf)
HRESULT WINAPI D3DXCreateMesh(DWORD numfaces, DWORD numvertices, DWORD options, const D3DVERTEXELEMENT9 *declaration, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh)
HRESULT WINAPI D3DXComputeBoundingBox(const D3DXVECTOR3 *pfirstposition, DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pmin, D3DXVECTOR3 *pmax)
HRESULT WINAPI D3DXOptimizeFaces(const void *indices, UINT num_faces, UINT num_vertices, BOOL indices_are_32bit, DWORD *face_remap)
HRESULT WINAPI D3DXComputeBoundingSphere(const D3DXVECTOR3 *pfirstposition, DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pcenter, float *pradius)
HRESULT WINAPI D3DXLoadSkinMeshFromXof(struct ID3DXFileData *filedata, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency_out, struct ID3DXBuffer **materials_out, struct ID3DXBuffer **effects_out, DWORD *num_materials_out, struct ID3DXSkinInfo **skin_info_out, struct ID3DXMesh **mesh_out)
BOOL WINAPI D3DXSphereBoundProbe(const D3DXVECTOR3 *center, float radius, const D3DXVECTOR3 *ray_position, const D3DXVECTOR3 *ray_direction)
static BOOL compute_sincos_table(struct sincos_table *sincos_table, float angle_start, float angle_step, int n)
static struct udec3 dword_to_udec3(DWORD d)
HRESULT WINAPI D3DXCreateSphere(struct IDirect3DDevice9 *device, float radius, UINT slices, UINT stacks, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency)
D3DXFRAME *WINAPI D3DXFrameFind(const D3DXFRAME *root, const char *name)
static struct outline * add_outline(struct outline_array *array)
static BOOL reserve(struct dynamic_array *array, int count, int itemsize)
UINT WINAPI D3DXGetDeclVertexSize(const D3DVERTEXELEMENT9 *decl, DWORD stream_idx)
HRESULT WINAPI D3DXValidMesh(ID3DXMesh *mesh, const DWORD *adjacency, ID3DXBuffer **errors_and_warnings)
static BOOL attempt_line_merge(struct outline *outline, int pt_index, const D3DXVECTOR2 *nextpt, BOOL to_curve, const struct cos_table *table)
HRESULT WINAPI D3DXCreateTorus(struct IDirect3DDevice9 *device, float innerradius, float outerradius, UINT sides, UINT rings, struct ID3DXMesh **mesh, ID3DXBuffer **adjacency)
static struct dec3n dword_to_dec3n(DWORD d)
HRESULT WINAPI D3DXCreateTextW(struct IDirect3DDevice9 *device, HDC hdc, const WCHAR *text, float deviation, float extrusion, struct ID3DXMesh **mesh_ptr, struct ID3DXBuffer **adjacency, GLYPHMETRICSFLOAT *glyphmetrics)
HRESULT WINAPI D3DXComputeNormals(struct ID3DXBaseMesh *mesh, const DWORD *adjacency)
HRESULT WINAPI D3DXLoadMeshFromXInMemory(const void *memory, DWORD memory_size, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency_out, struct ID3DXBuffer **materials_out, struct ID3DXBuffer **effects_out, DWORD *num_materials_out, struct ID3DXMesh **mesh_out)
static D3DXVECTOR2 * unit_vec2(D3DXVECTOR2 *dir, const D3DXVECTOR2 *pt1, const D3DXVECTOR2 *pt2)
HRESULT WINAPI D3DXWeldVertices(ID3DXMesh *mesh, DWORD flags, const D3DXWELDEPSILONS *epsilons, const DWORD *adjacency, DWORD *adjacency_out, DWORD *face_remap_out, ID3DXBuffer **vertex_remap_out)
HRESULT WINAPI D3DXCreateMeshFVF(DWORD numfaces, DWORD numvertices, DWORD options, DWORD fvf, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh)
HRESULT WINAPI D3DXFrameDestroy(D3DXFRAME *frame, ID3DXAllocateHierarchy *alloc_hier)
static WORD vertex_index(UINT slices, int slice, int stack)
BOOL WINAPI D3DXBoxBoundProbe(const D3DXVECTOR3 *pmin, const D3DXVECTOR3 *pmax, const D3DXVECTOR3 *prayposition, const D3DXVECTOR3 *praydirection)
HRESULT WINAPI D3DXFileCreate(ID3DXFile **d3dxfile)
#define HeapFree(x, y, z)
static void cleanup(void)
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLuint GLuint GLsizei GLenum const GLvoid * indices
GLuint GLenum GLenum transform
GLenum GLenum GLenum GLenum GLenum scale
GLenum GLuint GLint GLenum face
GLboolean GLboolean GLboolean b
GLenum const GLfloat * params
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
GLfloat GLfloat GLfloat v2
GLubyte GLubyte GLubyte GLubyte w
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
_Check_return_ __CRT_INLINE float __CRTDECL fabsf(_In_ float x)
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
_Check_return_ float __cdecl cosf(_In_ float x)
_Check_return_ float __cdecl sinf(_In_ float x)
#define skip_(test, file, line,...)
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
static ID3DXAllocateHierarchy alloc_hier
static DWORD init_dec3n_dword(INT x, INT y, INT z, INT w)
static void check_generated_effects_(int line, const D3DXMATERIAL *materials, DWORD num_materials, const D3DXEFFECTINSTANCE *effects)
static BOOL new_mesh(struct mesh *mesh, DWORD number_of_vertices, DWORD number_of_faces)
static void D3DXCreateMeshFVFTest(void)
static void check_floats_(int line, const char *prefix, const float *got, const float *exp, int dim)
static void D3DXCreateSphereTest(void)
static HRESULT CALLBACK ID3DXAllocateHierarchyImpl_CreateMeshContainer(ID3DXAllocateHierarchy *iface, const char *name, const D3DXMESHDATA *mesh_data, const D3DXMATERIAL *materials, const D3DXEFFECTINSTANCE *effects, DWORD num_materials, const DWORD *adjacency, ID3DXSkinInfo *skin_info, D3DXMESHCONTAINER **new_mesh_container)
static void compare_elements(const D3DVERTEXELEMENT9 *elements, const D3DVERTEXELEMENT9 *expected_elements, unsigned int line, unsigned int test_id)
static void test_createtext(IDirect3DDevice9 *device, HDC hdc, const char *text, float deviation, float extrusion)
static void free_glyphinfo(struct glyphinfo *glyph)
static void check_vertex_components(int line, int mesh_number, int vertex_number, BYTE *got_ptr, const BYTE *exp_ptr, D3DVERTEXELEMENT9 *declaration)
static HRESULT clear_normals(ID3DXMesh *mesh)
static BOOL compare_face(face a, face b)
static void D3DXCreatePolygonTest(void)
static void D3DXCreateMeshTest(void)
#define compare_float(got, exp)
static HRESULT CALLBACK ID3DXAllocateHierarchyImpl_DestroyFrame(ID3DXAllocateHierarchy *iface, LPD3DXFRAME frame)
static BOOL compare_vec3(D3DXVECTOR3 u, D3DXVECTOR3 v)
static void test_convert_point_reps_to_adjacency(void)
static void check_colorvalue_(int line, const char *prefix, const D3DCOLORVALUE got, const D3DCOLORVALUE expected)
static void test_sphere(IDirect3DDevice9 *device, FLOAT radius, UINT slices, UINT stacks)
static BOOL compute_box(struct mesh *mesh, float width, float height, float depth)
static void D3DXGetFVFVertexSizeTest(void)
static void D3DXCreateAnimationControllerTest(void)
static struct point2d * add_point(struct outline *array)
static void test_optimize_vertices(void)
static void test_get_decl_length(void)
static void test_compute_normals(void)
static void D3DXGenerateAdjacencyTest(void)
static BOOL compute_sphere(struct mesh *mesh, FLOAT radius, UINT slices, UINT stacks)
static HRESULT CALLBACK ID3DXAllocateHierarchyImpl_DestroyMeshContainer(ID3DXAllocateHierarchy *iface, LPD3DXMESHCONTAINER mesh_container)
static void check_matrix_(int line, const D3DXMATRIX *got, const D3DXMATRIX *expected)
static BOOL compute_torus(struct mesh *mesh, float innerradius, float outerradius, UINT sides, UINT rings)
static void D3DXIntersectTriTest(void)
static void test_convert_adjacency_to_point_reps(void)
static void free_outline(struct outline *outline)
static HRESULT destroy_mesh_container(LPD3DXMESHCONTAINER mesh_container)
static void test_fvf_to_decl(DWORD test_fvf, const D3DVERTEXELEMENT9 expected_elements[], HRESULT expected_hr, unsigned int line, unsigned int test_id)
static void D3DXComputeBoundingSphereTest(void)
static HRESULT CALLBACK ID3DXAllocateHierarchyImpl_CreateFrame(ID3DXAllocateHierarchy *iface, const char *name, D3DXFRAME **new_frame)
#define check_materials(got, got_count, expected, expected_count)
static ID3DXAllocateHierarchyVtbl ID3DXAllocateHierarchyImpl_Vtbl
#define compare_vertex_sizes(type, exp)
static void free_mesh(struct mesh *mesh)
static void compare_normals(unsigned int line, const char *test_name, ID3DXMesh *mesh, const D3DXVECTOR3 *normals, unsigned int num_normals)
#define test_LoadMeshFromX(device, xfile_str, vertex_array, fvf, index_array, materials_array, check_adjacency)
static void check_generated_adjacency_(int line, ID3DXMesh *mesh, const DWORD *got, FLOAT epsilon)
static BOOL compute_cylinder(struct mesh *mesh, FLOAT radius1, FLOAT radius2, FLOAT length, UINT slices, UINT stacks)
static void print_elements(const D3DVERTEXELEMENT9 *elements)
static void check_index_buffer_(int line, ID3DXMesh *mesh, const void *indices, DWORD num_indices, DWORD index_size)
static void D3DXCreateBoxTest(void)
static void D3DXCreateKeyframedAnimationSetTest(void)
static BOOL compare_vec4(D3DXVECTOR4 u, D3DXVECTOR4 v)
#define check_vertex_buffer(mesh, vertices, num_vertices, fvf)
static void D3DXCreateCylinderTest(void)
static void test_optimize_faces(void)
static void D3DXCreateTorusTest(void)
static void test_D3DXFrameFind(void)
static void check_materials_(int line, const D3DXMATERIAL *got, DWORD got_count, const D3DXMATERIAL *expected, DWORD expected_count)
static DWORD init_udec3_dword(UINT x, UINT y, UINT z, UINT w)
static char * strdupA(const char *p)
static void D3DXComputeBoundingBoxTest(void)
#define check_matrix(got, expected)
static void D3DXLoadMeshTest(void)
static void D3DXCreateTextTest(void)
static void test_update_semantics(void)
static void check_vertex_buffer_(int line, ID3DXMesh *mesh, const void *vertices, DWORD num_vertices, DWORD fvf)
static HRESULT compute_normals_D3DXComputeTangentFrameEx(ID3DXMesh *mesh, const DWORD *adjacency)
static void compute_text_mesh(struct mesh *mesh, const char *text, float deviation, float extrusion, float otmEMSquare, const struct glyphinfo *glyphs)
static HRESULT compute_normals_D3DXComputeNormals(ID3DXMesh *mesh, const DWORD *adjacency)
static void test_clone_mesh(void)
static void test_get_decl_vertex_size(void)
static void D3DXBoundProbeTest(void)
static void test_LoadMeshFromX_(int line, IDirect3DDevice9 *device, const char *xfile_str, size_t xfile_strlen, const void *vertices, DWORD num_vertices, DWORD fvf, const void *indices, DWORD num_indices, size_t index_size, const D3DXMATERIAL *expected_materials, DWORD expected_num_materials, BOOL check_adjacency)
static void test_fvf_decl_conversion(void)
static void test_weld_vertices(void)
static void compare_text_outline_mesh(const char *name, ID3DXMesh *d3dxmesh, struct mesh *mesh, size_t textlen, float extrusion, const struct glyphinfo *glyphs)
#define check_index_buffer(mesh, indices, num_indices, index_size)
static struct test_context * new_test_context(void)
static void test_valid_mesh(void)
static void test_cylinder(IDirect3DDevice9 *device, FLOAT radius1, FLOAT radius2, FLOAT length, UINT slices, UINT stacks)
static void test_decl_to_fvf(const D3DVERTEXELEMENT9 *decl, DWORD expected_fvf, HRESULT expected_hr, unsigned int line, unsigned int test_id)
static void test_box(IDirect3DDevice9 *device, float width, float height, float depth)
static void compare_mesh(const char *name, ID3DXMesh *d3dxmesh, struct mesh *mesh)
static void test_create_skin_info(void)
static BOOL compute_polygon(struct mesh *mesh, float length, unsigned int sides)
static HRESULT init_test_mesh(const DWORD num_faces, const DWORD num_vertices, const DWORD options, const D3DVERTEXELEMENT9 *declaration, IDirect3DDevice9 *device, ID3DXMesh **mesh_ptr, const void *vertices, const DWORD vertex_size, const DWORD *indices, const DWORD *attributes)
static ID3DXFileData * get_mesh_data(const void *memory, SIZE_T length)
static void free_test_context(struct test_context *test_context)
#define check_generated_effects(materials, num_materials, effects)
#define check_generated_adjacency(mesh, got, epsilon)
static void test_torus(IDirect3DDevice9 *device, float innerradius, float outerradius, UINT sides, UINT rings)
static float __port_nan(void)
static void test_load_skin_mesh_from_xof(void)
static void test_update_skinned_mesh(void)
static UINT UINT LPWORD glyphs
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static void test_polygon(void)
static const char * test_name
static char memory[1024 *256]
static float(__cdecl *square_half_float)(float x
_In_ ULONG _In_ ULONG Offset
#define WS_OVERLAPPEDWINDOW
#define IsEqualGUID(rguid1, rguid2)
#define D3DRM_XTEMPLATE_BYTES
unsigned char D3DRM_XTEMPLATES[]
#define D3DADAPTER_DEFAULT
#define D3DCREATE_SOFTWARE_VERTEXPROCESSING
HRESULT WINAPI D3DXCreateSkinInfo(DWORD num_vertices, const D3DVERTEXELEMENT9 *declaration, DWORD num_bones, ID3DXSkinInfo **skin_info)
HRESULT WINAPI D3DXCreateSkinInfoFVF(DWORD num_vertices, DWORD fvf, DWORD num_bones, ID3DXSkinInfo **skin_info)
wchar_t const *const size_t const buffer_size
D3DXEFFECTDEFAULTTYPE Type
LPD3DXEFFECTDEFAULT pDefaults
struct _D3DXFRAME * pFrameFirstChild
D3DXMATRIX TransformationMatrix
LPD3DXMESHCONTAINER pMeshContainer
struct _D3DXFRAME * pFrameSibling
struct outline_array outlines
IDirect3DDevice9 * device
Character const *const prefix
UINT WINAPI GetOutlineTextMetricsA(_In_ HDC hdc, _In_ UINT cjCopy, _Out_writes_bytes_opt_(cjCopy) LPOUTLINETEXTMETRICA potm)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define OUT_DEFAULT_PRECIS
#define CLIP_DEFAULT_PRECIS
HFONT WINAPI CreateFontA(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCSTR)
BOOL WINAPI DeleteDC(_In_ HDC)
DWORD WINAPI GetGlyphOutlineA(_In_ HDC hdc, _In_ UINT uChar, _In_ UINT fuFormat, _Out_ LPGLYPHMETRICS lpgm, _In_ DWORD cjBuffer, _Out_writes_bytes_opt_(cjBuffer) LPVOID pvBuffer, _In_ CONST MAT2 *lpmat2)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
BOOL WINAPI DestroyWindow(_In_ HWND)