wined3d: Reset the auto depth stencil

Henri Verbeet hverbeet at codeweavers.com
Wed Sep 10 04:08:58 CDT 2008


---
 dlls/wined3d/device.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 3cfc606..9e0cf4f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -7356,10 +7356,17 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
         pPresentationParameters->hDeviceWindow != swapchain->presentParms.hDeviceWindow) {
         ERR("Cannot change the device window yet\n");
     }
-    if(pPresentationParameters->EnableAutoDepthStencil != swapchain->presentParms.EnableAutoDepthStencil) {
-        ERR("What do do about a changed auto depth stencil parameter?\n");
+    if (pPresentationParameters->EnableAutoDepthStencil && !This->auto_depth_stencil_buffer) {
+        WARN("Auto depth stencil enabled, but no auto depth stencil present, returning WINED3DERR_INVALIDCALL\n");
+        return WINED3DERR_INVALIDCALL;
     }
 
+    /* Reset the depth stencil */
+    if (pPresentationParameters->EnableAutoDepthStencil)
+        IWineD3DDevice_SetDepthStencilSurface(iface, This->auto_depth_stencil_buffer);
+    else
+        IWineD3DDevice_SetDepthStencilSurface(iface, NULL);
+
     delete_opengl_contexts(iface, (IWineD3DSwapChain *) swapchain);
 
     if(pPresentationParameters->Windowed) {
-- 
1.5.6.4



--------------000805060001020909010906--



More information about the wine-patches mailing list