Henri Verbeet : wined3d: Use surface_modify_location() to manipulate location flags in IWineD3DSurfaceImpl_Unmap().

Alexandre Julliard julliard at winehq.org
Wed Jan 5 12:40:26 CST 2011


Module: wine
Branch: master
Commit: e5d1a0c72d41d630cd32b1b67c79149e76699dc5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e5d1a0c72d41d630cd32b1b67c79149e76699dc5

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Jan  4 17:42:00 2011 +0100

wined3d: Use surface_modify_location() to manipulate location flags in IWineD3DSurfaceImpl_Unmap().

Directly setting SFLAG_INFRAWABLE breaks for offscreen render targets, where
the drawable and texture are the same thing. Before commit
d3fd7b247b35d7c8c453afa2fc07e121ea75214b the explicit load of the texture
location with the default RTL_READTEX render target lock mode would have
prevented the flags from becomming inconsistent.

---

 dlls/wined3d/surface.c |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 278eb5e..96b897a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1884,19 +1884,15 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Unmap(IWineD3DSurface *iface)
 
         surface_load_location(This, SFLAG_INDRAWABLE, fullsurface ? NULL : &This->dirtyRect);
 
+        /* Partial rectangle tracking is not commonly implemented, it is only
+         * done for render targets. INSYSMEM was set before to tell
+         * surface_load_location() where to read the rectangle from.
+         * Indrawable is set because all modifications from the partial
+         * sysmem copy are written back to the drawable, thus the surface is
+         * merged again in the drawable. The sysmem copy is not fully up to
+         * date because only a subrectangle was read in Map(). */
         if (!fullsurface)
-        {
-            /* Partial rectangle tracking is not commonly implemented, it is
-             * only done for render targets. Overwrite the flags to bring
-             * them back into a sane state. INSYSMEM was set before to tell
-             * surface_load_location() where to read the rectangle from.
-             * Indrawable is set because all modifications from the partial
-             * sysmem copy are written back to the drawable, thus the surface
-             * is merged again in the drawable. The sysmem copy is not fully
-             * up to date because only a subrectangle was read in Map(). */
-            This->flags &= ~SFLAG_INSYSMEM;
-            This->flags |= SFLAG_INDRAWABLE;
-        }
+            surface_modify_location(This, SFLAG_INDRAWABLE, TRUE);
 
         This->dirtyRect.left   = This->currentDesc.Width;
         This->dirtyRect.top    = This->currentDesc.Height;




More information about the wine-cvs mailing list