mesa/src/gallium/state_trackers/nine
Marek Olšák bd214f030f gallium: use fence_finish instead of fence_signalled in state trackers
Reviewed-by: Brian Paul <brianp@vmware.com>
2015-07-05 15:08:59 +02:00
..
adapter9.c st/nine: Fix behaviour of D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING 2015-04-29 08:28:10 +02:00
adapter9.h nine: Implement threadpool 2014-11-18 02:02:54 +00:00
authenticatedchannel9.c
authenticatedchannel9.h
basetexture9.c st/nine: Remove Managed texture hack. 2015-04-29 08:28:11 +02:00
basetexture9.h util: Move gallium's linked list to util 2015-05-08 17:16:13 -07:00
cryptosession9.c
cryptosession9.h
cubetexture9.c st/nine: Bound the dirty regions to resource size 2015-04-29 08:28:11 +02:00
cubetexture9.h st/nine: Rework texture data allocation 2015-04-29 08:28:11 +02:00
device9.c st/nine: Some D3DUSAGE_AUTOGENMIPMAP fixes 2015-04-29 08:28:11 +02:00
device9.h util: Move gallium's linked list to util 2015-05-08 17:16:13 -07:00
device9ex.c st/nine: call DBG() at more external entry points 2014-11-26 20:09:11 +00:00
device9ex.h
device9video.c
device9video.h
guid.c
guid.h
indexbuffer9.c st/nine: Add debug warning when application uses sw processing 2015-04-29 08:28:11 +02:00
indexbuffer9.h
iunknown.c st/nine: call DBG() at more external entry points 2014-11-26 20:09:11 +00:00
iunknown.h
Makefile.am
Makefile.sources nine: Implement threadpool 2014-11-18 02:02:54 +00:00
nine_debug.c
nine_debug.h
nine_defines.h st/nine: Fix vertex declarations for non-standard (usage/index) 2014-12-03 16:39:24 +01:00
nine_dump.c
nine_dump.h
nine_ff.c tgsi/ureg: add support for output array declarations 2015-06-05 19:44:32 +02:00
nine_ff.h
nine_helpers.c
nine_helpers.h st/nine: Refactor format d3d9 to pipe conversion 2015-02-06 00:07:18 +01:00
nine_lock.c
nine_lock.h
nine_pdata.h
nine_pipe.c st/nine: Implement AMD alpha to coverage 2015-02-06 00:07:19 +01:00
nine_pipe.h st/nine: Simplify Surface9 Managed resources implementation 2015-04-29 08:28:11 +02:00
nine_quirk.c
nine_quirk.h
nine_shader.c tgsi/ureg: add support for output array declarations 2015-06-05 19:44:32 +02:00
nine_shader.h st/nine: Refactor how user constbufs sizes are calculated 2015-02-06 00:07:18 +01:00
nine_state.c st/nine: Encapsulate variables for MANAGED resource 2015-04-29 08:28:11 +02:00
nine_state.h util: Move gallium's linked list to util 2015-05-08 17:16:13 -07:00
nineexoverlayextension.c
nineexoverlayextension.h
pixelshader9.c st/nine: Refactor how user constbufs sizes are calculated 2015-02-06 00:07:18 +01:00
pixelshader9.h st/nine: Remove unused code for ps 2015-01-22 22:16:23 +00:00
query9.c st/nine: Improve D3DQUERYTYPE_TIMESTAMP 2015-04-29 08:28:10 +02:00
query9.h st/nine: Queries: Use gallium caps to get if queries are supported. (v2) 2014-12-03 16:39:24 +01:00
README
resource9.c st/nine: Remove duplicated debug message 2015-02-06 00:07:19 +01:00
resource9.h st/nine: rework the way D3DPOOL_SYSTEMMEM is handled 2014-11-26 20:09:10 +00:00
stateblock9.c st/nine: Encapsulate variables for MANAGED resource 2015-04-29 08:28:11 +02:00
stateblock9.h
surface9.c st/nine: Some D3DUSAGE_AUTOGENMIPMAP fixes 2015-04-29 08:28:11 +02:00
surface9.h util: Move gallium's linked list to util 2015-05-08 17:16:13 -07:00
swapchain9.c gallium: use fence_finish instead of fence_signalled in state trackers 2015-07-05 15:08:59 +02:00
swapchain9.h nine: Implement threadpool 2014-11-18 02:02:54 +00:00
swapchain9ex.c st/nine: call DBG() at more external entry points 2014-11-26 20:09:11 +00:00
swapchain9ex.h
texture9.c st/nine: Enforce LOD 0 for D3DUSAGE_AUTOGENMIPMAP 2015-04-29 08:28:11 +02:00
texture9.h st/nine: Rework texture data allocation 2015-04-29 08:28:11 +02:00
threadpool.c nine: Implement threadpool 2014-11-18 02:02:54 +00:00
threadpool.h nine: Implement threadpool 2014-11-18 02:02:54 +00:00
vertexbuffer9.c st/nine: Add debug warning when application uses sw processing 2015-04-29 08:28:11 +02:00
vertexbuffer9.h
vertexdeclaration9.c st/nine: Check for aligned offset in each vertex element 2015-02-06 00:07:19 +01:00
vertexdeclaration9.h st/nine: Fix vertex declarations for non-standard (usage/index) 2014-12-03 16:39:24 +01:00
vertexshader9.c st/nine: Refactor how user constbufs sizes are calculated 2015-02-06 00:07:18 +01:00
vertexshader9.h st/nine: Fix vertex declarations for non-standard (usage/index) 2014-12-03 16:39:24 +01:00
volume9.c st/nine: D3DUSAGE_AUTOGENMIPMAP is forbidden for volumes 2015-04-29 08:28:11 +02:00
volume9.h
volumetexture9.c st/nine: D3DUSAGE_AUTOGENMIPMAP is forbidden for volumes 2015-04-29 08:28:11 +02:00
volumetexture9.h

