NameDateSize

..10-Nov-2025178

.editorconfigH A D10-Nov-202547

adapter9.cH A D10-Nov-202547.4 KiB

adapter9.hH A D10-Nov-20255.5 KiB

authenticatedchannel9.cH A D10-Nov-20253 KiB

authenticatedchannel9.hH A D10-Nov-20252.7 KiB

basetexture9.cH A D10-Nov-202522.4 KiB

basetexture9.hH A D10-Nov-20255.4 KiB

buffer9.cH A D10-Nov-202531 KiB

buffer9.hH A D10-Nov-20254.8 KiB

cryptosession9.cH A D10-Nov-20254.2 KiB

cryptosession9.hH A D10-Nov-20253.5 KiB

cubetexture9.cH A D10-Nov-202512.3 KiB

cubetexture9.hH A D10-Nov-20253.1 KiB

device9.cH A D10-Nov-2025152.5 KiB

device9.hH A D10-Nov-202530.1 KiB

device9ex.cH A D10-Nov-202520.5 KiB

device9ex.hH A D10-Nov-20256.8 KiB

device9video.cH A D10-Nov-20252.6 KiB

device9video.hH A D10-Nov-20252.5 KiB

guid.cH A D10-Nov-20254.8 KiB

guid.hH A D10-Nov-20251.4 KiB

indexbuffer9.cH A D10-Nov-20254.2 KiB

indexbuffer9.hH A D10-Nov-20252.7 KiB

iunknown.cH A D10-Nov-20259 KiB

iunknown.hH A D10-Nov-20255 KiB

meson.buildH A D10-Nov-20252.1 KiB

nine_buffer_upload.cH A D10-Nov-20259.4 KiB

nine_buffer_upload.hH A D10-Nov-20252.2 KiB

nine_csmt_helper.hH A D10-Nov-202516.2 KiB

nine_debug.cH A D10-Nov-20255.4 KiB

nine_debug.hH A D10-Nov-20254.5 KiB

nine_defines.hH A D10-Nov-20252.7 KiB

nine_dump.cH A D10-Nov-202531.9 KiB

nine_dump.hH A D10-Nov-20251.4 KiB

nine_ff.cH A D10-Nov-202596.4 KiB

nine_ff.hH A D10-Nov-20253.8 KiB

nine_flags.hH A D10-Nov-2025298

nine_helpers.cH A D10-Nov-20253.1 KiB

nine_helpers.hH A D10-Nov-20255.8 KiB

nine_limits.hH A D10-Nov-20258.6 KiB

nine_lock.cH A D10-Nov-2025101.9 KiB

nine_lock.hH A D10-Nov-20252.5 KiB

nine_memory_helper.cH A D10-Nov-202547.1 KiB

nine_memory_helper.hH A D10-Nov-20253.3 KiB

nine_pdata.hH A D10-Nov-2025795

nine_pipe.cH A D10-Nov-202517.4 KiB

nine_pipe.hH A D10-Nov-202529.2 KiB

nine_queue.cH A D10-Nov-20257.3 KiB

nine_queue.hH A D10-Nov-20251.7 KiB

nine_quirk.cH A D10-Nov-20251.8 KiB

nine_quirk.hH A D10-Nov-20251.4 KiB

nine_shader.cH A D10-Nov-2025133.6 KiB

nine_shader.hH A D10-Nov-20259.6 KiB

nine_state.cH A D10-Nov-2025129.8 KiB

nine_state.hH A D10-Nov-202524.2 KiB

nineexoverlayextension.cH A D10-Nov-20252.2 KiB

nineexoverlayextension.hH A D10-Nov-20252.2 KiB

pixelshader9.cH A D10-Nov-20258.7 KiB

pixelshader9.hH A D10-Nov-20255.6 KiB

query9.cH A D10-Nov-202510.1 KiB

query9.hH A D10-Nov-20252.6 KiB

READMEH A D10-Nov-20253.1 KiB

resource9.cH A D10-Nov-20255.9 KiB

resource9.hH A D10-Nov-20252.6 KiB

stateblock9.cH A D10-Nov-202522.4 KiB

stateblock9.hH A D10-Nov-20252.2 KiB

surface9.cH A D10-Nov-202533 KiB

surface9.hH A D10-Nov-20255.6 KiB

swapchain9.cH A D10-Nov-202549.1 KiB

swapchain9.hH A D10-Nov-20255.3 KiB

swapchain9ex.cH A D10-Nov-20254.3 KiB

swapchain9ex.hH A D10-Nov-20252.4 KiB

texture9.cH A D10-Nov-202514.1 KiB

