fix(vk): FSR 4's and XeSS's native AA wait for the native scene when entered from their scaled mode, as DLAA does #1744
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1744
Loading…
Reference in a new issue
No description provided.
Delete branch "madebyjordan/Longshot:fix/native-aa-size"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: fix · Risk: low · Tested on: Windows 11, RX 6700 XT (Adrenalin 26.10.1) · Needs: an 8 GB AMD card at its VRAM limit; XeSS (any GPU with libxess)
TL;DR
Switching AMD FSR 4 (or Intel XeSS) from a scaled mode to its Native AA could turn it off for the rest of the session: for the first frames after the switch the game still draws the smaller scene, and the upscaler was rebuilt at that size. On an 8 GB card at its VRAM limit that rebuild failed and the game's own upscaler took over until the player changed the upscaler. Now those first frames are drawn by the scaled mode, as DLSS already does when switching to DLAA, and Native starts once the full-size scene arrives. A new test fails on main and passes here.
Breakdown
Why
A player on an RX 6600 (8 GB, VRAM at its limit) switched FSR 4 from 92% to Native. The log has
AMD FSR 4: its upscaler was not made (3) for 1429x804(1429x804 is the 92% scene of 1536x864), thenAMD FSR 4 Native AA: the game's upscale runs (it failed earlier)for the rest of the session: FSR 4 was off, and the player saw the game's own upscale and lower frame rates when changing the scale. DLAA has waited for the native-size scene since https://github.com/NotRexed/Hookshot/pull/2145 ("Creating DLAA for that queued scene would replace the feature twice"); FSR 4's and XeSS's Native AA never did. With this change FSR 4 makes no new context for the switch at all: the scaled context, made for the output size, is reused for Native.See #744, #1612.
How to reproduce
Seen on: Windows 11, RX 6600 8 GB, Adrenalin 26.11.1 (the #744 log)
Settings and switches: Upscaler AMD FSR 4, Render resolution 92%; a scene near the VRAM limit
Steps: in the Insert menu, Render resolution: Left to Native (FSR 4)
Expected: FSR 4 Native AA draws (
AMD FSR 4 Native AA draws OoT's upscale: 1536x864 -> 1536x864)Actual: on main
AMD FSR 4: FSR 4.1.2 made for outputs of 1429x804or, at the VRAM limit,its upscaler was not made (3) for 1429x804, then the game's upscale for the rest of the session. On a 12 GB card the creation succeeds, so the visible sign there is the extra creation (~100 ms of CPU, a hitch) at the queued size, followed by a second one at the full size.What changed
The three-frame wait for the native-size scene, until now DLAA's alone, applies to every Native mode entered from its own engine's scaled mode.
draw_engineingpu/vk/vk_temporal.cpp:entering_native(wasentering_dlaa) is anyur::full_scalemode entered fromur::engine(mode); the queued frames are drawn asur::engine(mode)(was DLSS); the expiry log line names the mode.tests/test_dlss_native_transition.pyruns the real dispatch block with FSR 4 → FSR 4 Native AA and XeSS → XeSS Native AA: a queued scaled frame makes no native context; the full-size scene does; a scene that stays small gets Native AA at its size after three frames.Measurements
Verdict: the test fails on main for the bug's reason and passes here; in game FSR 4 and its Native AA run as on main.
Hardware: Windows 11, RX 6700 XT 12 GB, Adrenalin 26.10.1, Ryzen 5 5600, 16 GB
Scene: Hyrule Field by day, standing still; 2560x1440, uncapped, no frame generation
Method: the game-free test with clang 23 (llvm-mingw); in game, the change applied to the v3.0.0 renderer (renderer built alone,
RX_VK_ONLY) in a copy of a v3.0.0 game folder, headless through the control bridge, 20-45 s per setting, median of the bridge's fpsHow to reproduce:
python -I -B tests/test_dlss_native_transition.py --cxx clang++868f6be8d5863b06test_dlss_native_transitionRX_VK_FSR4=2), fps (in game, see Baseline)Baseline: the in-game rows compare the v3.0.0 renderer (
09cbdd97) with the same renderer plus this change, in a copy of a v3.0.0 game folder: main's renderer doesn't build on Windows today (#1729), and v3.0.0'sdraw_engineblock is the same as main's. They show only that nothing else changes; the switch itself is the test's.Flags and settings
None
Testing
Tested: the new test both ways (main: fails with 13; here: passes; the key condition put back to DLAA-only: fails again), with clang++ and llvm-mingw's g++ (clang underneath: no real GCC run). The tests that read
vk_temporal.cpp(18 of them) pass, excepttest_psychov35_fsr3_fgandtest_upscaler_rows, which fail on main on this PC too. The renderer builds whole (Windows, llvm-mingw) with a local workaround for main's own Windows build break indescriptor_array_census.h(#1729 fixes it; not in this PR). In game (v3.0.0 + this change): FSR 4 at 50% and FSR 4 Native AA from the start both draw and run at main's frame rate.python -I -B tests/run_all.py: 679 passed, 45 failed, 127 skipped; the same 40 fail on main @868f6be8on this PC, and the other 5 pass here run alone (4 neededMAGICBEAN_TOOLINGset, as this worktree has no Tooling beside it;test_longshot_ctlpasses alone).Not testable by hand: the switch to Native itself, here: the control bridge's
option_setcan't step the Render resolution row onto Native, and this PC's 12 GB card doesn't fail the creation. The game-free test stands in for it.Not tested: XeSS (no libxess on this PC); Linux.
Must be tested:
AMD FSR 4: FSR 4.1.2 made for outputs ofline at the 92% size (main makes one, then another at full size) andAMD FSR 4 Native AA draws OoT's upscaleat the full size (by hand: the log)Risks
What could break: for up to three frames after a switch to FSR 4's or XeSS's Native, the picture is drawn by the scaled mode (as DLAA's switch already does); a scene that stays small gets Native AA at its size after those three frames, as before.
Turning it off: revert the commit.
Compatibility: Nothing changes.
Issues
See #744
See #1612
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
Tested in game: Windows 11, RX 6700 XT, Adrenalin 26.10.1: the change on the v3.0.0 renderer (same draw_engine as main) in a v3.0.0 game folder, Hyrule Field, headless: FSR 4 at 50% and FSR 4 Native AA from the start both drew and ran at the same fps as without it; the switch to Native itself is covered by the game-free test (the control bridge can't select Native)