[PATCH 6/8] wined3d: Move location flag updating out of surface_init_sysmem.

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


---
 dlls/wined3d/surface.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 7866557..9e18488 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1341,9 +1341,6 @@ static BOOL surface_init_sysmem(struct wined3d_surface *surface)
         surface->resource.allocatedMemory = surface->resource.heap_memory;
     }
 
-    surface_validate_location(surface, SFLAG_INSYSMEM);
-    surface_invalidate_location(surface, ~SFLAG_INSYSMEM);
-
     return TRUE;
 }
 
@@ -1370,7 +1367,10 @@ static void surface_unload(struct wined3d_resource *resource)
          * and all flags get lost
          */
         if (!(surface->flags & SFLAG_PBO))
+        {
             surface_init_sysmem(surface);
+            surface_validate_location(surface, SFLAG_INSYSMEM);
+        }
         /* 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
@@ -2784,11 +2784,12 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface,
             return hr;
         }
         surface->resource.allocatedMemory = surface->dib.bitmap_data;
-        surface->flags |= SFLAG_INSYSMEM;
     }
     else if (!surface_init_sysmem(surface))
         return E_OUTOFMEMORY;
 
+    surface_validate_location(surface, SFLAG_INSYSMEM);
+
     return WINED3D_OK;
 }
 
-- 
1.8.3.2




More information about the wine-patches mailing list