2010/1/4 Stefan Dösinger <stefan(a)codeweavers.com>:
+ if(This->query.context) context_free_event_query(&This->query); + This->query.context = NULL; context_free_event_query() already clears the context field.
+ if(This->resource.device->adapter->gl_info.supported[APPLE_FENCE]) You already have a gl_info pointer in buffer_create_buffer_object(), you're using it a few lines up. I'm not sure you can test for APPLE_fence to determine if event queries are available.
+static inline void buffer_sync_apple(struct wined3d_buffer *This, struct wined3d_context *context, DWORD flags) Do you have a good reason for adding that inline? I think it mostly just causes the compiler to not notice when the function is unused.
+ /* TODO: Test and implement D3DLOCK_DONOTWAIT */ + GL_EXTCALL(glFinishFenceAPPLE(This->query.id)); + checkGLcall("glFinishFenceAPPLE(This->query.id)"); The buffer code can't assume an event query is implemented with APPLE_fence.
+ GL_EXTCALL(glSetFenceAPPLE(cur->query.id)); + checkGLcall("glSetFenceAPPLE(cur->query.id)"); ...and neither can the draw code. The assumption is currently true of course, but that's just an accident of the code order in context_alloc_event_query(). Adding e.g. ARB_sync support to event queries will break that.