Commit 6334bf09 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d9/tests: Skip unsupported resources in test_resource_type.

parent 86168c4e
...@@ -8893,6 +8893,7 @@ static void test_resource_type(void) ...@@ -8893,6 +8893,7 @@ static void test_resource_type(void)
ULONG refcount; ULONG refcount;
HWND window; HWND window;
HRESULT hr; HRESULT hr;
D3DCAPS9 caps;
window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, NULL, NULL, NULL, NULL); 0, 0, 640, 480, NULL, NULL, NULL, NULL);
...@@ -8906,6 +8907,9 @@ static void test_resource_type(void) ...@@ -8906,6 +8907,9 @@ static void test_resource_type(void)
return; return;
} }
hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 4, 4, D3DFMT_X8R8G8B8, hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 4, 4, D3DFMT_X8R8G8B8,
D3DPOOL_SYSTEMMEM, &surface, NULL); D3DPOOL_SYSTEMMEM, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr);
...@@ -8966,6 +8970,8 @@ static void test_resource_type(void) ...@@ -8966,6 +8970,8 @@ static void test_resource_type(void)
IDirect3DSurface9_Release(surface); IDirect3DSurface9_Release(surface);
IDirect3DTexture9_Release(texture); IDirect3DTexture9_Release(texture);
if (caps.TextureCaps & D3DPTEXTURECAPS_CUBEMAP)
{
hr = IDirect3DDevice9_CreateCubeTexture(device, 1, 1, 0, D3DFMT_X8R8G8B8, hr = IDirect3DDevice9_CreateCubeTexture(device, 1, 1, 0, D3DFMT_X8R8G8B8,
D3DPOOL_SYSTEMMEM, &cube_texture, NULL); D3DPOOL_SYSTEMMEM, &cube_texture, NULL);
ok(SUCCEEDED(hr), "Failed to create cube texture, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to create cube texture, hr %#x.\n", hr);
...@@ -8987,7 +8993,12 @@ static void test_resource_type(void) ...@@ -8987,7 +8993,12 @@ static void test_resource_type(void)
surface_desc.Type); surface_desc.Type);
IDirect3DSurface9_Release(surface); IDirect3DSurface9_Release(surface);
IDirect3DCubeTexture9_Release(cube_texture); IDirect3DCubeTexture9_Release(cube_texture);
}
else
skip("Cube maps not supported.\n");
if (caps.TextureCaps & D3DPTEXTURECAPS_MIPVOLUMEMAP)
{
hr = IDirect3DDevice9_CreateVolumeTexture(device, 2, 4, 8, 4, 0, D3DFMT_X8R8G8B8, hr = IDirect3DDevice9_CreateVolumeTexture(device, 2, 4, 8, 4, 0, D3DFMT_X8R8G8B8,
D3DPOOL_SYSTEMMEM, &volume_texture, NULL); D3DPOOL_SYSTEMMEM, &volume_texture, NULL);
type = IDirect3DVolumeTexture9_GetType(volume_texture); type = IDirect3DVolumeTexture9_GetType(volume_texture);
...@@ -9031,6 +9042,9 @@ static void test_resource_type(void) ...@@ -9031,6 +9042,9 @@ static void test_resource_type(void)
ok(volume_desc.Depth == 2, "Expected depth 2, got %u.\n", volume_desc.Depth); ok(volume_desc.Depth == 2, "Expected depth 2, got %u.\n", volume_desc.Depth);
IDirect3DVolume9_Release(volume); IDirect3DVolume9_Release(volume);
IDirect3DVolumeTexture9_Release(volume_texture); IDirect3DVolumeTexture9_Release(volume_texture);
}
else
skip("Mipmapped volume maps not supported.\n");
refcount = IDirect3DDevice9_Release(device); refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount); ok(!refcount, "Device has %u references left.\n", refcount);
......
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