Preprocessor definitions are found at the bottom of the Home tab by clicking the “Edit Global Preprocessor Definitions” button. Changing these triggers a full recompile of your active shaders.
Recommended Preprocessor Configuration (2026 Performance Standard)
The following table provides the “High-Speed” values for the most common global definitions. These values ensure that depth-based effects (like MXAO or RTGI) don’t waste cycles on incorrect or inverted data.
| Definition | Performance Value | Technical Reason |
RESHADE_DEPTH_LINEARIZATION_FAR_PLANE | 1000.0 | Standardizes the depth range to prevent “infinite” calculation loops. |
RESHADE_DEPTH_INPUT_IS_REVERSED | 1 or 0 | Match your game. Setting this correctly stops shaders from “searching” for depth data. |
RESHADE_DEPTH_INPUT_X_SCALE | 1.0 | Keeps depth sampling at a 1:1 ratio with your resolution to avoid blurring. |
BUFFER_WIDTH / BUFFER_HEIGHT | [Auto] | Ensuring these match your native res avoids expensive re-scaling passes ($S_{pass}$). |
RESHADE_NO_GRAPHICS_PIPELINE_STATE | 1 | (v6.0+) Skips state checks in DX12/Vulkan, saving CPU overhead in raids. |
HowTo: Engineering the Preprocessor for 2026 Performance
Follow these GameEngineer.net technical steps to ensure your shader stack is running at maximum velocity:
- The Depth Buffer Alignment: Use the
DisplayDepth.fxshader to verify your depth map. If it’s black or broken, your shaders are wasting cycles on empty data. ToggleRESHADE_DEPTH_INPUT_IS_REVERSEDbetween0and1until the map appears correctly. A correctly aligned depth buffer can save up to $2\text{ms}$ of frame time. - Strip the “Upscale” Waste: If you use DLSS or FSR, your
RESHADE_DEPTH_INPUT_X_SCALEmay need to be adjusted (e.g.,1.5for Quality mode). If this is misaligned, every depth-based shader will perform a heavy “nearest-neighbor” search ($N_{search}$) on every pixel. Aligning it makes the sampling direct and “High-Speed.” - Global “Zero” Policy: If you aren’t using a specific advanced feature (like logarithmic depth), explicitly set its preprocessor definition to
0. Some modern shaders check these definitions and will branch into more complex code if they aren’t explicitly disabled. - Compute Shader Threading: In 2026, many shaders support
THREAD_SIZEdefinitions. If you have a high-end GPU (RTX 50/60 series), check the shader’s internal documentation and increase the preprocessor thread count to match your hardware’s wave size (usually32or64). - Force Static Branching: By setting definitions like
USE_DEPTH_CHECK=1globally, you allow the compiler to “hard-code” that logic into the shader binary. This is significantly faster than the shader checking a “checkbox” variable during the render loop.
Technical Explanation: Compiler Optimization and Branching
ReShade uses a Just-In-Time (JIT) compiler. When you define a preprocessor variable, you are using a #define directive in the underlying HLSL code.
From a mathematical perspective, this changes a Dynamic Branch ($B_{dyn}$) into a Static Branch ($B_{stat}$). Dynamic branches require the GPU’s execution unit to evaluate a condition for every pixel, which can lead to Divergence—where different threads in the same “warp” or “wavefront” take different paths, slowing down the entire group. By using Global Preprocessor Definitions, you prune these branches at compile time, ensuring all $8.3\text{ million pixels}$ (at 4K) follow the exact same high-speed execution path.