d3d8/tests: Add a volume texture test to test_reset().
This commit is contained in:
parent
4a7ff5fc35
commit
a4b032fd31
|
@ -885,6 +885,7 @@ static void test_reset(void)
|
|||
UINT mode_count = 0;
|
||||
HWND window = NULL;
|
||||
D3DVIEWPORT8 vp;
|
||||
D3DCAPS8 caps;
|
||||
DWORD shader;
|
||||
HRESULT hr;
|
||||
UINT i;
|
||||
|
@ -975,6 +976,9 @@ static void test_reset(void)
|
|||
hr = IDirect3DDevice8_TestCooperativeLevel(device1);
|
||||
ok(SUCCEEDED(hr), "TestCooperativeLevel failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_GetDeviceCaps(device1, &caps);
|
||||
ok(SUCCEEDED(hr), "GetDeviceCaps failed, hr %#x.\n", hr);
|
||||
|
||||
width = GetSystemMetrics(SM_CXSCREEN);
|
||||
height = GetSystemMetrics(SM_CYSCREEN);
|
||||
ok(width == modes[i].w, "Screen width is %u, expected %u.\n", width, modes[i].w);
|
||||
|
@ -1099,6 +1103,29 @@ static void test_reset(void)
|
|||
hr = IDirect3DDevice8_TestCooperativeLevel(device1);
|
||||
ok(SUCCEEDED(hr), "TestCooperativeLevel failed, hr %#x.\n", hr);
|
||||
|
||||
if (caps.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP)
|
||||
{
|
||||
IDirect3DVolumeTexture8 *volume_texture;
|
||||
|
||||
hr = IDirect3DDevice8_CreateVolumeTexture(device1, 16, 16, 4, 1, 0,
|
||||
D3DFMT_R5G6B5, D3DPOOL_DEFAULT, &volume_texture);
|
||||
ok(SUCCEEDED(hr), "CreateVolumeTexture failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice8_Reset(device1, &d3dpp);
|
||||
ok(hr == D3DERR_DEVICELOST, "Reset returned %#x, expected %#x.\n", hr, D3DERR_INVALIDCALL);
|
||||
hr = IDirect3DDevice8_TestCooperativeLevel(device1);
|
||||
ok(hr == D3DERR_DEVICENOTRESET, "TestCooperativeLevel returned %#x, expected %#x.\n",
|
||||
hr, D3DERR_DEVICENOTRESET);
|
||||
IDirect3DVolumeTexture8_Release(volume_texture);
|
||||
hr = IDirect3DDevice8_Reset(device1, &d3dpp);
|
||||
ok(SUCCEEDED(hr), "Reset failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice8_TestCooperativeLevel(device1);
|
||||
ok(SUCCEEDED(hr), "TestCooperativeLevel failed, hr %#x.\n", hr);
|
||||
}
|
||||
else
|
||||
{
|
||||
skip("Volume textures not supported.\n");
|
||||
}
|
||||
|
||||
/* Scratch, sysmem and managed pool resources are fine. */
|
||||
hr = IDirect3DDevice8_CreateTexture(device1, 16, 16, 1, 0, D3DFMT_R5G6B5, D3DPOOL_SCRATCH, &texture);
|
||||
ok(SUCCEEDED(hr), "CreateTexture failed, hr %#x.\n", hr);
|
||||
|
|
Loading…
Reference in New Issue