Commit 82a4373c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Check if formats are supported as render target in srgbwrite_format_test().

Floating point formats in particular may not be supported everywhere.
parent 74cf35d2
......@@ -11447,14 +11447,17 @@ static void srgbwrite_format_test(IDirect3DDevice9 *device)
for(i = 0; i < (sizeof(formats) / sizeof(*formats)); i++)
{
hr = IDirect3DDevice9_CreateTexture(device, 8, 8, 1, D3DUSAGE_RENDERTARGET, formats[i].fmt,
D3DPOOL_DEFAULT, &texture, NULL);
ok(SUCCEEDED(hr), "CreateTexture failed, hr %#x.\n", hr);
if(FAILED(hr))
if (FAILED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8,
D3DUSAGE_RENDERTARGET, D3DRTYPE_TEXTURE, formats[i].fmt)))
{
trace("Tex create failed\n");
skip("Format %s not supported as render target, skipping test.\n",
formats[i].name);
continue;
}
hr = IDirect3DDevice9_CreateTexture(device, 8, 8, 1, D3DUSAGE_RENDERTARGET, formats[i].fmt,
D3DPOOL_DEFAULT, &texture, NULL);
ok(SUCCEEDED(hr), "CreateTexture failed, hr %#x.\n", hr);
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ff0000, 0.0f, 0);
ok(SUCCEEDED(hr), "Clear failed, hr %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment