How to debug D3D9

Compile both Mesa-3D and Wine with CFLAGS and CXXFLAGS set to debug.

CFLAGS="-Og -ggdb -g -gdwarf-2 -gstrict-dwarf" CXXFLAGS="${CFLAGS}"

Also configure Mesa-3D with

--enable-debug

Make sure, you have disabled striping debug symbols if you are using distribution packages, ebuild or AUR.

A problem can be located in either wine or Mesa. If it's in mesa, you'll need to use https://docs.mesa3d.org/envvars.html#nine-frontend-environment-variables

when you comparing logs from ALWAYS_SOFTWARE, is handy to get rid of different addr for diff, with this helps you

sed -i -e ā€œs/0x[0-f]*/0x0/gā€ logfile.log*

For wine, WINEDEBUG=+d3dadapter9,+d3d9 should be enough.

You also may be interested in apitrace.

APITrace

When uploading APITrace .trace file, please repack it with brotli (best compression ā†’ apitrace repack -b your_app.trace your_app-brotli.trace)