[2/5] WineD3D: Add an internal event query finish function

Henri Verbeet hverbeet at gmail.com
Tue Jan 26 05:44:50 CST 2010


On 26 January 2010 11:51, Stefan Dösinger <stefan at codeweavers.com> wrote:
> +HRESULT wined3d_event_query_finish(IWineD3DQuery* iface) {
Please don't create function prototypes (or other code) by copy/paste.
Also, why does this take a IWineD3DQuery pointer in the first place?
You only really access wined3d_event_query fields.

> +        /* A glFinish does not reliably wait for draws in other contexts. The caller has
> +         * to find its own way to cope with the thread switch
> +         */
...
> +        /* Since this is an internal call the caller should know that event Query support is faked */
> +        FIXME("(%p): Event query not supported, calling glFinish\n", This);
> +        wglFinish();
> +        return WINED3D_OK;
> +    }
This is inconsistent. Also, note that event queries are pretty generic
things, you could use them for something else than draws as well.

> +    if (!gl_info->supported[APPLE_FENCE] && !gl_info->supported[NV_FENCE] && gl_info->supported[ARB_SYNC])
This doesn't make sense. Of course if you just used
wined3d_event_query instead of IWineD3DQuery you wouldn't even need
this at all, you could just let context_alloc_event_query() fail.

Just for reference, glFinish() behaviour is a bit more subtle than you
make it sound. It flushes GL commands for the current context to the
GPU, and then waits for the GPU to finish execution up to that point.
It won't flush command buffers for other contexts, but anything that's
already been submitted to the GPU before the glFinish() will have been
executed when the glFinish() returns.

I didn't look at the other patches much, but I think you want to look
them over a bit before resending as well.



More information about the wine-devel mailing list