Module: wine Branch: master Commit: 6c031274c3f2f4db4d1125465b111ec143e6168d URL: http://source.winehq.org/git/wine.git/?a=commit;h=6c031274c3f2f4db4d1125465b...
Author: Stefan Dösinger stefan@codeweavers.com Date: Tue Apr 16 14:48:35 2013 +0200
d3d9/tests: Fix a test failure on cards that don't support mipmapped cube textures.
---
dlls/d3d9/tests/device.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 310f47a..3283a6e 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -4653,7 +4653,10 @@ static void test_cube_texture_levels(IDirect3DDevice9 *device) D3DSURFACE_DESC desc; DWORD levels; HRESULT hr; + D3DCAPS9 caps;
+ hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); if (FAILED(IDirect3DDevice9_CreateCubeTexture(device, 64, 0, 0, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &texture, NULL))) { @@ -4662,7 +4665,10 @@ static void test_cube_texture_levels(IDirect3DDevice9 *device) }
levels = IDirect3DCubeTexture9_GetLevelCount(texture); - ok(levels == 7, "Got unexpected levels %u.\n", levels); + if (caps.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP) + ok(levels == 7, "Got unexpected levels %u.\n", levels); + else + ok(levels == 1, "Got unexpected levels %u.\n", levels);
hr = IDirect3DCubeTexture9_GetLevelDesc(texture, levels - 1, &desc); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);