Henri Verbeet : ddraw: Avoid d3d_device_update_depth_stencil() in ddraw_surface_delete_attached_surface().

Alexandre Julliard julliard at wine.codeweavers.com
Wed Mar 16 11:36:39 CDT 2016


Module: wine
Branch: master
Commit: 130bd9d8c73a5199524645ce5f83544646c80642
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=130bd9d8c73a5199524645ce5f83544646c80642

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Mar 15 16:55:10 2016 +0100

ddraw: Avoid d3d_device_update_depth_stencil() in ddraw_surface_delete_attached_surface().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ddraw/surface.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 4259c10..9e28655 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -1997,9 +1997,14 @@ static HRESULT ddraw_surface_delete_attached_surface(struct ddraw_surface *surfa
     attachment->next_attached = NULL;
     attachment->first_attached = attachment;
 
-    /* Check if the wined3d depth stencil needs updating. */
-    if (surface->ddraw->d3ddevice)
-        d3d_device_update_depth_stencil(surface->ddraw->d3ddevice);
+    /* Check if the wined3d depth stencil needs updating. Note that we don't
+     * just call d3d_device_update_depth_stencil() here since it uses
+     * QueryInterface(). Some applications, SCP - Containment Breach in
+     * particular, modify the QueryInterface() pointer in the surface vtbl
+     * but don't cleanup properly after the relevant dll is unloaded. */
+    if (attachment->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER
+            && wined3d_device_get_depth_stencil_view(surface->ddraw->wined3d_device) == surface->wined3d_rtv)
+        wined3d_device_set_depth_stencil_view(surface->ddraw->wined3d_device, NULL);
     wined3d_mutex_unlock();
 
     /* Set attached_iface to NULL before releasing it, the surface may go




More information about the wine-cvs mailing list