From 1dbc9d50c9737081196dec6829414229c88aa69f Mon Sep 17 00:00:00 2001 From: Alexander Dorofeyev Date: Mon, 10 Dec 2007 03:39:51 -0800 Subject: [PATCH] wined3d: Improve thread safety in IWineD3DSurfaceImpl_BltOverride. --- dlls/wined3d/surface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index b8a97d5621..692b506c84 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3236,6 +3236,9 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * return WINED3DERR_INVALIDCALL; } + ActivateContext(myDevice, (IWineD3DSurface *) This, CTXUSAGE_RESOURCELOAD); + ENTER_GL(); + TRACE("Calling GetSwapChain with mydevice = %p\n", myDevice); if(dstSwapchain && dstSwapchain->backBuffer && This == (IWineD3DSurfaceImpl*) dstSwapchain->backBuffer[0]) { glDrawBuffer(GL_BACK); @@ -3247,6 +3250,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * glDrawBuffer(myDevice->offscreenBuffer); checkGLcall("glDrawBuffer(myDevice->offscreenBuffer3)"); } else { + LEAVE_GL(); TRACE("Surface is higher back buffer, falling back to software\n"); return WINED3DERR_INVALIDCALL; } @@ -3268,6 +3272,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * glDrawBuffer(GL_BACK); } vcheckGLcall("glDrawBuffer"); + LEAVE_GL(); return WINED3D_OK; } -- 2.32.0.93.g670b81a890