wined3d: Simplify logic in wined3d_event_query_issue().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2017-04-05 15:38:06 +02:00 committed by Alexandre Julliard
parent 8b9ece6797
commit 1d27b69f32
1 changed files with 7 additions and 17 deletions

View File

@ -214,27 +214,17 @@ enum wined3d_event_query_result wined3d_event_query_finish(const struct wined3d_
void wined3d_event_query_issue(struct wined3d_event_query *query, const struct wined3d_device *device)
{
struct wined3d_context *context = NULL;
const struct wined3d_gl_info *gl_info;
struct wined3d_context *context;
if (query->context)
{
if (!(context = context_reacquire(device, query->context))
&& !query->context->gl_info->supported[ARB_SYNC])
{
context_free_event_query(query);
context = context_acquire(device, NULL, 0);
context_alloc_event_query(context, query);
}
if (!context)
context = context_acquire(device, NULL, 0);
}
else
{
if (query->context && !(context = context_reacquire(device, query->context))
&& !query->context->gl_info->supported[ARB_SYNC])
context_free_event_query(query);
if (!context)
context = context_acquire(device, NULL, 0);
context_alloc_event_query(context, query);
}
gl_info = context->gl_info;
if (!query->context)
context_alloc_event_query(context, query);
if (gl_info->supported[ARB_SYNC])
{