Commit cc8e8737 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

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: 's avatarMatteo Bruni <mbruni@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 6b98d3eb
......@@ -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)
......
......@@ -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;
}
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment