From: Ziqing Hui Subject: [PATCH 2/4] d3dx10/tests: Add texture frame data to test data. Message-Id: <840b4be5-623c-8b53-92fe-342cb88d8cbe@codeweavers.com> Date: Mon, 7 Jun 2021 14:57:35 +0800 Signed-off-by: Ziqing Hui --- dlls/d3dx10_43/tests/d3dx10.c | 250 +++++++++++++++++++++++++--------- 1 file changed, 186 insertions(+), 64 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 235c60ebf7e..022f584a782 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -31,6 +31,10 @@ static const BYTE test_bmp_1bpp[] = 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00, 0x00, 0x00 }; +static const BYTE test_bmp_1bpp_frame_data[] = +{ + 0xf3, 0xf2, 0xf1, 0xff +}; /* 1x1 4bpp bmp image */ static const BYTE test_bmp_4bpp[] = @@ -41,6 +45,10 @@ static const BYTE test_bmp_4bpp[] = 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00, 0x00, 0x00 }; +static const BYTE test_bmp_4bpp_frame_data[] = +{ + 0xf3, 0xf2, 0xf1, 0xff +}; /* 1x1 8bpp bmp image */ static const BYTE test_bmp_8bpp[] = @@ -51,6 +59,10 @@ static const BYTE test_bmp_8bpp[] = 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00, 0x00, 0x00 }; +static const BYTE test_bmp_8bpp_frame_data[] = +{ + 0xf3, 0xf2, 0xf1, 0xff +}; /* 1x1 16bpp bmp image */ static const BYTE test_bmp_16bpp[] = @@ -60,6 +72,10 @@ static const BYTE test_bmp_16bpp[] = 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x42, 0x00, 0x00, 0x00, 0x00 }; +static const BYTE test_bmp_16bpp_frame_data[] = +{ + 0x84, 0x84, 0x73, 0xff +}; /* 1x1 24bpp bmp image */ static const BYTE test_bmp_24bpp[] = @@ -69,6 +85,10 @@ static const BYTE test_bmp_24bpp[] = 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x84, 0x84, 0x00, 0x00, 0x00 }; +static const BYTE test_bmp_24bpp_frame_data[] = +{ + 0x84, 0x84, 0x73, 0xff +}; /* 2x2 32bpp XRGB bmp image */ static const BYTE test_bmp_32bpp_xrgb[] = @@ -79,6 +99,11 @@ static const BYTE test_bmp_32bpp_xrgb[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xb0, 0xc0, 0x00, 0xa1, 0xb1, 0xc1, 0x00, 0xa2, 0xb2, 0xc2, 0x00, 0xa3, 0xb3, 0xc3, 0x00 }; +static const BYTE test_bmp_32bpp_xrgb_frame_data[] = +{ + 0xc2, 0xb2, 0xa2, 0xff, 0xc3, 0xb3, 0xa3, 0xff, 0xc0, 0xb0, 0xa0, 0xff, 0xc1, 0xb1, 0xa1, 0xff + +}; /* 2x2 32bpp ARGB bmp image */ static const BYTE test_bmp_32bpp_argb[] = @@ -89,6 +114,11 @@ static const BYTE test_bmp_32bpp_argb[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xb0, 0xc0, 0x00, 0xa1, 0xb1, 0xc1, 0x00, 0xa2, 0xb2, 0xc2, 0x00, 0xa3, 0xb3, 0xc3, 0x01 }; +static const BYTE test_bmp_32bpp_argb_frame_data[] = +{ + 0xc2, 0xb2, 0xa2, 0xff, 0xc3, 0xb3, 0xa3, 0xff, 0xc0, 0xb0, 0xa0, 0xff, 0xc1, 0xb1, 0xa1, 0xff + +}; /* 1x1 8bpp gray png image */ static const BYTE test_png_8bpp_gray[] = @@ -99,6 +129,10 @@ static const BYTE test_png_8bpp_gray[] = 0x01, 0x01, 0x00, 0x1b, 0xb6, 0xee, 0x56, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; +static const BYTE test_png_8bpp_gray_frame_data[] = +{ + 0xff, 0xff, 0xff, 0xff +}; /* 1x1 jpg image */ static const BYTE test_jpg[] = @@ -122,6 +156,10 @@ static const BYTE test_jpg[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xb2, 0xc0, 0x07, 0xff, 0xd9 }; +static const BYTE test_jpg_frame_data[] = +{ + 0xff, 0xff, 0xff, 0xff +}; /* 1x1 gif image */ static const BYTE test_gif[] = @@ -130,6 +168,10 @@ static const BYTE test_gif[] = 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x44, 0x01, 0x00, 0x3b }; +static const BYTE test_gif_frame_data[] = +{ + 0xff, 0xff, 0xff, 0xff +}; /* 1x1 tiff image */ static const BYTE test_tiff[] = @@ -152,6 +194,10 @@ static const BYTE test_tiff[] = 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01 }; +static const BYTE test_tiff_frame_data[] = +{ + 0x00, 0x00, 0x00, 0xff +}; /* 1x1 alpha dds image */ static const BYTE test_dds_alpha[] = @@ -166,6 +212,10 @@ static const BYTE test_dds_alpha[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff }; +static const BYTE test_dds_alpha_frame_data[] = +{ + 0xff +}; /* 1x1 luminance dds image */ static const BYTE test_dds_luminance[] = @@ -180,6 +230,10 @@ static const BYTE test_dds_luminance[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82 }; +static const BYTE test_dds_luminance_frame_data[] = +{ + 0x82, 0x82, 0x82, 0xff +}; /* 1x1 16bpp dds image */ static const BYTE test_dds_16bpp[] = @@ -194,6 +248,10 @@ static const BYTE test_dds_16bpp[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x42 }; +static const BYTE test_dds_16bpp_frame_data[] = +{ + 0x84, 0x84, 0x73, 0xff +}; /* 1x1 24bpp dds image */ static const BYTE test_dds_24bpp[] = @@ -208,6 +266,10 @@ static const BYTE test_dds_24bpp[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x81, 0x83 }; +static const BYTE test_dds_24bpp_frame_data[] = +{ + 0x83, 0x81, 0x70, 0xff +}; /* 1x1 32bpp dds image */ static const BYTE test_dds_32bpp[] = @@ -222,6 +284,10 @@ static const BYTE test_dds_32bpp[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x81, 0x83, 0xff }; +static const BYTE test_dds_32bpp_frame_data[] = +{ + 0x83, 0x81, 0x70, 0xff +}; /* 1x1 64bpp dds image */ static const BYTE test_dds_64bpp[] = @@ -236,6 +302,10 @@ static const BYTE test_dds_64bpp[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x83, 0x81, 0x81, 0x70, 0x70, 0xff, 0xff }; +static const BYTE test_dds_64bpp_frame_data[] = +{ + 0x83, 0x83, 0x81, 0x81, 0x70, 0x70, 0xff, 0xff +}; /* 1x1 96bpp dds image */ static const BYTE test_dds_96bpp[] = @@ -251,6 +321,10 @@ static const BYTE test_dds_96bpp[] = 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e }; +static const BYTE test_dds_96bpp_frame_data[] = +{ + 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e +}; /* 1x1 128bpp dds image */ static const BYTE test_dds_128bpp[] = @@ -265,6 +339,11 @@ static const BYTE test_dds_128bpp[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e, 0x00, 0x00, 0x80, 0x3f }; +static const BYTE test_dds_128bpp_frame_data[] = +{ + 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e, 0x00, 0x00, 0x80, 0x3f + +}; /* 4x4 DXT1 dds image */ static const BYTE test_dds_dxt1[] = @@ -279,6 +358,10 @@ static const BYTE test_dds_dxt1[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x31, 0xf5, 0xbc, 0xe3, 0x6e, 0x2a, 0x3a }; +static const BYTE test_dds_dxt1_frame_data[] = +{ + 0x2a, 0x31, 0xf5, 0xbc, 0xe3, 0x6e, 0x2a, 0x3a +}; /* 4x4 DXT2 dds image */ static const BYTE test_dds_dxt2[] = @@ -295,6 +378,11 @@ static const BYTE test_dds_dxt2[] = 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x53, 0x00, 0x00, 0x52, 0x52, 0x55, 0x55, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x59, 0x00, 0x00, 0x54, 0x55, 0x55, 0x55 }; +static const BYTE test_dds_dxt2_frame_data[] = +{ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b + +}; /* 1x3 DXT3 dds image */ static const BYTE test_dds_dxt3[] = @@ -310,6 +398,11 @@ static const BYTE test_dds_dxt3[] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x92, 0x38, 0x84, 0x00, 0xff, 0x55, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x53, 0x8b, 0x53, 0x8b, 0x00, 0x00, 0x00, 0x00 }; +static const BYTE test_dds_dxt3_frame_data[] = +{ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4e, 0x92, 0xd6, 0x83, 0x00, 0xaa, 0x55, 0x55 + +}; /* 4x4 DXT4 dds image */ static const BYTE test_dds_dxt4[] = @@ -326,6 +419,11 @@ static const BYTE test_dds_dxt4[] = 0xff, 0x00, 0x40, 0x02, 0x24, 0x49, 0x92, 0x24, 0x57, 0x53, 0x00, 0x00, 0x52, 0x52, 0x55, 0x55, 0xff, 0x00, 0x48, 0x92, 0x24, 0x49, 0x92, 0x24, 0xce, 0x59, 0x00, 0x00, 0x54, 0x55, 0x55, 0x55 }; +static const BYTE test_dds_dxt4_frame_data[] = +{ + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b + +}; /* 4x2 DXT5 dds image */ static const BYTE test_dds_dxt5[] = @@ -340,6 +438,11 @@ static const BYTE test_dds_dxt5[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x50, 0x50 }; +static const BYTE test_dds_dxt5_frame_data[] = +{ + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x05, 0x05 + +}; /* 4x4 BC4 dds image */ static const BYTE test_dds_bc4[] = @@ -355,6 +458,10 @@ static const BYTE test_dds_bc4[] = 0xd9, 0x15, 0xbc, 0x41, 0x5b, 0xa3, 0x3d, 0x3a, 0x8f, 0x3d, 0x45, 0x81, 0x20, 0x45, 0x81, 0x20, 0x6f, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static const BYTE test_dds_bc4_frame_data[] = +{ + 0xd9, 0x15, 0xbc, 0x41, 0x5b, 0xa3, 0x3d, 0x3a +}; /* 6x3 BC5 dds image */ static const BYTE test_dds_bc5[] = @@ -372,6 +479,12 @@ static const BYTE test_dds_bc5[] = 0x83, 0x55, 0x08, 0x83, 0x30, 0x08, 0x83, 0x30, 0x79, 0x46, 0x31, 0x1c, 0xc3, 0x31, 0x1c, 0xc3, 0x6d, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static const BYTE test_dds_bc5_frame_data[] = +{ + 0x95, 0x35, 0xe2, 0xa3, 0xf5, 0xd2, 0x28, 0x68, 0x65, 0x32, 0x7c, 0x4e, 0xdb, 0xe4, 0x56, 0x0a, + 0xb9, 0x33, 0xaf, 0xf0, 0x52, 0xbe, 0xed, 0x27, 0xb4, 0x2e, 0xa6, 0x60, 0x4e, 0xb6, 0x5d, 0x3f + +}; /* 4x4 DXT1 cube map */ static const BYTE test_dds_cube[] = @@ -394,6 +507,10 @@ static const BYTE test_dds_cube[] = 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00 }; +static const BYTE test_dds_cube_frame_data[] = +{ + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7 +}; /* 1x1 wmp image */ static const BYTE test_wmp[] = @@ -417,125 +534,130 @@ static const BYTE test_wmp[] = 0x82, 0x76, 0x71, 0x13, 0xde, 0x50, 0xd4, 0x2d, 0xc2, 0xda, 0x1e, 0x3b, 0xa6, 0xa1, 0x62, 0x7b, 0xca, 0x1a, 0x85, 0x4b, 0x6e, 0x74, 0xec, 0x60 }; +static const BYTE test_wmp_frame_data[] = +{ + 0xff, 0xff, 0xff, 0xff +}; static const struct test_image { const BYTE *data; unsigned int size; - D3DX10_IMAGE_INFO expected; + const BYTE *expected_frame; + D3DX10_IMAGE_INFO expected_info; } test_image[] = { { - test_bmp_1bpp, sizeof(test_bmp_1bpp), + test_bmp_1bpp, sizeof(test_bmp_1bpp), test_bmp_1bpp_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} }, { - test_bmp_4bpp, sizeof(test_bmp_4bpp), + test_bmp_4bpp, sizeof(test_bmp_4bpp), test_bmp_4bpp_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} }, { - test_bmp_8bpp, sizeof(test_bmp_8bpp), + test_bmp_8bpp, sizeof(test_bmp_8bpp), test_bmp_8bpp_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} }, { - test_bmp_16bpp, sizeof(test_bmp_16bpp), + test_bmp_16bpp, sizeof(test_bmp_16bpp), test_bmp_16bpp_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} }, { - test_bmp_24bpp, sizeof(test_bmp_24bpp), + test_bmp_24bpp, sizeof(test_bmp_24bpp), test_bmp_24bpp_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} }, { - test_bmp_32bpp_xrgb, sizeof(test_bmp_32bpp_xrgb), + test_bmp_32bpp_xrgb, sizeof(test_bmp_32bpp_xrgb), test_bmp_32bpp_xrgb_frame_data, {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} }, { - test_bmp_32bpp_argb, sizeof(test_bmp_32bpp_argb), + test_bmp_32bpp_argb, sizeof(test_bmp_32bpp_argb), test_bmp_32bpp_argb_frame_data, {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} }, { - test_png_8bpp_gray, sizeof(test_png_8bpp_gray), + test_png_8bpp_gray, sizeof(test_png_8bpp_gray), test_png_8bpp_gray_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_PNG} }, { - test_jpg, sizeof(test_jpg), + test_jpg, sizeof(test_jpg), test_jpg_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_JPG} }, { - test_gif, sizeof(test_gif), + test_gif, sizeof(test_gif), test_gif_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_GIF} }, { - test_tiff, sizeof(test_tiff), + test_tiff, sizeof(test_tiff), test_tiff_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_TIFF} }, { - test_dds_alpha, sizeof(test_dds_alpha), + test_dds_alpha, sizeof(test_dds_alpha), test_dds_alpha_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_luminance, sizeof(test_dds_luminance), + test_dds_luminance, sizeof(test_dds_luminance), test_dds_luminance_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_16bpp, sizeof(test_dds_16bpp), + test_dds_16bpp, sizeof(test_dds_16bpp), test_dds_16bpp_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_24bpp, sizeof(test_dds_24bpp), + test_dds_24bpp, sizeof(test_dds_24bpp), test_dds_24bpp_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_32bpp, sizeof(test_dds_32bpp), + test_dds_32bpp, sizeof(test_dds_32bpp), test_dds_32bpp_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_64bpp, sizeof(test_dds_64bpp), + test_dds_64bpp, sizeof(test_dds_64bpp), test_dds_64bpp_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R16G16B16A16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_96bpp, sizeof(test_dds_96bpp), + test_dds_96bpp, sizeof(test_dds_96bpp), test_dds_96bpp_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_128bpp, sizeof(test_dds_128bpp), + test_dds_128bpp, sizeof(test_dds_128bpp), test_dds_128bpp_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R32G32B32A32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_dxt1, sizeof(test_dds_dxt1), + test_dds_dxt1, sizeof(test_dds_dxt1), test_dds_dxt1_frame_data, {4, 4, 1, 1, 1, 0, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_dxt2, sizeof(test_dds_dxt2), + test_dds_dxt2, sizeof(test_dds_dxt2), test_dds_dxt2_frame_data, {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_dxt3, sizeof(test_dds_dxt3), + test_dds_dxt3, sizeof(test_dds_dxt3), test_dds_dxt3_frame_data, {1, 3, 1, 1, 2, 0, DXGI_FORMAT_BC2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_dxt4, sizeof(test_dds_dxt4), + test_dds_dxt4, sizeof(test_dds_dxt4), test_dds_dxt4_frame_data, {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC3_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_dxt5, sizeof(test_dds_dxt5), + test_dds_dxt5, sizeof(test_dds_dxt5), test_dds_dxt5_frame_data, {4, 2, 1, 1, 1, 0, DXGI_FORMAT_BC3_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_bc4, sizeof(test_dds_bc4), + test_dds_bc4, sizeof(test_dds_bc4), test_dds_bc4_frame_data, {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC4_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_bc5, sizeof(test_dds_bc5), + test_dds_bc5, sizeof(test_dds_bc5), test_dds_bc5_frame_data, {6, 3, 1, 1, 3, 0, DXGI_FORMAT_BC5_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_dds_cube, sizeof(test_dds_cube), + test_dds_cube, sizeof(test_dds_cube), test_dds_cube_frame_data, {4, 4, 1, 6, 3, 0x4, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} }, { - test_wmp, sizeof(test_wmp), + test_wmp, sizeof(test_wmp), test_wmp_frame_data, {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_WMP} }, }; @@ -687,33 +809,33 @@ static void delete_resource_module(const WCHAR *filename, HMODULE module) static void check_image_info(D3DX10_IMAGE_INFO *image_info, unsigned int i, unsigned int line) { - ok_(__FILE__, line)(image_info->Width == test_image[i].expected.Width, + ok_(__FILE__, line)(image_info->Width == test_image[i].expected_info.Width, "Test %u: Got unexpected Width %u, expected %u.\n", - i, image_info->Width, test_image[i].expected.Width); - ok_(__FILE__, line)(image_info->Height == test_image[i].expected.Height, + i, image_info->Width, test_image[i].expected_info.Width); + ok_(__FILE__, line)(image_info->Height == test_image[i].expected_info.Height, "Test %u: Got unexpected Height %u, expected %u.\n", - i, image_info->Height, test_image[i].expected.Height); - ok_(__FILE__, line)(image_info->Depth == test_image[i].expected.Depth, + i, image_info->Height, test_image[i].expected_info.Height); + ok_(__FILE__, line)(image_info->Depth == test_image[i].expected_info.Depth, "Test %u: Got unexpected Depth %u, expected %u.\n", - i, image_info->Depth, test_image[i].expected.Depth); - ok_(__FILE__, line)(image_info->ArraySize == test_image[i].expected.ArraySize, + i, image_info->Depth, test_image[i].expected_info.Depth); + ok_(__FILE__, line)(image_info->ArraySize == test_image[i].expected_info.ArraySize, "Test %u: Got unexpected ArraySize %u, expected %u.\n", - i, image_info->ArraySize, test_image[i].expected.ArraySize); - ok_(__FILE__, line)(image_info->MipLevels == test_image[i].expected.MipLevels, + i, image_info->ArraySize, test_image[i].expected_info.ArraySize); + ok_(__FILE__, line)(image_info->MipLevels == test_image[i].expected_info.MipLevels, "Test %u: Got unexpected MipLevels %u, expected %u.\n", - i, image_info->MipLevels, test_image[i].expected.MipLevels); - ok_(__FILE__, line)(image_info->MiscFlags == test_image[i].expected.MiscFlags, + i, image_info->MipLevels, test_image[i].expected_info.MipLevels); + ok_(__FILE__, line)(image_info->MiscFlags == test_image[i].expected_info.MiscFlags, "Test %u: Got unexpected MiscFlags %#x, expected %#x.\n", - i, image_info->MiscFlags, test_image[i].expected.MiscFlags); - ok_(__FILE__, line)(image_info->Format == test_image[i].expected.Format, + i, image_info->MiscFlags, test_image[i].expected_info.MiscFlags); + ok_(__FILE__, line)(image_info->Format == test_image[i].expected_info.Format, "Test %u: Got unexpected Format %#x, expected %#x.\n", - i, image_info->Format, test_image[i].expected.Format); - ok_(__FILE__, line)(image_info->ResourceDimension == test_image[i].expected.ResourceDimension, + i, image_info->Format, test_image[i].expected_info.Format); + ok_(__FILE__, line)(image_info->ResourceDimension == test_image[i].expected_info.ResourceDimension, "Test %u: Got unexpected ResourceDimension %u, expected %u.\n", - i, image_info->ResourceDimension, test_image[i].expected.ResourceDimension); - ok_(__FILE__, line)(image_info->ImageFileFormat == test_image[i].expected.ImageFileFormat, + i, image_info->ResourceDimension, test_image[i].expected_info.ResourceDimension); + ok_(__FILE__, line)(image_info->ImageFileFormat == test_image[i].expected_info.ImageFileFormat, "Test %u: Got unexpected ImageFileFormat %u, expected %u.\n", - i, image_info->ImageFileFormat, test_image[i].expected.ImageFileFormat); + i, image_info->ImageFileFormat, test_image[i].expected_info.ImageFileFormat); } static void check_resource_info(ID3D10Resource *resource, unsigned int i, unsigned int line) @@ -726,9 +848,9 @@ static void check_resource_info(ID3D10Resource *resource, unsigned int i, unsign ID3D10Texture3D *texture_3d; HRESULT hr; - expected_width = test_image[i].expected.Width; - expected_height = test_image[i].expected.Height; - if (is_block_compressed(test_image[i].expected.Format)) + expected_width = test_image[i].expected_info.Width; + expected_height = test_image[i].expected_info.Height; + if (is_block_compressed(test_image[i].expected_info.Format)) { expected_width = (expected_width + 3) & ~3; expected_height = (expected_height + 3) & ~3; @@ -742,9 +864,9 @@ static void check_resource_info(ID3D10Resource *resource, unsigned int i, unsign } ID3D10Resource_GetType(resource, &resource_dimension); - ok(resource_dimension == test_image[i].expected.ResourceDimension, + ok(resource_dimension == test_image[i].expected_info.ResourceDimension, "Test %u: Got unexpected ResourceDimension %u, expected %u.\n", - i, resource_dimension, test_image[i].expected.ResourceDimension); + i, resource_dimension, test_image[i].expected_info.ResourceDimension); switch (resource_dimension) { @@ -761,12 +883,12 @@ static void check_resource_info(ID3D10Resource *resource, unsigned int i, unsign ok_(__FILE__, line)(desc_2d.MipLevels == expected_mip_levels, "Test %u: Got unexpected MipLevels %u, expected %u.\n", i, desc_2d.MipLevels, expected_mip_levels); - ok_(__FILE__, line)(desc_2d.ArraySize == test_image[i].expected.ArraySize, + ok_(__FILE__, line)(desc_2d.ArraySize == test_image[i].expected_info.ArraySize, "Test %u: Got unexpected ArraySize %u, expected %u.\n", - i, desc_2d.ArraySize, test_image[i].expected.ArraySize); - ok_(__FILE__, line)(desc_2d.Format == test_image[i].expected.Format, + i, desc_2d.ArraySize, test_image[i].expected_info.ArraySize); + ok_(__FILE__, line)(desc_2d.Format == test_image[i].expected_info.Format, "Test %u: Got unexpected Format %u, expected %u.\n", - i, desc_2d.Format, test_image[i].expected.Format); + i, desc_2d.Format, test_image[i].expected_info.Format); ok_(__FILE__, line)(desc_2d.SampleDesc.Count == 1, "Test %u: Got unexpected SampleDesc.Count %u, expected %u\n", i, desc_2d.SampleDesc.Count, 1); @@ -782,9 +904,9 @@ static void check_resource_info(ID3D10Resource *resource, unsigned int i, unsign ok_(__FILE__, line)(desc_2d.CPUAccessFlags == 0, "Test %u: Got unexpected CPUAccessFlags %#x, expected %#x\n", i, desc_2d.CPUAccessFlags, 0); - ok_(__FILE__, line)(desc_2d.MiscFlags == test_image[i].expected.MiscFlags, + ok_(__FILE__, line)(desc_2d.MiscFlags == test_image[i].expected_info.MiscFlags, "Test %u: Got unexpected MiscFlags %#x, expected %#x.\n", - i, desc_2d.MiscFlags, test_image[i].expected.MiscFlags); + i, desc_2d.MiscFlags, test_image[i].expected_info.MiscFlags); ID3D10Texture2D_Release(texture_2d); break; @@ -799,15 +921,15 @@ static void check_resource_info(ID3D10Resource *resource, unsigned int i, unsign ok_(__FILE__, line)(desc_3d.Height == expected_height, "Test %u: Got unexpected Height %u, expected %u.\n", i, desc_3d.Height, expected_height); - ok_(__FILE__, line)(desc_3d.Depth == test_image[i].expected.Depth, + ok_(__FILE__, line)(desc_3d.Depth == test_image[i].expected_info.Depth, "Test %u: Got unexpected Depth %u, expected %u.\n", - i, desc_3d.Depth, test_image[i].expected.Depth); + i, desc_3d.Depth, test_image[i].expected_info.Depth); ok_(__FILE__, line)(desc_3d.MipLevels == expected_mip_levels, "Test %u: Got unexpected MipLevels %u, expected %u.\n", i, desc_3d.MipLevels, expected_mip_levels); - ok_(__FILE__, line)(desc_3d.Format == test_image[i].expected.Format, + ok_(__FILE__, line)(desc_3d.Format == test_image[i].expected_info.Format, "Test %u: Got unexpected Format %u, expected %u.\n", - i, desc_3d.Format, test_image[i].expected.Format); + i, desc_3d.Format, test_image[i].expected_info.Format); ok_(__FILE__, line)(desc_3d.Usage == D3D10_USAGE_DEFAULT, "Test %u: Got unexpected Usage %u, expected %u\n", i, desc_3d.Usage, D3D10_USAGE_DEFAULT); @@ -817,9 +939,9 @@ static void check_resource_info(ID3D10Resource *resource, unsigned int i, unsign ok_(__FILE__, line)(desc_3d.CPUAccessFlags == 0, "Test %u: Got unexpected CPUAccessFlags %#x, expected %#x\n", i, desc_3d.CPUAccessFlags, 0); - ok_(__FILE__, line)(desc_3d.MiscFlags == test_image[i].expected.MiscFlags, + ok_(__FILE__, line)(desc_3d.MiscFlags == test_image[i].expected_info.MiscFlags, "Test %u: Got unexpected MiscFlags %#x, expected %#x.\n", - i, desc_3d.MiscFlags, test_image[i].expected.MiscFlags); + i, desc_3d.MiscFlags, test_image[i].expected_info.MiscFlags); ID3D10Texture3D_Release(texture_3d); break;