Module: wine
Branch: master
Commit: 78abb8ae07190714546ecc770680e54fcee20d66
URL: http://source.winehq.org/git/wine.git/?a=commit;h=78abb8ae07190714546ecc770…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Thu Nov 11 12:39:19 2010 +0100
wined3d: Simply use surface_modify_location() in IWineD3DSurfaceImpl_Map() with WINED3DLOCK_DISCARD.
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;
}