wined3d: Reduce CS spin count to 2000.
commitf032ccc2715a5525601f741337a7bc7df6873c9d
authorMatteo Bruni <mbruni@codeweavers.com>
Sun, 6 May 2018 01:09:44 +0000 (6 03:09 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 4 Jul 2023 13:37:29 +0000 (4 15:37 +0200)
tree79d610d8b7f3ce5b379665695f395760a5673d15
parentfcccca153a1db3d1151c62521b0670ecb4194619
wined3d: Reduce CS spin count to 2000.

Over the last few Wine releases we greatly reduced the need for the
application thread to wait for replies from the CS thread. Compared to
the time when the command stream was initially introduced, it's now
quite likely that, when the command queues become empty, they are
going to stay like that for a while (e.g. the game is throttling the
framerate or is busy doing some CPU work on its part before generating
more commands).

As a first step, reduce the spin count to reduce the busy waiting in
wined3d_cs_run(). In my tests this significantly reduces CPU usage,
with minimally decreased performance in a few rare cases but also
significantly improved performance in many cases (notably with
integrated GPUs where freeing the CPU directly allows more power to be
allocated to the GPU).
dlls/wined3d/wined3d_private.h