Re: [PATCH 1/5] wined3d: Make sure queries have an active GL context.
Am Friday 26 June 2009 10:07:08 schrieb Henri Verbeet: + ActivateContext(This-wineD3DDevice, This-wineD3DDevice-lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); + if (((WineQueryOcclusionData *)This-extendedData)-ctx != This-wineD3DDevice-activeContext || This-wineD3DDevice-activeContext-tid != GetCurrentThreadId()) Wouldn't it be better to activate a context after the thread check? Ie, don't activate a context when we know that we can't make use of the GL query anyway?
Re: [PATCH 1/5] wined3d: Make sure queries have an active GL context.
2009/6/26 Stefan Dösinger ste...@codeweavers.com: Am Friday 26 June 2009 10:07:08 schrieb Henri Verbeet: + ActivateContext(This-wineD3DDevice, This-wineD3DDevice-lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); + if (((WineQueryOcclusionData *)This-extendedData)-ctx != This-wineD3DDevice-activeContext || This-wineD3DDevice-activeContext-tid != GetCurrentThreadId()) Wouldn't it be better to activate a context after the thread check? Ie, don't activate a context when we know that we can't make use of the GL query anyway? Well, it checks the thread id of the currently active context. I think it makes sense to make sure that's actually a context appropriate for this thread, rather than whatever was used last.
Re: [PATCH 1/5] wined3d: Make sure queries have an active GL context.
2009/6/26 Henri Verbeet hverb...@gmail.com: 2009/6/26 Stefan Dösinger ste...@codeweavers.com: Am Friday 26 June 2009 10:07:08 schrieb Henri Verbeet: + ActivateContext(This-wineD3DDevice, This-wineD3DDevice-lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); + if (((WineQueryOcclusionData *)This-extendedData)-ctx != This-wineD3DDevice-activeContext || This-wineD3DDevice-activeContext-tid != GetCurrentThreadId()) Wouldn't it be better to activate a context after the thread check? Ie, don't activate a context when we know that we can't make use of the GL query anyway? Well, it checks the thread id of the currently active context. I think it makes sense to make sure that's actually a context appropriate for this thread, rather than whatever was used last. (You're right in that the tid check should be redundant now though.)