[PATCH 4/6] wined3d: Get rid of lastActiveRenderTarget in FindContext().

Henri Verbeet hverbeet at codeweavers.com
Tue Jul 21 04:51:10 CDT 2009


---
 dlls/wined3d/context.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 78ef374..b92cc99 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1667,7 +1667,8 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
      *    After that, the outer ActivateContext(which calls PreLoad) can activate the new
      *    target for the new thread
      */
-    if (readTexture && This->lastActiveRenderTarget != target) {
+    if (readTexture && context->current_rt != target)
+    {
         BOOL oldInDraw = This->isInDraw;
 
         /* PreLoad requires a context to load the texture, thus it will call ActivateContext.
@@ -1679,15 +1680,15 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
         /* Do that before switching the context:
          * Read the back buffer of the old drawable into the destination texture
          */
-        if (((IWineD3DSurfaceImpl *)This->lastActiveRenderTarget)->texture_name_srgb)
+        if (((IWineD3DSurfaceImpl *)context->current_rt)->texture_name_srgb)
         {
-            surface_internal_preload(This->lastActiveRenderTarget, SRGB_BOTH);
+            surface_internal_preload(context->current_rt, SRGB_BOTH);
         } else {
-            surface_internal_preload(This->lastActiveRenderTarget, SRGB_RGB);
+            surface_internal_preload(context->current_rt, SRGB_RGB);
         }
 
         /* Assume that the drawable will be modified by some other things now */
-        IWineD3DSurface_ModifyLocation(This->lastActiveRenderTarget, SFLAG_INDRAWABLE, FALSE);
+        IWineD3DSurface_ModifyLocation(context->current_rt, SFLAG_INDRAWABLE, FALSE);
 
         This->isInDraw = oldInDraw;
     }
-- 
1.6.0.6




More information about the wine-patches mailing list