Module: wine Branch: master Commit: 7806e4d85a2baa12736b60bf50a7f7e7395e2e04 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7806e4d85a2baa12736b60bf50...
Author: Chris Robinson chris.kcat@gmail.com Date: Tue Dec 2 23:07:54 2008 -0800
wined3d: Make sure a context is set for query object generation.
---
dlls/wined3d/device.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 4db3692..41b4861 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1237,13 +1237,19 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE
if(GL_SUPPORT(ARB_OCCLUSION_QUERY)) { TRACE("(%p) Allocating data for an occlusion query\n", This); + + ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); + ENTER_GL(); GL_EXTCALL(glGenQueriesARB(1, &((WineQueryOcclusionData *)(object->extendedData))->queryId)); + LEAVE_GL(); break; } case WINED3DQUERYTYPE_EVENT: object->extendedData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WineQueryEventData)); ((WineQueryEventData *)(object->extendedData))->ctx = This->activeContext;
+ ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); + ENTER_GL(); if(GL_SUPPORT(APPLE_FENCE)) { GL_EXTCALL(glGenFencesAPPLE(1, &((WineQueryEventData *)(object->extendedData))->fenceId)); checkGLcall("glGenFencesAPPLE"); @@ -1251,6 +1257,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE GL_EXTCALL(glGenFencesNV(1, &((WineQueryEventData *)(object->extendedData))->fenceId)); checkGLcall("glGenFencesNV"); } + LEAVE_GL(); break;
case WINED3DQUERYTYPE_VCACHE: