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

Stefan Dösinger stefan at codeweavers.com
Thu Feb 13 16:10:04 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 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 1c46417..5a54818 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -10383,6 +10383,7 @@ static void yuv_color_test(IDirect3DDevice9 *device)
     D3DLOCKED_RECT lr;
     IDirect3D9 *d3d;
     DWORD ref_color_left, ref_color_right, color;
+    D3DSURFACE_DESC desc;
 
     static const struct
     {
@@ -10418,6 +10419,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 (fmt = 0; fmt < 2; fmt++)
     {
@@ -10440,6 +10443,12 @@ static void yuv_color_test(IDirect3DDevice9 *device)
             skip("%s is not supported.\n", fmt_string);
             continue;
         }
+        if (FAILED(IDirect3D9_CheckDeviceFormatConversion(d3d, 0,
+                D3DDEVTYPE_HAL, format, desc.Format)))
+        {
+            skip("Driver cannot blit %s surfaces.\n", fmt_string);
+            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