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

..09-Feb-2022-

.editorconfigH A D09-Feb-202247 43

READMEH A D09-Feb-20223.1 KiB7862

adapter9.cH A D09-Feb-202247.4 KiB1,159897

adapter9.hH A D09-Feb-20225.5 KiB147104

authenticatedchannel9.cH A D09-Feb-20223 KiB7949

authenticatedchannel9.hH A D09-Feb-20222.7 KiB6635

basetexture9.cH A D09-Feb-202222.4 KiB622453

basetexture9.hH A D09-Feb-20225.4 KiB174116

buffer9.cH A D09-Feb-202231 KiB716478

buffer9.hH A D09-Feb-20224.8 KiB14799

cryptosession9.cH A D09-Feb-20224.2 KiB11682

cryptosession9.hH A D09-Feb-20223.5 KiB8752

cubetexture9.cH A D09-Feb-202212.3 KiB354267

cubetexture9.hH A D09-Feb-20223.1 KiB8250

device9.cH A D09-Feb-2022152.5 KiB4,3143,431

device9.hH A D09-Feb-202230.1 KiB861666

device9ex.cH A D09-Feb-202220.5 KiB535446

device9ex.hH A D09-Feb-20226.8 KiB165120

device9video.cH A D09-Feb-20222.6 KiB6335

device9video.hH A D09-Feb-20222.5 KiB5829

guid.cH A D09-Feb-20224.8 KiB8557

guid.hH A D09-Feb-20221.4 KiB4112

indexbuffer9.cH A D09-Feb-20224.2 KiB13596

indexbuffer9.hH A D09-Feb-20222.7 KiB8645

iunknown.cH A D09-Feb-20229 KiB305214

iunknown.hH A D09-Feb-20225 KiB181111

meson.buildH A D09-Feb-20222.1 KiB7771

nine_buffer_upload.cH A D09-Feb-20229.4 KiB304220

nine_buffer_upload.hH A D09-Feb-20222.2 KiB6022

nine_csmt_helper.hH A D09-Feb-202216.2 KiB439375

nine_debug.cH A D09-Feb-20225.4 KiB11883

nine_debug.hH A D09-Feb-20224.5 KiB13897

nine_defines.hH A D09-Feb-20222.7 KiB6631

nine_dump.cH A D09-Feb-202231.9 KiB814737

nine_dump.hH A D09-Feb-20221.4 KiB5343

nine_ff.cH A D09-Feb-202296.4 KiB2,5071,880

nine_ff.hH A D09-Feb-20223.8 KiB127102

nine_flags.hH A D09-Feb-2022298 145

nine_helpers.cH A D09-Feb-20223.1 KiB10168

nine_helpers.hH A D09-Feb-20225.8 KiB201152

nine_limits.hH A D09-Feb-20228.6 KiB248201

nine_lock.cH A D09-Feb-2022101.9 KiB3,2953,027

nine_lock.hH A D09-Feb-20222.5 KiB5528

nine_memory_helper.cH A D09-Feb-202247.1 KiB1,177846

nine_memory_helper.hH A D09-Feb-20223.3 KiB7624

nine_pdata.hH A D09-Feb-2022795 4534

nine_pipe.cH A D09-Feb-202217.4 KiB390290

nine_pipe.hH A D09-Feb-202229.2 KiB862705

nine_queue.cH A D09-Feb-20227.3 KiB280157

nine_queue.hH A D09-Feb-20221.7 KiB5521

nine_quirk.cH A D09-Feb-20221.8 KiB5022

nine_quirk.hH A D09-Feb-20221.4 KiB379

nine_shader.cH A D09-Feb-2022133.6 KiB4,1703,389

nine_shader.hH A D09-Feb-20229.6 KiB329262

nine_state.cH A D09-Feb-2022129.8 KiB3,7802,903

nine_state.hH A D09-Feb-202224.2 KiB699513

nineexoverlayextension.cH A D09-Feb-20222.2 KiB4721

nineexoverlayextension.hH A D09-Feb-20222.2 KiB5023

pixelshader9.cH A D09-Feb-20228.7 KiB259193

pixelshader9.hH A D09-Feb-20225.6 KiB163107

query9.cH A D09-Feb-202210.1 KiB315229

query9.hH A D09-Feb-20222.6 KiB8449

resource9.cH A D09-Feb-20225.9 KiB182107

resource9.hH A D09-Feb-20222.6 KiB9047

stateblock9.cH A D09-Feb-202222.4 KiB603392

stateblock9.hH A D09-Feb-20222.2 KiB7237

surface9.cH A D09-Feb-202233 KiB889687

surface9.hH A D09-Feb-20225.6 KiB180122

swapchain9.cH A D09-Feb-202249.1 KiB1,3271,023

swapchain9.hH A D09-Feb-20225.3 KiB159103

swapchain9ex.cH A D09-Feb-20224.3 KiB11882

swapchain9ex.hH A D09-Feb-20222.4 KiB6232

texture9.cH A D09-Feb-202214.1 KiB393285

texture9.hH A D09-Feb-20222.7 KiB7846

threadpool.cH A D09-Feb-20225.4 KiB201118

threadpool.hH A D09-Feb-20222.1 KiB6129

vertexbuffer9.cH A D09-Feb-20223.9 KiB12789

vertexbuffer9.hH A D09-Feb-20222.6 KiB8042

vertexdeclaration9.cH A D09-Feb-202219.2 KiB533437

vertexdeclaration9.hH A D09-Feb-20223.3 KiB10058

vertexshader9.cH A D09-Feb-202210.3 KiB308238

vertexshader9.hH A D09-Feb-20225.2 KiB15698

volume9.cH A D09-Feb-202219.7 KiB558443

volume9.hH A D09-Feb-20223.6 KiB11971

volumetexture9.cH A D09-Feb-202210.2 KiB295224

volumetexture9.hH A D09-Feb-20222.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