[3/3] wined3d: Remove isInDraw hack from context_setup_target.

Matteo Bruni matteo.mystral at gmail.com
Mon Aug 16 06:25:23 CDT 2010


The surface_internal_preload codepath taken in that case (calling
read_from_framebuffer_texture) was already acquiring the correct
context on its own.
-------------- next part --------------
From 694be1ec7707e85dae082f7494c0c749239bb80f Mon Sep 17 00:00:00 2001
From: Matteo Bruni <matteo.mystral at gmail.com>
Date: Sat, 7 Aug 2010 22:37:11 +0200
Subject: wined3d: Remove isInDraw hack from context_setup_target.

It is conceptually wrong and actually broken too (as the comment there
said). Just remove the hack now and properly fix any regression
that may come up later by explicitely acquiring the right context where
needed (so, in surface_internal_preload and its callees).
---
 dlls/wined3d/context.c |   15 ---------------
 1 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 72b84c9..d7f2cf3 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2321,19 +2321,6 @@ static void context_setup_target(IWineD3DDeviceImpl *device,
         if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
                 && old_render_offscreen && context->current_rt != target)
         {
-            BOOL oldInDraw = device->isInDraw;
-
-            /* surface_internal_preload() requires a context to load the
-             * texture, so it will call context_acquire(). Set isInDraw to true
-             * to signal surface_internal_preload() that it has a context. */
-
-            /* FIXME: This is just broken. There's no guarantee whatsoever
-             * that the currently active context, if any, is appropriate for
-             * reading back the render target. We should probably call
-             * context_set_current(context) here and then rely on
-             * context_acquire() doing the right thing. */
-            device->isInDraw = TRUE;
-
             /* Read the back buffer of the old drawable into the destination texture. */
             if (context->current_rt->texture_name_srgb)
             {
@@ -2345,8 +2332,6 @@ static void context_setup_target(IWineD3DDeviceImpl *device,
             }
 
             surface_modify_location(context->current_rt, SFLAG_INDRAWABLE, FALSE);
-
-            device->isInDraw = oldInDraw;
         }
     }
 
-- 
1.7.1


More information about the wine-patches mailing list