d3d9/tests: Fix test_updatetexture() on GPUs not supporting WINED3DFMT_R32_FLOAT.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Matteo Bruni 2017-03-14 00:09:54 +01:00 committed by Alexandre Julliard
parent 630ba97900
commit 7bcd6ed4c4
1 changed files with 17 additions and 11 deletions

View File

@ -19631,18 +19631,18 @@ done:
static void test_updatetexture(void)
{
IDirect3DDevice9 *device;
IDirect3D9 *d3d9;
HWND window;
HRESULT hr;
BOOL r32f_supported, ati2n_supported, do_visual_test;
IDirect3DBaseTexture9 *src, *dst;
unsigned int t, i, f, l, x, y, z;
D3DLOCKED_RECT locked_rect;
D3DLOCKED_BOX locked_box;
IDirect3DDevice9 *device;
IDirect3D9 *d3d9;
ULONG refcount;
D3DCAPS9 caps;
D3DCOLOR color;
BOOL ati2n_supported, do_visual_test;
D3DCAPS9 caps;
HWND window;
HRESULT hr;
static const struct
{
struct vec3 pos;
@ -19776,23 +19776,29 @@ static void test_updatetexture(void)
texture_types[t].name);
continue;
}
r32f_supported = TRUE;
if (FAILED(IDirect3D9_CheckDeviceFormat(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
D3DFMT_X8R8G8B8, D3DUSAGE_QUERY_FILTER, texture_types[t].type, D3DFMT_R32F)))
{
skip("%s R32F textures are not supported, skipping some tests.\n", texture_types[t].name);
r32f_supported = FALSE;
}
ati2n_supported = TRUE;
if (FAILED(IDirect3D9_CheckDeviceFormat(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
D3DFMT_X8R8G8B8, D3DUSAGE_QUERY_FILTER, texture_types[t].type, MAKEFOURCC('A','T','I','2'))))
{
skip("%s ATI2N textures are not supported, skipping some tests.\n", texture_types[t].name);
ati2n_supported = FALSE;
}
else
{
ati2n_supported = TRUE;
}
hr = IDirect3DDevice9_SetFVF(device, texture_types[t].fvf);
ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr);
for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i)
{
if (tests[i].src_format == MAKEFOURCC('A','T','I','2') && !ati2n_supported)
if (tests[i].dst_format == D3DFMT_R32F && !r32f_supported)
continue;
if (tests[i].dst_format == MAKEFOURCC('A','T','I','2') && !ati2n_supported)
continue;
switch (texture_types[t].type)