Command-line tools for anyone working with ReshadeFX shaders who wants to compile, verify, or analyze them quickly — without opening a game, and without needing Windows. Built for humans and AI assistants alike: same tools, same output, whether you're running them by hand or an agent is driving them as part of an automated workflow.
These use the real ReshadeFX compiler itself, not a re-implementation or a guess at what would compile — so the answer you get is the answer ReShade itself would give.
(This repo was previously called ReshadeFX-tools.)
build_reshade_testing_initiative.sh (Linux/macOS) and
build_reshade_testing_initiative.bat (Windows, MinGW-w64) fetch
crosire/reshade's own source at the tag in
RESHADE_VERSION and build four tools from it:
| tool | what it does |
|---|---|
reshadefx_cli_fixed |
crosire's ReShadeFXC with six bug fixes applied (docs/upstream/reshade-fxc.md). Compiles a .fx file and reports the errors ReShade would. --dxbc on Linux too, and --all-entry-points to compile every entry point from one parse (docs/COMPILE-SPEED.md). |
reshadefx_rga |
per-stage SPIR-V instruction cost; optionally drives AMD's RGA for real GPU ISA and register data. |
fxstat |
SPIR-V and DXBC instruction statistics, lane-weighted ALU and transcendental counts, optional real AMD GPU ISA via RGA (--rga), JSON output, baseline/diff mode. See fxstat/README.md. |
reshadefx_coverage |
how much of a shader corpus compiles to DXBC, per shader model. |
More detail on each:
reshadefx_cli_fixed— crosire'stools/fxc.cpp(theReShadeFXCtool that ships with ReShade) withtools/fxc-fix.pyapplied. Upstream's tool is not kept up to date with the runtime's compiler: it sets up a different preprocessor environment, so it rejects some effects ReShade compiles fine and silently compiles the wrong branch of others. That is why only the fixed build is shipped. It also adds--list-entry-pointsand-Fc.--dxbc --shader-model <30|40|41|50|...>gives real DX9/10/11/12-equivalent compilation: on Windows through crosire's owneffect_codegen_dxbc.cppand the actual Microsoft D3DCompiler (d3dcompiler_47.dll, which ships with Windows itself), on Linux via vkd3d-shader (docs/DXBC-ON-LINUX.md).reshadefx_rga— makes RGA (Radeon GPU Analyzer) understand ReshadeFX shaders directly. RGA only speaks raw HLSL/GLSL/SPIR-V and has no idea what atechnique/passis or how to resolveReShade.fxh; this tool compiles the.fxfile with the real reshadefx frontend, extracts each shader stage as SPIR-V, and:- always reports a real-instruction-based cost breakdown per shader stage (cheap ALU / transcendental / texture / control-flow / memory), classified directly from the actual SPIR-V opcode stream — a vendor-general proxy for "which parts of this shader are expensive," useful with no other tools installed, and enough on its own to confirm an optimization actually reduced instruction count rather than just looking leaner;
- with
--optimize, first runs the folding and dead-branch passes a GPU driver runs, so the counts reflect code that actually executes (needs SPIRV-Tools at build time); - if you point it at an installed copy of RGA with
--rga <path> --asic <name>, it additionally reports genuine AMD GPU ISA size and real VGPR/SGPR register usage for a real, named GPU; - can load or save a small settings file to exercise a uniform value other than the shader's own hardcoded default — see Testing shaders under different ReShade conditions below.
fxstat— overlaps withreshadefx_rgaon SPIR-V, adds DXBC, and is built as a library with a thin CLI on top. Why both exist: docs/LAYOUT.md.reshadefx_coverage— walks every effect, every entry point and every requested shader model and reports exactly what fails to compile to DXBC and why. Exits 1 if anything failed, so it can gate a script or CI step.
reshadefx_rga and fxstat accept --json for machine-readable output.
./build_reshade_testing_initiative.sh # builds everything into ./bin (Windows: .bat)
./bin/reshadefx_cli_fixed --hlsl -I path/to/reshade-shaders/Shaders -Fo out.hlsl myshader.fx
./bin/reshadefx_rga -I path/to/reshade-shaders/Shaders myshader.fxAll the tools accept -I <path> for include directories (e.g. the standard
reshade-shaders repo, if your
effect includes ReShade.fxh) and -D name=value for preprocessor macros.
For real GPU ISA instead of just the built-in instruction classification,
point reshadefx_rga at an installed copy of RGA (download from its
releases page
— not bundled here, it's a large AMD binary under AMD's own EULA):
./bin/reshadefx_rga -I path/to/reshade-shaders/Shaders --rga path/to/rga --asic gfx1100 myshader.fx
RGA is run in its vk-spv-offline mode, which needs no GPU or driver (the mode
fxstat --rga uses too). --rga-mode <mode> selects another, e.g. vulkan.
Add --json for machine-readable output instead of the human-readable text
shown above:
./bin/reshadefx_rga --json -I path/to/reshade-shaders/Shaders myshader.fx
On Windows, reshadefx_cli_fixed.exe supports real DX9/10/11/12
compilation via the actual Microsoft D3DCompiler (--shader-model maps
directly to the profile: 30=DX9, 40=DX10, 41/50=DX11/12):
reshadefx_cli_fixed.exe --dxbc --shader-model 50 -I path\to\reshade-shaders\Shaders -E MyEntryPoint -Fo out.cso myshader.fx
reshadefx_rga accepts four flags for the ReShade-specific macros a shader
might branch on — a shader would not normally need to check these, but some
do to work around known bugs or adjust for capabilities, so it's worth being
able to test both branches:
--reshade-version <num> # override __RESHADE__ (default: the version these # tools were built against; MAJOR*10000+MINOR*100+REVISION) --perf # set __RESHADE_PERFORMANCE_MODE__ to 1 (default: 0) --width <n> # override BUFFER_WIDTH (default: 1920) --height <n> # override BUFFER_HEIGHT (default: 1080)
--perf is the one worth understanding, not just using. ReShade
recompiles a shader with its uniform variables (normally used for editable
UI settings) turned into static const values when performance mode is on.
The compiler can sometimes fold and simplify the resulting math further than
it could with a genuinely variable value — so the same shader can compile
to meaningfully different, and sometimes faster, code in performance mode.
That means a real performance picture has two numbers, not one: how it
behaves in normal/edit mode (settings variable) and how it behaves in
performance mode (settings locked to static) — and not every shader author
remembers to check both. Occasionally a compiler bug surfaces in one mode
but not the other, too, particularly in larger, more complex effects.
By default, performance mode exercises whatever values the shader's own
uniform declarations already default to. To test a different value — the
other side of an if a uniform guards, for instance — use:
--load-settings[=<path>] # read plain-numeric uniform overrides from a # ReShade-preset-format file (a real ReShade # preset works too) and bake them into the # compiled shaders, including uniforms declared # in included files. Implies --perf, since # that's the only mode where a uniform's value # becomes part of the compiled code rather than # a runtime-editable buffer entry. --save-settings[=<path>] # scan the shader's own uniform defaults and # write them out in that same format, then # continue to compile as normal.
Leaving off =<path> for either flag defaults to <effect-name>.ini
alongside the shader — so reshadefx_rga --save-settings levels.fx writes
levels.ini next to it, and a later reshadefx_rga --load-settings levels.fx picks that same file back up. Hand-edit the saved file (or point
--load-settings at a real ReShade preset) to try a different value:
./bin/reshadefx_rga --save-settings levels.fx # writes levels.ini # edit levels.ini, e.g. change some_mode=0 to some_mode=1 ./bin/reshadefx_rga --load-settings levels.fx # compiles with that override
With no arguments the build script builds all four tools into ./bin. Pass
any of --cli-fixed, --rga, --fxstat, --coverage to build only
those — e.g. for a project like ShaderBridge, where you only care whether a
port compiles:
./build_reshade_testing_initiative.sh --cli-fixed # just the compiler ./build_reshade_testing_initiative.sh out --rga # just rga, into ./out
What each needs besides git and g++:
| Linux/macOS | Windows | |
|---|---|---|
reshadefx_cli_fixed |
python3, bison, flex | python |
reshadefx_rga |
SPIRV-Tools (optional, for --optimize) |
same, via SPIRV_TOOLS_DIR |
fxstat |
cmake, SPIRV-Tools, bison, flex | cmake, SPIRV-Tools via SPIRV_TOOLS_DIR |
reshadefx_coverage |
bison, flex | — |
bison and flex are for vkd3d-shader, which is what gives --dxbc on Linux.
Debian/Ubuntu: apt-get install spirv-tools bison flex cmake.
Downloaded sources (ReShade, the SPIR-V headers that ReShade tag pins, and
vkd3d) are cached in .deps/. The first full build takes a few minutes, mostly
vkd3d; after that it is quick. Delete .deps/ to start clean.
patches/*.patch are applied to the ReShade checkout once, by both build scripts:
reshade-include-names.patchmakes#includenames behave as on Windows (it does nothing on Windows itself):\is a path separator (iMMERSE includes".\MartysMods\mmx_global.fxh"), and a name not found as written is matched ignoring letter case (OtisFX includes"Reshade.fxh"). ReShade assumes Windows, so effects are written that way.reshade-token-reuse.patchmakes the front end about 14% cheaper by reusing token storage instead of allocating per token. Output is unchanged; see docs/COMPILE-SPEED.md.
patches/vkd3d/*.patch are applied to vkd3d-shader, which only the Linux build
uses: fold-division-by-zero.patch makes integer division by a constant zero a
warning, as in D3DCompiler, instead of an error
(docs/DXBC-ON-LINUX.md).
Don't want to build anything? Every push to main builds and tests both
platforms in CI — grab the latest binaries from the
Actions tab
(click the newest run's artifacts), or from the
Releases page for a
tagged version.
RESHADE_VERSION pins the exact upstream tag these tools are built against
(currently ReShade 6.8.0), and every tool in both build scripts is built against
it. A daily scheduled workflow checks
crosire/reshade's tags directly via
git (no REST API, no rate limits) for the newest clean vMAJOR.MINOR.REVISION
tag — pre-releases like v6.9.0-rc1 are ignored, matching how crosire
actually marks an official release. When a new version appears, it bumps
RESHADE_VERSION, tags this repo to match, and that tag push triggers the
build workflow above, which builds, tests, and publishes a matching release
automatically. No manual step required to stay current.
The Windows build uses MinGW-w64 rather than MSVC, so no Visual Studio
install is required — just MinGW-w64 (e.g. from winlibs.com,
or via MSYS2) and git on PATH. The .exe files are statically linked and need
no MinGW runtime DLLs. The simplest full setup is MSYS2, which is also what CI
uses:
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-spirv-tools
set SPIRV_TOOLS_DIR=C:\msys64\mingw64
build_reshade_testing_initiative.bat
vkd3d is not used on Windows; every --dxbc there goes through the real
d3dcompiler_47.dll. See fxstat/WINDOWS.md for what has
and hasn't been verified on real Windows.
See docs/LAYOUT.md. Open work is in docs/CHECKLIST.md.
The compiler these tools are built from is crosire/reshade, written by Patrick Mours and contributors, licensed under BSD 3-Clause. This repo doesn't vendor or redistribute that source — the build scripts fetch it from the pinned tag — but the CLI tools are thin wrappers around that code, and credit for the actual compiler belongs there. The optional GPU ISA analysis uses RGA, by AMD.
BSD 3-Clause, matching ReShade itself. See LICENSE.