texture9.hH A D10-Nov-20252.7 KiB

threadpool.cH A D10-Nov-20255.4 KiB

threadpool.hH A D10-Nov-20252.1 KiB

vertexbuffer9.cH A D10-Nov-20253.9 KiB

vertexbuffer9.hH A D10-Nov-20252.6 KiB

vertexdeclaration9.cH A D10-Nov-202519.2 KiB

vertexdeclaration9.hH A D10-Nov-20253.3 KiB

vertexshader9.cH A D10-Nov-202510.3 KiB

vertexshader9.hH A D10-Nov-20255.2 KiB

volume9.cH A D10-Nov-202519.7 KiB

volume9.hH A D10-Nov-20253.6 KiB

volumetexture9.cH A D10-Nov-202510.2 KiB

volumetexture9.hH A D10-Nov-20252.8 KiB

README

1Quickstart Guide
2
3*** Configure and build mesa
4CFLAGS="-m32" CXXFLAGS="-m32" ./autogen.sh --prefix=/usr \
5 --with-gallium-drivers=nouveau,r600,swrast --enable-nine \
6 --enable-debug --enable-texture-float --with-dri-drivers= --disable-dri \
7 --disable-opengl --disable-egl --disable-vdpau --disable-xvmc --disable-gbm \
8 --disable-llvm
9make
10
11*** Then we create some symlinks to mesa:
12ln -s "`pwd`/lib/gallium/libd3dadapter9.so.0.0.0" /usr/lib/
13ln -s "`pwd`/lib/gallium/libd3dadapter9.so.0" /usr/lib/
14ln -s "`pwd`/lib/gallium/libd3dadapter9.so" /usr/lib/
15ln -s "`pwd`/include/d3dadapter" /usr/include/
16
17*** Clone and build a patched wine
18git clone git@github.com:iXit/wine.git
19./configure
20make
21
22*** And finally we create some symlinks to our patched wine files:
23for f in d3d9.dll gdi32.dll user32.dll wineps.drv winex11.drv;
24do
25    mv /usr/lib/wine/$f.so /usr/lib/wine/$f.so.old
26    ln -s "`pwd`/dlls/`basename -s .dll $f`/$f.so" /usr/lib/wine/
27done
28
29*** Activating it within wine
30regedit
31Navigate to HKCU\Software\Wine\Direct3D
32If it's not there, create it
33Create a new DWORD value called UseNative
34Set its value to 1
35
36Every Direct3D9 program will now try using nine before wined3d
37
38If you want to selectively enable it per-exe instead, use the key:
39HKCU\Software\Wine\AppDefaults\app.exe\Direct3D\UseNative
40where app.exe is the name of your .exe file
41
42
43*** HOW IT WORKS ***
44
45Nine implements the full IDirect3DDevice9 COM interface and a custom COM
46interface called ID3DAdapter9 which is used to implement a final IDirect3D9Ex
47COM interface.
48ID3DAdapter9 is completely devoid of window system code, meaning this can be
49provided by wine, Xlib, Wayland, etc. It's inadvisible to write a non-Windows
50backend though, as we don't want to encourage linux developers to use this API.
51
52The gallium frontend is compiled, along with pipe-loader, into a library called
53libd3dadapter9.so. This library loads pipe_[driver].so drivers on demand and
54exports a single symbol for getting a subsystem driver. Currently only DRM is
55supported.
56This library is then linked to the library implementing the IDirect3D9[Ex]
57interface and the actual Direct3D9 entry points (Direct3DCreate9[Ex])
58
59The implementation of IDirect3D9[Ex] lies within wine and coexists with
60wined3d. It's loaded on demand and so if it's not there, it doesn't have any
61drivers or something else is wrong, d3d9.dll will automatically revert to using
62wined3d.
63Whether or not it's even tried is determined by 2 DWORD registry keys.
64> HKCU\Software\Wine\Direct3D\UseNative
65> HKCU\Software\Wine\AppDefaults\app.exe\Direct3D\UseNative
66The former is the global on-switch. The latter is per-exe.
67
68The driver search path can be set at configure time with
69--with-gallium-driver-dir and overridden at runtime with D3D9_DRIVERS_PATH.
70Debugging information can be gotten with the WINEDEBUG channels d3d9 and
71d3dadapter, and gallium frontend debug information can be gotten with NINE_DEBUG.
72Help on NINE_DEBUG is shown through NINE_DEBUG=help
73
74Finally, the ID3DPresent[Group] and ID3DAdapter9 interfaces are not set in
75stone, so feel free to hack on those as well as st/nine.
76
77Happy Hacking!
78