From 3961491d15f64f10f583a974c2672a669c6f541a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 14 Sep 2007 17:46:19 +0200 Subject: [PATCH] wined3d: Do not invalidate the sysmem copy if a pbo exists. --- dlls/wined3d/surface.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index fd0a94b4efb..d9a4e29e1bd 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -750,12 +750,11 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED /* Mark the surface locked */ This->Flags |= SFLAG_LOCKED; - /* Whatever surface we have, make sure that there is memory allocated for the downloaded copy */ - if(!This->resource.allocatedMemory) { - /* In case of PBOs allocatedMemory should be zero. */ - if(!(This->Flags & SFLAG_PBO)) - This->resource.allocatedMemory = HeapAlloc(GetProcessHeap() ,0 , This->resource.size + 4); - + /* Whatever surface we have, make sure that there is memory allocated for the downloaded copy, + * or a pbo to map + */ + if(!(This->resource.allocatedMemory || This->Flags & SFLAG_PBO)) { + This->resource.allocatedMemory = HeapAlloc(GetProcessHeap() ,0 , This->resource.size + 4); This->Flags &= ~SFLAG_INSYSMEM; /* This is the marker that surface data has to be downloaded */ }