• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

.editorconfigD23-Nov-202347 43

Makefile.sourcesD23-Nov-20231.4 KiB8382

READMED23-Nov-20233.1 KiB7862

adapter9.cD23-Nov-202347.3 KiB1,154892

adapter9.hD23-Nov-20235.4 KiB145102

authenticatedchannel9.cD23-Nov-20233 KiB7949

authenticatedchannel9.hD23-Nov-20232.7 KiB6635

basetexture9.cD23-Nov-202322.5 KiB625458

basetexture9.hD23-Nov-20235.3 KiB171114

buffer9.cD23-Nov-202317.8 KiB462310

buffer9.hD23-Nov-20234.7 KiB148100

cryptosession9.cD23-Nov-20234.2 KiB11682

cryptosession9.hD23-Nov-20233.5 KiB

cubetexture9.cD23-Nov-202312.2 KiB351265

cubetexture9.hD23-Nov-20233 KiB8149

device9.cD23-Nov-2023146.7 KiB4,1673,339

device9.hD23-Nov-202329.9 KiB852661

device9ex.cD23-Nov-202316.8 KiB459390

device9ex.hD23-Nov-20236.8 KiB165120

device9video.cD23-Nov-20232.6 KiB6335

device9video.hD23-Nov-20232.5 KiB5829

guid.cD23-Nov-20234.8 KiB8557

guid.hD23-Nov-20231.4 KiB4112

indexbuffer9.cD23-Nov-20234.2 KiB13596

indexbuffer9.hD23-Nov-20232.7 KiB8645

iunknown.cD23-Nov-20238.4 KiB288204

iunknown.hD23-Nov-20235 KiB181111

meson.buildD23-Nov-20232.1 KiB7670

nine_buffer_upload.cD23-Nov-20239 KiB295211

nine_buffer_upload.hD23-Nov-20232.2 KiB6022

nine_csmt_helper.hD23-Nov-202316.2 KiB439375

nine_debug.cD23-Nov-20235.4 KiB11883

nine_debug.hD23-Nov-20234.5 KiB13897

nine_defines.hD23-Nov-20232.7 KiB6631

nine_dump.cD23-Nov-202331.9 KiB814737

nine_dump.hD23-Nov-20231.4 KiB5343

nine_ff.cD23-Nov-202396.1 KiB2,5011,875

nine_ff.hD23-Nov-20233.8 KiB127102

nine_flags.hD23-Nov-2023298 145

nine_helpers.cD23-Nov-20233.1 KiB10168

nine_helpers.hD23-Nov-20235.8 KiB201152

nine_limits.hD23-Nov-20238.6 KiB248201

nine_lock.cD23-Nov-2023101.9 KiB3,2953,027

nine_lock.hD23-Nov-20232.5 KiB5528

nine_pdata.hD23-Nov-2023833 4736

nine_pipe.cD23-Nov-202317.3 KiB384283

nine_pipe.hD23-Nov-202328.3 KiB828675

nine_queue.cD23-Nov-20237.3 KiB280157

nine_queue.hD23-Nov-20231.7 KiB5521

nine_quirk.cD23-Nov-20231.8 KiB5022

nine_quirk.hD23-Nov-20231.4 KiB379

nine_shader.cD23-Nov-2023132.5 KiB4,1413,369

nine_shader.hD23-Nov-20239.6 KiB328261

nine_state.cD23-Nov-2023126.2 KiB3,7172,855

nine_state.hD23-Nov-202323.4 KiB674493

nineexoverlayextension.cD23-Nov-20232.2 KiB4721

nineexoverlayextension.hD23-Nov-20232.2 KiB5023

pixelshader9.cD23-Nov-20238.6 KiB257191

pixelshader9.hD23-Nov-20235.4 KiB159103

query9.cD23-Nov-202310.1 KiB315229

query9.hD23-Nov-20232.6 KiB8449

resource9.cD23-Nov-20235.9 KiB182107

resource9.hD23-Nov-20232.6 KiB9047

stateblock9.cD23-Nov-202322.4 KiB603392

stateblock9.hD23-Nov-20232.2 KiB7237

surface9.cD23-Nov-202330.8 KiB863665

surface9.hD23-Nov-20235.5 KiB179121

swapchain9.cD23-Nov-202348.7 KiB1,3201,019

swapchain9.hD23-Nov-20235.3 KiB159103

swapchain9ex.cD23-Nov-20234.3 KiB11882

swapchain9ex.hD23-Nov-20232.4 KiB6232

texture9.cD23-Nov-202314.1 KiB394282

texture9.hD23-Nov-20232.7 KiB7745

threadpool.cD23-Nov-20235.4 KiB201118

threadpool.hD23-Nov-20232.1 KiB6129

vertexbuffer9.cD23-Nov-20233.9 KiB12789

vertexbuffer9.hD23-Nov-20232.6 KiB8042

vertexdeclaration9.cD23-Nov-202319.2 KiB532436

vertexdeclaration9.hD23-Nov-20233.3 KiB10058

vertexshader9.cD23-Nov-202310.3 KiB305235

vertexshader9.hD23-Nov-20235.2 KiB15698

volume9.cD23-Nov-202319.8 KiB559443

volume9.hD23-Nov-20233.6 KiB11971

volumetexture9.cD23-Nov-202310.3 KiB294224

volumetexture9.hD23-Nov-20232.8 KiB7644

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