[PATCH v3 4/4] d3d9/tests: Do not use Nvidia mode in test_alpha_to_coverage() if reported GPU is AMD.

Paul Gofman gofmanp at gmail.com
Wed Feb 12 08:38:04 CST 2020


Otherwise if Wine exposes ATOC format the test will always trigger Nvidia path
regardless of reported GPU.

Signed-off-by: Paul Gofman <gofmanp at gmail.com>
---
 dlls/d3d9/tests/visual.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 24781ff788..108cb384c2 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -27011,19 +27011,20 @@ static void test_alpha_to_coverage(void)
         return;
     }
 
-    if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0,
-            D3DRTYPE_SURFACE, MAKEFOURCC('A','T','O','C')) == D3D_OK)
+
+    hr = IDirect3D9_GetAdapterIdentifier(d3d, D3DADAPTER_DEFAULT, 0, &identifier);
+    ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+
+    if (adapter_is_amd(&identifier))
     {
-        /* ATOC pseudo format is introduced by Nvidia. Some Intel GPUs support
-         * alpha to coverage the same way as Nvidia. */
-        nvidia_mode = TRUE;
+        nvidia_mode = FALSE;
     }
     else
     {
-        nvidia_mode = FALSE;
-        hr = IDirect3D9_GetAdapterIdentifier(d3d, D3DADAPTER_DEFAULT, 0, &identifier);
-        ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
-        if (!adapter_is_amd(&identifier))
+        /* ATOC pseudo format is introduced by Nvidia. Some Intel GPUs support
+         * alpha to coverage the same way as Nvidia. */
+        if (!IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0,
+                D3DRTYPE_SURFACE, MAKEFOURCC('A','T','O','C')) == D3D_OK)
         {
             win_skip("Alpha to coverage is not supported.\n");
             refcount = IDirect3DDevice9_Release(device);
@@ -27032,6 +27033,7 @@ static void test_alpha_to_coverage(void)
             DestroyWindow(window);
             return;
         }
+        nvidia_mode = TRUE;
     }
 
     hr = IDirect3DDevice9_CreateRenderTarget(device, 128, 128,
-- 
2.24.1




More information about the wine-devel mailing list