Faster WINE games with open source drivers? D3D9 aka Gallium Nine

Actual situation is, that wine has to translate DirectX => OpenGL => Gallium, which add complications and brings inefficiency. What we can do about it? It’s easy, skip OpenGL!

UPDATE: For actual information about nine state tracker use wiki page (ignore warning, certificate is self-signed)

Most opensource drivers were migrated to Gallium framework. Thanks to Gallium framework is possible simply extend all drivers, by state trackers (ST) with different functionality.
We already have state trackers for OpenCL, OpenVG etc., so long time ago zhasha wrote Gallium Nine tracker, which cover D3D9 API. Zhasha also wrote extension, which allow Wine to use this ST (DirectX => Gallium). Then left his work. Some time passed and chrisbmr picked up zhasha work and moved it into working state, where is possible run games (like Crysis, Bioshock etc.). Of course, not all games will probably work for you. For these which will work, you’ll get reduced cpu usage and probably better performance.
After some excitement, Chrismbr also abadoned his code (he also made some attempts for DX10 and 11, unfortunately Gallium framework wasn’t ready, so he didn’t finished it.

In my case BioShock runs with gallium-nine about 35-45 fps, which is nice. Without I get from my on-cpu AMD 6550D graphic card only 23-35 fps (tested from saved point). So – difference between playable and “poor performance”.
[ game: resolution 1920x1080, all graphic settings off; hw: gpu clock 720 Mhz, memory 1866 Mhz ]

So, I fixed code to run with Mesa 10.x branch (git repository, patch). Also maintained wine patch (patch against lastest release, git repository).

How to ?
Gentoo users can run
USE="nine" emerge -av1 mesa::ixit wine::ixit

Actual informations are placed at wiki
Have fun and beware reporting bugs is useless, RATHER FIX the code and send patches/fixes or pull request!
If you can help, join IRC channel #d3d9 on freenode and be patient. It take while, until people join.

Share your results! Benchmark it, how much performance improved :)
You can see games frame rate running it with prefix GALLIUM_HUD="cpu, fps" wine Bioshock.exe

Gameplay under Gallium Nine (beware, in youtube are old links to chrismbr github, not up-to-date):

14 thoughts on “Faster WINE games with open source drivers? D3D9 aka Gallium Nine”

    1. You can just git clone https://github.com/okias/Mesa-3D.git and build mesa as usual. Right now there is issue with nine without opencl build. Solution is close, so when it’ll be fixed I’ll release patch. Stay tuned, in two-three days including lot fixies for wine d3d9/tests :)

  1. d3d9_main.o: In function `DllMain':
    d3d9_main.c:(.text+0x690): undefined reference to `d3dadapter9_init’
    d3d9_main.c:(.text+0x6bc): undefined reference to `d3dadapter9_destroy’
    collect2: error: ld returned 1 exit status
    winegcc: x86_64-pc-linux-gnu-gcc failed
    make[1]: *** [d3d9.dll.so] Error 2
    make[1]: Leaving directory `/var/tmp/portage/app-emulation/wine-1.7.11-r1/work/wine-1.7.11-x86/dlls/d3d9′
    make: *** [dlls/d3d9] Error 2

  2. Is it possible to build a single d3d9.dll for wine like swiftshader ?
    So we can just use the dll to play games without patch wine and mesa . . .

      1. Is there a way to not need to compile Mesa, just compile and install Nine and write some comment to a Config file so mesa can see Nine? If not, can someone create a Mesa patch to accept Nine before merging Nine into Mesa? Mesa suppose to be modular, and accept new state trackers.

  3. Can i use “rpmbuild –rebuild” with your patches and sources of Mesa and Wine from my distribution, and how to? Thanks in advance!

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 5 = seven

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>