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

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).
parent fcccca15
......@@ -5079,7 +5079,7 @@ enum wined3d_push_constants
#else
#define WINED3D_CS_QUEUE_SIZE 0x400000u
#endif
#define WINED3D_CS_SPIN_COUNT 10000000u
#define WINED3D_CS_SPIN_COUNT 2000u
#define WINED3D_CS_QUEUE_MASK (WINED3D_CS_QUEUE_SIZE - 1)
C_ASSERT(!(WINED3D_CS_QUEUE_SIZE & (WINED3D_CS_QUEUE_SIZE - 1)));
......
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