[PATCH 1/5] ddraw/tests: Remove A4R4G4B4 ckey tests.

Stefan Dösinger stefandoesinger at gmx.at
Sun Jun 5 13:45:12 CDT 2016


Signed-off-by: Stefan Dösinger <stefandoesinger at gmx.at>

---

They're more broken on Nvidia + Win10 than they used to be on Nvidia +
Win7. I can't find a way to detect the problem without putting the driver
into a broken state.

The annoying part of this is that we lose 4 bit precision tests. X4R4G4B4
doesn't seem to exist everywhere.
---
 dlls/ddraw/tests/ddraw1.c | 39 +++++++++++----------------------------
 dlls/ddraw/tests/ddraw2.c | 39 +++++++++++----------------------------
 dlls/ddraw/tests/ddraw4.c | 40 +++++++++++-----------------------------
 dlls/ddraw/tests/ddraw7.c | 39 +++++++++++----------------------------
 4 files changed, 44 insertions(+), 113 deletions(-)

diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index c848593..96bc479 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -7603,14 +7603,16 @@ static void test_colorkey_precision(void)
             }
 
         },
-        {
-            15, 0, 2, 0x0678, "D3DFMT_A4R4G4B4",
-            {
-                sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0,
-                {16}, {0x0f00}, {0x00f0}, {0x000f}, {0xf000}
-            }
-
-        },
+        /*
+         * Broken on Nvidia on Windows. Blit returns, but the following Lock call waits forever.
+         * {
+         *     15, 0, 2, 0x0678, "D3DFMT_A4R4G4B4",
+         *     {
+         *         sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0,
+         *         {16}, {0x0f00}, {0x00f0}, {0x000f}, {0xf000}
+         *     }
+         * },
+         */
     };
 
     window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
@@ -7762,8 +7764,7 @@ static void test_colorkey_precision(void)
             hr = IDirectDrawSurface_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL);
             ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr);
 
-            /* Don't make this read only, it somehow breaks the detection of the Nvidia bug below. */
-            hr = IDirectDrawSurface_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT, NULL);
+            hr = IDirectDrawSurface_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT | DDLOCK_READONLY, NULL);
             ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr);
             switch (tests[t].bpp)
             {
@@ -7788,23 +7789,6 @@ static void test_colorkey_precision(void)
             {
                 ok(data[0] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n",
                         tests[t].clear, data[0], tests[t].name, c);
-
-                if (data[3] == tests[t].clear)
-                {
-                    /* My Geforce GTX 460 on Windows 7 misbehaves when A4R4G4B4 is blitted with color
-                     * keying: The blit takes ~0.5 seconds, and subsequent color keying draws are broken,
-                     * even when a different surface is used. The blit itself doesn't draw anything,
-                     * so we can detect the bug by looking at the otherwise unused 4th texel. It should
-                     * never be masked out by the key.
-                     *
-                     * Also appears to affect the testbot in some way with R5G6B5. Color keying is
-                     * terrible on WARP. */
-                    skip("Nvidia A4R4G4B4 color keying blit bug detected, skipping.\n");
-                    IDirectDrawSurface_Release(texture);
-                    IDirectDrawSurface_Release(src);
-                    IDirectDrawSurface_Release(dst);
-                    goto done;
-                }
             }
             else
                 ok(data[0] == (c - 1) << tests[t].shift, "Expected surface content %#x, got %#x, format %s, c=%u.\n",
@@ -7860,7 +7844,6 @@ static void test_colorkey_precision(void)
         IDirectDrawSurface_Release(src);
         IDirectDrawSurface_Release(dst);
     }
-done:
 
     destroy_viewport(device, viewport);
     destroy_material(green);
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index eefa334..ab66159 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -8761,14 +8761,16 @@ static void test_colorkey_precision(void)
             }
 
         },
