Repository navigation
d3d12: leave FidelityFX maximum-size vtable patch off by default (D3D12-SERIESX-FSR-MAX-SCALED) - #2756
Conversation
With LEONIDA_FSR_UPSCALER=1 and LEONIDA_RENDER_SCALE below 1.0 on Series X (DLSS or stretch), patching the FidelityFX upscaler's maximum-size vtable slot (0x6300ba8) to its scaled-size function caused the title to present only the HUD over a black world (investigated in 0ae217c). Leaving that patch off by default (opt-in via LEONIDA_FSR_MAX_SCALED=1) keeps the requested render scale while drawing and lighting the world at 1706x960 -> 2560x1440.
|
Independent check on Windows (not the author), at
Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, Rust 1.98.1 pinned. AI-assisted: yes (opencode). |
KelboLive
left a comment
There was a problem hiding this comment.
The flip itself is sound and the default is pinned: making it default-on fails exactly one test (hooks::tests::the_fidelityfx_maximum_patch_is_left_out_by_default, hooks.rs:625), the loader only writes that slot and the original function runs when off, and nothing else depends on 0x6300ba8. cargo test --locked -p leonida-loader is 82 + 2 + 1 passed, 0 failed here.
Two things must change before merge:
- The switch is undocumented.
python -I tools/d3d12_switches.py --check d3d12/docs/switches.mdis exit 0 onorigin/main86c30fceaand exit 1 on this head withmissing from the page: LEONIDA_FSR_MAX_SCALED(the other six names are pre-existing base drift, gone after a rebase). Add a row: default off, only=1turns it on (unlikeLEONIDA_OWN_UPSCALER, which is presence-on), and when it applies (LEONIDA_RENDER_SCALEset and the own upscaler not forced). - The gate is global while the evidence is one configuration. It applies whenever
LEONIDA_RENDER_SCALEis set, so Series S' native FSR now loses the patch too, while the body measures one desktop GPU under the Series X profile (and "on Series X" there is a profile, not console hardware). Say what Series S does now, or measure it — the patch was introduced for that FSR path (193152d00).
Minor: only the parser is tested (None/"0"/"1" plus the flag into render_scale_patches); nothing drives the real env path in resolution_levers, and empty/other strings are untested, so the "unset means off" claim rests on a direct call rather than on the loader's own entry point.
- play-nvidia.ps1: a launcher switch only overrides the F1 menu's saved value when it changed since the last start (leonida-settings-cmdline.txt), so the menu's DLSS, render scale and frame generation stay between launches. - play-nvidia.ps1: the menu's UPSCALER DLSS counts as asking for it on Series X, and it asks for the DLSS build. - hooks.rs: the FidelityFX maximum-size patch is off by default (LEONIDA_FSR_MAX_SCALED=1 turns it on), from ProjectLeonida#2756: it left the world black on Series X with DLSS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
RUN (independent, in game): RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro (build 26300). Head 591bd23 merged with Red and green, off the game. The pull request's test does not compile on In game. Series X profile,
Verdict: PASS. On this card, with DLSS on the Series X profile, the change turns the dark world into a lit one, for 0.7 ms more than the dark frame. AI-assisted: Claude Code (Claude Opus 5.5) |
|
Addendum to my RUN above, the output size it had not covered yet: the same merge, Series X, |
|
Verified by OreoFR (RUN, AI-assisted: oreofr-agent): head Red / green in game: RTX 4070 Laptop 8 GB, driver 621.40, Windows 11. Series X, DLSS quality, no frame generation, same data and pipelines for both runs.
Tests: This agrees with enlighted's 3090 result above: same fix on two cards. Safe to merge into main?
Ready once a maintainer approves the CI runs and they are green. |
|
Merging (oreofr-agent, with OreoFR's written OK as maintainer): head |
The merge queue's tests found the page out of date once this branch met main. Regenerated with tools/d3d12_switches.py after merging main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The merge queue took this out: on the merge with main, Fix: merge |
|
Merging again (oreofr-agent, with OreoFR's written OK): head |
Claimed in the coordination issue as: D3D12-SERIESX-FSR-MAX-SCALED (#2570 (comment))
What and why
Fixes the black-world bug on Series X when upscaling through FidelityFX (LEONIDA_FSR_UPSCALER=1, DLSS or stretch) below render scale 1.0 (follow-up to ae217ceb in d3d12/docs/findings.md).
ender_scale_patches in d3d12/crates/leonida-loader/src/hooks.rs was unconditionally patching the FidelityFX upscaler's maximum-size vtable slot (x6300ba8, slot 11 -> slot 10's scaled-size function). When LEONIDA_RENDER_SCALE was below 1.0 on Series X, the title rendered the scene internally at the scaled size, ran fxDispatch to the output target, and then presented only the HUD over a completely black world.
This change leaves "render scale: FSR maximum = scaled size" off by default (kept opt-in via LEONIDA_FSR_MAX_SCALED=1 for diagnosis via parse_fsr_max_scaled), while preserving FSR_LOAD_S, FSR_LOAD_OTHER, and the title's own upscaler patches.
Follow-up kept out of this PR: removing the experimental warning and preserving the F1 menu's DLSS selection on Series X in d3d12/scripts/play-nvidia.ps1 can be proposed separately once verified across other output sizes (such as 3840x2160) and GPUs.
Tested
GPUs tested: NVIDIA GeForce RTX 5070 12 GB (desktop, profile M), driver 621.40, Windows 11.
AI-assisted: yes (implementation: Gemini 4 Neon via Antigravity; independent separate reviewer agent: Gemini 4 Neon via Antigravity — approved).
Checklist
eeds rebase).