wined3d: Make the CS thread yield CPU when it can't block waiting.

It can't block because there are pending queries.
This commit is contained in:
Matteo Bruni 2018-11-15 22:39:45 +01:00 committed by Alexandre Julliard
parent ecdeab593b
commit fcccca153a

View file

@ -3422,8 +3422,13 @@ static DWORD WINAPI wined3d_cs_run(void *ctx)
if (wined3d_cs_queue_is_empty(cs, queue))
{
YieldProcessor();
if (++spin_count >= WINED3D_CS_SPIN_COUNT && list_empty(&cs->query_poll_list))
wined3d_cs_wait_event(cs);
if (++spin_count >= WINED3D_CS_SPIN_COUNT)
{
if (list_empty(&cs->query_poll_list))
wined3d_cs_wait_event(cs);
else
Sleep(0);
}
continue;
}
}