Henri Verbeet : wined3d: Avoid clearing the current wined3d context in WineD3D_CreateFakeGLContext( ).

Alexandre Julliard julliard at winehq.org
Thu Dec 8 13:43:38 CST 2011

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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Dec  7 22:08:57 2011 +0100

wined3d: Avoid clearing the current wined3d context in WineD3D_CreateFakeGLContext().

There should be no need to clear the thread's current wined3d context as long
as we properly restore the corresponding GL stuff. This avoids hitting the
context restore code in context_enter() when we have e.g. two d3d9 devices,
one of which is inactive, because now we can see that the GL context that's
active belongs to another wined3d context, and we don't need to bother
saving and restoring it.


 dlls/wined3d/directx.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index ece3b16..c2d5c2f 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -341,11 +341,6 @@ static BOOL WineD3D_CreateFakeGLContext(struct wined3d_fake_gl_ctx *ctx)
     /* Make it the current GL context. */
-    if (!context_set_current(NULL))
-    {
-        ERR_(d3d_caps)("Failed to clear current D3D context.\n");
-    }
     if (!pwglMakeCurrent(ctx->dc, ctx->gl_ctx))
         ERR_(d3d_caps)("Failed to make fake GL context current.\n");

More information about the wine-cvs mailing list