[PATCH 3/4] wined3d: Simply use surface_modify_location() in IWineD3DSurfaceImpl_Map() with WINED3DLOCK_DISCARD.

Henri Verbeet hverbeet at codeweavers.com
Thu Nov 11 05:39:19 CST 2010


The call to surface_add_dirty_rect() would have taken care of evicting the
other locations anyway, but we really shouldn't be touching the location flags
directly.
---
 dlls/wined3d/surface.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index a18f067..394ae6d 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1655,11 +1655,11 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Map(IWineD3DSurface *iface,
         TRACE("Warning: trying to lock unlockable surf@%p\n", This);
     }
 
-    if (Flags & WINED3DLOCK_DISCARD) {
-        /* Set SFLAG_INSYSMEM, so we'll never try to download the data from the texture. */
-        TRACE("WINED3DLOCK_DISCARD flag passed, marking local copy as up to date\n");
-        surface_prepare_system_memory(This); /* Makes sure memory is allocated */
-        This->Flags |= SFLAG_INSYSMEM;
+    if (Flags & WINED3DLOCK_DISCARD)
+    {
+        TRACE("WINED3DLOCK_DISCARD flag passed, marking SYSMEM as up to date.\n");
+        surface_prepare_system_memory(This);
+        surface_modify_location(This, SFLAG_INSYSMEM, TRUE);
         goto lock_end;
     }
 
-- 
1.7.2.2




More information about the wine-patches mailing list