[PATCH 7/8] wined3d: Load surfaces into map binding memory on unload.

Stefan Dösinger stefan at codeweavers.com
Fri Jan 10 05:40:46 CST 2014


A surface can stay in DIB or user memory just fine. When buffers get
their own location an exception for them has to be added.
---
 dlls/wined3d/surface.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 9e18488..bfde475 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1369,7 +1369,7 @@ static void surface_unload(struct wined3d_resource *resource)
         if (!(surface->flags & SFLAG_PBO))
         {
             surface_init_sysmem(surface);
-            surface_validate_location(surface, SFLAG_INSYSMEM);
+            surface_validate_location(surface, surface->map_binding);
         }
         /* 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
@@ -1379,9 +1379,9 @@ static void surface_unload(struct wined3d_resource *resource)
     }
     else
     {
-        surface_load_location(surface, SFLAG_INSYSMEM);
+        surface_load_location(surface, surface->map_binding);
     }
-    surface_invalidate_location(surface, ~SFLAG_INSYSMEM);
+    surface_invalidate_location(surface, ~surface->map_binding);
     surface->flags &= ~(SFLAG_ALLOCATED | SFLAG_SRGBALLOCATED);
 
     context = context_acquire(device, NULL);
-- 
1.8.3.2




More information about the wine-patches mailing list