d3d9: Add a test for auto depth stencil reset
Henri Verbeet
hverbeet at codeweavers.com
Wed Sep 10 04:08:58 CDT 2008
---
dlls/d3d9/tests/device.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index c234478..d28da88 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -744,6 +744,8 @@ static void test_reset(void)
d3dpp.BackBufferWidth = 800;
d3dpp.BackBufferHeight = 600;
d3dpp.BackBufferFormat = d3ddm.Format;
+ d3dpp.EnableAutoDepthStencil = TRUE;
+ d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8;
for(i = 0; i < IDirect3D9_GetAdapterModeCount(pD3d, D3DADAPTER_DEFAULT, d3ddm.Format); i++) {
ZeroMemory( &d3ddm2, sizeof(d3ddm2) );
@@ -924,6 +926,32 @@ static void test_reset(void)
ok(hr == D3D_OK, "IDirect3DDevice9_TestCooperativeLevel after a successful reset returned %#x\n", hr);
IDirect3DSurface9_Release(surface);
+ /* The depth stencil should get reset to the auto depth stencil when present. */
+ hr = IDirect3DDevice9_SetDepthStencilSurface(pDevice, NULL);
+ ok(hr == D3D_OK, "SetDepthStencilSurface failed with 0x%08x\n", hr);
+
+ hr = IDirect3DDevice9_GetDepthStencilSurface(pDevice, &surface);
+ ok(hr == D3DERR_NOTFOUND, "GetDepthStencilSurface returned 0x%08x, expected D3DERR_NOTFOUND\n", hr);
+ ok(surface == NULL, "Depth stencil should be NULL\n");
+
+ d3dpp.EnableAutoDepthStencil = TRUE;
+ d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8;
+ hr = IDirect3DDevice9_Reset(pDevice, &d3dpp);
+ ok(hr == D3D_OK, "IDirect3DDevice9_Reset failed with 0x%08x\n", hr);
+
+ hr = IDirect3DDevice9_GetDepthStencilSurface(pDevice, &surface);
+ ok(hr == D3D_OK, "GetDepthStencilSurface failed with 0x%08x\n", hr);
+ ok(surface != NULL, "Depth stencil should not be NULL\n");
+ if (surface) IDirect3DSurface9_Release(surface);
+
+ d3dpp.EnableAutoDepthStencil = FALSE;
+ hr = IDirect3DDevice9_Reset(pDevice, &d3dpp);
+ ok(hr == D3D_OK, "IDirect3DDevice9_Reset failed with 0x%08x\n", hr);
+
+ hr = IDirect3DDevice9_GetDepthStencilSurface(pDevice, &surface);
+ ok(hr == D3DERR_NOTFOUND, "GetDepthStencilSurface returned 0x%08x, expected D3DERR_NOTFOUND\n", hr);
+ ok(surface == NULL, "Depth stencil should be NULL\n");
+
/* Will a sysmem or scratch survive while locked */
hr = IDirect3DDevice9_CreateOffscreenPlainSurface(pDevice, 16, 16, D3DFMT_R5G6B5, D3DPOOL_SYSTEMMEM, &surface, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_CreateOffscreenPlainSurface returned %08x\n", hr);
--
1.5.6.4
--------------010007040201030102040904--
More information about the wine-patches
mailing list