Wine and D3D

Emanuele Oriani emaentra at ngi.it
Sat Jan 8 12:34:42 CST 2011


Hi wine developers,

I'm a wine user and StarCraft II player.
Unluckily Blizzard has left D3D only mode in win32 executable.

The game doesn't use CPU/GPU at 100%, but on Linux what happens is that 
we have a lot less FPS than windows.
To get some more FPS, like 50% more, we set one core (or all cores) to 
max frequency and then we set the 'affinity' of SC2.exe to that core 
only (to set the affinity I created a simple executable).
This way performance is better indeed, but nowhere near windows.
(I've opened a bug for this matter 
http://bugs.winehq.org/show_bug.cgi?id=24558 ).

My fear is that Blizzard has introduced some sort of FPS limit and 
probably wine doesn't cope very well with that.

And, potentially they're using multi-threaded rendering as well.

I've done some thread analysis and apparently the many threads the game 
execute stay in sleep (they actively invoke SleepEx) for 95% of the 
time, which is very strange.
This is why if we leave the CPU frequency in 'Ondemand' mode it goes to 
800MHz (or the lowest frequency).
Could it be related to the rendering infrastructure?

I know OpenGL is essentially mono-threaded (I've used it for quite a bit 
in the past years).
During some research I came across a Stefan's email from July 2006, were 
he was proposing the right thing (imho) to do to support multi-threaded 
D3D: a GL rendered thread per device/buffer.
What happened with that?
How is currently multi-threaded D3D rendering implemented in wine?

Thanks again,
Cheers,

Ema! ;-)

Ps. Thanks to wine and a simple 'fprinft' I managed to easily instrument 
the SleepEx function and gather such valuable information. Now I'd like 
to do the same for D3D part, understand why the main renderer thread 
goes to sleep (or not) and if it goes to sleep actively or it's waiting 
on some mutex, or something else.




More information about the wine-devel mailing list