[PATCH 2/5] wined3d: Mark default pool surfaces lost when they're unloaded.

Henri Verbeet hverbeet at codeweavers.com
Mon Oct 17 14:06:21 CDT 2011


---
 dlls/wined3d/surface.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c7bba27..277a317 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1866,6 +1866,11 @@ static void surface_unload(struct wined3d_resource *resource)
          * and all flags get lost
          */
         surface_init_sysmem(surface);
+        /* We also get here when the ddraw swapchain is destroyed, for example
+         * for a mode switch. In this case this surface won't necessarily be
+         * an implicit surface. We have to mark it lost so that the
+         * application can restore it after the mode switch. */
+        surface->flags |= SFLAG_LOST;
     }
     else
     {
@@ -2966,7 +2971,6 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface)
 {
     TRACE("surface %p.\n", surface);
 
-    /* So far we don't lose anything :) */
     surface->flags &= ~SFLAG_LOST;
     return WINED3D_OK;
 }
-- 
1.7.3.4




More information about the wine-patches mailing list