Stefan Dösinger : wined3d: Put implicit surfaces into drawable on unload.

Alexandre Julliard julliard at winehq.org
Tue Apr 8 06:37:48 CDT 2008


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Mon Apr  7 23:21:33 2008 +0200

wined3d: Put implicit surfaces into drawable on unload.

If we mark the sysmem copy up to date we would have to take care about
allocating it. As explained in the comment, INDRAWABLE is a saner
choice

---

 dlls/wined3d/surface.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 733d095..3eeaaa3 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -563,14 +563,21 @@ static void WINAPI IWineD3DSurfaceImpl_UnLoad(IWineD3DSurface *iface) {
          * Implicit resources stay however. So this means we have an implicit render target
          * or depth stencil. The content may be destroyed, but we still have to tear down
          * opengl resources, so we cannot leave early.
+         *
+         * Put the most up to date surface location into the drawable. D3D-wise this content
+         * is undefined, so it would be nowhere, but that would make the location management
+         * more complicated. The drawable is a sane location, because if we mark sysmem or
+         * texture up to date, drawPrim will copy the uninitialized texture or sysmem to the
+         * uninitialized drawable. That's pointless and we'd have to allocate the texture /
+         * sysmem copy here.
          */
-        IWineD3DSurface_ModifyLocation(iface, SFLAG_INSYSMEM, TRUE);
+        IWineD3DSurface_ModifyLocation(iface, SFLAG_INDRAWABLE, TRUE);
     } else {
         /* Load the surface into system memory */
         IWineD3DSurface_LoadLocation(iface, SFLAG_INSYSMEM, NULL);
+        IWineD3DSurface_ModifyLocation(iface, SFLAG_INDRAWABLE, FALSE);
     }
     IWineD3DSurface_ModifyLocation(iface, SFLAG_INTEXTURE, FALSE);
-    IWineD3DSurface_ModifyLocation(iface, SFLAG_INDRAWABLE, FALSE);
     This->Flags &= ~SFLAG_ALLOCATED;
 
     /* Destroy PBOs, but load them into real sysmem before */




More information about the wine-cvs mailing list