Commit 6c031274 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d9/tests: Fix a test failure on cards that don't support mipmapped cube textures.

parent a18cffb4
...@@ -4653,7 +4653,10 @@ static void test_cube_texture_levels(IDirect3DDevice9 *device) ...@@ -4653,7 +4653,10 @@ static void test_cube_texture_levels(IDirect3DDevice9 *device)
D3DSURFACE_DESC desc; D3DSURFACE_DESC desc;
DWORD levels; DWORD levels;
HRESULT hr; 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, if (FAILED(IDirect3DDevice9_CreateCubeTexture(device, 64, 0, 0,
D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &texture, NULL))) D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &texture, NULL)))
{ {
...@@ -4662,7 +4665,10 @@ static void test_cube_texture_levels(IDirect3DDevice9 *device) ...@@ -4662,7 +4665,10 @@ static void test_cube_texture_levels(IDirect3DDevice9 *device)
} }
levels = IDirect3DCubeTexture9_GetLevelCount(texture); 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); hr = IDirect3DCubeTexture9_GetLevelDesc(texture, levels - 1, &desc);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); ok(hr == D3D_OK, "Got unexpected 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