Commit 4a7ff5fc authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d9/tests: Add a volume texture test to test_reset().

parent 99092e8a
...@@ -861,6 +861,7 @@ static void test_reset(void) ...@@ -861,6 +861,7 @@ static void test_reset(void)
D3DLOCKED_RECT lockrect; D3DLOCKED_RECT lockrect;
IDirect3DDevice9 *device1 = NULL; IDirect3DDevice9 *device1 = NULL;
IDirect3DDevice9 *device2 = NULL; IDirect3DDevice9 *device2 = NULL;
D3DCAPS9 caps;
struct struct
{ {
UINT w; UINT w;
...@@ -933,6 +934,9 @@ static void test_reset(void) ...@@ -933,6 +934,9 @@ static void test_reset(void)
hr = IDirect3DDevice9_TestCooperativeLevel(device1); hr = IDirect3DDevice9_TestCooperativeLevel(device1);
ok(hr == D3D_OK, "IDirect3DDevice9_TestCooperativeLevel after creation returned %#x\n", hr); ok(hr == D3D_OK, "IDirect3DDevice9_TestCooperativeLevel after creation returned %#x\n", hr);
hr = IDirect3DDevice9_GetDeviceCaps(device1, &caps);
ok(SUCCEEDED(hr), "GetDeviceCaps failed, hr %#x.\n", hr);
width = GetSystemMetrics(SM_CXSCREEN); width = GetSystemMetrics(SM_CXSCREEN);
height = GetSystemMetrics(SM_CYSCREEN); height = GetSystemMetrics(SM_CYSCREEN);
ok(width == modes[i].w, "Screen width is %u, expected %u\n", width, modes[i].w); ok(width == modes[i].w, "Screen width is %u, expected %u\n", width, modes[i].w);
...@@ -1067,6 +1071,29 @@ static void test_reset(void) ...@@ -1067,6 +1071,29 @@ static void test_reset(void)
hr = IDirect3DDevice9_TestCooperativeLevel(device1); hr = IDirect3DDevice9_TestCooperativeLevel(device1);
ok(hr == D3D_OK, "IDirect3DDevice9_TestCooperativeLevel after a successful reset returned %#x\n", hr); ok(hr == D3D_OK, "IDirect3DDevice9_TestCooperativeLevel after a successful reset returned %#x\n", hr);
if (caps.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP)
{
IDirect3DVolumeTexture9 *volume_texture;
hr = IDirect3DDevice9_CreateVolumeTexture(device1, 16, 16, 4, 1, 0,
D3DFMT_R5G6B5, D3DPOOL_DEFAULT, &volume_texture, NULL);
ok(SUCCEEDED(hr), "CreateVolumeTexture failed, hr %#x.\n", hr);
hr = IDirect3DDevice9_Reset(device1, &d3dpp);
ok(hr == D3DERR_INVALIDCALL, "Reset returned %#x, expected %#x.\n", hr, D3DERR_INVALIDCALL);
hr = IDirect3DDevice9_TestCooperativeLevel(device1);
ok(hr == D3DERR_DEVICENOTRESET, "TestCooperativeLevel returned %#x, expected %#x.\n",
hr, D3DERR_DEVICENOTRESET);
IDirect3DVolumeTexture9_Release(volume_texture);
hr = IDirect3DDevice9_Reset(device1, &d3dpp);
ok(SUCCEEDED(hr), "Reset failed, hr %#x.\n", hr);
hr = IDirect3DDevice9_TestCooperativeLevel(device1);
ok(SUCCEEDED(hr), "TestCooperativeLevel failed, hr %#x.\n", hr);
}
else
{
skip("Volume textures not supported.\n");
}
/* Scratch, sysmem and managed pools are fine */ /* Scratch, sysmem and managed pools are fine */
hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device1, 16, 16, D3DFMT_R5G6B5, D3DPOOL_SCRATCH, &surface, NULL); hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device1, 16, 16, D3DFMT_R5G6B5, D3DPOOL_SCRATCH, &surface, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_CreateOffscreenPlainSurface returned %08x\n", hr); ok(hr == D3D_OK, "IDirect3DDevice9_CreateOffscreenPlainSurface returned %08x\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