42 return diff <= max_diff;
58#define check_release(obj, exp) _check_release(__LINE__, obj, exp)
61 int ref = IUnknown_Release(
obj);
84 trace(
"Can't unlock the offscreen surface, hr %#lx.\n",
hr);
94 memset(rb, 0,
sizeof(*rb));
98 trace(
"Failed to get source surface description, hr %#lx.\n",
hr);
106 trace(
"Can't create the readback surface, hr %#lx.\n",
hr);
113 trace(
"Can't load the readback surface, hr %#lx.\n",
hr);
122 trace(
"Can't lock the offscreen surface, hr %#lx.\n",
hr);
153#define DDS_PF_ALPHA 0x00000001
154#define DDS_PF_ALPHA_ONLY 0x00000002
155#define DDS_PF_FOURCC 0x00000004
156#define DDS_PF_INDEXED 0x00000020
157#define DDS_PF_RGB 0x00000040
158#define DDS_PF_LUMINANCE 0x00020000
159#define DDS_PF_BUMPLUMINANCE 0x00040000
160#define DDS_PF_BUMPDUDV 0x00080000
197 header->size =
sizeof(*header);
201 header->pixel_format.size =
sizeof(
header->pixel_format);
204 header->pixel_format.fourcc = 0;
205 header->pixel_format.bpp = 32;
206 header->pixel_format.rmask = 0xff0000;
207 header->pixel_format.gmask = 0x00ff00;
208 header->pixel_format.bmask = 0x0000ff;
209 header->pixel_format.amask = 0;
213#define check_dds_pixel_format(flags, fourcc, bpp, rmask, gmask, bmask, amask, format) \
214 check_dds_pixel_format_(__LINE__, flags, fourcc, bpp, rmask, gmask, bmask, amask, format)
232 dds.header.pixel_format.flags =
flags;
233 dds.header.pixel_format.fourcc = fourcc;
234 dds.header.pixel_format.bpp =
bpp;
235 dds.header.pixel_format.rmask = rmask;
236 dds.header.pixel_format.gmask = gmask;
237 dds.header.pixel_format.bmask =
bmask;
238 dds.header.pixel_format.amask = amask;
239 memset(dds.data, 0,
sizeof(dds.data));
242 ok_(__FILE__,
line)(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx for pixel format %#x, expected %#lx\n",
246 ok_(__FILE__,
line)(
info.Format == expected_format,
"D3DXGetImageInfoFromFileInMemory returned format %#x, expected %#x\n",
247 info.Format, expected_format);
252 rmask = gmask =
bmask = amask =
bpp = ~0
u;
254 rmask = gmask =
bmask = fourcc = ~0
u;
256 rmask = gmask =
bmask = amask = fourcc = ~0
u;
260 fourcc = amask = ~0
u;
262 gmask =
bmask = fourcc = ~0
u;
264 gmask =
bmask = amask = fourcc = ~0
u;
266 rmask = gmask =
bmask = fourcc = ~0
u;
270 fourcc = amask = ~0
u;
272 dds.header.pixel_format.fourcc = fourcc;
273 dds.header.pixel_format.bpp =
bpp;
274 dds.header.pixel_format.rmask = rmask;
275 dds.header.pixel_format.gmask = gmask;
276 dds.header.pixel_format.bmask =
bmask;
277 dds.header.pixel_format.amask = amask;
281 ok_(__FILE__,
line)(
info.Format == expected_format,
"Unexpected format %#x.\n",
info.Format);
304 DWORD pixel_data_size;
314 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, 0, 4, 4, 0, 0,
316 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDSD_PITCH, 4, 4, 0 , 0,
318 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDSD_PITCH, 4, 4, 1 , 0,
320 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDSD_PITCH, 4, 4, 2 , 0,
322 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDSD_PITCH, 4, 4, 3 , 0,
324 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDSD_PITCH, 4, 4, 4 , 0,
326 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDSD_PITCH, 4, 4, 16 , 0,
328 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDSD_PITCH, 4, 4, 1024 , 0,
330 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDSD_PITCH, 4, 4, -1 , 0,
333 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 }, 0, 4, 4, 0, 0,
336 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDSD_LINEARSIZE, 4, 4, 0 , 0,
338 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDSD_LINEARSIZE, 4, 4, 1 , 0,
340 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDSD_LINEARSIZE, 4, 4, 2 , 0,
342 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDSD_LINEARSIZE, 4, 4, 9 , 0,
344 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDSD_LINEARSIZE, 4, 4, 16 , 0,
346 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDSD_LINEARSIZE, 4, 4, -1 , 0,
349 { { 32,
DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x80000000, 0x80000000 , 0, 0,
351 { { 32,
DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x8000100, 0x800100 , 0, 0,
353 { { 32,
DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x80000001, 0x80000001 , 0, 0,
355 { { 32,
DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x80000001, 0x80000001 , 0, 0,
358 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 64, 0, 0, 49151, {
D3DXERR_INVALIDDATA, 0 } },
359 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 64, 0, 0, 49152, {
D3D_OK, 1 } },
360 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 64, 0, 4, 65279, {
D3DXERR_INVALIDDATA, 0 } },
361 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 64, 0, 4, 65280, {
D3D_OK, 4 } },
362 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 64, 0, 9, 65540, {
D3DXERR_INVALIDDATA, 0 } },
363 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 64, 0, 9, 65541, {
D3D_OK, 9 } },
364 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 0, 196607, {
D3DXERR_INVALIDDATA, 0 } },
365 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 0, 196608, {
D3D_OK, 1 } },
366 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 0, 196609, {
D3D_OK, 1 } },
367 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 1, 196607, {
D3DXERR_INVALIDDATA, 0 } },
369 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 1, 196608, {
D3D_OK, 1 } },
370 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 0, 196607, {
D3DXERR_INVALIDDATA, 0 } },
371 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 0, 196608, {
D3D_OK, 1 } },
372 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 0, 400000, {
D3D_OK, 1 } },
373 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 9, 262142, {
D3DXERR_INVALIDDATA, 0 } },
374 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 9, 262143, {
D3D_OK, 9 } },
375 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 10, 262145, {
D3DXERR_INVALIDDATA, 0 } },
376 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 10, 262146, {
D3D_OK, 10 } },
377 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 20, 262175, {
D3DXERR_INVALIDDATA, 0 } },
378 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 20, 262176, {
D3D_OK, 20 } },
380 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 }, 0, 256, 256, 0, 0, 32767, {
D3DXERR_INVALIDDATA, 0 } },
381 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 }, 0, 256, 256, 0, 0, 32768, {
D3D_OK, 1 } },
382 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 0, 32767, {
D3DXERR_INVALIDDATA, 0 } },
383 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 0, 32768, {
D3D_OK, 1 } },
384 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 9, 43703, {
D3DXERR_INVALIDDATA, 0 } },
385 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 9, 43704, {
D3D_OK, 9 } },
386 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 20, 43791, {
D3DXERR_INVALIDDATA, 0 } },
387 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 20, 43792, {
D3D_OK, 20 } },
388 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 }, 0, 256, 256, 0, 0, 65535, {
D3DXERR_INVALIDDATA, 0 } },
389 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 }, 0, 256, 256, 0, 0, 65536, {
D3D_OK, 1 } },
391 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 0, 65535, {
D3DXERR_INVALIDDATA, 0 } },
392 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 0, 65536, {
D3D_OK, 1 } },
393 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 9, 87407, {
D3DXERR_INVALIDDATA, 0 } },
394 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 9, 87408, {
D3D_OK, 9 } },
395 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 20, 87583, {
D3DXERR_INVALIDDATA, 0 } },
396 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 256, 0, 20, 87584, {
D3D_OK, 20 } },
397 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 64, 0, 4, 21759, {
D3DXERR_INVALIDDATA, 0 } },
398 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDSD_MIPMAPCOUNT, 256, 64, 0, 4, 21760, {
D3D_OK, 4 } },
400 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 0, 262146, {
D3D_OK, 1 } },
401 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 2, 262146, {
D3D_OK, 2 } },
403 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 9, 262146, {
D3D_OK, 9 } },
404 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 10, 262146, {
D3D_OK, 10 } },
406 { { 32,
DDS_PF_FOURCC,
D3DFMT_R8G8_B8G8, 0, 0, 0, 0, 0 }, 0, 3, 3, 0, 0, (4 * 3 * 2), {
D3D_OK, 1 } },
407 { { 32,
DDS_PF_FOURCC,
D3DFMT_G8R8_G8B8, 0, 0, 0, 0, 0 }, 0, 3, 3, 0, 0, (4 * 3 * 2), {
D3D_OK, 1 } },
408 { { 32,
DDS_PF_FOURCC,
D3DFMT_UYVY, 0, 0, 0, 0, 0 }, 0, 3, 3, 0, 0, (4 * 3 * 2), {
D3D_OK, 1 } },
409 { { 32,
DDS_PF_FOURCC,
D3DFMT_YUY2, 0, 0, 0, 0, 0 }, 0, 3, 3, 0, 0, (4 * 3 * 2), {
D3D_OK, 1 } },
411 { { 32,
DDS_PF_FOURCC,
D3DFMT_R8G8_B8G8, 0, 0, 0, 0, 0 }, 0, 3, 3, 0, 0, (3 * 3 * 2), {
D3DXERR_INVALIDDATA, 0 } },
412 { { 32,
DDS_PF_FOURCC,
D3DFMT_G8R8_G8B8, 0, 0, 0, 0, 0 }, 0, 3, 3, 0, 0, (3 * 3 * 2), {
D3DXERR_INVALIDDATA, 0 } },
414 { { 32,
DDS_PF_FOURCC,
D3DFMT_R8G8_B8G8, 0, 0, 0, 0, 0 }, 0, 4, 3, 4, 1, (4 * 3 * 2), {
D3D_OK, 1 } },
415 { { 32,
DDS_PF_FOURCC,
D3DFMT_G8R8_G8B8, 0, 0, 0, 0, 0 }, 0, 4, 3, 4, 1, (4 * 3 * 2), {
D3D_OK, 1 } },
416 { { 32,
DDS_PF_FOURCC,
D3DFMT_UYVY, 0, 0, 0, 0, 0 }, 0, 3, 3, 0, 0, (3 * 3 * 2), {
D3DXERR_INVALIDDATA, 0 } },
417 { { 32,
DDS_PF_FOURCC,
D3DFMT_YUY2, 0, 0, 0, 0, 0 }, 0, 3, 3, 0, 0, (3 * 3 * 2), {
D3DXERR_INVALIDDATA, 0 } },
418 { { 32,
DDS_PF_FOURCC,
D3DFMT_UYVY, 0, 0, 0, 0, 0 }, 0, 4, 3, 4, 1, (4 * 3 * 2), {
D3D_OK, 1 } },
419 { { 32,
DDS_PF_FOURCC,
D3DFMT_YUY2, 0, 0, 0, 0, 0 }, 0, 4, 3, 4, 1, (4 * 3 * 2), {
D3D_OK, 1 } },
477 dds =
calloc(1,
sizeof(*dds));
480 skip(
"Failed to allocate memory.\n");
492 dds->header.flags |=
tests[
i].flags;
493 dds->header.width =
tests[
i].width;
494 dds->header.height =
tests[
i].height;
495 dds->header.pitch_or_linear_size =
tests[
i].pitch;
496 dds->header.miplevels =
tests[
i].miplevels;
497 dds->header.pixel_format =
tests[
i].pixel_format;
504 ok(
info.MipLevels ==
tests[
i].expected.miplevels,
"Unexpected MipLevels %u, expected %u.\n",
512 uint32_t file_size =
sizeof(dds->magic) +
sizeof(dds->header) + info_tests[
i].pixel_data_size;
518 dds->header.flags = info_tests[
i].flags;
519 dds->header.width = info_tests[
i].width;
520 dds->header.height = info_tests[
i].height;
521 dds->header.depth = info_tests[
i].depth;
522 dds->header.pitch_or_linear_size = info_tests[
i].row_pitch;
523 dds->header.miplevels = info_tests[
i].mip_levels;
524 dds->header.caps = info_tests[
i].caps;
525 dds->header.caps2 = info_tests[
i].caps2;
533 info_tests[
i].expected.depth, info_tests[
i].expected.mip_levels,
D3DFMT_X8R8G8B8,
534 info_tests[
i].expected.resource_type,
D3DXIFF_DDS, info_tests[
i].todo_info);
542#define COLORMAP_TYPE_NONE 0
543#define COLORMAP_TYPE_ONE 1
545#define IMAGETYPE_COLORMAPPED 1
546#define IMAGETYPE_TRUECOLOR 2
547#define IMAGETYPE_GRAYSCALE 3
548#define IMAGETYPE_RLE 8
550#define IMAGE_RIGHTTOLEFT 0x10
551#define IMAGE_TOPTOBOTTOM 0x20
580 {
'T',
'R',
'U',
'E',
'V',
'I',
'S',
'I',
'O',
'N',
'-',
'X',
'F',
'I',
'L',
'E',
'.', 0 }
583#define check_tga_image_info(tga, tga_size, expected_width, expected_height, expected_format, expected_hr) \
584 check_tga_image_info_(__LINE__, tga, tga_size, expected_width, expected_height, expected_format, expected_hr)
616 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_TRUECOLOR, 0, 0, 0, 0, 0, 4, 4, 15, 0 },
620 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_TRUECOLOR, 0, 0, 0, 0, 0, 4, 4, 16, 0 },
624 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_TRUECOLOR, 0, 0, 0, 0, 0, 4, 4, 24, 0 },
628 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_TRUECOLOR, 0, 0, 0, 0, 0, 4, 4, 32, 0 },
632 { { 0,
COLORMAP_TYPE_ONE,
IMAGETYPE_COLORMAPPED, 0, 256, 15, 0, 0, 4, 4, 8, 0 },
636 { { 0,
COLORMAP_TYPE_ONE,
IMAGETYPE_COLORMAPPED, 0, 256, 16, 0, 0, 4, 4, 8, 0 },
640 { { 0,
COLORMAP_TYPE_ONE,
IMAGETYPE_COLORMAPPED, 0, 256, 24, 0, 0, 4, 4, 8, 0 },
644 { { 0,
COLORMAP_TYPE_ONE,
IMAGETYPE_COLORMAPPED, 0, 256, 32, 0, 0, 4, 4, 8, 0 },
648 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_GRAYSCALE, 0, 0, 0, 0, 0, 4, 4, 8, 0 },
652 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_GRAYSCALE, 0, 0, 0, 0, 0, 4, 4, 16, 0 },
664 tga =
calloc(1,
sizeof(*tga));
667 skip(
"Failed to allocate memory.\n");
678 tga->header = info_tests[
i].header;
680 info_tests[
i].expected.format, info_tests[
i].expected.hr);
683 tga->header.xorigin = tga->header.width + 1;
684 tga->header.yorigin = tga->header.height + 1;
686 info_tests[
i].expected.format, info_tests[
i].expected.hr);
689 tga->header.image_descriptor = 0xcf;
691 info_tests[
i].expected.format, info_tests[
i].expected.hr);
702 memcpy(&tga->data[info_tests[
i].extra_header_size], &tmp_footer,
sizeof(tmp_footer));
704 info_tests[
i].expected.format, info_tests[
i].expected.hr);
709 info_tests[
i].expected.format, info_tests[
i].expected.hr);
710 tga->header.image_type &= ~IMAGETYPE_RLE;
719 tga->header.color_map_length = 1;
721 info_tests[
i].expected.format, info_tests[
i].expected.hr);
723 tga->header.color_map_entrysize = 8;
728 info_tests[
i].expected.format, info_tests[
i].expected.hr);
731 tga->header.id_length = 1;
736 info_tests[
i].expected.format, info_tests[
i].expected.hr);
744 tga->header.id_length = tga->header.color_map_entrysize = tga->header.color_map_length = 0;
749 tga->header.color_map_entrysize = 8;
750 tga->header.color_map_length = 1;
754 tga->header.color_map_entrysize = 16;
756 info_tests[
i].expected.format, info_tests[
i].expected.hr);
759 tga->header.color_map_firstentry = 512;
761 info_tests[
i].expected.format, info_tests[
i].expected.hr);
773 BOOL testdummy_ok, testbitmap_ok;
784 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFile returned %#lx, expected %#lx\n",
hr,
D3D_OK);
787 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFile returned %#lx, expected %#lx\n",
hr,
D3D_OK);
788 }
else skip(
"Couldn't create \"testbitmap.bmp\"\n");
792 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFile returned %#lx, expected %#lx\n",
hr,
D3D_OK);
796 }
else skip(
"Couldn't create \"testdummy.bmp\"\n");
816 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromResource returned %#lx, expected %#lx\n",
hr,
D3D_OK);
819 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromResource returned %#lx, expected %#lx\n",
hr,
D3D_OK);
822 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromResource returned %#lx, expected %#lx\n",
hr,
D3D_OK);
842 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
845 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
848 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
851 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromResource returned %#lx, expected %#lx\n",
hr,
D3D_OK);
890 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
891 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
896 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
897 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
900 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
901 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
935 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
936 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
941 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
943 ok(
info.Width == 2,
"Got width %u, expected 2\n",
info.Width);
944 ok(
info.Height == 2,
"Got height %u, expected 2\n",
info.Height);
945 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
946 ok(
info.MipLevels == 2,
"Got miplevels %u, expected 2\n",
info.MipLevels);
950 }
else skip(
"Couldn't get image info from 24-bit DDS file in memory\n");
953 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
955 ok(
info.Width == 2,
"Got width %u, expected 2\n",
info.Width);
956 ok(
info.Height == 2,
"Got height %u, expected 2\n",
info.Height);
957 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
958 ok(
info.MipLevels == 1,
"Got miplevels %u, expected 1\n",
info.MipLevels);
962 }
else skip(
"Couldn't get image info from 16-bit DDS file in memory\n");
966 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx\n",
hr);
967 ok(
info.Width == 16,
"Got width %u.\n",
info.Width);
968 ok(
info.Height == 4,
"Got height %u.\n",
info.Height);
969 ok(
info.Depth == 1,
"Got depth %u.\n",
info.Depth);
970 ok(
info.MipLevels == 1,
"Got miplevels %u.\n",
info.MipLevels);
976 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
978 ok(
info.Width == 4,
"Got width %u, expected 4\n",
info.Width);
979 ok(
info.Height == 4,
"Got height %u, expected 4\n",
info.Height);
980 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
981 ok(
info.MipLevels == 1,
"Got miplevels %u, expected 1\n",
info.MipLevels);
985 }
else skip(
"Couldn't get image info from cube map in memory\n");
988 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
990 ok(
info.Width == 4,
"Got width %u, expected 4\n",
info.Width);
991 ok(
info.Height == 4,
"Got height %u, expected 4\n",
info.Height);
992 ok(
info.Depth == 2,
"Got depth %u, expected 2\n",
info.Depth);
993 ok(
info.MipLevels == 3,
"Got miplevels %u, expected 3\n",
info.MipLevels);
997 }
else skip(
"Couldn't get image info from volume map in memory\n");
1074#define check_pixel_2bpp(lockrect, x, y, color) _check_pixel_2bpp(__LINE__, lockrect, x, y, color)
1078 ok_(__FILE__,
line)(
color == expected_color,
"Got color 0x%04x, expected 0x%04x\n",
color, expected_color);
1081#define check_pixel_4bpp(lockrect, x, y, color) _check_pixel_4bpp(__LINE__, lockrect, x, y, color)
1085 ok_(__FILE__,
line)(
color == expected_color,
"Got color 0x%08lx, expected 0x%08lx\n",
color, expected_color);
1088#define check_pixel_8bpp(lockrect, x, y, color) _check_pixel_8bpp(__LINE__, lockrect, x, y, color)
1092 ok_(__FILE__,
line)(
color == expected_color,
"Got color %#I64x, expected %#I64x.\n",
color, expected_color);
1095#define check_pixel_float4(lockrect, x, y, fx, fy, fz, fw, ulps, todo) \
1096 _check_pixel_float4(__LINE__, lockrect, x, y, fx, fy, fz, fw, ulps, todo)
1100 float *
ptr = (
float *)(((
BYTE *)lockrect->
pBits) + (
y * lockrect->
Pitch) + (
x *
sizeof(
float) * 4));
1106 "Expected (%.8e, %.8e, %.8e, %.8e), got (%.8e, %.8e, %.8e, %.8e)\n",
1111#define check_readback_pixel_4bpp(rb, x, y, color, todo) _check_readback_pixel_4bpp(__LINE__, rb, x, y, color, todo)
1121 {0x00,0x00,0x00,0x00}, {0x00,0x00,0x80,0x01}, {0x00,0x80,0x00,0x02}, {0x00,0x80,0x80,0x03},
1122 {0x80,0x00,0x00,0x04}, {0x80,0x00,0x80,0x05}, {0x80,0x80,0x00,0x06}, {0xc0,0xc0,0xc0,0x07},
1123 {0xc0,0xdc,0xc0,0x08}, {0xf0,0xca,0xa6,0x09}, {0x00,0x20,0x40,0x0a}, {0x00,0x20,0x60,0x0b},
1124 {0x00,0x20,0x80,0x0c}, {0x00,0x20,0xa0,0x0d}, {0x00,0x20,0xc0,0x0e}, {0x00,0x20,0xe0,0x0f},
1126 {0x00,0x40,0x00,0x10}, {0x00,0x40,0x20,0x11}, {0x00,0x40,0x40,0x12}, {0x00,0x40,0x60,0x13},
1127 {0x00,0x40,0x80,0x14}, {0x00,0x40,0xa0,0x15}, {0x00,0x40,0xc0,0x16}, {0x00,0x40,0xe0,0x17},
1128 {0x00,0x60,0x00,0x18}, {0x00,0x60,0x20,0x19}, {0x00,0x60,0x40,0x1a}, {0x00,0x60,0x60,0x1b},
1129 {0x00,0x60,0x80,0x1c}, {0x00,0x60,0xa0,0x1d}, {0x00,0x60,0xc0,0x1e}, {0x00,0x60,0xe0,0x1f},
1131 {0x00,0x80,0x00,0x20}, {0x00,0x80,0x20,0x21}, {0x00,0x80,0x40,0x22}, {0x00,0x80,0x60,0x23},
1132 {0x00,0x80,0x80,0x24}, {0x00,0x80,0xa0,0x25}, {0x00,0x80,0xc0,0x26}, {0x00,0x80,0xe0,0x27},
1133 {0x00,0xa0,0x00,0x28}, {0x00,0xa0,0x20,0x29}, {0x00,0xa0,0x40,0x2a}, {0x00,0xa0,0x60,0x2b},
1134 {0x00,0xa0,0x80,0x2c}, {0x00,0xa0,0xa0,0x2d}, {0x00,0xa0,0xc0,0x2e}, {0x00,0xa0,0xe0,0x2f},
1136 {0x00,0xc0,0x00,0x30}, {0x00,0xc0,0x20,0x31}, {0x00,0xc0,0x40,0x32}, {0x00,0xc0,0x60,0x33},
1137 {0x00,0xc0,0x80,0x34}, {0x00,0xc0,0xa0,0x35}, {0x00,0xc0,0xc0,0x36}, {0x00,0xc0,0xe0,0x37},
1138 {0x00,0xe0,0x00,0x38}, {0x00,0xe0,0x20,0x39}, {0x00,0xe0,0x40,0x3a}, {0x00,0xe0,0x60,0x3b},
1139 {0x00,0xe0,0x80,0x3c}, {0x00,0xe0,0xa0,0x3d}, {0x00,0xe0,0xc0,0x3e}, {0x00,0xe0,0xe0,0x3f},
1141 {0x40,0x00,0x00,0x40}, {0x40,0x00,0x20,0x41}, {0x40,0x00,0x40,0x42}, {0x40,0x00,0x60,0x43},
1142 {0x40,0x00,0x80,0x44}, {0x40,0x00,0xa0,0x45}, {0x40,0x00,0xc0,0x46}, {0x40,0x00,0xe0,0x47},
1143 {0x40,0x20,0x00,0x48}, {0x40,0x20,0x20,0x49}, {0x40,0x20,0x40,0x4a}, {0x40,0x20,0x60,0x4b},
1144 {0x40,0x20,0x80,0x4c}, {0x40,0x20,0xa0,0x4d}, {0x40,0x20,0xc0,0x4e}, {0x40,0x20,0xe0,0x4f},
1146 {0x40,0x40,0x00,0x50}, {0x40,0x40,0x20,0x51}, {0x40,0x40,0x40,0x52}, {0x40,0x40,0x60,0x53},
1147 {0x40,0x40,0x80,0x54}, {0x40,0x40,0xa0,0x55}, {0x40,0x40,0xc0,0x56}, {0x40,0x40,0xe0,0x57},
1148 {0x40,0x60,0x00,0x58}, {0x40,0x60,0x20,0x59}, {0x40,0x60,0x40,0x5a}, {0x40,0x60,0x60,0x5b},
1149 {0x40,0x60,0x80,0x5c}, {0x40,0x60,0xa0,0x5d}, {0x40,0x60,0xc0,0x5e}, {0x40,0x60,0xe0,0x5f},
1151 {0x40,0x80,0x00,0x60}, {0x40,0x80,0x20,0x61}, {0x40,0x80,0x40,0x62}, {0x40,0x80,0x60,0x63},
1152 {0x40,0x80,0x80,0x64}, {0x40,0x80,0xa0,0x65}, {0x40,0x80,0xc0,0x66}, {0x40,0x80,0xe0,0x67},
1153 {0x40,0xa0,0x00,0x68}, {0x40,0xa0,0x20,0x69}, {0x40,0xa0,0x40,0x6a}, {0x40,0xa0,0x60,0x6b},
1154 {0x40,0xa0,0x80,0x6c}, {0x40,0xa0,0xa0,0x6d}, {0x40,0xa0,0xc0,0x6e}, {0x40,0xa0,0xe0,0x6f},
1156 {0x40,0xc0,0x00,0x70}, {0x40,0xc0,0x20,0x71}, {0x40,0xc0,0x40,0x72}, {0x40,0xc0,0x60,0x73},
1157 {0x40,0xc0,0x80,0x74}, {0x40,0xc0,0xa0,0x75}, {0x40,0xc0,0xc0,0x76}, {0x40,0xc0,0xe0,0x77},
1158 {0x40,0xe0,0x00,0x78}, {0x40,0xe0,0x20,0x79}, {0x40,0xe0,0x40,0x7a}, {0x40,0xe0,0x60,0x7b},
1159 {0x40,0xe0,0x80,0x7c}, {0x40,0xe0,0xa0,0x7d}, {0x40,0xe0,0xc0,0x7e}, {0x40,0xe0,0xe0,0x7f},
1161 {0x80,0x00,0x00,0x80}, {0x80,0x00,0x20,0x81}, {0x80,0x00,0x40,0x82}, {0x80,0x00,0x60,0x83},
1162 {0x80,0x00,0x80,0x84}, {0x80,0x00,0xa0,0x85}, {0x80,0x00,0xc0,0x86}, {0x80,0x00,0xe0,0x87},
1163 {0x80,0x20,0x00,0x88}, {0x80,0x20,0x20,0x89}, {0x80,0x20,0x40,0x8a}, {0x80,0x20,0x60,0x8b},
1164 {0x80,0x20,0x80,0x8c}, {0x80,0x20,0xa0,0x8d}, {0x80,0x20,0xc0,0x8e}, {0x80,0x20,0xe0,0x8f},
1166 {0x80,0x40,0x00,0x90}, {0x80,0x40,0x20,0x91}, {0x80,0x40,0x40,0x92}, {0x80,0x40,0x60,0x93},
1167 {0x80,0x40,0x80,0x94}, {0x80,0x40,0xa0,0x95}, {0x80,0x40,0xc0,0x96}, {0x80,0x40,0xe0,0x97},
1168 {0x80,0x60,0x00,0x98}, {0x80,0x60,0x20,0x99}, {0x80,0x60,0x40,0x9a}, {0x80,0x60,0x60,0x9b},
1169 {0x80,0x60,0x80,0x9c}, {0x80,0x60,0xa0,0x9d}, {0x80,0x60,0xc0,0x9e}, {0x80,0x60,0xe0,0x9f},
1171 {0x80,0x80,0x00,0xa0}, {0x80,0x80,0x20,0xa1}, {0x80,0x80,0x40,0xa2}, {0x80,0x80,0x60,0xa3},
1172 {0x80,0x80,0x80,0xa4}, {0x80,0x80,0xa0,0xa5}, {0x80,0x80,0xc0,0xa6}, {0x80,0x80,0xe0,0xa7},
1173 {0x80,0xa0,0x00,0xa8}, {0x80,0xa0,0x20,0xa9}, {0x80,0xa0,0x40,0xaa}, {0x80,0xa0,0x60,0xab},
1174 {0x80,0xa0,0x80,0xac}, {0x80,0xa0,0xa0,0xad}, {0x80,0xa0,0xc0,0xae}, {0x80,0xa0,0xe0,0xaf},
1176 {0x80,0xc0,0x00,0xb0}, {0x80,0xc0,0x20,0xb1}, {0x80,0xc0,0x40,0xb2}, {0x80,0xc0,0x60,0xb3},
1177 {0x80,0xc0,0x80,0xb4}, {0x80,0xc0,0xa0,0xb5}, {0x80,0xc0,0xc0,0xb6}, {0x80,0xc0,0xe0,0xb7},
1178 {0x80,0xe0,0x00,0xb8}, {0x80,0xe0,0x20,0xb9}, {0x80,0xe0,0x40,0xba}, {0x80,0xe0,0x60,0xbb},
1179 {0x80,0xe0,0x80,0xbc}, {0x80,0xe0,0xa0,0xbd}, {0x80,0xe0,0xc0,0xbe}, {0x80,0xe0,0xe0,0xbf},
1181 {0xc0,0x00,0x00,0xc0}, {0xc0,0x00,0x20,0xc1}, {0xc0,0x00,0x40,0xc2}, {0xc0,0x00,0x60,0xc3},
1182 {0xc0,0x00,0x80,0xc4}, {0xc0,0x00,0xa0,0xc5}, {0xc0,0x00,0xc0,0xc6}, {0xc0,0x00,0xe0,0xc7},
1183 {0xc0,0x20,0x00,0xc8}, {0xc0,0x20,0x20,0xc9}, {0xc0,0x20,0x40,0xca}, {0xc0,0x20,0x60,0xcb},
1184 {0xc0,0x20,0x80,0xcc}, {0xc0,0x20,0xa0,0xcd}, {0xc0,0x20,0xc0,0xce}, {0xc0,0x20,0xe0,0xcf},
1186 {0xc0,0x40,0x00,0xd0}, {0xc0,0x40,0x20,0xd1}, {0xc0,0x40,0x40,0xd2}, {0xc0,0x40,0x60,0xd3},
1187 {0xc0,0x40,0x80,0xd4}, {0xc0,0x40,0xa0,0xd5}, {0xc0,0x40,0xc0,0xd6}, {0xc0,0x40,0xe0,0xd7},
1188 {0xc0,0x60,0x00,0xd8}, {0xc0,0x60,0x20,0xd9}, {0xc0,0x60,0x40,0xda}, {0xc0,0x60,0x60,0xdb},
1189 {0xc0,0x60,0x80,0xdc}, {0xc0,0x60,0xa0,0xdd}, {0xc0,0x60,0xc0,0xde}, {0xc0,0x60,0xe0,0xdf},
1191 {0xc0,0x80,0x00,0xe0}, {0xc0,0x80,0x20,0xe1}, {0xc0,0x80,0x40,0xe2}, {0xc0,0x80,0x60,0xe3},
1192 {0xc0,0x80,0x80,0xe4}, {0xc0,0x80,0xa0,0xe5}, {0xc0,0x80,0xc0,0xe6}, {0xc0,0x80,0xe0,0xe7},
1193 {0xc0,0xa0,0x00,0xe8}, {0xc0,0xa0,0x20,0xe9}, {0xc0,0xa0,0x40,0xea}, {0xc0,0xa0,0x60,0xeb},
1194 {0xc0,0xa0,0x80,0xec}, {0xc0,0xa0,0xa0,0xed}, {0xc0,0xa0,0xc0,0xee}, {0xc0,0xa0,0xe0,0xef},
1196 {0xc0,0xc0,0x00,0xf0}, {0xc0,0xc0,0x20,0xf1}, {0xc0,0xc0,0x40,0xf2}, {0xc0,0xc0,0x60,0xf3},
1197 {0xc0,0xc0,0x80,0xf4}, {0xc0,0xc0,0xa0,0xf5}, {0xf0,0xfb,0xff,0xf6}, {0xa4,0xa0,0xa0,0xf7},
1198 {0x80,0x80,0x80,0xf8}, {0x00,0x00,0xff,0xf9}, {0x00,0xff,0x00,0xfa}, {0x00,0xff,0xff,0xfb},
1199 {0xff,0x00,0x00,0xfc}, {0xff,0x00,0xff,0xfd}, {0xff,0xff,0x00,0xfe}, {0xff,0xff,0xff,0xff},
1204 0x0000, 0x3000, 0x4000, 0x7fff, 0x8000, 0x8001, 0xc000, 0xffff,
1209 0x00,0x80,0x00,0xb0,0x00,0xc0,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0x3f,0xff,0x7f,
1214 0x00,0x00,0x00,0x00,0x80,0x01,0xc0,0x3e,0x00,0x00,0x80,0x3f,0x00,0x00,0x80,0x3f,
1215 0x00,0x01,0x00,0x3f,0x00,0x00,0x80,0x3f,0x00,0x00,0x80,0x3f,0x00,0x00,0x80,0x3f,
1216 0x00,0x00,0x80,0xbf,0x00,0x00,0x80,0xbf,0x00,0x00,0x80,0x3f,0x00,0x00,0x80,0x3f,
1217 0x00,0x01,0x00,0xbf,0x00,0x01,0x00,0xb8,0x00,0x00,0x80,0x3f,0x00,0x00,0x80,0x3f,
1222 0x00,0x30,0x40,0x7f,0x80,0x81,0xc0,0xff,
1227 0x00,0x00,0x00,0x00,0x06,0x83,0xc1,0x3e,0x00,0x00,0x80,0x3f,0x00,0x00,0x80,0x3f,
1228 0x04,0x02,0x01,0x3f,0x00,0x00,0x80,0x3f,0x00,0x00,0x80,0x3f,0x00,0x00,0x80,0x3f,
1229 0x00,0x00,0x80,0xbf,0x00,0x00,0x80,0xbf,0x00,0x00,0x80,0x3f,0x00,0x00,0x80,0x3f,
1230 0x04,0x02,0x01,0xbf,0x04,0x02,0x01,0xbc,0x00,0x00,0x80,0x3f,0x00,0x00,0x80,0x3f,
1235 0x0000,0x1000,0x2000,0x3000,0x4000,0x5000,0x6000,0x7000,
1236 0x8000,0x9000,0xa000,0xb000,0xc000,0xd000,0xe000,0xffff,
1241 0x00,0x00,0x00,0x00,0x80,0x00,0x80,0x3d,0x80,0x00,0x00,0x3e,0xc0,0x00,0x40,0x3e,
1242 0x80,0x00,0x80,0x3e,0xa0,0x00,0xa0,0x3e,0xc0,0x00,0xc0,0x3e,0xe0,0x00,0xe0,0x3e,
1243 0x80,0x00,0x00,0x3f,0x90,0x00,0x10,0x3f,0xa0,0x00,0x20,0x3f,0xb0,0x00,0x30,0x3f,
1244 0xc0,0x00,0x40,0x3f,0xd0,0x00,0x50,0x3f,0xe0,0x00,0x60,0x3f,0x00,0x00,0x80,0x3f,
1249 0x0000,0x1000,0x2000,0x3000,0x4000,0x5000,0x6000,0x7fff,
1250 0x8000,0x8001,0xa000,0xb000,0xc000,0xd000,0xe000,0xffff,
1255 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x3e,0x00,0x01,0x80,0x3e,0x80,0x01,0xc0,0x3e,
1256 0x00,0x01,0x00,0x3f,0x40,0x01,0x20,0x3f,0x80,0x01,0x40,0x3f,0x00,0x00,0x80,0x3f,
1257 0x00,0x00,0x80,0xbf,0x00,0x00,0x80,0xbf,0x80,0x01,0x40,0xbf,0x40,0x01,0x20,0xbf,
1258 0x00,0x01,0x00,0xbf,0x80,0x01,0xc0,0xbe,0x00,0x01,0x80,0xbe,0x00,0x01,0x00,0xb8,
1263 0x00,0x40,0x80,0xff,
1268 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x00,0x00,0x80,0x80,0xff,0xff,0xff,0xff,
1273 0x00,0x10,0x40,0x20,0x80,0x30,0xff,0x40
1278 0x00,0x00,0x00,0x10,0x00,0x00,0x40,0x20,0x00,0x00,0x80,0x30,0xff,0xff,0xff,0x40,
1312 assert(0 &&
"Need to add format to get_bpp_for_d3dformat().");
1323 const RECT src_rect;
1324 const void *src_data;
1327 const void *expected_dst_data;
1342 IDirect3DTexture9 *tex;
1355 ok(
hr ==
D3D_OK,
"Failed to get the surface, hr %#lx.\n",
hr);
1367 for (
y = 0;
y <
tests[
i].src_rect.bottom; ++
y)
1372 for (
x = 0;
x <
tests[
i].src_rect.right; ++
x)
1374 const uint8_t *dst_expected_pixel = dst_expected_row + (dst_fmt_bpp *
x);
1375 const uint8_t *dst_pixel = dst_row + (dst_fmt_bpp *
x);
1376 BOOL pixel_match = !
memcmp(dst_pixel, dst_expected_pixel, dst_fmt_bpp);
1398 static const uint32_t dxt_pma_decompressed_expected[] =
1400 0x00000000, 0x22ffffff, 0x44ffffff, 0x66ffffff, 0x88f7f3f7, 0xaac5c2c5, 0xcca5a2a5, 0xff848284,
1401 0x00000000, 0x22ffffff, 0x44ffffff, 0x66ffffff, 0x88f7f3f7, 0xaac5c2c5, 0xcca5a2a5, 0xff848284,
1403 static const uint32_t dxt_decompressed_expected[] =
1405 0x00848284, 0x22848284, 0x44848284, 0x66848284, 0x88848284, 0xaa848284, 0xcc848284, 0xff848284,
1406 0x00848284, 0x22848284, 0x44848284, 0x66848284, 0x88848284, 0xaa848284, 0xcc848284, 0xff848284,
1408 static const uint8_t dxt3_block[] =
1410 0x20,0x64,0xa8,0xfc,0x20,0x64,0xa8,0xfc,0x10,0x84,0x10,0x84,0x00,0x00,0x00,0x00,
1412 static const uint8_t dxt5_block[] =
1414 0x22,0xcc,0x86,0xc6,0xe6,0x86,0xc6,0xe6,0x10,0x84,0x10,0x84,0x00,0x00,0x00,0x00,
1416 static const uint32_t test_compress_pixels[] =
1418 0xffffffff, 0x00ffffff, 0xffffffff, 0x00ffffff, 0xffffffff, 0x00ffffff, 0xffffffff, 0x00ffffff,
1419 0xffffffff, 0x00ffffff, 0xffffffff, 0x00ffffff, 0xffffffff, 0x00ffffff, 0xffffffff, 0x00ffffff,
1421 static const struct test
1432 static const RECT src_rect = { 0, 0, 4, 4 };
1444 IDirect3DTexture9 *pma_tex, *tex;
1450 skip(
"Failed to create texture for format %#x, hr %#lx.\n",
tests[
i].pma_fmt,
hr);
1458 skip(
"Failed to create texture for format %#x, hr %#lx.\n",
tests[
i].nonpma_fmt,
hr);
1484 for (
y = 0;
y < 4; ++
y)
1486 for (
x = 0;
x < 4; ++
x)
1488 const uint32_t expected_pixel = !(
x & 0x01) ? 0xffffffff : 0x00000000;
1497 for (
y = 0;
y < 4; ++
y)
1499 for (
x = 0;
x < 4; ++
x)
1513 for (
y = 0;
y < 4; ++
y)
1515 for (
x = 0;
x < 4; ++
x)
1517 const uint32_t expected_pixel = dxt_pma_decompressed_expected[(
y * 4) +
x];
1518 const BOOL todo = ((expected_pixel >> 24) & 0xff) != 0xff;
1532 for (
y = 0;
y < 4; ++
y)
1534 for (
x = 0;
x < 4; ++
x)
1550 0x00,0x00,0x10,0x00,0x00,0x02,0x10,0x02,0x00,0x40,0x10,0x40,0x00,0x42,0x18,0x63,
1551 0x78,0x63,0x34,0x7b,0x88,0x00,0x8c,0x00,0x90,0x00,0x94,0x00,0x98,0x00,0x9c,0x00,
1552 0x00,0x01,0x04,0x01,0x08,0x01,0x0c,0x01,0x10,0x01,0x14,0x01,0x18,0x01,0x1c,0x01,
1553 0x80,0x01,0x84,0x01,0x88,0x01,0x8c,0x01,0x90,0x01,0x94,0x01,0x98,0x01,0x9c,0x01,
1554 0x00,0x02,0x04,0x02,0x08,0x02,0x0c,0x02,0x10,0x02,0x14,0x02,0x18,0x02,0x1c,0x02,
1555 0x80,0x02,0x84,0x02,0x88,0x02,0x8c,0x02,0x90,0x02,0x94,0x02,0x98,0x02,0x9c,0x02,
1556 0x00,0x03,0x04,0x03,0x08,0x03,0x0c,0x03,0x10,0x03,0x14,0x03,0x18,0x03,0x1c,0x03,
1557 0x80,0x03,0x84,0x03,0x88,0x03,0x8c,0x03,0x90,0x03,0x94,0x03,0x98,0x03,0x9c,0x03,
1558 0x00,0x20,0x04,0x20,0x08,0x20,0x0c,0x20,0x10,0x20,0x14,0x20,0x18,0x20,0x1c,0x20,
1559 0x80,0x20,0x84,0x20,0x88,0x20,0x8c,0x20,0x90,0x20,0x94,0x20,0x98,0x20,0x9c,0x20,
1560 0x00,0x21,0x04,0x21,0x08,0x21,0x0c,0x21,0x10,0x21,0x14,0x21,0x18,0x21,0x1c,0x21,
1561 0x80,0x21,0x84,0x21,0x88,0x21,0x8c,0x21,0x90,0x21,0x94,0x21,0x98,0x21,0x9c,0x21,
1562 0x00,0x22,0x04,0x22,0x08,0x22,0x0c,0x22,0x10,0x22,0x14,0x22,0x18,0x22,0x1c,0x22,
1563 0x80,0x22,0x84,0x22,0x88,0x22,0x8c,0x22,0x90,0x22,0x94,0x22,0x98,0x22,0x9c,0x22,
1564 0x00,0x23,0x04,0x23,0x08,0x23,0x0c,0x23,0x10,0x23,0x14,0x23,0x18,0x23,0x1c,0x23,
1565 0x80,0x23,0x84,0x23,0x88,0x23,0x8c,0x23,0x90,0x23,0x94,0x23,0x98,0x23,0x9c,0x23,
1566 0x00,0x40,0x04,0x40,0x08,0x40,0x0c,0x40,0x10,0x40,0x14,0x40,0x18,0x40,0x1c,0x40,
1567 0x80,0x40,0x84,0x40,0x88,0x40,0x8c,0x40,0x90,0x40,0x94,0x40,0x98,0x40,0x9c,0x40,
1568 0x00,0x41,0x04,0x41,0x08,0x41,0x0c,0x41,0x10,0x41,0x14,0x41,0x18,0x41,0x1c,0x41,
1569 0x80,0x41,0x84,0x41,0x88,0x41,0x8c,0x41,0x90,0x41,0x94,0x41,0x98,0x41,0x9c,0x41,
1570 0x00,0x42,0x04,0x42,0x08,0x42,0x0c,0x42,0x10,0x42,0x14,0x42,0x18,0x42,0x1c,0x42,
1571 0x80,0x42,0x84,0x42,0x88,0x42,0x8c,0x42,0x90,0x42,0x94,0x42,0x98,0x42,0x9c,0x42,
1572 0x00,0x43,0x04,0x43,0x08,0x43,0x0c,0x43,0x10,0x43,0x14,0x43,0x18,0x43,0x1c,0x43,
1573 0x80,0x43,0x84,0x43,0x88,0x43,0x8c,0x43,0x90,0x43,0x94,0x43,0x98,0x43,0x9c,0x43,
1574 0x00,0x60,0x04,0x60,0x08,0x60,0x0c,0x60,0x10,0x60,0x14,0x60,0x18,0x60,0x1c,0x60,
1575 0x80,0x60,0x84,0x60,0x88,0x60,0x8c,0x60,0x90,0x60,0x94,0x60,0x98,0x60,0x9c,0x60,
1576 0x00,0x61,0x04,0x61,0x08,0x61,0x0c,0x61,0x10,0x61,0x14,0x61,0x18,0x61,0x1c,0x61,
1577 0x80,0x61,0x84,0x61,0x88,0x61,0x8c,0x61,0x90,0x61,0x94,0x61,0x98,0x61,0x9c,0x61,
1578 0x00,0x62,0x04,0x62,0x08,0x62,0x0c,0x62,0x10,0x62,0x14,0x62,0x18,0x62,0x1c,0x62,
1579 0x80,0x62,0x84,0x62,0x88,0x62,0x8c,0x62,0x90,0x62,0x94,0x62,0x98,0x62,0x9c,0x62,
1580 0x00,0x63,0x04,0x63,0x08,0x63,0x0c,0x63,0x10,0x63,0x14,0x63,0xff,0x7b,0x94,0x52,
1581 0x10,0x42,0x1f,0x00,0xe0,0x03,0xff,0x03,0x00,0x7c,0x1f,0x7c,0xe0,0x7f,0xff,0x7f,
1586 0x00,0x00,0x10,0x00,0x00,0x02,0x10,0x02,0x00,0x40,0x10,0x40,0x00,0x42,0x18,0x63,
1587 0x78,0x63,0x34,0x7b,0x88,0x00,0x8c,0x00,0x90,0x00,0x94,0x00,0x98,0x00,0x9c,0x00,
1588 0x00,0x01,0x04,0x01,0x08,0x01,0x0c,0x01,0x10,0x01,0x14,0x01,0x18,0x01,0x1c,0x01,
1589 0x80,0x01,0x84,0x01,0x88,0x01,0x8c,0x01,0x90,0x01,0x94,0x01,0x98,0x01,0x9c,0x01,
1590 0x00,0x02,0x04,0x02,0x08,0x02,0x0c,0x02,0x10,0x02,0x14,0x02,0x18,0x02,0x1c,0x02,
1591 0x80,0x02,0x84,0x02,0x88,0x02,0x8c,0x02,0x90,0x02,0x94,0x02,0x98,0x02,0x9c,0x02,
1592 0x00,0x03,0x04,0x03,0x08,0x03,0x0c,0x03,0x10,0x03,0x14,0x03,0x18,0x03,0x1c,0x03,
1593 0x80,0x03,0x84,0x03,0x88,0x03,0x8c,0x03,0x90,0x03,0x94,0x03,0x98,0x03,0x9c,0x03,
1594 0x00,0x20,0x04,0x20,0x08,0x20,0x0c,0x20,0x10,0x20,0x14,0x20,0x18,0x20,0x1c,0x20,
1595 0x80,0x20,0x84,0x20,0x88,0x20,0x8c,0x20,0x90,0x20,0x94,0x20,0x98,0x20,0x9c,0x20,
1596 0x00,0x21,0x04,0x21,0x08,0x21,0x0c,0x21,0x10,0x21,0x14,0x21,0x18,0x21,0x1c,0x21,
1597 0x80,0x21,0x84,0x21,0x88,0x21,0x8c,0x21,0x90,0x21,0x94,0x21,0x98,0x21,0x9c,0x21,
1598 0x00,0x22,0x04,0x22,0x08,0x22,0x0c,0x22,0x10,0x22,0x14,0x22,0x18,0x22,0x1c,0x22,
1599 0x80,0x22,0x84,0x22,0x88,0x22,0x8c,0x22,0x90,0x22,0x94,0x22,0x98,0x22,0x9c,0x22,
1600 0x00,0x23,0x04,0x23,0x08,0x23,0x0c,0x23,0x10,0x23,0x14,0x23,0x18,0x23,0x1c,0x23,
1601 0x80,0x23,0x84,0x23,0x88,0x23,0x8c,0x23,0x90,0x23,0x94,0x23,0x98,0x23,0x9c,0x23,
1602 0x00,0xc0,0x04,0xc0,0x08,0xc0,0x0c,0xc0,0x10,0xc0,0x14,0xc0,0x18,0xc0,0x1c,0xc0,
1603 0x80,0xc0,0x84,0xc0,0x88,0xc0,0x8c,0xc0,0x90,0xc0,0x94,0xc0,0x98,0xc0,0x9c,0xc0,
1604 0x00,0xc1,0x04,0xc1,0x08,0xc1,0x0c,0xc1,0x10,0xc1,0x14,0xc1,0x18,0xc1,0x1c,0xc1,
1605 0x80,0xc1,0x84,0xc1,0x88,0xc1,0x8c,0xc1,0x90,0xc1,0x94,0xc1,0x98,0xc1,0x9c,0xc1,
1606 0x00,0xc2,0x04,0xc2,0x08,0xc2,0x0c,0xc2,0x10,0xc2,0x14,0xc2,0x18,0xc2,0x1c,0xc2,
1607 0x80,0xc2,0x84,0xc2,0x88,0xc2,0x8c,0xc2,0x90,0xc2,0x94,0xc2,0x98,0xc2,0x9c,0xc2,
1608 0x00,0xc3,0x04,0xc3,0x08,0xc3,0x0c,0xc3,0x10,0xc3,0x14,0xc3,0x18,0xc3,0x1c,0xc3,
1609 0x80,0xc3,0x84,0xc3,0x88,0xc3,0x8c,0xc3,0x90,0xc3,0x94,0xc3,0x98,0xc3,0x9c,0xc3,
1610 0x00,0xe0,0x04,0xe0,0x08,0xe0,0x0c,0xe0,0x10,0xe0,0x14,0xe0,0x18,0xe0,0x1c,0xe0,
1611 0x80,0xe0,0x84,0xe0,0x88,0xe0,0x8c,0xe0,0x90,0xe0,0x94,0xe0,0x98,0xe0,0x9c,0xe0,
1612 0x00,0xe1,0x04,0xe1,0x08,0xe1,0x0c,0xe1,0x10,0xe1,0x14,0xe1,0x18,0xe1,0x1c,0xe1,
1613 0x80,0xe1,0x84,0xe1,0x88,0xe1,0x8c,0xe1,0x90,0xe1,0x94,0xe1,0x98,0xe1,0x9c,0xe1,
1614 0x00,0xe2,0x04,0xe2,0x08,0xe2,0x0c,0xe2,0x10,0xe2,0x14,0xe2,0x18,0xe2,0x1c,0xe2,
1615 0x80,0xe2,0x84,0xe2,0x88,0xe2,0x8c,0xe2,0x90,0xe2,0x94,0xe2,0x98,0xe2,0x9c,0xe2,
1616 0x00,0xe3,0x04,0xe3,0x08,0xe3,0x0c,0xe3,0x10,0xe3,0x14,0xe3,0xff,0xfb,0x94,0xd2,
1617 0x10,0xc2,0x1f,0x80,0xe0,0x83,0xff,0x83,0x00,0xfc,0x1f,0xfc,0xe0,0xff,0xff,0xff,
1622 0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0x80,
1623 0x00,0x80,0x00,0x80,0x80,0xc0,0xc0,0xc0,0xc0,0xdc,0xc0,0xa6,0xca,0xf0,0x40,0x20,
1624 0x00,0x60,0x20,0x00,0x80,0x20,0x00,0xa0,0x20,0x00,0xc0,0x20,0x00,0xe0,0x20,0x00,
1625 0x00,0x40,0x00,0x20,0x40,0x00,0x40,0x40,0x00,0x60,0x40,0x00,0x80,0x40,0x00,0xa0,
1626 0x40,0x00,0xc0,0x40,0x00,0xe0,0x40,0x00,0x00,0x60,0x00,0x20,0x60,0x00,0x40,0x60,
1627 0x00,0x60,0x60,0x00,0x80,0x60,0x00,0xa0,0x60,0x00,0xc0,0x60,0x00,0xe0,0x60,0x00,
1628 0x00,0x80,0x00,0x20,0x80,0x00,0x40,0x80,0x00,0x60,0x80,0x00,0x80,0x80,0x00,0xa0,
1629 0x80,0x00,0xc0,0x80,0x00,0xe0,0x80,0x00,0x00,0xa0,0x00,0x20,0xa0,0x00,0x40,0xa0,
1630 0x00,0x60,0xa0,0x00,0x80,0xa0,0x00,0xa0,0xa0,0x00,0xc0,0xa0,0x00,0xe0,0xa0,0x00,
1631 0x00,0xc0,0x00,0x20,0xc0,0x00,0x40,0xc0,0x00,0x60,0xc0,0x00,0x80,0xc0,0x00,0xa0,
1632 0xc0,0x00,0xc0,0xc0,0x00,0xe0,0xc0,0x00,0x00,0xe0,0x00,0x20,0xe0,0x00,0x40,0xe0,
1633 0x00,0x60,0xe0,0x00,0x80,0xe0,0x00,0xa0,0xe0,0x00,0xc0,0xe0,0x00,0xe0,0xe0,0x00,
1634 0x00,0x00,0x40,0x20,0x00,0x40,0x40,0x00,0x40,0x60,0x00,0x40,0x80,0x00,0x40,0xa0,
1635 0x00,0x40,0xc0,0x00,0x40,0xe0,0x00,0x40,0x00,0x20,0x40,0x20,0x20,0x40,0x40,0x20,
1636 0x40,0x60,0x20,0x40,0x80,0x20,0x40,0xa0,0x20,0x40,0xc0,0x20,0x40,0xe0,0x20,0x40,
1637 0x00,0x40,0x40,0x20,0x40,0x40,0x40,0x40,0x40,0x60,0x40,0x40,0x80,0x40,0x40,0xa0,
1638 0x40,0x40,0xc0,0x40,0x40,0xe0,0x40,0x40,0x00,0x60,0x40,0x20,0x60,0x40,0x40,0x60,
1639 0x40,0x60,0x60,0x40,0x80,0x60,0x40,0xa0,0x60,0x40,0xc0,0x60,0x40,0xe0,0x60,0x40,
1640 0x00,0x80,0x40,0x20,0x80,0x40,0x40,0x80,0x40,0x60,0x80,0x40,0x80,0x80,0x40,0xa0,
1641 0x80,0x40,0xc0,0x80,0x40,0xe0,0x80,0x40,0x00,0xa0,0x40,0x20,0xa0,0x40,0x40,0xa0,
1642 0x40,0x60,0xa0,0x40,0x80,0xa0,0x40,0xa0,0xa0,0x40,0xc0,0xa0,0x40,0xe0,0xa0,0x40,
1643 0x00,0xc0,0x40,0x20,0xc0,0x40,0x40,0xc0,0x40,0x60,0xc0,0x40,0x80,0xc0,0x40,0xa0,
1644 0xc0,0x40,0xc0,0xc0,0x40,0xe0,0xc0,0x40,0x00,0xe0,0x40,0x20,0xe0,0x40,0x40,0xe0,
1645 0x40,0x60,0xe0,0x40,0x80,0xe0,0x40,0xa0,0xe0,0x40,0xc0,0xe0,0x40,0xe0,0xe0,0x40,
1646 0x00,0x00,0x80,0x20,0x00,0x80,0x40,0x00,0x80,0x60,0x00,0x80,0x80,0x00,0x80,0xa0,
1647 0x00,0x80,0xc0,0x00,0x80,0xe0,0x00,0x80,0x00,0x20,0x80,0x20,0x20,0x80,0x40,0x20,
1648 0x80,0x60,0x20,0x80,0x80,0x20,0x80,0xa0,0x20,0x80,0xc0,0x20,0x80,0xe0,0x20,0x80,
1649 0x00,0x40,0x80,0x20,0x40,0x80,0x40,0x40,0x80,0x60,0x40,0x80,0x80,0x40,0x80,0xa0,
1650 0x40,0x80,0xc0,0x40,0x80,0xe0,0x40,0x80,0x00,0x60,0x80,0x20,0x60,0x80,0x40,0x60,
1651 0x80,0x60,0x60,0x80,0x80,0x60,0x80,0xa0,0x60,0x80,0xc0,0x60,0x80,0xe0,0x60,0x80,
1652 0x00,0x80,0x80,0x20,0x80,0x80,0x40,0x80,0x80,0x60,0x80,0x80,0x80,0x80,0x80,0xa0,
1653 0x80,0x80,0xc0,0x80,0x80,0xe0,0x80,0x80,0x00,0xa0,0x80,0x20,0xa0,0x80,0x40,0xa0,
1654 0x80,0x60,0xa0,0x80,0x80,0xa0,0x80,0xa0,0xa0,0x80,0xc0,0xa0,0x80,0xe0,0xa0,0x80,
1655 0x00,0xc0,0x80,0x20,0xc0,0x80,0x40,0xc0,0x80,0x60,0xc0,0x80,0x80,0xc0,0x80,0xa0,
1656 0xc0,0x80,0xc0,0xc0,0x80,0xe0,0xc0,0x80,0x00,0xe0,0x80,0x20,0xe0,0x80,0x40,0xe0,
1657 0x80,0x60,0xe0,0x80,0x80,0xe0,0x80,0xa0,0xe0,0x80,0xc0,0xe0,0x80,0xe0,0xe0,0x80,
1658 0x00,0x00,0xc0,0x20,0x00,0xc0,0x40,0x00,0xc0,0x60,0x00,0xc0,0x80,0x00,0xc0,0xa0,
1659 0x00,0xc0,0xc0,0x00,0xc0,0xe0,0x00,0xc0,0x00,0x20,0xc0,0x20,0x20,0xc0,0x40,0x20,
1660 0xc0,0x60,0x20,0xc0,0x80,0x20,0xc0,0xa0,0x20,0xc0,0xc0,0x20,0xc0,0xe0,0x20,0xc0,
1661 0x00,0x40,0xc0,0x20,0x40,0xc0,0x40,0x40,0xc0,0x60,0x40,0xc0,0x80,0x40,0xc0,0xa0,
1662 0x40,0xc0,0xc0,0x40,0xc0,0xe0,0x40,0xc0,0x00,0x60,0xc0,0x20,0x60,0xc0,0x40,0x60,
1663 0xc0,0x60,0x60,0xc0,0x80,0x60,0xc0,0xa0,0x60,0xc0,0xc0,0x60,0xc0,0xe0,0x60,0xc0,
1664 0x00,0x80,0xc0,0x20,0x80,0xc0,0x40,0x80,0xc0,0x60,0x80,0xc0,0x80,0x80,0xc0,0xa0,
1665 0x80,0xc0,0xc0,0x80,0xc0,0xe0,0x80,0xc0,0x00,0xa0,0xc0,0x20,0xa0,0xc0,0x40,0xa0,
1666 0xc0,0x60,0xa0,0xc0,0x80,0xa0,0xc0,0xa0,0xa0,0xc0,0xc0,0xa0,0xc0,0xe0,0xa0,0xc0,
1667 0x00,0xc0,0xc0,0x20,0xc0,0xc0,0x40,0xc0,0xc0,0x60,0xc0,0xc0,0x80,0xc0,0xc0,0xa0,
1668 0xc0,0xc0,0xff,0xfb,0xf0,0xa0,0xa0,0xa4,0x80,0x80,0x80,0xff,0x00,0x00,0x00,0xff,
1669 0x00,0xff,0xff,0x00,0x00,0x00,0xff,0xff,0x00,0xff,0x00,0xff,0xff,0xff,0xff,0xff,
1674 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x01,0x00,0x80,0x00,0x02,0x80,0x80,0x00,0x03,
1675 0x00,0x00,0x80,0x04,0x80,0x00,0x80,0x05,0x00,0x80,0x80,0x06,0xc0,0xc0,0xc0,0x07,
1676 0xc0,0xdc,0xc0,0x08,0xa6,0xca,0xf0,0x09,0x40,0x20,0x00,0x0a,0x60,0x20,0x00,0x0b,
1677 0x80,0x20,0x00,0x0c,0xa0,0x20,0x00,0x0d,0xc0,0x20,0x00,0x0e,0xe0,0x20,0x00,0x0f,
1678 0x00,0x40,0x00,0x10,0x20,0x40,0x00,0x11,0x40,0x40,0x00,0x12,0x60,0x40,0x00,0x13,
1679 0x80,0x40,0x00,0x14,0xa0,0x40,0x00,0x15,0xc0,0x40,0x00,0x16,0xe0,0x40,0x00,0x17,
1680 0x00,0x60,0x00,0x18,0x20,0x60,0x00,0x19,0x40,0x60,0x00,0x1a,0x60,0x60,0x00,0x1b,
1681 0x80,0x60,0x00,0x1c,0xa0,0x60,0x00,0x1d,0xc0,0x60,0x00,0x1e,0xe0,0x60,0x00,0x1f,
1682 0x00,0x80,0x00,0x20,0x20,0x80,0x00,0x21,0x40,0x80,0x00,0x22,0x60,0x80,0x00,0x23,
1683 0x80,0x80,0x00,0x24,0xa0,0x80,0x00,0x25,0xc0,0x80,0x00,0x26,0xe0,0x80,0x00,0x27,
1684 0x00,0xa0,0x00,0x28,0x20,0xa0,0x00,0x29,0x40,0xa0,0x00,0x2a,0x60,0xa0,0x00,0x2b,
1685 0x80,0xa0,0x00,0x2c,0xa0,0xa0,0x00,0x2d,0xc0,0xa0,0x00,0x2e,0xe0,0xa0,0x00,0x2f,
1686 0x00,0xc0,0x00,0x30,0x20,0xc0,0x00,0x31,0x40,0xc0,0x00,0x32,0x60,0xc0,0x00,0x33,
1687 0x80,0xc0,0x00,0x34,0xa0,0xc0,0x00,0x35,0xc0,0xc0,0x00,0x36,0xe0,0xc0,0x00,0x37,
1688 0x00,0xe0,0x00,0x38,0x20,0xe0,0x00,0x39,0x40,0xe0,0x00,0x3a,0x60,0xe0,0x00,0x3b,
1689 0x80,0xe0,0x00,0x3c,0xa0,0xe0,0x00,0x3d,0xc0,0xe0,0x00,0x3e,0xe0,0xe0,0x00,0x3f,
1690 0x00,0x00,0x40,0x40,0x20,0x00,0x40,0x41,0x40,0x00,0x40,0x42,0x60,0x00,0x40,0x43,
1691 0x80,0x00,0x40,0x44,0xa0,0x00,0x40,0x45,0xc0,0x00,0x40,0x46,0xe0,0x00,0x40,0x47,
1692 0x00,0x20,0x40,0x48,0x20,0x20,0x40,0x49,0x40,0x20,0x40,0x4a,0x60,0x20,0x40,0x4b,
1693 0x80,0x20,0x40,0x4c,0xa0,0x20,0x40,0x4d,0xc0,0x20,0x40,0x4e,0xe0,0x20,0x40,0x4f,
1694 0x00,0x40,0x40,0x50,0x20,0x40,0x40,0x51,0x40,0x40,0x40,0x52,0x60,0x40,0x40,0x53,
1695 0x80,0x40,0x40,0x54,0xa0,0x40,0x40,0x55,0xc0,0x40,0x40,0x56,0xe0,0x40,0x40,0x57,
1696 0x00,0x60,0x40,0x58,0x20,0x60,0x40,0x59,0x40,0x60,0x40,0x5a,0x60,0x60,0x40,0x5b,
1697 0x80,0x60,0x40,0x5c,0xa0,0x60,0x40,0x5d,0xc0,0x60,0x40,0x5e,0xe0,0x60,0x40,0x5f,
1698 0x00,0x80,0x40,0x60,0x20,0x80,0x40,0x61,0x40,0x80,0x40,0x62,0x60,0x80,0x40,0x63,
1699 0x80,0x80,0x40,0x64,0xa0,0x80,0x40,0x65,0xc0,0x80,0x40,0x66,0xe0,0x80,0x40,0x67,
1700 0x00,0xa0,0x40,0x68,0x20,0xa0,0x40,0x69,0x40,0xa0,0x40,0x6a,0x60,0xa0,0x40,0x6b,
1701 0x80,0xa0,0x40,0x6c,0xa0,0xa0,0x40,0x6d,0xc0,0xa0,0x40,0x6e,0xe0,0xa0,0x40,0x6f,
1702 0x00,0xc0,0x40,0x70,0x20,0xc0,0x40,0x71,0x40,0xc0,0x40,0x72,0x60,0xc0,0x40,0x73,
1703 0x80,0xc0,0x40,0x74,0xa0,0xc0,0x40,0x75,0xc0,0xc0,0x40,0x76,0xe0,0xc0,0x40,0x77,
1704 0x00,0xe0,0x40,0x78,0x20,0xe0,0x40,0x79,0x40,0xe0,0x40,0x7a,0x60,0xe0,0x40,0x7b,
1705 0x80,0xe0,0x40,0x7c,0xa0,0xe0,0x40,0x7d,0xc0,0xe0,0x40,0x7e,0xe0,0xe0,0x40,0x7f,
1706 0x00,0x00,0x80,0x80,0x20,0x00,0x80,0x81,0x40,0x00,0x80,0x82,0x60,0x00,0x80,0x83,
1707 0x80,0x00,0x80,0x84,0xa0,0x00,0x80,0x85,0xc0,0x00,0x80,0x86,0xe0,0x00,0x80,0x87,
1708 0x00,0x20,0x80,0x88,0x20,0x20,0x80,0x89,0x40,0x20,0x80,0x8a,0x60,0x20,0x80,0x8b,
1709 0x80,0x20,0x80,0x8c,0xa0,0x20,0x80,0x8d,0xc0,0x20,0x80,0x8e,0xe0,0x20,0x80,0x8f,
1710 0x00,0x40,0x80,0x90,0x20,0x40,0x80,0x91,0x40,0x40,0x80,0x92,0x60,0x40,0x80,0x93,
1711 0x80,0x40,0x80,0x94,0xa0,0x40,0x80,0x95,0xc0,0x40,0x80,0x96,0xe0,0x40,0x80,0x97,
1712 0x00,0x60,0x80,0x98,0x20,0x60,0x80,0x99,0x40,0x60,0x80,0x9a,0x60,0x60,0x80,0x9b,
1713 0x80,0x60,0x80,0x9c,0xa0,0x60,0x80,0x9d,0xc0,0x60,0x80,0x9e,0xe0,0x60,0x80,0x9f,
1714 0x00,0x80,0x80,0xa0,0x20,0x80,0x80,0xa1,0x40,0x80,0x80,0xa2,0x60,0x80,0x80,0xa3,
1715 0x80,0x80,0x80,0xa4,0xa0,0x80,0x80,0xa5,0xc0,0x80,0x80,0xa6,0xe0,0x80,0x80,0xa7,
1716 0x00,0xa0,0x80,0xa8,0x20,0xa0,0x80,0xa9,0x40,0xa0,0x80,0xaa,0x60,0xa0,0x80,0xab,
1717 0x80,0xa0,0x80,0xac,0xa0,0xa0,0x80,0xad,0xc0,0xa0,0x80,0xae,0xe0,0xa0,0x80,0xaf,
1718 0x00,0xc0,0x80,0xb0,0x20,0xc0,0x80,0xb1,0x40,0xc0,0x80,0xb2,0x60,0xc0,0x80,0xb3,
1719 0x80,0xc0,0x80,0xb4,0xa0,0xc0,0x80,0xb5,0xc0,0xc0,0x80,0xb6,0xe0,0xc0,0x80,0xb7,
1720 0x00,0xe0,0x80,0xb8,0x20,0xe0,0x80,0xb9,0x40,0xe0,0x80,0xba,0x60,0xe0,0x80,0xbb,
1721 0x80,0xe0,0x80,0xbc,0xa0,0xe0,0x80,0xbd,0xc0,0xe0,0x80,0xbe,0xe0,0xe0,0x80,0xbf,
1722 0x00,0x00,0xc0,0xc0,0x20,0x00,0xc0,0xc1,0x40,0x00,0xc0,0xc2,0x60,0x00,0xc0,0xc3,
1723 0x80,0x00,0xc0,0xc4,0xa0,0x00,0xc0,0xc5,0xc0,0x00,0xc0,0xc6,0xe0,0x00,0xc0,0xc7,
1724 0x00,0x20,0xc0,0xc8,0x20,0x20,0xc0,0xc9,0x40,0x20,0xc0,0xca,0x60,0x20,0xc0,0xcb,
1725 0x80,0x20,0xc0,0xcc,0xa0,0x20,0xc0,0xcd,0xc0,0x20,0xc0,0xce,0xe0,0x20,0xc0,0xcf,
1726 0x00,0x40,0xc0,0xd0,0x20,0x40,0xc0,0xd1,0x40,0x40,0xc0,0xd2,0x60,0x40,0xc0,0xd3,
1727 0x80,0x40,0xc0,0xd4,0xa0,0x40,0xc0,0xd5,0xc0,0x40,0xc0,0xd6,0xe0,0x40,0xc0,0xd7,
1728 0x00,0x60,0xc0,0xd8,0x20,0x60,0xc0,0xd9,0x40,0x60,0xc0,0xda,0x60,0x60,0xc0,0xdb,
1729 0x80,0x60,0xc0,0xdc,0xa0,0x60,0xc0,0xdd,0xc0,0x60,0xc0,0xde,0xe0,0x60,0xc0,0xdf,
1730 0x00,0x80,0xc0,0xe0,0x20,0x80,0xc0,0xe1,0x40,0x80,0xc0,0xe2,0x60,0x80,0xc0,0xe3,
1731 0x80,0x80,0xc0,0xe4,0xa0,0x80,0xc0,0xe5,0xc0,0x80,0xc0,0xe6,0xe0,0x80,0xc0,0xe7,
1732 0x00,0xa0,0xc0,0xe8,0x20,0xa0,0xc0,0xe9,0x40,0xa0,0xc0,0xea,0x60,0xa0,0xc0,0xeb,
1733 0x80,0xa0,0xc0,0xec,0xa0,0xa0,0xc0,0xed,0xc0,0xa0,0xc0,0xee,0xe0,0xa0,0xc0,0xef,
1734 0x00,0xc0,0xc0,0xf0,0x20,0xc0,0xc0,0xf1,0x40,0xc0,0xc0,0xf2,0x60,0xc0,0xc0,0xf3,
1735 0x80,0xc0,0xc0,0xf4,0xa0,0xc0,0xc0,0xf5,0xff,0xfb,0xf0,0xf6,0xa0,0xa0,0xa4,0xf7,
1736 0x80,0x80,0x80,0xf8,0xff,0x00,0x00,0xf9,0x00,0xff,0x00,0xfa,0xff,0xff,0x00,0xfb,
1737 0x00,0x00,0xff,0xfc,0xff,0x00,0xff,0xfd,0x00,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,
1742 0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70,0x80,0x90,0xa0,0xb0,0xc0,0xd0,0xe0,0xff,
1747 0x83,0x10,0x83,0x20,0x03,0x80,0x90,0xa0,0xb0,0x03,0xc0,0xd0,0xe0,0xff,
1752 0x00,0x04,0x42,0x0c,0x84,0x14,0xc6,0x1c,0x08,0x25,0x4a,0x2d,0x8c,0x35,0xce,0x3d,
1753 0x10,0x46,0x52,0x4e,0x94,0x56,0xd6,0x5e,0x18,0x67,0x5a,0x6f,0x9c,0x77,0xde,0x7f,
1758 0x03,0x00,0x04,0x42,0x0c,0x84,0x14,0xc6,0x1c,0x81,0x08,0x25,0x00,0x8c,0x35,0x00,
1759 0xce,0x3d,0x03,0x10,0x46,0x52,0x4e,0x94,0x56,0xd6,0x5e,0x03,0x18,0x67,0x5a,0x6f,
1760 0x9c,0x77,0xde,0x7f,
1765 0x00,0x04,0x42,0x0c,0x84,0x14,0xc6,0x1c,0x08,0x25,0x4a,0x2d,0x8c,0x35,0xce,0x3d,
1766 0x10,0xc6,0x52,0xce,0x94,0xd6,0xd6,0xde,0x18,0xe7,0x5a,0xef,0x9c,0xf7,0xde,0xff,
1771 0x03,0x00,0x04,0x42,0x0c,0x84,0x14,0xc6,0x1c,0x81,0x08,0x25,0x00,0x8c,0x35,0x00,
1772 0xce,0x3d,0x03,0x10,0xc6,0x52,0xce,0x94,0xd6,0xd6,0xde,0x03,0x18,0xe7,0x5a,0xef,
1773 0x9c,0xf7,0xde,0xff,
1778 0x00,0x04,0x08,0x10,0x14,0x18,0x20,0x24,0x28,0x30,0x34,0x38,0x40,0x44,0x48,0x50,
1779 0x54,0x58,0x60,0x64,0x68,0x70,0x74,0x78,0x80,0x84,0x88,0x90,0x94,0x98,0xa0,0xa4,
1780 0xa8,0xb0,0xb4,0xb8,0xc0,0xc4,0xc8,0xd0,0xd4,0xd8,0xe0,0xe4,0xe8,0xf0,0xf4,0xf8,
1785 0x03,0x00,0x04,0x08,0x10,0x14,0x18,0x20,0x24,0x28,0x30,0x34,0x38,0x81,0x40,0x44,
1786 0x48,0x00,0x60,0x64,0x68,0x00,0x70,0x74,0x78,0x03,0x80,0x84,0x88,0x90,0x94,0x98,
1787 0xa0,0xa4,0xa8,0xb0,0xb4,0xb8,0x03,0xc0,0xc4,0xc8,0xd0,0xd4,0xd8,0xe0,0xe4,0xe8,
1793 0x08,0x04,0x00,0x0c,0x18,0x14,0x10,0x1c,0x28,0x24,0x20,0x2c,0x38,0x34,0x30,0x3c,
1794 0x48,0x44,0x40,0x4c,0x58,0x54,0x50,0x5c,0x68,0x64,0x60,0x6c,0x78,0x74,0x70,0x7c,
1795 0x88,0x84,0x80,0x8c,0x98,0x94,0x90,0x9c,0xa8,0xa4,0xa0,0xac,0xb8,0xb4,0xb0,0xbc,
1796 0xc8,0xc4,0xc0,0xcc,0xd8,0xd4,0xd0,0xdc,0xe8,0xe4,0xe0,0xec,0xf8,0xf4,0xf0,0xfc,
1801 0x03,0x08,0x04,0x00,0x0c,0x18,0x14,0x10,0x1c,0x28,0x24,0x20,0x2c,0x38,0x34,0x30,
1802 0x3c,0x81,0x48,0x44,0x40,0x4c,0x00,0x68,0x64,0x60,0x6c,0x00,0x78,0x74,0x70,0x7c,
1803 0x03,0x88,0x84,0x80,0x8c,0x98,0x94,0x90,0x9c,0xa8,0xa4,0xa0,0xac,0xb8,0xb4,0xb0,
1804 0xbc,0x03,0xc8,0xc4,0xc0,0xcc,0xd8,0xd4,0xd0,0xdc,0xe8,0xe4,0xe0,0xec,0xf8,0xf4,
1810 0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70,0x80,0x90,0xa0,0xb0,0xc0,0xd0,0xe0,0xf0,
1815 0x03,0x00,0x10,0x20,0x30,0x82,0x40,0x00,0x70,0x03,0x80,0x90,0xa0,0xb0,0x03,0xc0,
1822 0x00,0x00,0x00,0xff,0x00,0x42,0x00,0xff,0x00,0x84,0x00,0xff,0x00,0xc6,0x00,0xff,
1823 0x42,0x00,0x00,0xff,0x42,0x42,0x00,0xff,0x42,0x84,0x00,0xff,0x42,0xc6,0x00,0xff,
1824 0x84,0x00,0x00,0xff,0x84,0x42,0x00,0xff,0x84,0x84,0x00,0xff,0x84,0xc6,0x00,0xff,
1825 0xc6,0x00,0x00,0xff,0xc6,0x42,0x00,0xff,0xc6,0x84,0x00,0xff,0xff,0xff,0xff,0xff,
1830 0x00,0x42,0x00,0xff,0x00,0x42,0x00,0xff,0x00,0x42,0x00,0xff,0x00,0x42,0x00,0xff,
1831 0x00,0x84,0x00,0xff,0x00,0x84,0x00,0xff,0x00,0x84,0x00,0xff,0x00,0x84,0x00,0xff,
1832 0x84,0x00,0x00,0xff,0x84,0x42,0x00,0xff,0x84,0x84,0x00,0xff,0x84,0xc6,0x00,0xff,
1833 0xc6,0x00,0x00,0xff,0xc6,0x42,0x00,0xff,0xc6,0x84,0x00,0xff,0xff,0xff,0xff,0xff,
1838 0x00,0x00,0x00,0x00,0x00,0x42,0x00,0x00,0x00,0x84,0x00,0x00,0x00,0xc6,0x00,0x00,
1839 0x42,0x00,0x00,0x00,0x42,0x42,0x00,0x00,0x42,0x84,0x00,0x00,0x42,0xc6,0x00,0x00,
1840 0x84,0x00,0x00,0xff,0x84,0x42,0x00,0xff,0x84,0x84,0x00,0xff,0x84,0xc6,0x00,0xff,
1841 0xc6,0x00,0x00,0xff,0xc6,0x42,0x00,0xff,0xc6,0x84,0x00,0xff,0xff,0xff,0xff,0xff,
1846 0x00,0x00,0x00,0xff,0x00,0x40,0x00,0xff,0x00,0x80,0x00,0xff,0x00,0xc0,0x00,0xff,
1847 0x40,0x00,0x00,0xff,0x40,0x40,0x00,0xff,0x40,0x80,0x00,0xff,0x40,0xc0,0x00,0xff,
1848 0x80,0x00,0x00,0xff,0x80,0x40,0x00,0xff,0x80,0x80,0x00,0xff,0x80,0xc0,0x00,0xff,
1849 0xc0,0x00,0x00,0xff,0xc0,0x40,0x00,0xff,0xc0,0x80,0x00,0xff,0xff,0xff,0xff,0xff,
1854 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x10,0x00,0x80,0x00,0x20,0x00,0xc0,0x00,0x30,
1855 0x40,0x00,0x00,0x40,0x40,0x40,0x00,0x50,0x40,0x80,0x00,0x60,0x40,0xc0,0x00,0x70,
1856 0x80,0x00,0x00,0x80,0x80,0x40,0x00,0x90,0x80,0x80,0x00,0xa0,0x80,0xc0,0x00,0xb0,
1857 0xc0,0x00,0x00,0xc0,0xc0,0x40,0x00,0xd0,0xc0,0x80,0x00,0xe0,0xff,0xff,0xff,0xff,
1862 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x10,0x00,0x80,0x00,0x20,0x00,0xc0,0x00,0x30,
1863 0x40,0x00,0x00,0x40,0x40,0x40,0x00,0x50,0x40,0x80,0x00,0x60,0x40,0xc0,0x00,0x70,
1864 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
1865 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
1870 0x00,0x04,0x42,0x0c,0x84,0x14,0xc6,0x1c,0x08,0x25,0x08,0x25,0x8c,0x35,0xce,0x3d,
1871 0x10,0x46,0x52,0x4e,0x94,0x56,0xd6,0x5e,0x18,0x67,0x5a,0x6f,0x9c,0x77,0xde,0x7f,
1876 0x00,0x04,0x42,0x0c,0x84,0x14,0xc6,0x1c,0x08,0x25,0x08,0x25,0x8c,0x35,0xce,0x3d,
1877 0x10,0xc6,0x52,0xce,0x94,0xd6,0xd6,0xde,0x18,0xe7,0x5a,0xef,0x9c,0xf7,0xde,0xff,
1882 0x00,0x04,0x08,0x10,0x14,0x18,0x20,0x24,0x28,0x30,0x34,0x38,0x40,0x44,0x48,0x40,
1883 0x44,0x48,0x60,0x64,0x68,0x70,0x74,0x78,0x80,0x84,0x88,0x90,0x94,0x98,0xa0,0xa4,
1884 0xa8,0xb0,0xb4,0xb8,0xc0,0xc4,0xc8,0xd0,0xd4,0xd8,0xe0,0xe4,0xe8,0xf0,0xf4,0xf8,
1889 0x08,0x04,0x00,0x0c,0x18,0x14,0x10,0x1c,0x28,0x24,0x20,0x2c,0x38,0x34,0x30,0x3c,
1890 0x48,0x44,0x40,0x4c,0x48,0x44,0x40,0x4c,0x68,0x64,0x60,0x6c,0x78,0x74,0x70,0x7c,
1891 0x88,0x84,0x80,0x8c,0x98,0x94,0x90,0x9c,0xa8,0xa4,0xa0,0xac,0xb8,0xb4,0xb0,0xbc,
1892 0xc8,0xc4,0xc0,0xcc,0xd8,0xd4,0xd0,0xdc,0xe8,0xe4,0xe0,0xec,0xf8,0xf4,0xf0,0xfc,
1897 0x00,0x10,0x20,0x30,0x40,0x40,0x40,0x70,0x80,0x90,0xa0,0xb0,0xc0,0xd0,0xe0,0xf0,
1900#define check_tga_surface_load(surface, expected, right_to_left, bottom_to_top) \
1901 check_tga_surface_load_(__LINE__, surface, expected, right_to_left, bottom_to_top)
1914 fmt_pitch = fmt_bpp *
desc.Width;
1916 for (
y = 0;
y <
desc.Height; ++
y)
1918 const uint32_t expected_row_idx = bottom_to_top ? (
desc.Height -
y - 1) :
y;
1920 const uint8_t *expected_row =
expected + (fmt_pitch * expected_row_idx);
1922 for (
x = 0;
x <
desc.Width; ++
x)
1924 const uint32_t expected_pixel_idx = right_to_left ? (
desc.Width -
x - 1) :
x;
1925 const uint8_t *expected_pixel = expected_row + (fmt_bpp * expected_pixel_idx);
1927 BOOL pixel_match = !
memcmp(pixel, expected_pixel, fmt_bpp);
1929 ok_(__FILE__,
line)(pixel_match,
"Pixel mismatch at (%u,%u).\n",
x,
y);
1948 { { 0,
COLORMAP_TYPE_ONE,
IMAGETYPE_COLORMAPPED, 0, 256, 15, 0, 0, 4, 4, 8, 0 },
1953 { { 0,
COLORMAP_TYPE_ONE,
IMAGETYPE_COLORMAPPED |
IMAGETYPE_RLE, 0, 256, 15, 0, 0, 4, 4, 8, 0 },
1958 { { 0,
COLORMAP_TYPE_ONE,
IMAGETYPE_COLORMAPPED, 0, 256, 16, 0, 0, 4, 4, 8, 0 },
1963 { { 0,
COLORMAP_TYPE_ONE,
IMAGETYPE_COLORMAPPED, 0, 256, 24, 0, 0, 4, 4, 8, 0 },
1968 { { 0,
COLORMAP_TYPE_ONE,
IMAGETYPE_COLORMAPPED, 0, 256, 32, 0, 0, 4, 4, 8, 0 },
1973 { { 0,
COLORMAP_TYPE_ONE,
IMAGETYPE_COLORMAPPED, 0, 128, 32, 0, 0, 4, 4, 8, 0 },
1978 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_TRUECOLOR, 0, 0, 0, 0, 0, 4, 4, 15, 0 },
1983 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_TRUECOLOR |
IMAGETYPE_RLE, 0, 0, 0, 0, 0, 4, 4, 15, 0 },
1988 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_TRUECOLOR, 0, 0, 0, 0, 0, 4, 4, 16, 0 },
1993 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_TRUECOLOR |
IMAGETYPE_RLE, 0, 0, 0, 0, 0, 4, 4, 16, 0 },
1998 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_TRUECOLOR, 0, 0, 0, 0, 0, 4, 4, 24, 0 },
2003 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_TRUECOLOR |
IMAGETYPE_RLE, 0, 0, 0, 0, 0, 4, 4, 24, 0 },
2008 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_TRUECOLOR, 0, 0, 0, 0, 0, 4, 4, 32, 0 },
2013 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_TRUECOLOR |
IMAGETYPE_RLE, 0, 0, 0, 0, 0, 4, 4, 32, 0 },
2018 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_GRAYSCALE, 0, 0, 0, 0, 0, 4, 4, 8, 0 },
2023 { { 0,
COLORMAP_TYPE_NONE,
IMAGETYPE_GRAYSCALE |
IMAGETYPE_RLE, 0, 0, 0, 0, 0, 4, 4, 8, 0 },
2029 static const uint8_t rle_test_bits[] = { 15, 16, 24, 32 };
2039 if (!(tga =
calloc(1,
sizeof(*tga))))
2041 skip(
"Failed to allocate memory.\n");
2047 const uint32_t file_size =
sizeof(tga->header) + tga_tests[
i].color_map_size + tga_tests[
i].pixels_size;
2053 tga->header = tga_tests[
i].header;
2054 if (tga_tests[
i].color_map)
2055 memcpy(tga->data, tga_tests[
i].color_map, tga_tests[
i].color_map_size);
2056 memcpy(tga->data + tga_tests[
i].color_map_size, tga_tests[
i].pixels, tga_tests[
i].pixels_size);
2110 const uint32_t packet_size = ((rle_test_bits[
i] + 7) / 8) + 1;
2117 memset(tga->data, 0,
sizeof(tga->data));
2118 tga->header = rle_hdr;
2122 surface_fmt =
info.Format;
2132 tga->data[0] = 0x87;
2138 tga->data[0] = 0x83;
2139 tga->data[packet_size] = 0x83;
2146 tga->data[packet_size] = 0x82;
2160 BOOL testdummy_ok, testbitmap_ok;
2161 IDirect3DTexture9 *tex;
2165 static const WORD pixdata_a8r3g3b2[] = { 0x57df, 0x98fc, 0xacdd, 0xc891 };
2166 static const WORD pixdata_a1r5g5b5[] = { 0x46b5, 0x99c8, 0x06a2, 0x9431 };
2167 static const WORD pixdata_r5g6b5[] = { 0x9ef6, 0x658d, 0x0aee, 0x42ee };
2168 static const WORD pixdata_a8l8[] = { 0xff00, 0x00ff, 0xff30, 0x7f7f };
2169 static const DWORD pixdata_g16r16[] = { 0x07d23fbe, 0xdc7f44a4, 0xe4d8976b, 0x9a84fe89 };
2170 static const DWORD pixdata_a8b8g8r8[] = { 0xc3394cf0, 0x235ae892, 0x09b197fd, 0x8dc32bf6 };
2171 static const DWORD pixdata_a2r10g10b10[] = { 0x57395aff, 0x5b7668fd, 0xb0d856b5, 0xff2c61d6 };
2172 static const uint32_t pixdata_a8r8g8b8[] = { 0x00102030, 0x40506070, 0x8090a0b0, 0xc0d0e0ff };
2173 static const uint32_t pixdata_a8b8g8r8_2[] = { 0x30201000, 0x70605040, 0xb0a09080, 0xffe0d0c0 };
2174 static const uint32_t pixdata_x8l8v8u8[] = { 0x00003000, 0x00557f40, 0x00aa8180, 0x00ffffc0 };
2175 static const uint32_t pixdata_a2w10v10u10[] = { 0x0ba17400, 0x5ff5d117, 0xae880600, 0xfffe8b45 };
2176 static const uint32_t pixdata_q8w8v8u8[] = { 0x30201000, 0x7f605040, 0xb0a08180, 0xffe0d0c0 };
2177 static const float pixdata_a32b32g32r32f[] = { 0.0f, 0.1f,
NAN,
INFINITY, 1.0f, 1.1f, 1.2f, 1.3f,
2178 -0.1f, -0.2f, -
NAN, -
INFINITY, -1.0f, -1.1f, -1.2f, -1.3f };
2179 static const uint16_t pixdata_v8u8[] = { 0x3000, 0x7f40, 0x8180, 0xffc0 };
2191 skip(
"Failed to create a surface (%#lx)\n",
hr);
2200 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromFile returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2204 }
else skip(
"Couldn't create \"testbitmap.bmp\"\n");
2209 }
else skip(
"Couldn't create \"testdummy.bmp\"\n");
2221 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromResource returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2225 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromResource returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2241 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2266 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2269 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2281 ok(
hr ==
E_FAIL,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
E_FAIL);
2283 SetRect(&destrect, -1, -1, 1, 1);
2287 SetRect(&destrect, 255, 255, 257, 257);
2291 SetRect(&destrect, 1, 1, 0, 0);
2295 SetRect(&destrect, 1, 2, 1, 2);
2300 SetRect(&destrect, 257, 257, 257, 257);
2309 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2318 }
else skip(
"Failed to create a second surface\n");
2326 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2330 }
else skip(
"Failed to create texture\n");
2402 skip(
"Failed to create multisampled render target.\n");
2406 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_GetRenderTarget returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2409 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2411 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2413 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2415 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2417 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2433 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2435 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2437 ok(
hr ==
E_FAIL,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
E_FAIL);
2439 ok(
hr ==
E_FAIL,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
E_FAIL);
2445 ok(
hr ==
E_FAIL,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
E_FAIL);
2448 SetRect(&destrect, 1, 1, 2, 2);
2450 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2452 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2454 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#lx, expected %#lx.\n",
hr,
D3D_OK);
2484 if (
sizeof(
void *) != 8)
2495 skip(
"Skipping test for negative source rectangle values on 64-bit.\n");
2509 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2519 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2529 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2539 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2561 SetRect(&destrect, 1, 1, 2, 2);
2604 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
2610 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
2616 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
2622 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
2634 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2638 "Pixel color mismatch: got %#lx, expected 0x80f3f2f1\n", *(
DWORD*)lockrect.
pBits);
2645 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromFileInMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2648 ok(*(
DWORD*)lockrect.
pBits == 0xfff3f2f1,
"Pixel color mismatch: got %#lx, expected 0xfff3f2f1\n", *(
DWORD*)lockrect.
pBits);
2672 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
2678 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
2683 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
2689 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
2700 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2710 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2720 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2730 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2742 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2754 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2782 skip(
"Failed to create A8L8 texture, hr %#lx.\n",
hr);
2802 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#lx, expected %#lx\n",
hr,
D3D_OK);
2877 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
2883 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
2889 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
2895 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
2904 skip(
"Failed to create A8R8G8B8 surface, hr %#lx.\n",
hr);
2912 skip(
"Failed to create DXT2 texture, hr %#lx.\n",
hr);
2918 ok(
SUCCEEDED(
hr),
"Failed to convert pixels to DXT2 format.\n");
2925 skip(
"Failed to create DXT3 texture, hr %#lx.\n",
hr);
2931 ok(
SUCCEEDED(
hr),
"Failed to convert pixels to DXT3 format.\n");
2938 skip(
"Failed to create DXT4 texture, hr %#lx.\n",
hr);
2944 ok(
SUCCEEDED(
hr),
"Failed to convert pixels to DXT4 format.\n");
2951 skip(
"Failed to create DXT5 texture, hr %#lx.\n",
hr);
2959 ok(
SUCCEEDED(
hr),
"Failed to convert pixels to DXT5 format.\n");
2975 SetRect(&destrect, 0, 0, 4, 8);
3058 SetRect(&destrect, 2, 2, 6, 6);
3081 SetRect(&destrect, 4, 0, 6, 2);
3103 skip(
"Failed to create DXT1 texture, hr %#lx.\n",
hr);
3109 ok(
SUCCEEDED(
hr),
"Failed to convert pixels to DXT1 format.\n");
3112 ok(
SUCCEEDED(
hr),
"Failed to convert pixels from DXT1 format.\n");
3123 skip(
"Failed to create a D3DFMT_A32B32G32R32F surface, hr %#lx.\n",
hr);
3133 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3134 check_pixel_float4(&lockrect, 0, 0, pixdata_a32b32g32r32f[0], pixdata_a32b32g32r32f[1],
3135 pixdata_a32b32g32r32f[2], pixdata_a32b32g32r32f[3], 0,
FALSE);
3136 check_pixel_float4(&lockrect, 1, 0, pixdata_a32b32g32r32f[4], pixdata_a32b32g32r32f[5],
3137 pixdata_a32b32g32r32f[6], pixdata_a32b32g32r32f[7], 0,
FALSE);
3138 check_pixel_float4(&lockrect, 0, 1, pixdata_a32b32g32r32f[8], pixdata_a32b32g32r32f[9],
3139 pixdata_a32b32g32r32f[10], pixdata_a32b32g32r32f[11], 0,
FALSE);
3140 check_pixel_float4(&lockrect, 1, 1, pixdata_a32b32g32r32f[12], pixdata_a32b32g32r32f[13],
3141 pixdata_a32b32g32r32f[14], pixdata_a32b32g32r32f[15], 0,
FALSE);
3143 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3151 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3152 check_pixel_float4(&lockrect, 0, 0, 0.00000000e+000f, 1.25984251e-001f, 2.51968503e-001f, 3.77952754e-001f, 0,
FALSE);
3153 check_pixel_float4(&lockrect, 1, 0, 5.03937006e-001f, 6.29921257e-001f, 7.55905509e-001f, 1.00000000e+000f, 0,
FALSE);
3154 check_pixel_float4(&lockrect, 0, 1, -1.00000000e+000f, -1.00000000e+000f, -7.55905509e-001f, -6.29921257e-001f, 0,
FALSE);
3155 check_pixel_float4(&lockrect, 1, 1, -5.03937006e-001f, -3.77952754e-001f, -2.51968503e-001f, -7.87401572e-003f, 0,
FALSE);
3157 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3165 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3166 check_pixel_float4(&lockrect, 0, 0, 0.00000000e+000f, 6.27451017e-002f, 1.25490203e-001f, 1.88235313e-001f, 1,
FALSE);
3167 check_pixel_float4(&lockrect, 1, 0, 2.50980407e-001f, 3.13725501e-001f, 3.76470625e-001f, 4.39215720e-001f, 1,
FALSE);
3168 check_pixel_float4(&lockrect, 0, 1, 5.01960814e-001f, 5.64705908e-001f, 6.27451003e-001f, 6.90196097e-001f, 0,
FALSE);
3169 check_pixel_float4(&lockrect, 1, 1, 7.52941251e-001f, 8.15686345e-001f, 8.78431439e-001f, 1.00000000e+000f, 1,
FALSE);
3171 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3179 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3185 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3193 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3199 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3208 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3214 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3221 skip(
"Failed to create D3DFMT_Q8W8V8U8 texture, hr %#lx.\n",
hr);
3225 ok(
hr ==
D3D_OK,
"Failed to get the surface, hr %#lx.\n",
hr);
3233 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3239 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3247 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3253 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3261 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3267 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3274 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3280 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3288 skip(
"Failed to create D3DFMT_X8L8V8U8 texture, hr %#lx.\n",
hr);
3292 ok(
hr ==
D3D_OK,
"Failed to get the surface, hr %#lx.\n",
hr);
3305 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3311 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3323 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3329 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3337 skip(
"Failed to create D3DFMT_V8U8 texture, hr %#lx.\n",
hr);
3341 ok(
hr ==
D3D_OK,
"Failed to get the surface, hr %#lx.\n",
hr);
3350 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3356 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3368 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3379 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3393 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3401 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3408 ok(
hr ==
D3D_OK,
"Failed to lock surface, hr %#lx.\n",
hr);
3416 ok(
hr ==
D3D_OK,
"Failed to unlock surface, hr %#lx.\n",
hr);
3428#define check_dds_pixel_format_struct(pixel_format, expected_pixel_format, wine_todo) \
3429 check_dds_pixel_format_struct_(__FILE__, __LINE__, pixel_format, expected_pixel_format, wine_todo)
3463#define check_dds_header(header, flags, height, width, pitch, depth, mip_levels, pixel_format, caps, caps2, wine_todo) \
3464 check_dds_header_(__FILE__, __LINE__, header, flags, height, width, pitch, depth, mip_levels, pixel_format, \
3465 caps, caps2, wine_todo)
3486 ok_(
file,
line)(
header->pitch_or_linear_size == pitch,
"Unexpected DDS header pitch %#lx.\n",
3487 header->pitch_or_linear_size);
3491 ok_(
file,
line)(
header->miplevels == mip_levels,
"Unexpected DDS header mip levels %#lx.\n",
header->miplevels);
3493 "Unexpected values in DDS header reserved field.");
3504#define DDS_FILE_HEADER_SIZE (sizeof(uint32_t) + sizeof(struct dds_header))
3505#define PALETTED_DDS_FILE_HEADER_SIZE (DDS_FILE_HEADER_SIZE + (sizeof(PALETTEENTRY) * 256))
3805 skip(
"Couldn't create surface for format %#x.\n", dds_tests[
i].
format);
3820 dds_tests[
i].todo_expected);
3832 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 };
3833 static const uint32_t tmp_pixdata_4_4[] = { 0xff000000, 0xff000000, 0xff000000, 0xff000000,
3834 0x00ff0040, 0x00ff0040, 0x00ff0040, 0x00ff0040,
3835 0x0000ff80, 0x0000ff80, 0x0000ff80, 0x0000ff80,
3836 0x000000c0, 0x000000c0, 0x000000c0, 0x000000c0 };
3842 test_access_types[] =
3857 unsigned int i,
x,
y;
3864 skip(
"Couldn't create surface\n");
3878 ok(
size > 0,
"ID3DXBuffer_GetBufferSize returned %lu, expected > 0\n",
size);
3917 for (
y = 0;
y < 2; ++
y)
3919 for (
x = 0;
x < 2; ++
x)
3921 const uint32_t expected_pixel = tmp_pixdata_4_4[((2 +
y) * 4) + (
x + 2)];
3924 ok(expected_pixel == saved_pixel,
"Unexpected pixel value %#x.\n", saved_pixel);
3966 {0xff, 0x00, 0x00, 0x00, 0xff, 0x00,
3967 0x00, 0x00, 0xff, 0x00, 0x00, 0xff,};
3978 skip(
"Couldn't create surface.\n");
3994 ok(image_info.
Width == 2,
"Wrong width %u.\n", image_info.
Width);
3995 ok(image_info.
Height == 2,
"Wrong height %u.\n", image_info.
Height);
4003 "Pixel data mismatch in the first row.\n");
4005 "Pixel data mismatch in the second row.\n");
4020 "Pixel data mismatch in the first row.\n");
4022 "Pixel data mismatch in the second row.\n");
4049 ok(image_info.
Width == 2,
"Wrong width %u.\n", image_info.
Width);
4056 "Pixel data mismatch in the first row.\n");
4058 "Pixel data mismatch in the second row.\n");
4100 skip(
"Couldn't create application window\n");
4105 skip(
"Couldn't create IDirect3D9 object\n");
4115 skip(
"Failed to create IDirect3DDevice9 object %#lx\n",
hr);
#define D3DERR_INVALIDCALL
enum _D3DRESOURCETYPE D3DRESOURCETYPE
@ D3DMULTISAMPLE_2_SAMPLES
#define D3DUSAGE_RENDERTARGET
enum _D3DFORMAT D3DFORMAT
IDirect3D9 *WINAPI Direct3DCreate9(UINT SDKVersion)
#define IDirect3DTexture9_GetSurfaceLevel(p, a, b)
#define IDirect3DSurface9_LockRect(p, a, b, c)
#define IDirect3D9_CreateDevice(p, a, b, c, d, e, f)
#define IDirect3DDevice9_CreateTexture(p, a, b, c, d, e, f, g, h)
#define IDirect3D9_Release(p)
#define IDirect3DSurface9_GetDesc(p, a)
#define IDirect3DSurface9_UnlockRect(p)
#define IDirect3DSurface9_Release(p)
#define IDirect3DTexture9_Release(p)
#define IDirect3DDevice9_CreateRenderTarget(p, a, b, c, d, e, f, g, h)
#define IDirect3DDevice9_CreateOffscreenPlainSurface(p, a, b, c, d, e, f)
#define IDirect3DDevice9_GetRenderTarget(p, a, b)
#define D3DXERR_INVALIDDATA
struct ID3DXBuffer ID3DXBuffer
static const uint8_t dds_16bit[]
static const uint8_t pixdata[]
#define check_image_info(info, width, height, depth, mip_levels, format, resource_type, image_file_format, wine_todo)
static const uint8_t dds_a8p8[]
static const uint8_t jpg_grayscale_2_2[]
static const uint8_t dxt5_8_8[]
static const uint8_t png_2_2_64bpp_rgba[]
static const uint8_t jpg_rgb_2_2[]
static const uint8_t png_2_2_24bpp_bgr[]
static const uint8_t bmp_4bpp[]
static const uint8_t dds_24bit[]
static const uint8_t png_2_2_48bpp_rgb[]
static const uint8_t bmp_32bpp_xrgb[]
static const uint8_t dds_cube_map[]
static void check_image_info_(const char *file, uint32_t line, const D3DXIMAGE_INFO *info, uint32_t width, uint32_t height, uint32_t depth, uint32_t mip_levels, D3DFORMAT format, D3DRESOURCETYPE resource_type, D3DXIMAGE_FILEFORMAT image_file_format, BOOL wine_todo)
static const uint8_t bmp_2bpp[]
static const struct @1911 test_filter_values[]
static const uint8_t bmp_8bpp[]
static const uint8_t dds_dxt5_8_8[]
static const uint8_t dds_volume_map[]
static const uint8_t noimage[4]
static const uint8_t png_grayscale[]
static const uint8_t bmp_1bpp[]
static const uint8_t dds_8bit[]
static const uint8_t dds_dxt5[]
static const uint8_t bmp_32bpp_argb[]
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 D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, const char *src_file, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize, D3DXIMAGE_INFO *info)
HRESULT WINAPI D3DXGetImageInfoFromResourceA(HMODULE module, const char *resource, D3DXIMAGE_INFO *info)
HRESULT WINAPI D3DXSaveSurfaceToFileA(const char *dst_filename, D3DXIMAGE_FILEFORMAT file_format, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect)
#define IMAGETYPE_COLORMAPPED
HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_FILEFORMAT file_format, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect)
HRESULT WINAPI D3DXGetImageInfoFromFileA(const char *file, D3DXIMAGE_INFO *info)
#define DDS_PF_BUMPLUMINANCE
HRESULT WINAPI D3DXLoadSurfaceFromResourceA(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const char *resource, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_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)
#define IMAGE_RIGHTTOLEFT
#define DDS_PF_ALPHA_ONLY
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)
#define IMAGE_TOPTOBOTTOM
#define IMAGETYPE_GRAYSCALE
#define IMAGETYPE_TRUECOLOR
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
#define ID3DXBuffer_GetBufferSize(p)
#define ID3DXBuffer_GetBufferPointer(p)
#define ID3DXBuffer_Release(p)
#define D3DX_FILTER_MIRROR
#define D3DX_FILTER_LINEAR
#define D3DX_FILTER_TRIANGLE
#define D3DX_FILTER_POINT
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei width
GLsizeiptr const GLvoid GLenum usage
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
static const int bmask[16]
#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
#define memcpy(s1, s2, n)
static struct test_info tests[]
D3D11_SHADER_VARIABLE_DESC desc
#define compare_float(got, exp)
#define IDD_BITMAPDATA_1x1
static void check_tga_surface_load_(uint32_t line, IDirect3DSurface9 *surface, const uint8_t *expected, BOOL right_to_left, BOOL bottom_to_top)
static void test_D3DXSaveSurfaceToFileInMemory(IDirect3DDevice9 *device)
static void test_dds_header_handling(void)
static const uint8_t test_tga_color_map_15bpp_rle_expected[]
static const uint8_t a8p8_2_2_expected[]
static const uint8_t v16u16_2_2_expected2[]
static BOOL compare_uint(uint32_t x, uint32_t y, uint32_t max_diff)
static const uint8_t test_tga_color_map_32bpp_expected[]
#define check_dds_pixel_format_struct(pixel_format, expected_pixel_format, wine_todo)
static void test_load_surface_from_tga(IDirect3DDevice9 *device)
static void test_format_conversion(IDirect3DDevice9 *device)
static const uint8_t test_tga_color_map_index_4_4[]
static const uint8_t test_tga_grayscale_8bpp_4_4_rle[]
static const uint8_t v16u16_2_2_expected[]
#define check_readback_pixel_4bpp(rb, x, y, color, todo)
#define check_pixel_2bpp(lockrect, x, y, color)
static const uint8_t test_tga_true_color_24bpp_4_4[]
#define check_pixel_float4(lockrect, x, y, fx, fy, fz, fw, ulps, todo)
static void test_save_surface_to_dds(IDirect3DDevice9 *device)
static const uint8_t test_tga_true_color_16bpp_rle_expected[]
static const uint8_t a16b16g16r16_2_2_expected[]
static const uint8_t test_tga_grayscale_8bpp_rle_expected[]
#define check_dds_header(header, flags, height, width, pitch, depth, mip_levels, pixel_format, caps, caps2, wine_todo)
static const uint8_t test_tga_true_color_16bpp_4_4_rle[]
static const uint8_t test_tga_color_map_16bpp[]
static void check_dds_pixel_format_(unsigned int line, DWORD flags, DWORD fourcc, DWORD bpp, DWORD rmask, DWORD gmask, DWORD bmask, DWORD amask, D3DFORMAT expected_format)
#define COLORMAP_TYPE_NONE
static const uint8_t test_tga_color_map_half_32bpp_expected[]
static const uint8_t test_tga_color_map_15bpp_expected[]
static void test_D3DXGetImageInfo(void)
static const uint8_t test_tga_true_color_24bpp_rle_expected[]
#define check_dds_pixel_format(flags, fourcc, bpp, rmask, gmask, bmask, amask, format)
#define check_pixel_8bpp(lockrect, x, y, color)
static const uint8_t test_tga_true_color_32bpp_rle_expected[]
static const uint8_t v8u8_2_2_expected[]
static const uint8_t q16w16v16u16_2_2_expected[]
static const struct tga_footer default_tga_footer
static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
static void _check_pixel_8bpp(unsigned int line, const D3DLOCKED_RECT *lockrect, int x, int y, uint64_t expected_color)
static void check_dds_header_(const char *file, uint32_t line, const struct dds_header *header, uint32_t flags, uint32_t height, uint32_t width, uint32_t pitch, uint32_t depth, uint32_t mip_levels, const struct dds_pixel_format *pixel_format, uint32_t caps, uint32_t caps2, BOOL wine_todo)
static void test_tga_header_handling(void)
static const uint8_t test_tga_color_map_32bpp[]
static void release_surface_readback(struct surface_readback *rb)
static const uint8_t test_tga_color_map_24bpp[]
static const uint8_t p8_2_2[]
#define check_pixel_4bpp(lockrect, x, y, color)
#define check_tga_image_info(tga, tga_size, expected_width, expected_height, expected_format, expected_hr)
static const uint8_t test_tga_true_color_15bpp_4_4_rle[]
static uint32_t get_readback_color(struct surface_readback *rb, uint32_t x, uint32_t y)
static const uint8_t p8_2_2_expected[]
static const uint8_t test_tga_color_map_24bpp_expected[]
static const uint16_t v16u16_2_2[]
static const uint8_t a8p8_2_2[]
static const uint8_t test_tga_true_color_32bpp_4_4[]
#define COLORMAP_TYPE_ONE
static const uint8_t test_tga_true_color_24bpp_4_4_rle[]
#define PALETTED_DDS_FILE_HEADER_SIZE
static const uint16_t a16b16g16r16_2_2[]
static void _check_release(unsigned int line, IUnknown *obj, int exp)
static const uint8_t test_tga_color_map_index_4_4_rle[]
static const uint8_t test_tga_grayscale_8bpp_4_4[]
static const uint8_t test_tga_true_color_15bpp_rle_expected[]
static void test_D3DXSaveSurfaceToFile(IDirect3DDevice9 *device)
static void _check_readback_pixel_4bpp(unsigned int line, struct surface_readback *rb, uint32_t x, uint32_t y, uint32_t expected_color, BOOL todo)
static void _check_pixel_4bpp(unsigned int line, const D3DLOCKED_RECT *lockrect, int x, int y, DWORD expected_color)
static uint32_t get_bpp_for_d3dformat(D3DFORMAT format)
static const uint8_t test_tga_true_color_16bpp_4_4[]
static const uint8_t test_tga_color_map_15bpp[]
static const uint16_t q16w16v16u16_2_2[]
static const uint8_t test_tga_color_map_16bpp_expected[]
#define check_tga_surface_load(surface, expected, right_to_left, bottom_to_top)
static void check_dds_pixel_format_struct_(const char *file, uint32_t line, const struct dds_pixel_format *pixel_format, const struct dds_pixel_format *expected_pixel_format, BOOL wine_todo)
static const uint8_t test_tga_true_color_32bpp_4_4_rle[]
static void _check_pixel_2bpp(unsigned int line, const D3DLOCKED_RECT *lockrect, int x, int y, WORD expected_color)
static const PALETTEENTRY test_palette[256]
static void get_surface_readback(IDirect3DDevice9 *device, IDirect3DSurface9 *src_surface, D3DFORMAT rb_format, struct surface_readback *rb)
#define DDS_FILE_HEADER_SIZE
static void test_dxt_premultiplied_alpha(IDirect3DDevice9 *device)
static void check_tga_image_info_(uint32_t line, const void *tga, uint32_t tga_size, uint32_t expected_width, uint32_t expected_height, D3DFORMAT expected_format, HRESULT expected_hr)
static const uint8_t test_tga_true_color_15bpp_4_4[]
static void get_surface_decompressed_readback(IDirect3DDevice9 *device, IDirect3DSurface9 *compressed_surface, struct surface_readback *rb)
static void _check_pixel_float4(uint32_t line, const D3DLOCKED_RECT *lockrect, uint32_t x, uint32_t y, float fx, float fy, float fz, float fw, uint32_t ulps, BOOL todo)
static void fill_dds_header(struct dds_header *header)
static const uint8_t v8u8_2_2[]
#define check_release(obj, exp)
#define create_file(name, size)
static const char * dst_format
#define WS_OVERLAPPEDWINDOW
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define MAKEINTRESOURCEA(i)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
static unsigned __int64 next
static unsigned int file_size
#define D3DADAPTER_DEFAULT
#define D3DCREATE_SOFTWARE_VERTEXPROCESSING
#define DDSCAPS2_CUBEMAP_ALLFACES
#define DDSCAPS2_CUBEMAP_POSITIVEX
wchar_t const *const size_t const buffer_size
D3DXIMAGE_FILEFORMAT ImageFileFormat
D3DLOCKED_RECT locked_rect
IDirect3DSurface9 * surface
DWORD WINAPI GetLastError(void)
static HRESULT HRESULT_FROM_WIN32(unsigned int x)