wined3d: Get rid of most of the redundant query flushes.

This way we avoid queueing up CS packets on each
wined3d_query_get_data() call, which has been seen in some degenerate
cases to starve other client threads that are trying to submit actual
work into the CS (sort-of a livelock).

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2017-09-08 18:44:08 +02:00 committed by Alexandre Julliard
parent 6b98d3ebf1
commit cc8e873720
3 changed files with 4 additions and 1 deletions

View file

@ -877,6 +877,7 @@ void wined3d_cs_emit_flush(struct wined3d_cs *cs)
op->opcode = WINED3D_CS_OP_FLUSH;
cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
cs->queries_flushed = TRUE;
}
static void wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data)
@ -1863,6 +1864,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
op->flags = flags;
cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
cs->queries_flushed = FALSE;
}
static void wined3d_cs_exec_preload_resource(struct wined3d_cs *cs, const void *data)

View file

@ -389,7 +389,7 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query,
}
else if (query->counter_main != query->counter_retrieved)
{
if (flags & WINED3DGETDATA_FLUSH)
if (flags & WINED3DGETDATA_FLUSH && !query->device->cs->queries_flushed)
wined3d_cs_emit_flush(query->device->cs);
return S_FALSE;
}

View file

@ -3427,6 +3427,7 @@ struct wined3d_cs
size_t data_size, start, end;
void *data;
struct list query_poll_list;
BOOL queries_flushed;
HANDLE event;
BOOL waiting_for_event;