Module: wine
Branch: master
Commit: cfb07e711476b6278fc2eb6d3af3365b5d43a9c9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=cfb07e711476b6278fc2eb6d3…
Author: H. Verbeet <hverbeet(a)gmail.com>
Date: Wed Aug 1 22:48:42 2007 +0200
wined3d: Set SFLAG_INSYSMEM when WINED3DLOCK_DISCARD is passed to IWineD3DSurfaceImpl_LockRect.
---
dlls/wined3d/surface.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 75a2d26..56ce845 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -763,8 +763,14 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
}
}
- if((Flags & WINED3DLOCK_DISCARD) || (This->Flags & SFLAG_INSYSMEM)) {
- TRACE("WINED3DLOCK_DISCARD flag passed, or local copy is up to date, not downloading data\n");
+ 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");
+ This->Flags |= SFLAG_INSYSMEM;
+ }
+
+ if (This->Flags & SFLAG_INSYSMEM) {
+ TRACE("Local copy is up to date, not downloading data\n");
goto lock_end;
}