[PATCH 5/5] d3d10core/tests: Add a test for DXGI_FORMAT_A8_UNORM textures.

Matteo Bruni mbruni at codeweavers.com
Wed Mar 23 15:19:12 CDT 2016


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
 dlls/d3d10core/tests/device.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index ba6f22e..dd63a64 100644
--- a/dlls/d3d10core/tests/device.c
+++ b/dlls/d3d10core/tests/device.c
@@ -3790,6 +3790,13 @@ static void test_texture(void)
         0xffb1c4de, 0xfff0f1f2, 0xfffafdfe, 0xff5a560f,
         0xffd5ff00, 0xffc8f99f, 0xffaa00aa, 0xffdd55bb,
     };
+    static const BYTE a8_data[] =
+    {
+        0x00, 0x10, 0x20, 0x30,
+        0x40, 0x50, 0x60, 0x70,
+        0x80, 0x90, 0xa0, 0xb0,
+        0xc0, 0xd0, 0xe0, 0xf0,
+    };
     static const BYTE bc1_data[] =
     {
         0x00, 0xf8, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00,
@@ -3836,6 +3843,8 @@ static void test_texture(void)
     };
     static const struct texture srgb_texture = {4, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,
             {{srgb_data, 4 * sizeof(*srgb_data)}}};
+    static const struct texture a8_texture = {4, 4, 1, DXGI_FORMAT_A8_UNORM,
+            {{a8_data, 4 * sizeof(*a8_data)}}};
     static const struct texture bc1_texture = {8, 8, 1, DXGI_FORMAT_BC1_UNORM, {{bc1_data, 2 * 8}}};
     static const struct texture bc2_texture = {8, 8, 1, DXGI_FORMAT_BC2_UNORM, {{bc2_data, 2 * 16}}};
     static const struct texture bc3_texture = {8, 8, 1, DXGI_FORMAT_BC3_UNORM, {{bc3_data, 2 * 16}}};
@@ -3876,6 +3885,13 @@ static void test_texture(void)
         0xff708cba, 0xffdee0e2, 0xfff3fbfd, 0xff1a1801,
         0xffa9ff00, 0xff93f159, 0xff670067, 0xffb8177f,
     };
+    static const DWORD a8_colors[] =
+    {
+        0x00000000, 0x10000000, 0x20000000, 0x30000000,
+        0x40000000, 0x50000000, 0x60000000, 0x70000000,
+        0x80000000, 0x90000000, 0xa0000000, 0xb0000000,
+        0xc0000000, 0xd0000000, 0xe0000000, 0xf0000000,
+    };
     static const DWORD bc_colors[] =
     {
         0xff0000ff, 0xff0000ff, 0xff00ff00, 0xff00ff00,
@@ -3948,6 +3964,7 @@ static void test_texture(void)
         {&ps_sample,   &rgba_texture,  D3D10_FILTER_MIN_MAG_MIP_POINT,        2.0f, 0.0f, D3D10_FLOAT32_MAX,  0.0f, rgba_level_0},
         {&ps_sample,   &rgba_texture,  D3D10_FILTER_MIN_MAG_MIP_POINT,        8.0f, 0.0f, D3D10_FLOAT32_MAX,  0.0f, level_1_colors},
         {&ps_sample,   &srgb_texture,  D3D10_FILTER_MIN_MAG_MIP_POINT,        0.0f, 0.0f,              0.0f,  0.0f, srgb_colors},
+        {&ps_sample,   &a8_texture,    D3D11_FILTER_MIN_MAG_MIP_POINT,        0.0f, 0.0f,              0.0f,  0.0f, a8_colors},
         {&ps_sample_b, &rgba_texture,  D3D10_FILTER_MIN_MAG_MIP_POINT,        0.0f, 0.0f, D3D10_FLOAT32_MAX,  0.0f, rgba_level_0},
         {&ps_sample_b, &rgba_texture,  D3D10_FILTER_MIN_MAG_MIP_POINT,        8.0f, 0.0f, D3D10_FLOAT32_MAX,  0.0f, level_1_colors},
         {&ps_sample_b, &rgba_texture,  D3D10_FILTER_MIN_MAG_MIP_POINT,        0.0f, 0.0f, D3D10_FLOAT32_MAX,  8.0f, level_1_colors},
@@ -4101,9 +4118,9 @@ static void test_texture(void)
         draw_quad(&test_context);
 
         get_texture_readback(test_context.backbuffer, &rb);
-        for (x = 0; x < 4; ++x)
+        for (y = 0; y < 4; ++y)
         {
-            for (y = 0; y < 4; ++y)
+            for (x = 0; x < 4; ++x)
             {
                 color = get_readback_color(&rb, 80 + x * 160, 60 + y * 120);
                 ok(compare_color(color, test->expected_colors[y * 4 + x], 1),
-- 
2.7.3




More information about the wine-patches mailing list