Henri Verbeet : wined3d: Check if formats are supported as render target in srgbwrite_format_test() .
Alexandre Julliard
julliard at winehq.org
Wed Feb 2 12:30:15 CST 2011
Module: wine
Branch: master
Commit: 82a4373cd0b5df7be59c4c318cb3a7d57571ba3d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=82a4373cd0b5df7be59c4c318cb3a7d57571ba3d
Author: Henri Verbeet <hverbeet at gmail.com>
Date: Tue Feb 1 20:47:21 2011 +0100
wined3d: Check if formats are supported as render target in srgbwrite_format_test().
Floating point formats in particular may not be supported everywhere.
---
dlls/d3d9/tests/visual.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index f615369..ca33fae 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -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);
More information about the wine-cvs
mailing list