d3d9/tests: Skip YUV tests if the formats cannot be converted.

The Windows 8 testbot supports some YUV formats as plain surfaces, but cannot
convert them to RGB in StretchRect.
oldstable
Stefan Dösinger 2014-02-16 22:42:20 +01:00 committed by Alexandre Julliard
parent 35223d80cb
commit 6745982aaa
1 changed files with 13 additions and 0 deletions

View File

@ -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