From 0add13759c4401423c3f729803ae9d343276e54c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 12 Oct 2007 09:32:43 +0200 Subject: [PATCH] wined3d: Create query private data when faking the query. --- dlls/wined3d/device.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 056186cdcea..7a1b79d3c70 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1219,24 +1219,24 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE /* allocated the 'extended' data based on the type of query requested */ switch(Type){ case WINED3DQUERYTYPE_OCCLUSION: + object->extendedData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WineQueryOcclusionData)); + ((WineQueryOcclusionData *)(object->extendedData))->ctx = This->activeContext; + if(GL_SUPPORT(ARB_OCCLUSION_QUERY)) { TRACE("(%p) Allocating data for an occlusion query\n", This); - object->extendedData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WineQueryOcclusionData)); GL_EXTCALL(glGenQueriesARB(1, &((WineQueryOcclusionData *)(object->extendedData))->queryId)); - ((WineQueryOcclusionData *)(object->extendedData))->ctx = This->activeContext; break; } case WINED3DQUERYTYPE_EVENT: + object->extendedData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WineQueryEventData)); + ((WineQueryEventData *)(object->extendedData))->ctx = This->activeContext; + if(GL_SUPPORT(APPLE_FENCE)) { - object->extendedData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WineQueryEventData)); GL_EXTCALL(glGenFencesAPPLE(1, &((WineQueryEventData *)(object->extendedData))->fenceId)); checkGLcall("glGenFencesAPPLE"); - ((WineQueryEventData *)(object->extendedData))->ctx = This->activeContext; } else if(GL_SUPPORT(NV_FENCE)) { - object->extendedData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WineQueryEventData)); GL_EXTCALL(glGenFencesNV(1, &((WineQueryEventData *)(object->extendedData))->fenceId)); checkGLcall("glGenFencesNV"); - ((WineQueryEventData *)(object->extendedData))->ctx = This->activeContext; } break;