32#define ADMITTED_ERROR 0.0001f
39#define expect_vec4(expected, got) expect_vec4_(__LINE__, expected, got)
46 "Expected (%f, %f, %f, %f), got (%f, %f, %f, %f)\n",
48 got->
x, got->
y, got->
z, got->
w);
72 ok_(__FILE__,
line)(
desc->MultiSampleType == multi_sample_type,
"Expected multi sample type %d, got %d.\n",
73 multi_sample_type,
desc->MultiSampleType);
75 ok_(__FILE__,
line)(
desc->MultiSampleQuality == multi_sample_quality,
"Expected multi sample quality %u, got %lu.\n",
76 multi_sample_quality,
desc->MultiSampleQuality);
83#define check_texture_level_desc(tex, level, format, usage, pool, multi_sample_type, multi_sample_quality, width, \
85 check_texture_level_desc_(__LINE__, tex, level, format, usage, pool, multi_sample_type, multi_sample_quality, \
86 width, height, wine_todo)
96 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to get texture level desc with hr %#lx.\n",
hr);
104#define check_cube_texture_level_desc(tex, level, format, usage, pool, multi_sample_type, multi_sample_quality, size, \
106 check_cube_texture_level_desc_(__LINE__, tex, level, format, usage, pool, multi_sample_type, multi_sample_quality, \
117 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to get cube texture level desc with hr %#lx.\n",
hr);
124#define check_volume_texture_level_desc(tex, level, format, usage, pool, width, height, depth, wine_todo) \
125 check_volume_texture_level_desc_(__LINE__, tex, level, format, usage, pool, width, height, depth, wine_todo)
136 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to get texture level desc with hr %#lx.\n",
hr);
160#define check_texture_mip_levels(tex, expected_mip_levels, wine_todo) \
161 check_texture_mip_levels_(__LINE__, ((IDirect3DBaseTexture9 *)tex), expected_mip_levels, wine_todo)
167 todo_wine_if(wine_todo)
ok_(__FILE__,
line)(mip_levels == expected_mip_levels,
"Got miplevels %u, expected %u.\n",
168 mip_levels, expected_mip_levels);
173 unsigned int diff =
x >
y ?
x -
y :
y -
x;
175 return diff <= max_diff;
181 &&
compare_uint((c1 >> 8) & 0xff, (c2 >> 8) & 0xff, max_diff)
182 &&
compare_uint((c1 >> 16) & 0xff, (c2 >> 16) & 0xff, max_diff)
183 &&
compare_uint((c1 >> 24) & 0xff, (c2 >> 24) & 0xff, max_diff);
205 trace(
"Can't unlock the readback surface, hr %#lx.\n",
hr);
217 trace(
"Failed to get surface description, hr %#lx.\n",
hr);
225 trace(
"Can't create the readback surface, hr %#lx.\n",
hr);
232 trace(
"Can't load the readback surface, hr %#lx.\n",
hr);
238 trace(
"Can't lock the readback surface, hr %#lx.\n",
hr);
255 memset(rb, 0,
sizeof(*rb));
259 trace(
"Failed to get surface for mip level %d, hr %#lx.\n", mip_level,
hr);
273 memset(rb, 0,
sizeof(*rb));
277 trace(
"Failed to get surface for face %d mip level %d, hr %#lx.\n",
face, mip_level,
hr);
285#define check_readback_pixel_4bpp(rb, x, y, color, todo) _check_readback_pixel_4bpp(__LINE__, rb, x, y, color, todo)
320 unsigned int expected_size;
331 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
334 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
342 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
343 ok(
width == 256,
"Returned width %d, expected %d\n",
width, 256);
344 ok(
height == 256,
"Returned height %d, expected %d\n",
height, 256);
348 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
349 ok(
width == 256,
"Returned width %d, expected %d\n",
width, 256);
352 skip(
"Hardware only supports pow2 textures\n");
357 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
358 ok(
width == 62,
"Returned width %d, expected %d\n",
width, 62);
362 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
364 ok(
height == 63,
"Returned height %d, expected %d\n",
height, 63);
369 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
370 ok(
width == 1,
"Returned width %d, expected %d\n",
width, 1);
375 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
376 ok(
width == 1,
"Returned width %d, expected %d\n",
width, 1);
381 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
382 ok(
width == 1,
"Returned width %d, expected %d\n",
width, 1);
386 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
391 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
401 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
402 ok(mipmaps == 7,
"Returned mipmaps %d, expected %d\n", mipmaps, 7);
409 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
410 ok(mipmaps == 9,
"Returned mipmaps %d, expected %d\n", mipmaps, 9);
415 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
416 ok(mipmaps == 6,
"Returned mipmaps %d, expected %d\n", mipmaps, 6);
419 skip(
"Skipping some tests, npot2 textures unsupported\n");
423 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
424 ok(mipmaps == 9,
"Returned mipmaps %d, expected %d\n", mipmaps, 9);
428 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
429 ok(mipmaps == 9,
"Returned mipmaps %d, expected %d\n", mipmaps, 9);
436 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
437 ok(mipmaps == 0,
"Returned mipmaps %d, expected %d\n", mipmaps, 0);
440 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
441 ok(mipmaps == 1,
"Returned mipmaps %d, expected %d\n", mipmaps, 1);
444 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
445 ok(mipmaps == 0,
"Returned mipmaps %d, expected %d\n", mipmaps, 0);
448 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
449 ok(mipmaps == 0,
"Returned mipmaps %d, expected %d\n", mipmaps, 0);
452 skip(
"No D3DUSAGE_AUTOGENMIPMAP support for textures\n");
468 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
472 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
477 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
482 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
503 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
514 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
525 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
536 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
550 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
559 ok(mipmaps == 1,
"Got unexpected level count %u.\n", mipmaps);
577 ok(mipmaps == 1,
"Got unexpected level count %u.\n", mipmaps);
592 ok(
width == expected_size,
"Unexpected width %u, expected %u.\n",
width, expected_size);
593 ok(
height == expected_size,
"Unexpected height %u, expected %u.\n",
height, expected_size);
594 ok(mipmaps == 1,
"Got unexpected level count %u.\n", mipmaps);
608 ok(mipmaps == 1,
"Got unexpected level count %u.\n", mipmaps);
634 skip(
"No cube textures support\n");
640 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
643 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
651 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
652 ok(
size == 256,
"Returned size %d, expected %d\n",
size, 256);
658 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
659 ok(mipmaps == 7,
"Returned mipmaps %d, expected %d\n", mipmaps, 7);
666 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
674 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
679 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
680 ok(mipmaps == 9,
"Returned mipmaps %d, expected %d\n", mipmaps, 9);
686 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
687 ok(mipmaps == 0,
"Returned mipmaps %d, expected %d\n", mipmaps, 0);
690 skip(
"No D3DUSAGE_AUTOGENMIPMAP support for cube textures\n");
706 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
710 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
715 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
720 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
735 skip(
"Limited or no volume textures support.\n");
741 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
744 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
752 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
753 ok(
width == 256,
"Returned width %d, expected %d\n",
width, 256);
754 ok(
height == 256,
"Returned height %d, expected %d\n",
height, 256);
755 ok(
depth == 1,
"Returned depth %d, expected %d\n",
depth, 1);
759 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
760 ok(
width == 256,
"Returned width %d, expected %d\n",
width, 256);
764 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
765 ok(
width == 1,
"Returned width %d, expected %d\n",
width, 1);
767 ok(
depth == 1,
"Returned height %d, expected %d\n",
depth, 1);
771 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
772 ok(
width == 1,
"Returned width %d, expected %d\n",
width, 1);
774 ok(
depth == 1,
"Returned height %d, expected %d\n",
depth, 1);
778 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
779 ok(
width == 1,
"Returned width %d, expected %d\n",
width, 1);
783 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
788 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
792 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
797 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
802 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
807 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
816 skip(
"No volume textures mipmapping support\n");
823 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
824 ok(mipmaps == 7,
"Returned mipmaps %d, expected %d\n", mipmaps, 7);
832 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
837 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#lx, expected %#lx\n",
hr,
D3D_OK);
838 ok(mipmaps == 9,
"Returned mipmaps %d, expected %d\n", mipmaps, 9);
842 "D3DUSAGE_AUTOGENMIPMAP is unexpectedly supported on volume textures.\n");
869 ok(
desc.Width == 256,
"Returned width %d, expected %d\n",
desc.Width, 256);
870 ok(
desc.Height == 256,
"Returned height %d, expected %d\n",
desc.Height, 256);
885 ok(
desc.Width == 1,
"Returned width %d, expected %d\n",
desc.Width, 1);
886 ok(
desc.Height == 1,
"Returned height %d, expected %d\n",
desc.Height, 1);
893 skip(
"Hardware only supports pow2 textures\n");
900 "D3DXCreateTexture returned %#lx, expected %#lx\n",
hr,
D3D_OK);
913 "Returned width %d, expected %d\n",
desc.Width, 63);
917 "Returned height %d, expected %d\n",
desc.Height, 63);
931 ok(mipmaps == 7,
"Returned mipmaps %d, expected %d\n", mipmaps, 7);
943 ok(mipmaps == 9,
"Returned mipmaps %d, expected %d\n", mipmaps, 9);
955 ok(mipmaps == 1,
"Returned mipmaps %d, expected %d\n", mipmaps, 1);
967 ok(mipmaps == 1,
"Returned mipmaps %d, expected %d\n", mipmaps, 1);
1014 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromResource returned %#lx, expected %#lx\n",
hr,
D3D_OK);
1018 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromResource returned %#lx, expected %#lx\n",
hr,
D3D_OK);
1035 hr =
D3DXCreateTextureFromResourceExA(
device,
NULL,
MAKEINTRESOURCEA(
IDD_BITMAPDATA_1x1),
D3DX_DEFAULT,
D3DX_DEFAULT,
D3DX_DEFAULT, 0,
D3DFMT_UNKNOWN,
D3DPOOL_MANAGED,
D3DX_DEFAULT,
D3DX_DEFAULT, 0,
NULL,
NULL, &
texture);
1036 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromResourceEx returned %#lx, expected %#lx\n",
hr,
D3D_OK);
1039 hr =
D3DXCreateTextureFromResourceExA(
device,
NULL,
MAKEINTRESOURCEA(
IDS_STRING),
D3DX_DEFAULT,
D3DX_DEFAULT,
D3DX_DEFAULT, 0,
D3DFMT_UNKNOWN,
D3DPOOL_MANAGED,
D3DX_DEFAULT,
D3DX_DEFAULT, 0,
NULL,
NULL, &
texture);
1042 hr =
D3DXCreateTextureFromResourceExA(
NULL,
NULL,
MAKEINTRESOURCEA(
IDD_BITMAPDATA_1x1),
D3DX_DEFAULT,
D3DX_DEFAULT,
D3DX_DEFAULT, 0,
D3DFMT_UNKNOWN,
D3DPOOL_MANAGED,
D3DX_DEFAULT,
D3DX_DEFAULT, 0,
NULL,
NULL, &
texture);
1045 hr =
D3DXCreateTextureFromResourceExA(
device,
NULL,
NULL,
D3DX_DEFAULT,
D3DX_DEFAULT,
D3DX_DEFAULT, 0,
D3DFMT_UNKNOWN,
D3DPOOL_MANAGED,
D3DX_DEFAULT,
D3DX_DEFAULT, 0,
NULL,
NULL, &
texture);
1048 hr =
D3DXCreateTextureFromResourceExA(
device,
NULL,
MAKEINTRESOURCEA(
IDD_BITMAPDATA_1x1),
D3DX_DEFAULT,
D3DX_DEFAULT,
D3DX_DEFAULT, 0,
D3DFMT_UNKNOWN,
D3DPOOL_MANAGED,
D3DX_DEFAULT,
D3DX_DEFAULT, 0,
NULL,
NULL,
NULL);
1054 IDirect3DTexture9 *tex;
1055 IDirect3DCubeTexture9 *cubetex;
1056 IDirect3DVolumeTexture9 *voltex;
1089 skip(
"Failed to create texture\n");
1104 skip(
"Failed to create texture\n");
1115 skip(
"Failed to create texture\n");
1125 skip(
"Failed to create texture\n");
1135 skip(
"Failed to create texture\n");
1163 skip(
"Failed to create texture\n");
1199 skip(
"Failed to create volume texture\n");
1204 skip(
"No D3DUSAGE_AUTOGENMIPMAP supported for textures\n");
1216 skip(
"Failed to create texture\n");
1226 skip(
"Failed to create texture\n");
1233 for (
i = 0;
i < 4;
i++)
1236 if (diff > 1)
return FALSE;
1257 test_access_types[] =
1264 IDirect3DTexture9 *tex;
1282 for (
m = 0;
m < 3;
m++)
1287 ok(
hr ==
D3D_OK,
"Unexpected hr %#lx, i %u, m %lu.\n",
hr,
i,
m);
1288 temp_surface = src_surface;
1294 ok(
hr ==
D3D_OK,
"Unexpected hr %#lx, i %u, m %lu.\n",
hr,
i,
m);
1296 ok(
hr ==
D3D_OK,
"Unexpected hr %#lx, i %u, m %lu.\n",
hr,
i,
m);
1298 ok(
hr ==
D3D_OK,
"Unexpected hr %#lx, i %u, m %lu.\n",
hr,
i,
m);
1307 v[0] = (
value >> 24) & 0xff;
1308 v[1] = (
value >> 16) & 0xff;
1309 v[2] = (
value >> 8) & 0xff;
1313 e[1] = (
x + 0.5f) /
size * 255.0f + 0.5f;
1314 e[2] = (
y + 0.5f) /
size * 255.0f + 0.5f;
1315 e[3] = 255.0f /
size + 0.5f;
1319 "Texel at (%lu, %lu) doesn't match: %#lx, expected %#lx, i %u, m %lu.\n",
1324 if (temp_surface != src_surface)
1359 ok(
hr ==
D3D_OK,
"Couldn't lock the texture, error %#lx\n",
hr);
1363 for (
y = 0;
y < 4;
y++)
1365 for (
x = 0;
x < 4;
x++)
1369 v[1] =
value >> 10 & 0x1f;
1370 v[2] =
value >> 5 & 0x1f;
1374 e[1] = (
x + 0.5f) / 4.0f * 31.0f + 0.5f;
1375 e[2] = (
y + 0.5f) / 4.0f * 31.0f + 0.5f;
1380 "Texel at (%lu, %lu) doesn't match: %#lx, expected %#lx\n",
1390 skip(
"Failed to create texture\n");
1405 for (
y = 0;
y < 4;
y++)
1427 skip(
"Failed to lock texture\n");
1432 skip(
"Failed to create D3DFMT_A16B16G16R16F texture\n");
1446 for (
y = 0;
y < 4;
y++)
1448 float *
ptr = (
float *)lock_rect.
pBits +
y * pitch;
1470 skip(
"Failed to lock texture\n");
1475 skip(
"Failed to create D3DFMT_A32B32G32R32F texture\n");
1489 skip(
"Failed to create D3DFMT_DXT1 texture\n");
1495 value->x = (texcoord->
x + 1.0f) / 2.0f;
1496 value->y = (texcoord->
y + 1.0f) / 2.0f;
1497 value->z = (texcoord->
z + 1.0f) / 2.0f;
1527 return size -
x - 0.5f;
1531 return size -
y - 0.5f;
1537 trace(
"Unexpected coordinate value\n");
1553 pitch = lock_rect->
Pitch /
sizeof(
WORD);
1557 | (
value >> 10 & 0x1f) << 16
1558 | (
value >> 5 & 0x1f) << 8
1570 return (
BYTE)(
v >= 0.0f ?
v * 255 + 0.5f : 0.0f);
1584 return (
BYTE)(
v->w + 0.5f) << 24
1585 | (
BYTE)(
v->x * 31 + 0.5f) << 16
1586 | (
BYTE)(
v->y * 31 + 0.5f) << 8
1587 | (
BYTE)(
v->z * 31 + 0.5f);
1593#define compare_cube_texture(t,f,d) compare_cube_texture_(t,f,d,__LINE__)
1597 static const enum cube_coord coordmap[6][3] =
1623 for (
f = 0;
f < 6;
f++)
1625 texelsize.
x = (
f == 0) || (
f == 1) ? 0.0f : 2.0f /
size;
1626 texelsize.
y = (
f == 2) || (
f == 3) ? 0.0f : 2.0f /
size;
1627 texelsize.
z = (
f == 4) || (
f == 5) ? 0.0f : 2.0f /
size;
1630 ok(
hr ==
D3D_OK,
"Couldn't lock the texture, error %#lx.\n",
hr);
1646 "Texel at face %lu (%lu, %lu) doesn't match: %08lx, expected %08lx.\n",
1657 IDirect3DCubeTexture9 *tex;
1686 skip(
"Texture format D3DFMT_A1R5G5B5 unsupported.\n");
1701 IDirect3DVolumeTexture9 *tex;
1721 ok(
hr ==
D3D_OK,
"D3DXFillVolumeTexture returned %#lx, expected %#lx\n",
hr,
D3D_OK);
1723 for (
m = 0;
m < 3;
m++)
1726 ok(
hr ==
D3D_OK,
"Couldn't lock the texture, error %#lx\n",
hr);
1738 v[0] = (
value >> 24) & 0xff;
1739 v[1] = (
value >> 16) & 0xff;
1740 v[2] = (
value >> 8) & 0xff;
1743 e[0] = 255.0f /
size + 0.5f;
1744 e[1] = (
x + 0.5f) /
size * 255.0f + 0.5f;
1745 e[2] = (
y + 0.5f) /
size * 255.0f + 0.5f;
1746 e[3] = (
z + 0.5f) /
size * 255.0f + 0.5f;
1750 "Texel at (%lu, %lu, %lu) doesn't match: %#lx, expected %#lx\n",
1763 skip(
"Failed to create texture\n");
1773 ok(
hr ==
D3D_OK,
"Couldn't lock the texture, error %#lx\n",
hr);
1778 for (
z = 0;
z < 4;
z++)
1780 for (
y = 0;
y < 4;
y++)
1782 for (
x = 0;
x < 4;
x++)
1786 v[1] =
value >> 10 & 0x1f;
1787 v[2] =
value >> 5 & 0x1f;
1791 e[1] = (
x + 0.5f) / 4 * 31.0f + 0.5f;
1792 e[2] = (
y + 0.5f) / 4 * 31.0f + 0.5f;
1793 e[3] = (
z + 0.5f) / 4 * 31.0f + 0.5f;
1797 "Texel at (%lu, %lu, %lu) doesn't match: %#lx, expected %#lx\n",
1808 skip(
"Failed to create texture\n");
1813 static const DWORD dds_dxt5_expected[] =
1815 0xff7b207b, 0xff7b207b, 0xff84df7b, 0xff84df7b,
1816 0xff7b207b, 0xff7b207b, 0xff84df7b, 0xff84df7b,
1817 0xff7b207b, 0xff7b207b, 0xff84df7b, 0xff84df7b,
1818 0xff7b207b, 0xff7b207b, 0xff84df7b, 0xff84df7b,
1820 static const DWORD dds_dxt5_8_8_expected[] =
1822 0x0000ff00, 0x0000ff00, 0x000000ff, 0x000000ff, 0x3f00ffff, 0x3f00ffff, 0x3fff0000, 0x3fff0000,
1823 0x0000ff00, 0x0000ff00, 0x000000ff, 0x000000ff, 0x3f00ffff, 0x3f00ffff, 0x3fff0000, 0x3fff0000,
1824 0x000000ff, 0x000000ff, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x3f00ffff, 0x3f00ffff,
1825 0x000000ff, 0x000000ff, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x3f00ffff, 0x3f00ffff,
1826 0x7fffff00, 0x7fffff00, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
1827 0x7fffff00, 0x7fffff00, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
1828 0x7fff00ff, 0x7fff00ff, 0x7fffff00, 0x7fffff00, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000,
1829 0x7fff00ff, 0x7fff00ff, 0x7fffff00, 0x7fffff00, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000,
1831 static const DWORD dds_dxt5_8_8_expected_misaligned_1[] =
1833 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x3fff0000, 0x3fff0000,
1834 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x3fff0000, 0x3fff0000,
1835 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x3fff0000, 0x3fff0000,
1836 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x3fff0000, 0x3fff0000,
1837 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
1838 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
1839 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
1840 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
1842 static const DWORD dds_dxt5_8_8_expected_misaligned_3[] =
1844 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1845 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1846 0x00000000, 0x00000000, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x00000000, 0x00000000,
1847 0x00000000, 0x00000000, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x00000000, 0x00000000,
1848 0x00000000, 0x00000000, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0x00000000, 0x00000000,
1849 0x00000000, 0x00000000, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0x00000000, 0x00000000,
1850 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1851 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1853 static const uint32_t dds_volume_dxt3_4_4_4_expected_uncompressed[] =
1855 0xffff0000, 0xff00ff00, 0xff0000ff,
1862 unsigned int i,
x,
y;
1868 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
1872 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
1880 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemory returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
1884 ok(
hr ==
D3D_OK,
"IDirect3DTexture9_GetLevelDesc returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
1885 ok(
desc.Width == 4,
"Width is %u, expected 4.\n",
desc.Width);
1886 ok(
desc.Height == 4,
"Height is %u, expected 4.\n",
desc.Height);
1891 ok(
hr ==
D3D_OK,
"IDirect3DTexture9_LockRect returned %#lx, expected %#lx\n",
hr,
D3D_OK);
1894 for (
i = 0;
i < 16;
i++)
1896 "Byte at index %u is 0x%02x, expected 0x%02x.\n",
1904 skip(
"D3DFMT_DXT5 textures are not supported, skipping a test.\n");
1917 ok(
desc.Width == 4,
"Got unexpected width %u.\n",
desc.Width);
1918 ok(
desc.Height == 4,
"Got unexpected height %u.\n",
desc.Height);
1928 for (
y = 0;
y < 4; ++
y)
1930 for (
x = 0;
x < 4; ++
x)
1936 dds_dxt5_expected[
y * 4 +
x], 32),
1937 "Color at position %u, %u is 0x%08lx, expected 0x%08lx.\n",
1939 dds_dxt5_expected[
y * 4 +
x]);
1958 ok(
desc.Width == 8,
"Got unexpected width %u.\n",
desc.Width);
1959 ok(
desc.Height == 8,
"Got unexpected height %u.\n",
desc.Height);
1971 for (
y = 0;
y < 8; ++
y)
1973 for (
x = 0;
x < 8; ++
x)
1976 dds_dxt5_8_8_expected[
y * 8 +
x], 0),
1977 "Color at position %u, %u is 0x%08lx, expected 0x%08lx.\n",
1979 dds_dxt5_8_8_expected[
y * 8 +
x]);
1988 for (
y = 0;
y < 2; ++
y)
2002 for (
y = 0;
y < 8; ++
y)
2004 for (
x = 0;
x < 8; ++
x)
2007 dds_dxt5_8_8_expected_misaligned_1[
y * 8 +
x], 0),
2008 "Color at position %u, %u is 0x%08lx, expected 0x%08lx.\n",
2010 dds_dxt5_8_8_expected_misaligned_1[
y * 8 +
x]);
2018 for (
y = 0;
y < 2; ++
y)
2035 for (
y = 0;
y < 8; ++
y)
2037 for (
x = 0;
x < 8; ++
x)
2040 dds_dxt5_8_8_expected_misaligned_3[
y * 8 +
x], 0),
2041 "Color at position %u, %u is 0x%08lx, expected 0x%08lx.\n",
2043 dds_dxt5_8_8_expected_misaligned_3[
y * 8 +
x]);
2057 for (
y = 0;
y < 8; ++
y)
2059 for (
x = 0;
x < 8; ++
x)
2062 dds_dxt5_8_8_expected_misaligned_3[
y * 8 +
x], 0),
2063 "Color at position %u, %u is 0x%08lx, expected 0x%08lx.\n",
2065 dds_dxt5_8_8_expected_misaligned_3[
y * 8 +
x]);
2077 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemory returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2081 ok(level_count == 3,
"Texture has %lu mip levels, 3 expected.\n", level_count);
2083 ok(
hr ==
D3D_OK,
"IDirect3DTexture9_GetLevelDesc returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2084 ok(
desc.Width == 4,
"Width is %u, expected 4.\n",
desc.Width);
2085 ok(
desc.Height == 4,
"Height is %u, expected 4.\n",
desc.Height);
2091 ok(
hr ==
D3D_OK,
"IDirect3DTexture9_LockRect returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2094 for (
i = 0;
i < 16; ++
i)
2096 "Byte at index %u is 0x%02x, expected 0x%02x.\n",
2104 skip(
"D3DFMT_DXT3 volume textures are not supported, skipping a test.\n");
2124 for (mip_level = 0; mip_level <
ARRAY_SIZE(dds_volume_dxt3_4_4_4_expected_uncompressed); ++mip_level)
2126 const uint32_t expected_color = dds_volume_dxt3_4_4_4_expected_uncompressed[mip_level];
2131 for (
y = 0;
y <
desc.Height; ++
y)
2133 for (
x = 0;
x <
desc.Width; ++
x)
2144 skip(
"D3DFMT_DXT3 textures are not supported, skipping a test.\n");
2152 static const uint32_t dds_24bit_8_8_expected[] =
2154 0xffff0000, 0xff00ff00, 0xff0000ff, 0xff000000,
2156 static const uint32_t dds_volume_24bit_4_4_4_expected[] =
2158 0xffff0000, 0xff00ff00, 0xff0000ff,
2160 static const uint32_t dds_volume_dxt3_4_4_4_expected_uncompressed[] =
2162 0xffff0000, 0xff00ff00, 0xff0000ff,
2174 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2216 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2222 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2224 ok(miplevels == 1,
"Got miplevels %u, expected %u.\n", miplevels, 1);
2228 "Surface dimensions are %ux%u, expected 1x1.\n",
desc.Width,
desc.Height);
2234 skip(
"No D3DUSAGE_AUTOGENMIPMAP support for textures\n");
2240 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2247 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2256 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2265 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2275 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2284 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2293 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2303 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2312 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2321 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2397 for (mip_level = 0; mip_level <
ARRAY_SIZE(dds_24bit_8_8_expected); ++mip_level)
2399 const uint32_t expected_color = dds_24bit_8_8_expected[mip_level];
2404 for (
y = 0;
y <
desc.Height; ++
y)
2406 for (
x = 0;
x <
desc.Width; ++
x)
2428 for (mip_level = 0; mip_level <
ARRAY_SIZE(dds_volume_24bit_4_4_4_expected); ++mip_level)
2430 const uint32_t expected_color = dds_volume_24bit_4_4_4_expected[mip_level];
2435 for (
y = 0;
y <
desc.Height; ++
y)
2437 for (
x = 0;
x <
desc.Width; ++
x)
2461 for (mip_level = 0; mip_level <
ARRAY_SIZE(dds_volume_dxt3_4_4_4_expected_uncompressed); ++mip_level)
2463 const uint32_t expected_color = dds_volume_dxt3_4_4_4_expected_uncompressed[mip_level];
2468 for (
y = 0;
y <
desc.Height; ++
y)
2470 for (
x = 0;
x <
desc.Width; ++
x)
2482 skip(
"D3DFMT_DXT3 textures are not supported, skipping tests.\n");
2526 IDirect3DCubeTexture9 *cube_texture;
2551 ok(levelcount == 3,
"GetLevelCount returned %lu, expected 3\n", levelcount);
2555 ok(surface_desc.
Width == 4,
"Got width %u, expected 4\n", surface_desc.
Width);
2556 ok(surface_desc.
Height == 4,
"Got height %u, expected 4\n", surface_desc.
Height);
2559 ok(
ref == 0,
"Invalid reference count. Got %lu, expected 0\n",
ref);
2560 }
else skip(
"Couldn't create cube texture\n");
2565 static const uint32_t dds_cube_map_non_square_expected[] =
2567 0xffff0000, 0xff00ff00, 0xff0000ff, 0xffffff00, 0xffff00ff, 0xff000000,
2569 static const uint32_t dds_cube_map_4_4_expected[] =
2571 0xffff0000, 0xff00ff00, 0xff0000ff, 0xffffff00, 0xffff00ff, 0xff00ffff,
2572 0xffffffff, 0xff000000, 0xff800000, 0xff008000, 0xff000080, 0xff808000
2574 IDirect3DCubeTexture9 *cube_texture;
2595 cube_texture =
NULL;
2611 cube_texture =
NULL;
2623 cube_texture =
NULL;
2633 skip(
"No D3DUSAGE_AUTOGENMIPMAP support for cube textures\n");
2656 for (
i = 0;
i < 6; ++
i)
2658 const uint32_t expected_color = dds_cube_map_non_square_expected[
i];
2662 for (
y = 0;
y <
desc.Height; ++
y)
2664 for (
x = 0;
x <
desc.Width; ++
x)
2666 if (
y <
info.Height)
2690 for (
i = 0;
i < 6; ++
i)
2692 const uint32_t expected_color = dds_cube_map_non_square_expected[
i];
2696 for (
y = 0;
y <
desc.Height; ++
y)
2698 for (
x = 0;
x <
desc.Width; ++
x)
2720 for (
i = 0;
i < 6; ++
i)
2722 const uint32_t expected_color = dds_cube_map_non_square_expected[
i];
2726 for (
y = 0;
y <
desc.Height; ++
y)
2728 for (
x = 0;
x <
desc.Width; ++
x)
2751 for (
i = 0;
i < 6; ++
i)
2755 for (mip_level = 0; mip_level < 2; ++mip_level)
2757 const uint32_t expected_color = dds_cube_map_4_4_expected[(
i * 2) + mip_level];
2762 for (
y = 0;
y <
desc.Height; ++
y)
2764 for (
x = 0;
x <
desc.Width; ++
x)
2794 for (
i = 0;
i < 6; ++
i)
2796 const uint32_t expected_color = dds_cube_map_4_4_expected[(
i * 2) + 1];
2801 for (
y = 0;
y <
desc.Height; ++
y)
2803 for (
x = 0;
x <
desc.Width; ++
x)
2819 IDirect3DVolumeTexture9 *volume_texture;
2835 ok(
hr ==
D3D_OK,
"D3DXCreateVolumeTextureFromFileInMemory returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2837 ok(levelcount == 3,
"GetLevelCount returned %lu, expected 3.\n", levelcount);
2841 ok(volume_desc.
Width == 4,
"Got width %u, expected 4.\n", volume_desc.
Width);
2842 ok(volume_desc.
Height == 4,
"Got height %u, expected 4.\n", volume_desc.
Height);
2843 ok(volume_desc.
Depth == 2,
"Got depth %u, expected 2.\n", volume_desc.
Depth);
2848 ok(volume_desc.
Width == 2,
"Got width %u, expected 2.\n", volume_desc.
Width);
2849 ok(volume_desc.
Height == 2,
"Got height %u, expected 2.\n", volume_desc.
Height);
2850 ok(volume_desc.
Depth == 1,
"Got depth %u, expected 1.\n", volume_desc.
Depth);
2853 ok(
ref == 0,
"Invalid reference count. Got %lu, expected 0.\n",
ref);
2858 static const uint32_t dds_volume_dxt3_4_4_4_expected_uncompressed[] =
2860 0xffff0000, 0xff00ff00, 0xff0000ff,
2862 static const uint32_t dds_24bit_8_8_expected[] =
2864 0xffff0000, 0xff00ff00, 0xff0000ff, 0xff000000,
2866 static const uint32_t bmp_32bpp_4_4_argb_expected[] =
2868 0xffff0000, 0xff00ff00, 0xff0000ff, 0xff000000,
2870 IDirect3DVolumeTexture9 *volume_texture, *
texture;
2957 for (mip_level = 0; mip_level < 4; ++mip_level)
2959 const uint32_t expected_color = dds_24bit_8_8_expected[mip_level];
2964 for (
z = 0;
z <
desc.Depth; ++
z)
2966 for (
y = 0;
y <
desc.Height; ++
y)
2968 for (
x = 0;
x <
desc.Width; ++
x)
2991 for (mip_level = 0; mip_level < 3; ++mip_level)
2993 const uint32_t expected_color = dds_volume_dxt3_4_4_4_expected_uncompressed[mip_level];
2998 for (
z = 0;
z <
desc.Depth; ++
z)
3000 for (
y = 0;
y <
desc.Height; ++
y)
3002 for (
x = 0;
x <
desc.Width; ++
x)
3014 skip(
"D3DFMT_DXT3 volume textures are not supported, skipping tests.\n");
3029 for (mip_level = 0; mip_level < 3; ++mip_level)
3033 for (
z = 0;
z <
desc.Depth; ++
z)
3035 for (
y = 0;
y <
desc.Height; ++
y)
3037 const uint32_t *expected_color = &bmp_32bpp_4_4_argb_expected[(
desc.Height == 1 ||
y < (
desc.Height / 2)) ? 0 : 2];
3039 for (
x = 0;
x <
desc.Width; ++
x)
3041 if (
desc.Width == 1 ||
x < (
desc.Width / 2))
3095 if (tex_coord->
x > 0 &&
fabs(tex_coord->
x) >
fabs(tex_coord->
y) &&
fabs(tex_coord->
x) >
fabs(tex_coord->
z))
3103 IDirect3DCubeTexture9 *cube_texture;
3104 IDirect3DVolumeTexture9 *volume_texture;
3106 void *buffer_pointer;
3115 skip(
"Failed to create texture\n");
3122 ok(
hr ==
D3D_OK,
"D3DXSaveTextureToFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3128 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3130 ok(
info.Width == 256,
"Got width %u, expected %u\n",
info.Width, 256);
3131 ok(
info.Height == 256,
"Got height %u, expected %u\n",
info.Height, 256);
3132 ok(
info.MipLevels == 1,
"Got miplevels %u, expected %u\n",
info.MipLevels, 1);
3134 ok(
info.ImageFileFormat == file_format,
"Got file format %#x, expected %#x\n",
info.ImageFileFormat, file_format);
3141 ok(
hr ==
D3D_OK,
"D3DXSaveTextureToFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3147 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3149 ok(
info.Width == 256,
"Got width %u, expected %u\n",
info.Width, 256);
3150 ok(
info.Height == 256,
"Got height %u, expected %u\n",
info.Height, 256);
3151 ok(
info.MipLevels == 9,
"Got miplevels %u, expected %u\n",
info.MipLevels, 9);
3164 skip(
"Failed to create cube texture\n");
3172 ok(
hr ==
D3D_OK,
"D3DXSaveTextureToFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3180 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3182 ok(
info.Width == 256,
"Got width %u, expected %u\n",
info.Width, 256);
3183 ok(
info.Height == 256,
"Got height %u, expected %u\n",
info.Height, 256);
3184 ok(
info.MipLevels == 1,
"Got miplevels %u, expected %u\n",
info.MipLevels, 1);
3195 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3201 ok(*
color == 0x00ff0000,
"Got color %#lx, expected %#x\n", *
color, 0x00ff0000);
3206 }
else skip(
"Failed to create surface\n");
3213 ok(
hr ==
D3D_OK,
"D3DXSaveTextureToFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3219 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3221 ok(
info.Width == 256,
"Got width %u, expected %u\n",
info.Width, 256);
3222 ok(
info.Height == 256,
"Got height %u, expected %u\n",
info.Height, 256);
3223 ok(
info.MipLevels == 9,
"Got miplevels %u, expected %u\n",
info.MipLevels, 9);
3236 skip(
"Failed to create volume texture\n");
3242 ok(
hr ==
D3D_OK,
"D3DXSaveTextureToFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3248 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3250 ok(
info.Width == 256,
"Got width %u, expected %u\n",
info.Width, 256);
3251 ok(
info.Height == 256,
"Got height %u, expected %u\n",
info.Height, 256);
3252 ok(
info.Depth == 1,
"Got depth %u, expected %u\n",
info.Depth, 1);
3253 ok(
info.MipLevels == 1,
"Got miplevels %u, expected %u\n",
info.MipLevels, 1);
3260 ok(
hr ==
D3D_OK,
"D3DXSaveTextureToFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3266 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
3268 ok(
info.Width == 256,
"Got width %u, expected %u\n",
info.Width, 256);
3269 ok(
info.Height == 256,
"Got height %u, expected %u\n",
info.Height, 256);
3270 ok(
info.Depth == 256,
"Got depth %u, expected %u\n",
info.Depth, 256);
3271 ok(
info.MipLevels == 9,
"Got miplevels %u, expected %u\n",
info.MipLevels, 9);
3289 return float4(
pos, 1.0);
3292 static const DWORD shader_code[] =
3294 0x54580100, 0x0015fffe, 0x42415443, 0x0000001c, 0x0000001f, 0x54580100, 0x00000000, 0x00000000,
3295 0x00000100, 0x0000001c, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3296 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x000afffe,
3297 0x54494c43, 0x00000004, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3298 0x00000000, 0x00000000, 0x0014fffe, 0x434c5846, 0x00000002, 0x10000003, 0x00000001, 0x00000000,
3299 0x00000003, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10000001, 0x00000001, 0x00000000,
3300 0x00000001, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3303float f1[2] = { 0.4f, 0.1f };
3322 return float4(
pos,
f1[0] +
f1[1] +
b1 * 0.6f +
t);
3325 static const DWORD shader_code2[] =
3327 0x54580100, 0x0074fffe, 0x42415443, 0x0000001c, 0x000001a3, 0x54580100, 0x00000005, 0x0000001c,
3328 0x00000100, 0x000001a0, 0x00000080, 0x00090002, 0x00000001, 0x00000084, 0x00000094, 0x000000a4,
3329 0x00070002, 0x00000002, 0x000000a8, 0x00000000, 0x000000b8, 0x00050002, 0x00000002, 0x000000bc,
3330 0x000000cc, 0x000000ec, 0x000a0002, 0x00000001, 0x000000f0, 0x00000000, 0x00000100, 0x00000002,
3331 0x00000005, 0x00000190, 0x00000000, 0xab003162, 0x00010000, 0x00010001, 0x00000001, 0x00000000,
3332 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xab003262, 0x00010000, 0x00010001, 0x00000002,
3333 0x00000000, 0xab003166, 0x00030000, 0x00010001, 0x00000002, 0x00000000, 0x3ecccccd, 0x00000000,
3334 0x00000000, 0x00000000, 0x3dcccccd, 0x00000000, 0x00000000, 0x00000000, 0xab003266, 0x00030001,
3335 0x00040001, 0x00000001, 0x00000000, 0x62003173, 0xabab0033, 0x00010000, 0x00010001, 0x00000001,
3336 0x00000000, 0xab003366, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003466, 0x00030001,
3337 0x00040001, 0x00000001, 0x00000000, 0xab003169, 0x00020000, 0x00010001, 0x00000001, 0x00000000,
3338 0xab003269, 0x00020000, 0x00010001, 0x00000001, 0x00000000, 0x00000103, 0x00000108, 0x00000118,
3339 0x0000011c, 0x0000012c, 0x00000130, 0x00000140, 0x00000144, 0x00000154, 0x00000158, 0x00000005,
3340 0x00080001, 0x00050001, 0x00000168, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3341 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x0062fffe, 0x54494c43,
3342 0x00000030, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3343 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3344 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3345 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3346 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3347 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3348 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3349 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3350 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3351 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3352 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3353 0x00000000, 0x40000000, 0x3fe33333, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3354 0x00000000, 0x0059fffe, 0x434c5846, 0x00000008, 0xa0500001, 0x00000002, 0x00000000, 0x00000002,
3355 0x0000001c, 0x00000000, 0x00000002, 0x00000020, 0x00000000, 0x00000007, 0x00000000, 0xa0500001,
3356 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002, 0x00000028, 0x00000000,
3357 0x00000007, 0x00000004, 0xa0400001, 0x00000002, 0x00000000, 0x00000007, 0x00000004, 0x00000000,
3358 0x00000002, 0x00000010, 0x00000000, 0x00000007, 0x00000000, 0xa0400001, 0x00000002, 0x00000000,
3359 0x00000002, 0x00000014, 0x00000000, 0x00000002, 0x00000018, 0x00000000, 0x00000007, 0x00000001,
3360 0xa0500001, 0x00000002, 0x00000000, 0x00000002, 0x00000024, 0x00000000, 0x00000001, 0x0000002c,
3361 0x00000000, 0x00000007, 0x00000002, 0xa0400001, 0x00000002, 0x00000000, 0x00000007, 0x00000002,
3362 0x00000000, 0x00000007, 0x00000001, 0x00000000, 0x00000007, 0x00000004, 0xa0400001, 0x00000002,
3363 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000004,
3364 0x00000003, 0x10000003, 0x00000001, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000004,
3365 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3367 IDirect3DVolumeTexture9 *volume_texture;
3368 IDirect3DCubeTexture9 *cube_texture;
3376 ID3DXTextureShader *tx;
3390 tx = (
void *)0xdeadbeef;
3393 ok(tx == (
void *)0xdeadbeef,
"Unexpected pointer %p.\n", tx);
3395 tx = (
void *)0xdeadbeef;
3398 ok(tx == (
void *)0xdeadbeef,
"Unexpected pointer %p.\n", tx);
3400 tx = (
void *)0xdeadbeef;
3403 ok(tx == (
void *)0xdeadbeef,
"Unexpected pointer %p.\n", tx);
3405 tx = (
void *)0xdeadbeef;
3408 ok(tx == (
void *)0xdeadbeef,
"Unexpected pointer %p.\n", tx);
3413 hr = tx->lpVtbl->GetFunction(tx, &
buffer);
3416 hr = tx->lpVtbl->GetFunction(tx, &buffer2);
3418 ok(buffer2 ==
buffer,
"Unexpected buffer object.\n");
3422 ok(
size == 224,
"Unexpected buffer size %lu.\n",
size);
3427 hr = tx->lpVtbl->GetConstantBuffer(tx, &
buffer);
3429 ok(
SUCCEEDED(
hr),
"Failed to get texture shader constant buffer.\n");
3434 ok(!
size,
"Unexpected buffer size %lu.\n",
size);
3439 hr = tx->lpVtbl->GetDesc(tx, &ctab_desc);
3441 ok(
hr ==
S_OK,
"Failed to get constant description, hr %#lx.\n",
hr);
3446 h = tx->lpVtbl->GetConstant(tx,
NULL, 0);
3447 ok(!
h,
"Unexpected handle %p.\n",
h);
3452 skip(
"Couldn't create application window.\n");
3453 IUnknown_Release(tx);
3459 skip(
"Couldn't create IDirect3D9 object.\n");
3461 IUnknown_Release(tx);
3472 skip(
"Failed to create IDirect3DDevice9 object, hr %#lx.\n",
hr);
3475 IUnknown_Release(tx);
3491 for (
y = 0;
y < 256; ++
y)
3493 for (
x = 0;
x < 256; ++
x)
3495 unsigned int expected = 0xff000000 |
x << 16 |
y << 8;
3509 skip(
"Cube textures not supported, skipping tests.\n");
3514 &cube_texture,
NULL);
3524 skip(
"Volume textures not supported, skipping test.\n");
3538 for (
z = 0;
z < 64; ++
z)
3540 for (
y = 0;
y < 64; ++
y)
3542 for (
x = 0;
x < 64; ++
x)
3544 unsigned int expected = 0xff000000 | ((
x * 4 + 2) << 16) | ((
y * 4 + 2) << 8) | (
z * 4 + 2);
3558 IUnknown_Release(tx);
3568 hr = tx->lpVtbl->GetConstantBuffer(tx, &
buffer);
3570 ok(
SUCCEEDED(
hr),
"Failed to get texture shader constant buffer.\n");
3573 skip(
"Texture shaders not supported, skipping further tests.\n");
3574 IUnknown_Release(tx);
3579 ok(
size == 176,
"Unexpected buffer size %lu.\n",
size);
3581 hr = tx->lpVtbl->GetDesc(tx, &ctab_desc);
3582 ok(
hr ==
S_OK,
"Failed to get constant description, hr %#lx.\n",
hr);
3585 h = tx->lpVtbl->GetConstant(tx,
NULL, 0);
3586 ok(!!
h,
"Unexpected handle %p.\n",
h);
3587 hr = tx->lpVtbl->GetConstantDesc(tx,
h, &const_desc, &
count);
3589 ok(!
strcmp(const_desc.
Name,
"b1"),
"Unexpected name %s.\n", const_desc.
Name);
3594 h = tx->lpVtbl->GetConstant(tx,
NULL, 1);
3595 ok(!!
h,
"Unexpected handle %p.\n",
h);
3596 hr = tx->lpVtbl->GetConstantDesc(tx,
h, &const_desc, &
count);
3598 ok(!
strcmp(const_desc.
Name,
"b2"),
"Unexpected name %s.\n", const_desc.
Name);
3603 h = tx->lpVtbl->GetConstant(tx,
NULL, 2);
3604 ok(!!
h,
"Unexpected handle %p.\n",
h);
3605 hr = tx->lpVtbl->GetConstantDesc(tx,
h, &const_desc, &
count);
3607 ok(!
strcmp(const_desc.
Name,
"f1"),
"Unexpected name %s.\n", const_desc.
Name);
3611 ok(const_desc.
Elements == 2,
"Unexpected elements count %u.\n", const_desc.
Elements);
3614 h2 = tx->lpVtbl->GetConstantElement(tx,
h, 0);
3615 ok(!!h2,
"Unexpected handle %p.\n",
h);
3616 hr = tx->lpVtbl->GetConstantDesc(tx, h2, &const_desc, &
count);
3618 ok(!
strcmp(const_desc.
Name,
"f1"),
"Unexpected name %s.\n", const_desc.
Name);
3622 ok(const_desc.
Elements == 1,
"Unexpected elements count %u.\n", const_desc.
Elements);
3624 h2 = tx->lpVtbl->GetConstantElement(tx,
h, 1);
3625 ok(!!h2,
"Unexpected handle %p.\n",
h);
3626 hr = tx->lpVtbl->GetConstantDesc(tx, h2, &const_desc, &
count);
3628 ok(!
strcmp(const_desc.
Name,
"f1"),
"Unexpected name %s.\n", const_desc.
Name);
3632 ok(const_desc.
Elements == 1,
"Unexpected elements count %u.\n", const_desc.
Elements);
3634 h2 = tx->lpVtbl->GetConstantElement(tx,
h, 2);
3635 ok(!h2,
"Unexpected handle %p.\n",
h);
3637 h = tx->lpVtbl->GetConstant(tx,
NULL, 3);
3638 ok(!!
h,
"Unexpected handle %p.\n",
h);
3639 hr = tx->lpVtbl->GetConstantDesc(tx,
h, &const_desc, &
count);
3641 ok(!
strcmp(const_desc.
Name,
"f2"),
"Unexpected name %s.\n", const_desc.
Name);
3647 h = tx->lpVtbl->GetConstant(tx,
NULL, 4);
3648 ok(!!
h,
"Unexpected handle %p.\n",
h);
3649 hr = tx->lpVtbl->GetConstantDesc(tx,
h, &const_desc, &
count);
3651 ok(!
strcmp(const_desc.
Name,
"s1"),
"Unexpected name %s.\n", const_desc.
Name);
3658 h2 = tx->lpVtbl->GetConstant(tx,
h, 0);
3659 ok(!!h2,
"Unexpected handle %p.\n",
h);
3660 hr = tx->lpVtbl->GetConstantDesc(tx, h2, &const_desc, &
count);
3662 ok(!
strcmp(const_desc.
Name,
"b3"),
"Unexpected name %s.\n", const_desc.
Name);
3666 ok(const_desc.
Elements == 1,
"Unexpected elements count %u.\n", const_desc.
Elements);
3668 h2 = tx->lpVtbl->GetConstant(tx,
h, 1);
3669 ok(!!h2,
"Unexpected handle %p.\n",
h);
3670 hr = tx->lpVtbl->GetConstantDesc(tx, h2, &const_desc, &
count);
3672 ok(!
strcmp(const_desc.
Name,
"f3"),
"Unexpected name %s.\n", const_desc.
Name);
3676 ok(const_desc.
Elements == 1,
"Unexpected elements count %u.\n", const_desc.
Elements);
3678 h2 = tx->lpVtbl->GetConstant(tx,
h, 10);
3679 ok(!h2,
"Unexpected handle %p.\n",
h);
3688 IUnknown_Release(tx);
3703 skip(
"Couldn't create application window\n");
3708 skip(
"Couldn't create IDirect3D9 object\n");
3718 skip(
"Failed to create IDirect3DDevice9 object %#lx\n",
hr);
3735 trace(
"DXTn texture support: 2D DXT1 %#x, 2D DXT3 %#x, 2D DXT5 %#x, cube DXT5 %#x, 3D dxt3 %#x.\n",
3755 ok(!
ref,
"Device has %lu references left.\n",
ref);
#define D3DERR_INVALIDCALL
#define D3DUSAGE_NPATCHES
enum _D3DRESOURCETYPE D3DRESOURCETYPE
#define D3DUSAGE_DONOTCLIP
#define D3DUSAGE_WRITEONLY
#define D3DUSAGE_RENDERTARGET
enum _D3DFORMAT D3DFORMAT
#define D3DUSAGE_RTPATCHES
#define D3DUSAGE_DEPTHSTENCIL
enum _D3DMULTISAMPLE_TYPE D3DMULTISAMPLE_TYPE
IDirect3D9 *WINAPI Direct3DCreate9(UINT SDKVersion)
#define IDirect3DTexture9_GetLevelDesc(p, a, b)
#define IDirect3DCubeTexture9_UnlockRect(p, a, b)
#define IDirect3DVolumeTexture9_GetLevelDesc(p, a, b)
#define IDirect3DTexture9_GetSurfaceLevel(p, a, b)
#define IDirect3DVolumeTexture9_Release(p)
#define IDirect3DTexture9_GetType(p)
#define IDirect3DSurface9_LockRect(p, a, b, c)
#define IDirect3DDevice9_GetDirect3D(p, a)
#define IDirect3D9_CreateDevice(p, a, b, c, d, e, f)
#define IDirect3DTexture9_UnlockRect(p, a)
#define IDirect3DDevice9_StretchRect(p, a, b, c, d, e)
#define IDirect3DTexture9_GetLevelCount(p)
#define IDirect3DDevice9_CreateTexture(p, a, b, c, d, e, f, g, h)
#define IDirect3DDevice9_GetCreationParameters(p, a)
#define IDirect3DCubeTexture9_Release(p)
#define IDirect3DCubeTexture9_LockRect(p, a, b, c, d, e)
#define IDirect3DDevice9_GetDeviceCaps(p, a)
#define IDirect3DVolumeTexture9_GetLevelCount(p)
#define IDirect3DCubeTexture9_GetLevelCount(p)
#define IDirect3DBaseTexture9_GetLevelCount(p)
#define IDirect3DCubeTexture9_GetLevelDesc(p, a, b)
#define IDirect3DDevice9_CreateCubeTexture(p, a, b, c, d, e, f, g)
#define IDirect3DDevice9_CreateVolumeTexture(p, a, b, c, d, e, f, g, h, i)
#define IDirect3D9_Release(p)
#define IDirect3DVolumeTexture9_LockBox(p, a, b, c, d)
#define IDirect3DSurface9_GetDesc(p, a)
#define IDirect3DDevice9_Release(p)
#define IDirect3DTexture9_LockRect(p, a, b, c, d)
#define IDirect3D9_CheckDeviceFormat(p, a, b, c, d, e, f)
#define IDirect3DSurface9_UnlockRect(p)
#define IDirect3DSurface9_Release(p)
#define IDirect3DVolumeTexture9_UnlockBox(p, a)
#define IDirect3DCubeTexture9_GetCubeMapSurface(p, a, b, c)
#define IDirect3DTexture9_Release(p)
#define IDirect3DDevice9_GetDisplayMode(p, a, b)
#define IDirect3DDevice9_CreateRenderTarget(p, a, b, c, d, e, f, g, h)
#define IDirect3DDevice9_CreateOffscreenPlainSurface(p, a, b, c, d, e, f)
#define D3DUSAGE_AUTOGENMIPMAP
#define D3DXERR_INVALIDDATA
struct ID3DXBuffer ID3DXBuffer
static const uint8_t dds_16bit[]
#define check_volume_readback_pixel_4bpp(rb, x, y, z, color, todo)
static const uint8_t dds_cube_map_4_4[]
static const uint8_t dds_cube_map_2_4[]
static const uint8_t bmp_32bpp_4_4_argb[]
#define check_image_info(info, width, height, depth, mip_levels, format, resource_type, image_file_format, wine_todo)
static const uint8_t dds_24bit_8_8[]
static const uint8_t dds_volume_24bit_4_4_4[]
#define get_texture_volume_readback(device, volume_tex, mip_level, rb)
static const uint8_t png_2_2_64bpp_rgba[]
static const uint8_t jpg_rgb_2_2[]
static const uint8_t dds_cube_map_4_2[]
static const uint8_t dds_24bit[]
static const uint8_t png_2_2_48bpp_rgb[]
static const uint8_t dds_cube_map[]
static const struct @1911 test_filter_values[]
static const uint8_t dds_dxt5_8_8[]
static const uint8_t dds_volume_map[]
static const uint8_t png_grayscale[]
#define release_volume_readback(rb)
static const uint8_t dds_volume_dxt3_4_4_4[]
static const uint8_t dds_dxt5[]
FLOAT *WINAPI D3DXFloat16To32Array(FLOAT *pout, const D3DXFLOAT16 *pin, UINT n)
HRESULT WINAPI D3DXFillCubeTextureTX(struct IDirect3DCubeTexture9 *cube, ID3DXTextureShader *texture_shader)
HRESULT WINAPI D3DXFillTextureTX(struct IDirect3DTexture9 *texture, ID3DXTextureShader *texture_shader)
HRESULT WINAPI D3DXCreateTextureShader(const DWORD *function, ID3DXTextureShader **texture_shader)
HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, const void *src_memory, D3DFORMAT src_format, UINT src_pitch, const PALETTEENTRY *src_palette, const RECT *src_rect, DWORD filter, D3DCOLOR color_key)
HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize, D3DXIMAGE_INFO *info)
HRESULT WINAPI D3DXLoadSurfaceFromSurface(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect, DWORD filter, D3DCOLOR color_key)
HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface, const PALETTEENTRY *pDestPalette, const RECT *pDestRect, const void *pSrcData, UINT SrcDataSize, const RECT *pSrcRect, DWORD dwFilter, D3DCOLOR Colorkey, D3DXIMAGE_INFO *pSrcInfo)
static float get_cube_coord(enum cube_coord coord, unsigned int x, unsigned int y, unsigned int size)
HRESULT WINAPI D3DXCreateTextureFromResourceA(struct IDirect3DDevice9 *device, HMODULE srcmodule, const char *resource, struct IDirect3DTexture9 **texture)
HRESULT WINAPI D3DXCheckCubeTextureRequirements(struct IDirect3DDevice9 *device, UINT *size, UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool)
HRESULT WINAPI D3DXCreateCubeTextureFromFileInMemoryEx(IDirect3DDevice9 *device, const void *src_data, UINT src_data_size, UINT size, UINT mip_levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mip_filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info, PALETTEENTRY *palette, IDirect3DCubeTexture9 **cube_texture)
HRESULT WINAPI D3DXFillTexture(struct IDirect3DTexture9 *texture, LPD3DXFILL2D function, void *funcdata)
HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_FILEFORMAT file_format, IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette)
HRESULT WINAPI D3DXCreateVolumeTextureFromFileInMemory(IDirect3DDevice9 *device, const void *data, UINT data_size, IDirect3DVolumeTexture9 **volume_texture)
HRESULT WINAPI D3DXFillVolumeTextureTX(struct IDirect3DVolumeTexture9 *texture, ID3DXTextureShader *texture_shader)
HRESULT WINAPI D3DXCreateTexture(struct IDirect3DDevice9 *device, UINT width, UINT height, UINT miplevels, DWORD usage, D3DFORMAT format, D3DPOOL pool, struct IDirect3DTexture9 **texture)
HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *device, const void *srcdata, UINT srcdatasize, UINT width, UINT height, UINT miplevels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo, PALETTEENTRY *palette, struct IDirect3DTexture9 **texture)
HRESULT WINAPI D3DXFilterTexture(IDirect3DBaseTexture9 *texture, const PALETTEENTRY *palette, UINT srclevel, DWORD filter)
HRESULT WINAPI D3DXCreateTextureFromResourceExA(struct IDirect3DDevice9 *device, HMODULE srcmodule, const char *resource, UINT width, UINT height, UINT miplevels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo, PALETTEENTRY *palette, struct IDirect3DTexture9 **texture)
HRESULT WINAPI D3DXCreateVolumeTextureFromFileInMemoryEx(IDirect3DDevice9 *device, const void *data, UINT data_size, UINT width, UINT height, UINT depth, UINT mip_levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mip_filter, D3DCOLOR color_key, D3DXIMAGE_INFO *info, PALETTEENTRY *palette, IDirect3DVolumeTexture9 **volume_texture)
HRESULT WINAPI D3DXCheckVolumeTextureRequirements(struct IDirect3DDevice9 *device, UINT *width, UINT *height, UINT *depth, UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool)
HRESULT WINAPI D3DXFillVolumeTexture(struct IDirect3DVolumeTexture9 *texture, LPD3DXFILL3D function, void *funcdata)
HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UINT *width, UINT *height, UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool)
HRESULT WINAPI D3DXCreateTextureFromFileInMemory(struct IDirect3DDevice9 *device, const void *srcdata, UINT srcdatasize, struct IDirect3DTexture9 **texture)
HRESULT WINAPI D3DXCreateCubeTextureFromFileInMemory(struct IDirect3DDevice9 *device, const void *data, UINT datasize, struct IDirect3DCubeTexture9 **texture)
HRESULT WINAPI D3DXFillCubeTexture(struct IDirect3DCubeTexture9 *texture, LPD3DXFILL3D function, void *funcdata)
static void cleanup(void)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP double __cdecl fabs(double)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
#define D3DPTEXTURECAPS_CUBEMAP_POW2
#define D3DPTEXTURECAPS_VOLUMEMAP
#define D3DPTEXTURECAPS_VOLUMEMAP_POW2
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL
#define D3DPTEXTURECAPS_CUBEMAP
#define D3DPTEXTURECAPS_MIPCUBEMAP
#define D3DPTEXTURECAPS_POW2
#define D3DPTEXTURECAPS_MIPVOLUMEMAP
#define D3DCAPS2_CANAUTOGENMIPMAP
#define ID3DXBuffer_GetBufferSize(p)
#define ID3DXBuffer_GetBufferPointer(p)
#define ID3DXBuffer_Release(p)
#define D3DX_SKIP_DDS_MIP_LEVELS(l, f)
void(WINAPI * LPD3DXFILL3D)(D3DXVECTOR4 *out, const D3DXVECTOR3 *texcoord, const D3DXVECTOR3 *texelsize, void *data)
#define D3DX_FILTER_POINT
#define D3DX_SKIP_DDS_MIP_LEVELS_SHIFT
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei width
GLenum GLuint GLint GLenum face
GLenum const GLfloat * params
GLsizeiptr const GLvoid GLenum usage
GLfloat GLfloat GLfloat GLfloat h
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
#define todo_wine_if(is_todo)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
static CRYPT_DATA_BLOB b3[]
static CRYPT_DATA_BLOB b2[]
static CRYPT_DATA_BLOB b1[]
D3D11_SHADER_VARIABLE_DESC desc
#define relative_error(exp, out)
#define IDD_BITMAPDATA_1x1
static const DWORD shader_invalid[]
static const DWORD shader_empty[]
static const DWORD shader_zero[]
#define check_volume_texture_level_desc(tex, level, format, usage, pool, width, height, depth, wine_todo)
static void get_cube_texture_surface_readback(IDirect3DDevice9 *device, IDirect3DCubeTexture9 *texture, uint32_t face, uint32_t mip_level, struct surface_readback *rb)
static void test_D3DXSaveTextureToFileInMemory(IDirect3DDevice9 *device)
static void WINAPI fillfunc(D3DXVECTOR4 *value, const D3DXVECTOR2 *texcoord, const D3DXVECTOR2 *texelsize, void *data)
#define check_readback_pixel_4bpp(rb, x, y, color, todo)
static void test_D3DXCheckCubeTextureRequirements(IDirect3DDevice9 *device)
static void compare_cube_texture_(IDirect3DCubeTexture9 *texture, LPD3DXFILL3D func, BYTE diff, unsigned int line)
static DWORD get_expected_argb_color(D3DFORMAT format, const D3DXVECTOR4 *v)
static void test_D3DXCreateCubeTextureFromFileInMemory(IDirect3DDevice9 *device)
static void test_D3DXCheckTextureRequirements(IDirect3DDevice9 *device)
static void WINAPI fill_cube_positive_x(D3DXVECTOR4 *out, const D3DXVECTOR3 *tex_coord, const D3DXVECTOR3 *texel_size, void *data)
static void test_D3DXCreateVolumeTextureFromFileInMemory(IDirect3DDevice9 *device)
static BYTE get_s8_clipped(float v)
static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff)
static void test_D3DXCreateTexture(IDirect3DDevice9 *device)
static void expect_vec4_(unsigned int line, const D3DXVECTOR4 *expected, const D3DXVECTOR4 *got)
static void check_texture_level_desc_(uint32_t line, IDirect3DTexture9 *tex, uint32_t level, D3DFORMAT format, uint32_t usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multi_sample_type, uint32_t multi_sample_quality, uint32_t width, uint32_t height, BOOL wine_todo)
static void check_surface_desc(uint32_t line, D3DFORMAT format, uint32_t usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multi_sample_type, uint32_t multi_sample_quality, uint32_t width, uint32_t height, const D3DSURFACE_DESC *desc, BOOL wine_todo)
static void check_cube_texture_level_desc_(uint32_t line, IDirect3DCubeTexture9 *tex, uint32_t level, D3DFORMAT format, uint32_t usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multi_sample_type, uint32_t multi_sample_quality, uint32_t size, BOOL wine_todo)
static BOOL is_autogenmipmap_supported(IDirect3DDevice9 *device, D3DRESOURCETYPE resource_type)
#define check_texture_level_desc(tex, level, format, usage, pool, multi_sample_type, multi_sample_quality, width, height, wine_todo)
static void check_texture_mip_levels_(uint32_t line, IDirect3DBaseTexture9 *tex, uint32_t expected_mip_levels, BOOL wine_todo)
static void release_surface_readback(struct surface_readback *rb)
static void test_D3DXCreateVolumeTextureFromFileInMemoryEx(IDirect3DDevice9 *device)
static void WINAPI fillfunc_cube(D3DXVECTOR4 *value, const D3DXVECTOR3 *texcoord, const D3DXVECTOR3 *texelsize, void *data)
static void WINAPI fillfunc_volume(D3DXVECTOR4 *value, const D3DXVECTOR3 *texcoord, const D3DXVECTOR3 *texelsize, void *data)
static uint32_t get_readback_color(struct surface_readback *rb, uint32_t x, uint32_t y)
static void get_texture_surface_readback(IDirect3DDevice9 *device, IDirect3DTexture9 *texture, uint32_t mip_level, struct surface_readback *rb)
static BOOL compare_color(DWORD c1, DWORD c2, BYTE max_diff)
#define compare_cube_texture(t, f, d)
static void _check_readback_pixel_4bpp(uint32_t line, struct surface_readback *rb, uint32_t x, uint32_t y, uint32_t expected_color, BOOL todo)
#define expect_vec4(expected, got)
static void test_D3DXFilterTexture(IDirect3DDevice9 *device)
#define check_cube_texture_level_desc(tex, level, format, usage, pool, multi_sample_type, multi_sample_quality, size, wine_todo)
static void test_D3DXCreateTextureFromFileInMemoryEx(IDirect3DDevice9 *device)
static void test_D3DXCheckVolumeTextureRequirements(IDirect3DDevice9 *device)
#define check_texture_mip_levels(tex, expected_mip_levels, wine_todo)
static void test_texture_shader(void)
static void test_D3DXCreateTextureFromFileInMemory(IDirect3DDevice9 *device)
static void test_D3DXFillCubeTexture(IDirect3DDevice9 *device)
static void check_volume_texture_level_desc_(uint32_t line, IDirect3DVolumeTexture9 *tex, uint32_t level, D3DFORMAT format, uint32_t usage, D3DPOOL pool, uint32_t width, uint32_t height, uint32_t depth, BOOL wine_todo)
static BOOL color_match(const DWORD *value, const DWORD *expected)
static void test_D3DXCreateCubeTextureFromFileInMemoryEx(IDirect3DDevice9 *device)
static void test_D3DXFillVolumeTexture(IDirect3DDevice9 *device)
static void WINAPI fillfunc_cube_coord(D3DXVECTOR4 *value, const D3DXVECTOR3 *texcoord, const D3DXVECTOR3 *texelsize, void *data)
static DWORD get_argb_color(D3DFORMAT format, DWORD x, DWORD y, const D3DLOCKED_RECT *lock_rect)
static void test_D3DXFillTexture(IDirect3DDevice9 *device)
static void get_surface_readback(IDirect3DDevice9 *device, IDirect3DSurface9 *surface, struct surface_readback *rb)
static float(__cdecl *square_half_float)(float x
#define WS_OVERLAPPEDWINDOW
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
#define MAKEINTRESOURCEA(i)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
for(i=0;i< sizeof(testsuite)/sizeof(testsuite[0]);++i) ok(call_test(testsuite[i].func)
#define D3DADAPTER_DEFAULT
#define D3DERR_NOTAVAILABLE
#define D3DCREATE_SOFTWARE_VERTEXPROCESSING
wchar_t const *const size_t const buffer_size
D3DXPARAMETER_CLASS Class
D3DXREGISTER_SET RegisterSet
D3DLOCKED_RECT locked_rect
IDirect3DSurface9 * surface
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out