Quickstart Guide

*** Configure and build mesa
CFLAGS="-m32" CXXFLAGS="-m32" ./autogen.sh --prefix=/usr \
 --with-gallium-drivers=nouveau,r600,swrast --enable-nine \
 --with-gallium-driver-dir="`pwd`/src/gallium/targets/pipe-loader/.libs" \
 --enable-debug --enable-texture-float --with-dri-drivers= --disable-dri \
 --disable-opengl --disable-egl --disable-vdpau --disable-xvmc --disable-gbm \
 --disable-gallium-llvm
make

*** Then we create some symlinks to mesa:
ln -s "`pwd`/lib/gallium/libd3dadapter9.so.0.0.0" /usr/lib/
ln -s "`pwd`/lib/gallium/libd3dadapter9.so.0" /usr/lib/
ln -s "`pwd`/lib/gallium/libd3dadapter9.so" /usr/lib/
ln -s "`pwd`/include/d3dadapter" /usr/include/

*** Clone and build a patched wine
git clone git@github.com:iXit/wine.git
./configure
make

*** And finally we create some symlinks to our patched wine files:
for f in d3d9.dll gdi32.dll user32.dll wineps.drv winex11.drv;
do
    mv /usr/lib/wine/$f.so /usr/lib/wine/$f.so.old
    ln -s "`pwd`/dlls/`basename -s .dll $f`/$f.so" /usr/lib/wine/
done

*** Activating it within wine
regedit
Navigate to HKCU\Software\Wine\Direct3D
If it's not there, create it
Create a new DWORD value called UseNative
Set its value to 1

Every Direct3D9 program will now try using nine before wined3d

If you want to selectively enable it per-exe instead, use the key:
HKCU\Software\Wine\AppDefaults\app.exe\Direct3D\UseNative
where app.exe is the name of your .exe file


*** HOW IT WORKS ***

Nine implements the full IDirect3DDevice9 COM interface and a custom COM
interface called ID3DAdapter9 which is used to implement a final IDirect3D9Ex
COM interface.
ID3DAdapter9 is completely devoid of window system code, meaning this can be
provided by wine, Xlib, Wayland, etc. It's inadvisible to write a non-Windows
backend though, as we don't want to encourage linux developers to use this API.

The state tracker is compiled, along with pipe-loader, into a library called
libd3dadapter9.so. This library loads pipe_[driver].so drivers on demand and
exports a single symbol for getting a subsystem driver. Currently only DRM is
supported.
This library is then linked to the library implementing the IDirect3D9[Ex]
interface and the actual Direct3D9 entry points (Direct3DCreate9[Ex])

The implementation of IDirect3D9[Ex] lies within wine and coexists with
wined3d. It's loaded on demand and so if it's not there, it doesn't have any
drivers or something else is wrong, d3d9.dll will automatically revert to using
wined3d.
Whether or not it's even tried is determined by 2 DWORD registry keys.
> HKCU\Software\Wine\Direct3D\UseNative
> HKCU\Software\Wine\AppDefaults\app.exe\Direct3D\UseNative
The former is the global on-switch. The latter is per-exe.

The driver search path can be set at configure time with
--with-gallium-driver-dir and overridden at runtime with D3D9_DRIVERS_PATH.
Debugging information can be gotten with the WINEDEBUG channels d3d9 and
d3dadapter, and state_tracker debug information can be gotten with NINE_DEBUG.
Help on NINE_DEBUG is shown through NINE_DEBUG=help

Finally, the ID3DPresent[Group] and ID3DAdapter9 interfaces are not set in
stone, so feel free to hack on those as well as st/nine.

Happy Hacking!