-        {
-            15, 0, 2, 0x0678, "D3DFMT_A4R4G4B4",
-            {
-                sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0,
-                {16}, {0x0f00}, {0x00f0}, {0x000f}, {0xf000}
-            }
-
-        },
+        /*
+         * Broken on Nvidia on Windows. Blit returns, but the following Lock call waits forever.
+         * {
+         *     15, 0, 2, 0x0678, "D3DFMT_A4R4G4B4",
+         *     {
+         *         sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0,
+         *         {16}, {0x0f00}, {0x00f0}, {0x000f}, {0xf000}
+         *     }
+         * },
+         */
     };
 
     window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
@@ -8896,8 +8898,7 @@ static void test_colorkey_precision(void)
             hr = IDirectDrawSurface_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL);
             ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr);
 
-            /* Don't make this read only, it somehow breaks the detection of the Nvidia bug below. */
-            hr = IDirectDrawSurface_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT, NULL);
+            hr = IDirectDrawSurface_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT | DDLOCK_READONLY, NULL);
             ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr);
             switch (tests[t].bpp)
             {
@@ -8922,23 +8923,6 @@ static void test_colorkey_precision(void)
             {
                 ok(data[0] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n",
                         tests[t].clear, data[0], tests[t].name, c);
-
-                if (data[3] == tests[t].clear)
-                {
-                    /* My Geforce GTX 460 on Windows 7 misbehaves when A4R4G4B4 is blitted with color
-                     * keying: The blit takes ~0.5 seconds, and subsequent color keying draws are broken,
-                     * even when a different surface is used. The blit itself doesn't draw anything,
-                     * so we can detect the bug by looking at the otherwise unused 4th texel. It should
-                     * never be masked out by the key.
-                     *
-                     * Also appears to affect the testbot in some way with R5G6B5. Color keying is
-                     * terrible on WARP. */
-                    skip("Nvidia A4R4G4B4 color keying blit bug detected, skipping.\n");
-                    IDirectDrawSurface_Release(texture);
-                    IDirectDrawSurface_Release(src);
-                    IDirectDrawSurface_Release(dst);
-                    goto done;
-                }
             }
             else
                 ok(data[0] == (c - 1) << tests[t].shift, "Expected surface content %#x, got %#x, format %s, c=%u.\n",
@@ -8996,7 +8980,6 @@ static void test_colorkey_precision(void)
         IDirectDrawSurface_Release(src);
         IDirectDrawSurface_Release(dst);
     }
-done:
 
     destroy_viewport(device, viewport);
     destroy_material(green);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index ab5ccab..4c98568 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -9904,14 +9904,16 @@ static void test_colorkey_precision(void)
             }
 
         },
-        {
-            15, 0, 2, 0x0678, "D3DFMT_A4R4G4B4",
-            {
-                sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0,
-                {16}, {0x0f00}, {0x00f0}, {0x000f}, {0xf000}
-            }
-
-        },
+        /*
+         * Broken on Nvidia on Windows. Blit returns, but the following Lock call waits forever.
+         * {
+         *     15, 0, 2, 0x0678, "D3DFMT_A4R4G4B4",
+         *     {
+         *         sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0,
+         *         {16}, {0x0f00}, {0x00f0}, {0x000f}, {0xf000}
+         *     }
+         * },
+         */
     };
 
     window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
@@ -10046,8 +10048,7 @@ static void test_colorkey_precision(void)
             hr = IDirectDrawSurface4_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL);
             ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr);
 
