[PATCH 2/5] d3d9/tests: Skip YUV tests if the formats cannot be converted.

Stefan Dösinger stefan at codeweavers.com
Sun Feb 16 15:42:20 CST 2014


The Windows 8 testbot supports some YUV formats as plain surfaces, but cannot
convert them to RGB in StretchRect. This check gracefully skips the tests.

The same limitation applies to my rather ancient Radeon 9000 Mobility.
---
 dlls/d3d9/tests/visual.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 89f02b9..13d0ea6 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -10382,6 +10382,7 @@ static void yuv_color_test(IDirect3DDevice9 *device)
     IDirect3D9 *d3d;
     D3DCOLOR color;
     D3DFORMAT skip_once = D3DFMT_UNKNOWN;
+    D3DSURFACE_DESC desc;
 
     static const struct
     {
@@ -10435,6 +10436,8 @@ static void yuv_color_test(IDirect3DDevice9 *device)
     ok(SUCCEEDED(hr), "Failed to get d3d9 interface, hr %#x.\n", hr);
     hr = IDirect3DDevice9_GetRenderTarget(device, 0, &target);
     ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
+    hr = IDirect3DSurface9_GetDesc(target, &desc);
+    ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr);
 
     for (i = 0; i < sizeof(test_data) / sizeof(test_data[0]); i++)
     {
@@ -10450,6 +10453,16 @@ static void yuv_color_test(IDirect3DDevice9 *device)
             }
             continue;
         }
+        if (FAILED(IDirect3D9_CheckDeviceFormatConversion(d3d, 0,
+                D3DDEVTYPE_HAL, test_data[i].format, desc.Format)))
+        {
+            if (skip_once != test_data[i].format)
+            {
+                skip("Driver cannot blit %s surfaces.\n", test_data[i].fmt_string);
+                skip_once = test_data[i].format;
+            }
+            continue;
+        }
 
         /* A pixel is effectively 16 bit large, but two pixels are stored together, so the minimum size is 2x1.
          * However, Nvidia Windows drivers have problems with 2x1 YUY2/UYVY surfaces, so use a 4x1 surface and
-- 
1.8.3.2




More information about the wine-patches mailing list