320x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x08,0x00,0x02,0x00,0x00,0x00,
330x02,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
340x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
350x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
360x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
370x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,
380xe0,0x03,0x00,0x00,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,
390x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
400xff,0x7f,0xff,0x7f,0xff,0x7f,0xff,0x7f
450x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x0a,0x00,0x02,0x00,0x00,0x00,
460x02,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
470x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
480x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
490x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
500x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0xff,0x00,
510x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x40,0x00,
520x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
530xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
580x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x08,0x00,0x04,0x00,0x00,0x00,
590x04,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
600x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
610x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
620x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
630x04,0x00,0x00,0x00,0x44,0x58,0x54,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
640x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x00,
650x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
660xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50,
670xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x51,
680xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x52,
690xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x53,
700xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x54,
710xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x55
760x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x8a,0x00,0x04,0x00,0x00,0x00,
770x04,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
780x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
790x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
800x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
810x04,0x00,0x00,0x00,0x44,0x58,0x54,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
820x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x40,0x00,
830x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
840xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50,
850xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50,
860xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x2f,0x7e,0xcf,0x79,0x01,0x54,0x5c,0x5c,
870x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x84,0xef,0x7b,0xaa,0xab,0xab,0xab
93 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x08,0x00,0x02,0x00,0x00,0x00,
94 0x04,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
95 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
96 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
97 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
98 0x04,0x00,0x00,0x00,0x44,0x58,0x54,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
99 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x00,
100 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
101 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50,
106 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x08,0x00,0x08,0x00,0x00,0x00,
107 0x08,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
108 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
109 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
110 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
111 0x04,0x00,0x00,0x00,0x44,0x58,0x54,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
112 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x00,
113 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
114 0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x00,0xe0,0x07,0x05,0x05,0x50,0x50,
115 0x3f,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0x07,0x05,0x05,0x50,0x50,
116 0x7f,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xf8,0xe0,0xff,0x05,0x05,0x50,0x50,
117 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x05,0x05,0x50,0x50,
122 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49,
123 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00,
124 0x00, 0x00, 0x00, 0x3a, 0x7e, 0x9b, 0x55, 0x00, 0x00, 0x00, 0x0a, 0x49, 0x44,
125 0x41, 0x54, 0x08, 0xd7, 0x63, 0xf8, 0x0f, 0x00, 0x01, 0x01, 0x01, 0x00, 0x1b,
126 0xb6, 0xee, 0x56, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
130#define ADMITTED_ERROR 0.0001f
137#define expect_vec4(expected, got) expect_vec4_(__LINE__, expected, got)
144 "Expected (%f, %f, %f, %f), got (%f, %f, %f, %f)\n",
146 got->
x, got->
y, got->
z, got->
w);
151 unsigned int diff =
x >
y ?
x -
y :
y -
x;
153 return diff <= max_diff;
159 &&
compare_uint((c1 >> 8) & 0xff, (c2 >> 8) & 0xff, max_diff)
160 &&
compare_uint((c1 >> 16) & 0xff, (c2 >> 16) & 0xff, max_diff)
161 &&
compare_uint((c1 >> 24) & 0xff, (c2 >> 24) & 0xff, max_diff);
201 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
204 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
212 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
213 ok(
width == 256,
"Returned width %d, expected %d\n",
width, 256);
214 ok(
height == 256,
"Returned height %d, expected %d\n",
height, 256);
218 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
219 ok(
width == 256,
"Returned width %d, expected %d\n",
width, 256);
222 skip(
"Hardware only supports pow2 textures\n");
227 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
228 ok(
width == 62,
"Returned width %d, expected %d\n",
width, 62);
232 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
234 ok(
height == 63,
"Returned height %d, expected %d\n",
height, 63);
239 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
240 ok(
width == 1,
"Returned width %d, expected %d\n",
width, 1);
245 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
246 ok(
width == 1,
"Returned width %d, expected %d\n",
width, 1);
251 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
252 ok(
width == 1,
"Returned width %d, expected %d\n",
width, 1);
256 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
261 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
271 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
272 ok(mipmaps == 7,
"Returned mipmaps %d, expected %d\n", mipmaps, 7);
279 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
280 ok(mipmaps == 9,
"Returned mipmaps %d, expected %d\n", mipmaps, 9);
285 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
286 ok(mipmaps == 6,
"Returned mipmaps %d, expected %d\n", mipmaps, 6);
289 skip(
"Skipping some tests, npot2 textures unsupported\n");
293 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
294 ok(mipmaps == 9,
"Returned mipmaps %d, expected %d\n", mipmaps, 9);
298 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
299 ok(mipmaps == 9,
"Returned mipmaps %d, expected %d\n", mipmaps, 9);
306 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
307 ok(mipmaps == 0,
"Returned mipmaps %d, expected %d\n", mipmaps, 0);
310 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
311 ok(mipmaps == 1,
"Returned mipmaps %d, expected %d\n", mipmaps, 1);
314 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
315 ok(mipmaps == 0,
"Returned mipmaps %d, expected %d\n", mipmaps, 0);
318 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
319 ok(mipmaps == 0,
"Returned mipmaps %d, expected %d\n", mipmaps, 0);
322 skip(
"No D3DUSAGE_AUTOGENMIPMAP support for textures\n");
338 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
342 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
347 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
352 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
373 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
384 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
395 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
406 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
417 ok(
hr ==
D3D_OK,
"D3DXCheckTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
426 ok(mipmaps == 1,
"Got unexpected level count %u.\n", mipmaps);
444 ok(mipmaps == 1,
"Got unexpected level count %u.\n", mipmaps);
457 ok(mipmaps == 1,
"Got unexpected level count %u.\n", mipmaps);
471 ok(mipmaps == 1,
"Got unexpected level count %u.\n", mipmaps);
497 skip(
"No cube textures support\n");
503 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
506 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
514 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
515 ok(
size == 256,
"Returned size %d, expected %d\n",
size, 256);
521 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
522 ok(mipmaps == 7,
"Returned mipmaps %d, expected %d\n", mipmaps, 7);
529 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
537 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
542 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
543 ok(mipmaps == 9,
"Returned mipmaps %d, expected %d\n", mipmaps, 9);
549 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
550 ok(mipmaps == 0,
"Returned mipmaps %d, expected %d\n", mipmaps, 0);
553 skip(
"No D3DUSAGE_AUTOGENMIPMAP support for cube textures\n");
569 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
573 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
578 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
583 ok(
hr ==
D3D_OK,
"D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
598 skip(
"Limited or no volume textures support.\n");
604 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
607 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
615 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
616 ok(
width == 256,
"Returned width %d, expected %d\n",
width, 256);
617 ok(
height == 256,
"Returned height %d, expected %d\n",
height, 256);
618 ok(
depth == 1,
"Returned depth %d, expected %d\n",
depth, 1);
622 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
623 ok(
width == 256,
"Returned width %d, expected %d\n",
width, 256);
627 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
628 ok(
width == 1,
"Returned width %d, expected %d\n",
width, 1);
630 ok(
depth == 1,
"Returned height %d, expected %d\n",
depth, 1);
634 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
635 ok(
width == 1,
"Returned width %d, expected %d\n",
width, 1);
637 ok(
depth == 1,
"Returned height %d, expected %d\n",
depth, 1);
641 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
642 ok(
width == 1,
"Returned width %d, expected %d\n",
width, 1);
646 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
651 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
655 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
660 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
665 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
670 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
679 skip(
"No volume textures mipmapping support\n");
686 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
687 ok(mipmaps == 7,
"Returned mipmaps %d, expected %d\n", mipmaps, 7);
695 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
700 ok(
hr ==
D3D_OK,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n",
hr,
D3D_OK);
701 ok(mipmaps == 9,
"Returned mipmaps %d, expected %d\n", mipmaps, 9);
705 "D3DUSAGE_AUTOGENMIPMAP is unexpectedly supported on volume textures.\n");
732 ok(
desc.Width == 256,
"Returned width %d, expected %d\n",
desc.Width, 256);
733 ok(
desc.Height == 256,
"Returned height %d, expected %d\n",
desc.Height, 256);
748 ok(
desc.Width == 1,
"Returned width %d, expected %d\n",
desc.Width, 1);
749 ok(
desc.Height == 1,
"Returned height %d, expected %d\n",
desc.Height, 1);
756 skip(
"Hardware only supports pow2 textures\n");
763 "D3DXCreateTexture returned %#x, expected %#x\n",
hr,
D3D_OK);
776 "Returned width %d, expected %d\n",
desc.Width, 63);
780 "Returned height %d, expected %d\n",
desc.Height, 63);
794 ok(mipmaps == 7,
"Returned mipmaps %d, expected %d\n", mipmaps, 7);
806 ok(mipmaps == 9,
"Returned mipmaps %d, expected %d\n", mipmaps, 9);
818 ok(mipmaps == 1,
"Returned mipmaps %d, expected %d\n", mipmaps, 1);
830 ok(mipmaps == 1,
"Returned mipmaps %d, expected %d\n", mipmaps, 1);
877 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromResource returned %#x, expected %#x\n",
hr,
D3D_OK);
881 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromResource returned %#x, expected %#x\n",
hr,
D3D_OK);
898 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);
899 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromResourceEx returned %#x, expected %#x\n",
hr,
D3D_OK);
902 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);
905 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);
908 hr =
D3DXCreateTextureFromResourceExA(
device,
NULL,
NULL,
D3DX_DEFAULT,
D3DX_DEFAULT,
D3DX_DEFAULT, 0,
D3DFMT_UNKNOWN,
D3DPOOL_MANAGED,
D3DX_DEFAULT,
D3DX_DEFAULT, 0,
NULL,
NULL, &
texture);
911 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);
917 IDirect3DTexture9 *tex;
918 IDirect3DCubeTexture9 *cubetex;
919 IDirect3DVolumeTexture9 *voltex;
941 skip(
"Failed to create texture\n");
956 skip(
"Failed to create texture\n");
967 skip(
"Failed to create texture\n");
977 skip(
"Failed to create texture\n");
987 skip(
"Failed to create texture\n");
1005 skip(
"Failed to create texture\n");
1031 skip(
"Failed to create volume texture\n");
1036 skip(
"No D3DUSAGE_AUTOGENMIPMAP supported for textures\n");
1048 skip(
"Failed to create texture\n");
1058 skip(
"Failed to create texture\n");
1065 for (
i = 0;
i < 4;
i++)
1068 if (diff > 1)
return FALSE;
1089 test_access_types[] =
1096 IDirect3DTexture9 *tex;
1114 for (
m = 0;
m < 3;
m++)
1116 IDirect3DSurface9 *src_surface, *temp_surface;
1120 temp_surface = src_surface;
1139 v[0] = (
value >> 24) & 0xff;
1140 v[1] = (
value >> 16) & 0xff;
1141 v[2] = (
value >> 8) & 0xff;
1145 e[1] = (
x + 0.5f) /
size * 255.0f + 0.5f;
1146 e[2] = (
y + 0.5f) /
size * 255.0f + 0.5f;
1147 e[3] = 255.0f /
size + 0.5f;
1151 "Texel at (%u, %u) doesn't match: %#x, expected %#x, i %u, m %u.\n",
1156 if (temp_surface != src_surface)
1191 ok(
hr ==
D3D_OK,
"Couldn't lock the texture, error %#x\n",
hr);
1195 for (
y = 0;
y < 4;
y++)
1197 for (
x = 0;
x < 4;
x++)
1201 v[1] =
value >> 10 & 0x1f;
1202 v[2] =
value >> 5 & 0x1f;
1206 e[1] = (
x + 0.5f) / 4.0f * 31.0f + 0.5f;
1207 e[2] = (
y + 0.5f) / 4.0f * 31.0f + 0.5f;
1212 "Texel at (%u, %u) doesn't match: %#x, expected %#x\n",
1222 skip(
"Failed to create texture\n");
1237 for (
y = 0;
y < 4;
y++)
1259 skip(
"Failed to lock texture\n");
1264 skip(
"Failed to create D3DFMT_A16B16G16R16F texture\n");
1278 for (
y = 0;
y < 4;
y++)
1280 float *
ptr = (
float *)lock_rect.
pBits +
y * pitch;
1302 skip(
"Failed to lock texture\n");
1307 skip(
"Failed to create D3DFMT_A32B32G32R32F texture\n");
1321 skip(
"Failed to create D3DFMT_DXT1 texture\n");
1327 value->x = (texcoord->
x + 1.0f) / 2.0f;
1328 value->y = (texcoord->
y + 1.0f) / 2.0f;
1329 value->z = (texcoord->
z + 1.0f) / 2.0f;
1350 return size -
x - 0.5f;
1354 return size -
y - 0.5f;
1360 trace(
"Unexpected coordinate value\n");
1367 IDirect3DCubeTexture9 *tex;
1392 for (
m = 0;
m < 3;
m++)
1394 for (
f = 0;
f < 6;
f++)
1397 ok(
hr ==
D3D_OK,
"Couldn't lock the texture, error %#x\n",
hr);
1406 v[0] = (
value >> 24) & 0xff;
1407 v[1] = (
value >> 16) & 0xff;
1408 v[2] = (
value >> 8) & 0xff;
1411 e[0] = (
f == 0) || (
f == 1) ?
1412 0 : (
BYTE)(255.0f /
size * 2.0f + 0.5f);
1419 "Texel at face %u (%u, %u) doesn't match: %#x, expected %#x\n",
1432 skip(
"Failed to create texture\n");
1441 for (
f = 0;
f < 6;
f++)
1444 ok(
hr ==
D3D_OK,
"Couldn't lock the texture, error %#x\n",
hr);
1448 for (
y = 0;
y < 4;
y++)
1450 for (
x = 0;
x < 4;
x++)
1454 v[1] =
value >> 10 & 0x1f;
1455 v[2] =
value >> 5 & 0x1f;
1458 e[0] = (
f == 0) || (
f == 1) ?
1459 0 : (
BYTE)(1.0f /
size * 2.0f + 0.5f);
1466 "Texel at face %u (%u, %u) doesn't match: %#x, expected %#x\n",
1477 skip(
"Failed to create texture\n");
1491 IDirect3DVolumeTexture9 *tex;
1513 for (
m = 0;
m < 3;
m++)
1516 ok(
hr ==
D3D_OK,
"Couldn't lock the texture, error %#x\n",
hr);
1528 v[0] = (
value >> 24) & 0xff;
1529 v[1] = (
value >> 16) & 0xff;
1530 v[2] = (
value >> 8) & 0xff;
1533 e[0] = 255.0f /
size + 0.5f;
1534 e[1] = (
x + 0.5f) /
size * 255.0f + 0.5f;
1535 e[2] = (
y + 0.5f) /
size * 255.0f + 0.5f;
1536 e[3] = (
z + 0.5f) /
size * 255.0f + 0.5f;
1540 "Texel at (%u, %u, %u) doesn't match: %#x, expected %#x\n",
1553 skip(
"Failed to create texture\n");
1563 ok(
hr ==
D3D_OK,
"Couldn't lock the texture, error %#x\n",
hr);
1568 for (
z = 0;
z < 4;
z++)
1570 for (
y = 0;
y < 4;
y++)
1572 for (
x = 0;
x < 4;
x++)
1576 v[1] =
value >> 10 & 0x1f;
1577 v[2] =
value >> 5 & 0x1f;
1581 e[1] = (
x + 0.5f) / 4 * 31.0f + 0.5f;
1582 e[2] = (
y + 0.5f) / 4 * 31.0f + 0.5f;
1583 e[3] = (
z + 0.5f) / 4 * 31.0f + 0.5f;
1587 "Texel at (%u, %u, %u) doesn't match: %#x, expected %#x\n",
1598 skip(
"Failed to create texture\n");
1603 static const DWORD dds_dxt5_expected[] =
1605 0xff7b207b, 0xff7b207b, 0xff84df7b, 0xff84df7b,
1606 0xff7b207b, 0xff7b207b, 0xff84df7b, 0xff84df7b,
1607 0xff7b207b, 0xff7b207b, 0xff84df7b, 0xff84df7b,
1608 0xff7b207b, 0xff7b207b, 0xff84df7b, 0xff84df7b,
1610 static const DWORD dds_dxt5_8_8_expected[] =
1612 0x0000ff00, 0x0000ff00, 0x000000ff, 0x000000ff, 0x3f00ffff, 0x3f00ffff, 0x3fff0000, 0x3fff0000,
1613 0x0000ff00, 0x0000ff00, 0x000000ff, 0x000000ff, 0x3f00ffff, 0x3f00ffff, 0x3fff0000, 0x3fff0000,
1614 0x000000ff, 0x000000ff, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x3f00ffff, 0x3f00ffff,
1615 0x000000ff, 0x000000ff, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x3f00ffff, 0x3f00ffff,
1616 0x7fffff00, 0x7fffff00, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
1617 0x7fffff00, 0x7fffff00, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
1618 0x7fff00ff, 0x7fff00ff, 0x7fffff00, 0x7fffff00, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000,
1619 0x7fff00ff, 0x7fff00ff, 0x7fffff00, 0x7fffff00, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000,
1621 static const DWORD dds_dxt5_8_8_expected_misaligned_1[] =
1623 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x3fff0000, 0x3fff0000,
1624 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x3fff0000, 0x3fff0000,
1625 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x3fff0000, 0x3fff0000,
1626 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x3fff0000, 0x3fff0000,
1627 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
1628 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
1629 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
1630 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
1632 static const DWORD dds_dxt5_8_8_expected_misaligned_3[] =
1634 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1635 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1636 0x00000000, 0x00000000, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x00000000, 0x00000000,
1637 0x00000000, 0x00000000, 0x0000ff00, 0x0000ff00, 0x3fff0000, 0x3fff0000, 0x00000000, 0x00000000,
1638 0x00000000, 0x00000000, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0x00000000, 0x00000000,
1639 0x00000000, 0x00000000, 0x7fff00ff, 0x7fff00ff, 0xff000000, 0xff000000, 0x00000000, 0x00000000,
1640 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1641 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1643 IDirect3DSurface9 *surface, *uncompressed_surface;
1648 unsigned int i,
x,
y;
1654 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
1658 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
1666 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemory returned %#x, expected %#x.\n",
hr,
D3D_OK);
1670 ok(
hr ==
D3D_OK,
"IDirect3DTexture9_GetLevelDesc returned %#x, expected %#x.\n",
hr,
D3D_OK);
1671 ok(
desc.Width == 4,
"Width is %u, expected 4.\n",
desc.Width);
1672 ok(
desc.Height == 4,
"Height is %u, expected 4.\n",
desc.Height);
1677 ok(
hr ==
D3D_OK,
"IDirect3DTexture9_LockRect returned %#x, expected %#x\n",
hr,
D3D_OK);
1680 for (
i = 0;
i < 16;
i++)
1682 "Byte at index %u is 0x%02x, expected 0x%02x.\n",
1690 skip(
"D3DFMT_DXT5 textures are not supported, skipping a test.\n");
1703 ok(
desc.Width == 4,
"Got unexpected width %u.\n",
desc.Width);
1704 ok(
desc.Height == 4,
"Got unexpected height %u.\n",
desc.Height);
1714 for (
y = 0;
y < 4; ++
y)
1716 for (
x = 0;
x < 4; ++
x)
1722 dds_dxt5_expected[
y * 4 +
x], 32),
1723 "Color at position %u, %u is 0x%08x, expected 0x%08x.\n",
1725 dds_dxt5_expected[
y * 4 +
x]);
1744 ok(
desc.Width == 8,
"Got unexpected width %u.\n",
desc.Width);
1745 ok(
desc.Height == 8,
"Got unexpected height %u.\n",
desc.Height);
1757 for (
y = 0;
y < 8; ++
y)
1759 for (
x = 0;
x < 8; ++
x)
1762 dds_dxt5_8_8_expected[
y * 8 +
x], 0),
1763 "Color at position %u, %u is 0x%08x, expected 0x%08x.\n",
1765 dds_dxt5_8_8_expected[
y * 8 +
x]);
1774 for (
y = 0;
y < 2; ++
y)
1788 for (
y = 0;
y < 8; ++
y)
1790 for (
x = 0;
x < 8; ++
x)
1793 dds_dxt5_8_8_expected_misaligned_1[
y * 8 +
x], 0),
1794 "Color at position %u, %u is 0x%08x, expected 0x%08x.\n",
1796 dds_dxt5_8_8_expected_misaligned_1[
y * 8 +
x]);
1804 for (
y = 0;
y < 2; ++
y)
1821 for (
y = 0;
y < 8; ++
y)
1823 for (
x = 0;
x < 8; ++
x)
1826 dds_dxt5_8_8_expected_misaligned_3[
y * 8 +
x], 0),
1827 "Color at position %u, %u is 0x%08x, expected 0x%08x.\n",
1829 dds_dxt5_8_8_expected_misaligned_3[
y * 8 +
x]);
1843 for (
y = 0;
y < 8; ++
y)
1845 for (
x = 0;
x < 8; ++
x)
1848 dds_dxt5_8_8_expected_misaligned_3[
y * 8 +
x], 0),
1849 "Color at position %u, %u is 0x%08x, expected 0x%08x.\n",
1851 dds_dxt5_8_8_expected_misaligned_3[
y * 8 +
x]);
1863 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemory returned %#x, expected %#x.\n",
hr,
D3D_OK);
1867 todo_wine ok(level_count == 3,
"Texture has %u mip levels, 3 expected.\n", level_count);
1869 ok(
hr ==
D3D_OK,
"IDirect3DTexture9_GetLevelDesc returned %#x, expected %#x.\n",
hr,
D3D_OK);
1870 ok(
desc.Width == 4,
"Width is %u, expected 4.\n",
desc.Width);
1871 ok(
desc.Height == 4,
"Height is %u, expected 4.\n",
desc.Height);
1877 ok(
hr ==
D3D_OK,
"IDirect3DTexture9_LockRect returned %#x, expected %#x.\n",
hr,
D3D_OK);
1880 for (
i = 0;
i < 16; ++
i)
1882 "Byte at index %u is 0x%02x, expected 0x%02x.\n",
1890 skip(
"D3DFMT_DXT3 volume textures are not supported, skipping a test.\n");
1901 unsigned int miplevels;
1902 IDirect3DSurface9 *surface;
1907 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x\n",
hr,
D3D_OK);
1912 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x\n",
hr,
D3D_OK);
1918 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x\n",
hr,
D3D_OK);
1920 ok(miplevels == 1,
"Got miplevels %u, expected %u.\n", miplevels, 1);
1924 "Surface dimensions are %ux%u, expected 1x1.\n",
desc.Width,
desc.Height);
1930 skip(
"No D3DUSAGE_AUTOGENMIPMAP support for textures\n");
1936 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x\n",
hr,
D3D_OK);
1943 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.\n",
hr,
D3D_OK);
1952 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.\n",
hr,
D3D_OK);
1961 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.\n",
hr,
D3D_OK);
1971 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.\n",
hr,
D3D_OK);
1980 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.\n",
hr,
D3D_OK);
1989 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.\n",
hr,
D3D_OK);
1999 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.\n",
hr,
D3D_OK);
2008 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.\n",
hr,
D3D_OK);
2017 ok(
hr ==
D3D_OK,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.\n",
hr,
D3D_OK);
2030 IDirect3DCubeTexture9 *cube_texture;
2049 ok(levelcount == 3,
"GetLevelCount returned %u, expected 3\n", levelcount);
2053 ok(surface_desc.
Width == 4,
"Got width %u, expected 4\n", surface_desc.
Width);
2054 ok(surface_desc.
Height == 4,
"Got height %u, expected 4\n", surface_desc.
Height);
2057 ok(
ref == 0,
"Invalid reference count. Got %u, expected 0\n",
ref);
2058 }
else skip(
"Couldn't create cube texture\n");
2063 IDirect3DCubeTexture9 *cube_texture;
2074 skip(
"No D3DUSAGE_AUTOGENMIPMAP support for cube textures\n");
2090 IDirect3DVolumeTexture9 *volume_texture;
2106 ok(
hr ==
D3D_OK,
"D3DXCreateVolumeTextureFromFileInMemory returned %#x, expected %#x.\n",
hr,
D3D_OK);
2108 ok(levelcount == 3,
"GetLevelCount returned %u, expected 3.\n", levelcount);
2112 ok(volume_desc.
Width == 4,
"Got width %u, expected 4.\n", volume_desc.
Width);
2113 ok(volume_desc.
Height == 4,
"Got height %u, expected 4.\n", volume_desc.
Height);
2114 ok(volume_desc.
Depth == 2,
"Got depth %u, expected 2.\n", volume_desc.
Depth);
2119 ok(volume_desc.
Width == 2,
"Got width %u, expected 2.\n", volume_desc.
Width);
2120 ok(volume_desc.
Height == 2,
"Got height %u, expected 2.\n", volume_desc.
Height);
2121 ok(volume_desc.
Depth == 1,
"Got depth %u, expected 1.\n", volume_desc.
Depth);
2124 ok(
ref == 0,
"Invalid reference count. Got %u, expected 0.\n",
ref);
2129 IDirect3DVolumeTexture9 *volume_texture;
2147 if (tex_coord->
x > 0 &&
fabs(tex_coord->
x) >
fabs(tex_coord->
y) &&
fabs(tex_coord->
x) >
fabs(tex_coord->
z))
2155 IDirect3DCubeTexture9 *cube_texture;
2156 IDirect3DVolumeTexture9 *volume_texture;
2158 void *buffer_pointer;
2167 skip(
"Failed to create texture\n");
2174 ok(
hr ==
D3D_OK,
"D3DXSaveTextureToFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2180 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2182 ok(
info.Width == 256,
"Got width %u, expected %u\n",
info.Width, 256);
2183 ok(
info.Height == 256,
"Got height %u, expected %u\n",
info.Height, 256);
2184 ok(
info.MipLevels == 1,
"Got miplevels %u, expected %u\n",
info.MipLevels, 1);
2186 ok(
info.ImageFileFormat == file_format,
"Got file format %#x, expected %#x\n",
info.ImageFileFormat, file_format);
2193 ok(
hr ==
D3D_OK,
"D3DXSaveTextureToFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2199 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2201 ok(
info.Width == 256,
"Got width %u, expected %u\n",
info.Width, 256);
2202 ok(
info.Height == 256,
"Got height %u, expected %u\n",
info.Height, 256);
2203 ok(
info.MipLevels == 9,
"Got miplevels %u, expected %u\n",
info.MipLevels, 9);
2216 skip(
"Failed to create cube texture\n");
2224 ok(
hr ==
D3D_OK,
"D3DXSaveTextureToFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2227 IDirect3DSurface9 *surface;
2232 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2234 ok(
info.Width == 256,
"Got width %u, expected %u\n",
info.Width, 256);
2235 ok(
info.Height == 256,
"Got height %u, expected %u\n",
info.Height, 256);
2236 ok(
info.MipLevels == 1,
"Got miplevels %u, expected %u\n",
info.MipLevels, 1);
2247 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2253 ok(*
color == 0x00ff0000,
"Got color %#x, expected %#x\n", *
color, 0x00ff0000);
2258 }
else skip(
"Failed to create surface\n");
2265 ok(
hr ==
D3D_OK,
"D3DXSaveTextureToFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2271 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2273 ok(
info.Width == 256,
"Got width %u, expected %u\n",
info.Width, 256);
2274 ok(
info.Height == 256,
"Got height %u, expected %u\n",
info.Height, 256);
2275 ok(
info.MipLevels == 9,
"Got miplevels %u, expected %u\n",
info.MipLevels, 9);
2288 skip(
"Failed to create volume texture\n");
2294 ok(
hr ==
D3D_OK,
"D3DXSaveTextureToFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2300 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2302 ok(
info.Width == 256,
"Got width %u, expected %u\n",
info.Width, 256);
2303 ok(
info.Height == 256,
"Got height %u, expected %u\n",
info.Height, 256);
2304 ok(
info.Depth == 1,
"Got depth %u, expected %u\n",
info.Depth, 1);
2305 ok(
info.MipLevels == 1,
"Got miplevels %u, expected %u\n",
info.MipLevels, 1);
2312 ok(
hr ==
D3D_OK,
"D3DXSaveTextureToFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2318 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
2320 ok(
info.Width == 256,
"Got width %u, expected %u\n",
info.Width, 256);
2321 ok(
info.Height == 256,
"Got height %u, expected %u\n",
info.Height, 256);
2322 ok(
info.Depth == 256,
"Got depth %u, expected %u\n",
info.Depth, 256);
2323 ok(
info.MipLevels == 9,
"Got miplevels %u, expected %u\n",
info.MipLevels, 9);
2341 return float4(
pos, 1.0);
2344 static const DWORD shader_code[] =
2346 0x54580100, 0x0015fffe, 0x42415443, 0x0000001c, 0x0000001f, 0x54580100, 0x00000000, 0x00000000,
2347 0x00000100, 0x0000001c, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
2348 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x000afffe,
2349 0x54494c43, 0x00000004, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2350 0x00000000, 0x00000000, 0x0014fffe, 0x434c5846, 0x00000002, 0x10000003, 0x00000001, 0x00000000,
2351 0x00000003, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10000001, 0x00000001, 0x00000000,
2352 0x00000001, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
2354 IDirect3DVolumeTexture9 *volume_texture;
2355 IDirect3DCubeTexture9 *cube_texture;
2358 IDirect3DDevice9 *
device;
2359 ID3DXTextureShader *tx;
2360 unsigned int x,
y,
z;
2388 hr = tx->lpVtbl->GetFunction(tx, &
buffer);
2392 skip(
"Texture shaders not supported, skipping further tests.\n");
2393 IUnknown_Release(tx);
2401 skip(
"Couldn't create application window.\n");
2402 IUnknown_Release(tx);
2408 skip(
"Couldn't create IDirect3D9 object.\n");
2410 IUnknown_Release(tx);
2421 skip(
"Failed to create IDirect3DDevice9 object, hr %#x.\n",
hr);
2424 IUnknown_Release(tx);
2440 for (
y = 0;
y < 256; ++
y)
2442 for (
x = 0;
x < 256; ++
x)
2444 unsigned int expected = 0xff000000 |
x << 16 |
y << 8;
2458 skip(
"Cube textures not supported, skipping tests.\n");
2463 &cube_texture,
NULL);
2469 for (
z = 0;
z < 6; ++
z)
2471 static const char *
const mapping[6][3] =
2484 for (
y = 0;
y < 256; ++
y)
2486 for (
x = 0;
x < 256; ++
x)
2489 unsigned int expected = 0xff000000;
2492 for (
i = 0;
i < 3; ++
i)
2501 component =
mapping[
z][
i][1] ==
'x' ?
x * 2 - 255 :
y * 2 - 255;
2503 component = -component;
2518 skip(
"Volume textures not supported, skipping test.\n");
2531 for (
z = 0;
z < 64; ++
z)
2533 for (
y = 0;
y < 64; ++
y)
2535 for (
x = 0;
x < 64; ++
x)
2537 unsigned int expected = 0xff000000 | ((
x * 4 + 2) << 16) | ((
y * 4 + 2) << 8) | (
z * 4 + 2);
2554 IUnknown_Release(tx);
2561 IDirect3DDevice9 *
device;
2569 skip(
"Couldn't create application window\n");
2574 skip(
"Couldn't create IDirect3D9 object\n");
2584 skip(
"Failed to create IDirect3DDevice9 object %#x\n",
hr);
2601 trace(
"DXTn texture support: 2D DXT1 %#x, 2D DXT3 %#x, 2D DXT5 %#x, cube DXT5 %#x, 3D dxt3 %#x.\n",
2621 ok(!
ref,
"Device has %u references left.\n",
ref);
#define D3DXERR_INVALIDDATA
#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 D3DUSAGE_NPATCHES
enum _D3DRESOURCETYPE D3DRESOURCETYPE
#define D3DUSAGE_DONOTCLIP
#define D3DUSAGE_WRITEONLY
#define D3DUSAGE_RENDERTARGET
enum _D3DFORMAT D3DFORMAT
#define D3DUSAGE_RTPATCHES
#define D3DUSAGE_DEPTHSTENCIL
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 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 D3DCAPS2_CANAUTOGENMIPMAP
#define D3DUSAGE_AUTOGENMIPMAP
#define D3DERR_INVALIDCALL
struct ID3DXBuffer ID3DXBuffer
#define ID3DXBuffer_GetBufferSize(p)
#define ID3DXBuffer_GetBufferPointer(p)
#define ID3DXBuffer_Release(p)