diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index c6256748bae..de428cd64bc 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1551,7 +1551,8 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf switch(wined3d_settings.offscreen_rendering_mode) { case ORM_FBO: /* FBOs do not need a different context. Stay with whatever context is active at the moment */ - if(This->activeContext && tid == This->lastThread) { + if (This->activeContext && This->activeContext->tid == tid) + { context = This->activeContext; } else { /* This may happen if the app jumps straight into offscreen rendering @@ -1600,7 +1601,8 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf case ORM_BACKBUFFER: /* Stay with the currently active context for back buffer rendering */ - if(This->activeContext && tid == This->lastThread) { + if (This->activeContext && This->activeContext->tid == tid) + { context = This->activeContext; } else { /* This may happen if the app jumps straight into offscreen rendering @@ -1763,12 +1765,11 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU if (!target) target = This->activeContext->current_rt; - if (This->activeContext->current_rt != target || tid != This->lastThread) + if (This->activeContext->current_rt != target || This->activeContext->tid != tid) { context = FindContext(This, target, tid); context->draw_buffer_dirty = TRUE; context->current_rt = target; - This->lastThread = tid; } else { /* Stick to the old context */ context = This->activeContext; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 422dbf80cdf..94000dff8aa 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2165,7 +2165,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, } IWineD3DSurface_AddRef(This->render_targets[0]); This->activeContext = swapchain->context[0]; - This->lastThread = GetCurrentThreadId(); /* Depth Stencil support */ This->stencilBufferTarget = This->auto_depth_stencil_buffer; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index d8d95e79b93..b7085c5aeac 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1584,7 +1584,6 @@ struct IWineD3DDeviceImpl /* Context management */ WineD3DContext **contexts; /* Dynamic array containing pointers to context structures */ WineD3DContext *activeContext; - DWORD lastThread; UINT numContexts; WineD3DContext *pbufferContext; /* The context that has a pbuffer as drawable */ DWORD pbufferWidth, pbufferHeight; /* Size of the buffer drawable */