17ec681f3SmrgQuickstart Guide 27ec681f3Smrg 37ec681f3Smrg*** Configure and build mesa 47ec681f3SmrgCFLAGS="-m32" CXXFLAGS="-m32" ./autogen.sh --prefix=/usr \ 57ec681f3Smrg --with-gallium-drivers=nouveau,r600,swrast --enable-nine \ 67ec681f3Smrg --enable-debug --enable-texture-float --with-dri-drivers= --disable-dri \ 77ec681f3Smrg --disable-opengl --disable-egl --disable-vdpau --disable-xvmc --disable-gbm \ 87ec681f3Smrg --disable-llvm 97ec681f3Smrgmake 107ec681f3Smrg 117ec681f3Smrg*** Then we create some symlinks to mesa: 127ec681f3Smrgln -s "`pwd`/lib/gallium/libd3dadapter9.so.0.0.0" /usr/lib/ 137ec681f3Smrgln -s "`pwd`/lib/gallium/libd3dadapter9.so.0" /usr/lib/ 147ec681f3Smrgln -s "`pwd`/lib/gallium/libd3dadapter9.so" /usr/lib/ 157ec681f3Smrgln -s "`pwd`/include/d3dadapter" /usr/include/ 167ec681f3Smrg 177ec681f3Smrg*** Clone and build a patched wine 187ec681f3Smrggit clone git@github.com:iXit/wine.git 197ec681f3Smrg./configure 207ec681f3Smrgmake 217ec681f3Smrg 227ec681f3Smrg*** And finally we create some symlinks to our patched wine files: 237ec681f3Smrgfor f in d3d9.dll gdi32.dll user32.dll wineps.drv winex11.drv; 247ec681f3Smrgdo 257ec681f3Smrg mv /usr/lib/wine/$f.so /usr/lib/wine/$f.so.old 267ec681f3Smrg ln -s "`pwd`/dlls/`basename -s .dll $f`/$f.so" /usr/lib/wine/ 277ec681f3Smrgdone 287ec681f3Smrg 297ec681f3Smrg*** Activating it within wine 307ec681f3Smrgregedit 317ec681f3SmrgNavigate to HKCU\Software\Wine\Direct3D 327ec681f3SmrgIf it's not there, create it 337ec681f3SmrgCreate a new DWORD value called UseNative 347ec681f3SmrgSet its value to 1 357ec681f3Smrg 367ec681f3SmrgEvery Direct3D9 program will now try using nine before wined3d 377ec681f3Smrg 387ec681f3SmrgIf you want to selectively enable it per-exe instead, use the key: 397ec681f3SmrgHKCU\Software\Wine\AppDefaults\app.exe\Direct3D\UseNative 407ec681f3Smrgwhere app.exe is the name of your .exe file 417ec681f3Smrg 427ec681f3Smrg 437ec681f3Smrg*** HOW IT WORKS *** 447ec681f3Smrg 457ec681f3SmrgNine implements the full IDirect3DDevice9 COM interface and a custom COM 467ec681f3Smrginterface called ID3DAdapter9 which is used to implement a final IDirect3D9Ex 477ec681f3SmrgCOM interface. 487ec681f3SmrgID3DAdapter9 is completely devoid of window system code, meaning this can be 497ec681f3Smrgprovided by wine, Xlib, Wayland, etc. It's inadvisible to write a non-Windows 507ec681f3Smrgbackend though, as we don't want to encourage linux developers to use this API. 517ec681f3Smrg 527ec681f3SmrgThe gallium frontend is compiled, along with pipe-loader, into a library called 537ec681f3Smrglibd3dadapter9.so. This library loads pipe_[driver].so drivers on demand and 547ec681f3Smrgexports a single symbol for getting a subsystem driver. Currently only DRM is 557ec681f3Smrgsupported. 567ec681f3SmrgThis library is then linked to the library implementing the IDirect3D9[Ex] 577ec681f3Smrginterface and the actual Direct3D9 entry points (Direct3DCreate9[Ex]) 587ec681f3Smrg 597ec681f3SmrgThe implementation of IDirect3D9[Ex] lies within wine and coexists with 607ec681f3Smrgwined3d. It's loaded on demand and so if it's not there, it doesn't have any 617ec681f3Smrgdrivers or something else is wrong, d3d9.dll will automatically revert to using 627ec681f3Smrgwined3d. 637ec681f3SmrgWhether or not it's even tried is determined by 2 DWORD registry keys. 647ec681f3Smrg> HKCU\Software\Wine\Direct3D\UseNative 657ec681f3Smrg> HKCU\Software\Wine\AppDefaults\app.exe\Direct3D\UseNative 667ec681f3SmrgThe former is the global on-switch. The latter is per-exe. 677ec681f3Smrg 687ec681f3SmrgThe driver search path can be set at configure time with 697ec681f3Smrg--with-gallium-driver-dir and overridden at runtime with D3D9_DRIVERS_PATH. 707ec681f3SmrgDebugging information can be gotten with the WINEDEBUG channels d3d9 and 717ec681f3Smrgd3dadapter, and gallium frontend debug information can be gotten with NINE_DEBUG. 727ec681f3SmrgHelp on NINE_DEBUG is shown through NINE_DEBUG=help 737ec681f3Smrg 747ec681f3SmrgFinally, the ID3DPresent[Group] and ID3DAdapter9 interfaces are not set in 757ec681f3Smrgstone, so feel free to hack on those as well as st/nine. 767ec681f3Smrg 777ec681f3SmrgHappy Hacking! 78