-            /* Don't make this read only, it somehow breaks the detection of the Nvidia bug below. */
-            hr = IDirectDrawSurface4_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT, NULL);
+            hr = IDirectDrawSurface4_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT | DDLOCK_READONLY, NULL);
             ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr);
             switch (tests[t].bpp)
             {
@@ -10072,24 +10073,6 @@ static void test_colorkey_precision(void)
             {
                 ok(data[0] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n",
                         tests[t].clear, data[0], tests[t].name, c);
-
-                if (data[3] == tests[t].clear)
-                {
-                    /* My Geforce GTX 460 on Windows 7 misbehaves when A4R4G4B4 is blitted with color
-                     * keying: The blit takes ~0.5 seconds, and subsequent color keying draws are broken,
-                     * even when a different surface is used. The blit itself doesn't draw anything,
-                     * so we can detect the bug by looking at the otherwise unused 4th texel. It should
-                     * never be masked out by the key.
-                     *
-                     * Also appears to affect the testbot in some way with R5G6B5. Color keying is
-                     * terrible on WARP. */
-                    skip("Nvidia A4R4G4B4 color keying blit bug detected, skipping.\n");
-                    IDirect3DTexture2_Release(d3d_texture);
-                    IDirectDrawSurface4_Release(texture);
-                    IDirectDrawSurface4_Release(src);
-                    IDirectDrawSurface4_Release(dst);
-                    goto done;
-                }
             }
             else
                 ok(data[0] == (c - 1) << tests[t].shift, "Expected surface content %#x, got %#x, format %s, c=%u.\n",
@@ -10146,7 +10129,6 @@ static void test_colorkey_precision(void)
         IDirectDrawSurface4_Release(src);
         IDirectDrawSurface4_Release(dst);
     }
-    done:
 
     destroy_viewport(device, viewport);
     IDirectDrawSurface4_Release(rt);
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 9a3bfe3..afa424c 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -10236,14 +10236,16 @@ static void test_colorkey_precision(void)
             }
 
         },
-        {
-            15, 0, 2, 0x0678, "D3DFMT_A4R4G4B4",
-            {
-                sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0,
-                {16}, {0x0f00}, {0x00f0}, {0x000f}, {0xf000}
-            }
-
-        },
+        /*
+         * Broken on Nvidia on Windows. Blit returns, but the following Lock call waits forever.
+         * {
+         *     15, 0, 2, 0x0678, "D3DFMT_A4R4G4B4",
+         *     {
+         *         sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0,
+         *         {16}, {0x0f00}, {0x00f0}, {0x000f}, {0xf000}
+         *     }
+         * },
+         */
     };
 
     window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
@@ -10368,8 +10370,7 @@ static void test_colorkey_precision(void)
             hr = IDirectDrawSurface7_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL);
             ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr);
 
-            /* Don't make this read only, it somehow breaks the detection of the Nvidia bug below. */
-            hr = IDirectDrawSurface7_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT, NULL);
+            hr = IDirectDrawSurface7_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT | DDLOCK_READONLY, NULL);
             ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr);
             switch (tests[t].bpp)
             {
@@ -10394,23 +10395,6 @@ static void test_colorkey_precision(void)
             {
                 ok(data[0] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n",
                         tests[t].clear, data[0], tests[t].name, c);
-
-                if (data[3] == tests[t].clear)
-                {
-                    /* My Geforce GTX 460 on Windows 7 misbehaves when A4R4G4B4 is blitted with color
-                     * keying: The blit takes ~0.5 seconds, and subsequent color keying draws are broken,
-                     * even when a different surface is used. The blit itself doesn't draw anything,
-                     * so we can detect the bug by looking at the otherwise unused 4th texel. It should
-                     * never be masked out by the key.
-                     *
-                     * Also appears to affect the testbot in some way with R5G6B5. Color keying is
-                     * terrible on WARP. */
-                    skip("Nvidia A4R4G4B4 color keying blit bug detected, skipping.\n");
-                    IDirectDrawSurface7_Release(texture);
-                    IDirectDrawSurface7_Release(src);
-                    IDirectDrawSurface7_Release(dst);
-                    goto done;
-                }
             }
             else
                 ok(data[0] == (c - 1) << tests[t].shift, "Expected surface content %#x, got %#x, format %s, c=%u.\n",
@@ -10466,7 +10450,6 @@ static void test_colorkey_precision(void)
         IDirectDrawSurface7_Release(src);
         IDirectDrawSurface7_Release(dst);
     }
-done:
 
     IDirectDrawSurface7_Release(rt);
     IDirectDraw7_Release(ddraw);
-- 
2.7.3




More information about the wine-patches mailing list