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

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): https://www.youtube.com/watch?v=F0nEfqgAuK4

(archive) Discussion import below article:

Harri January 13, 2014 at 18:43

What’s the bioshock performance on windows? Dukeukemx January 15, 2014 at 09:14

Anyway you can make patch for the mesa dx9 state tracker? I have no idea how to use github.

David Heidelberger
January 18, 2014 at 01:55

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 🙂
David Heidelberger
January 18, 2014 at 04:21

Patch is in download directory, don’t try combine nine with opencl (clover) yet.

Dukenukemx January 25, 2014 at 05:55

Have you tried talking to oibaf to see if he could include this with his drivers?

David Heidelberger
January 25, 2014 at 14:25

D3D9 State Tracker need more work, before I do that 🙂 We need more (interested) devs.

camplus2 February 4, 2014 at 17:27

d3d9_main.o: In function DllMain’: d3d9_main.c:(.text+0x690): undefined reference tod3dadapter9_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

David Heidelberger
February 5, 2014 at 00:09

please fill issue at github.com/okias/ixit/issues , including emerge –info.

Cooky March 11, 2014 at 14:27

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 . . .

David Heidelberger
March 12, 2014 at 01:04

(The wine modifications only affect { d3d9.dll.so, gdi32.dll.so,
user32.dll.so, wineps.drv.so and winex11.drv.so }, so you don’t have to
replace all of it).
source: http://lists.freedesktop.org/archives/mesa-dev/2013-July/041900.html

I hope in future, it will be possible, to build separated mesa d3d9 lib.
    artivision
    March 14, 2014 at 20:27

    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.

Pingback: 开源图形驱动也可以流畅 Wine “原生的” DX9! | Felix's Blog artivision March 17, 2014 at 00:36

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