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