fix(vk): DLSS is given the 3D without the game's own anti-aliasing #3221
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3221
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/dlss-without-game-aa"
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?
Summary
The game anti-aliases its 3D itself, after the tone map and before the upscale:
26fe0c70ab9fc547finds edges,685adb41edc19de7makes blend weights and6637ac1d052d22d4blends the picture the upscale takes (frame dumps;26fe0c70is the pass in #348). So NVIDIA DLSS and DLAA were given an already smoothed picture.While DLSS or DLAA draws that upscale, the weights dispatch is now replaced by a clear of the weights image, so the blend passes the picture through. The edge dispatch still runs, so a weights dispatch that is not replaced always has this frame's edges. It follows what drew (
temporal_dlss_drawing): if DLSS stops, the pass is back within three frames. DLAA before the bloom keeps the pass: it draws before the tone map, so the pass does not feed it. The game's own upscaler, Off, FSR 3.1, FSR 4, XeSS and GSR 2 keep it too: with it left out, FSR 3.1 changed more from frame to frame in stills and GSR 2 was mixed; FSR 4 and XeSS were not measured.Read:
game_aa_left_outingpu/vk/vk_draw.cpp,dlss_drew_upscaleandtemporal_dlss_drawingingpu/vk/vk_temporal.cpp. See #2569, #348, #2346.Testing
Tested: Linux (CachyOS), RTX 3090, Market, 2560x1440, on a tree of this PR and its sibling menu PRs over
main@7bc53f84: DLAA and DLSS 67% logthe game's own anti-aliasing is left out while NVIDIA DLSS draws; withRX_VK_DLSS_GAME_AA=1they do not. With DLAA before the bloom on, the stills match aRX_VK_DLSS_GAME_AA=1run (local contrast within 2%): the pass stays (the line still logs once there, from the frames before DLAA moves ahead of the bloom). An earlier build, which also skipped the edge dispatch, switched Off, DLAA, Off with the Off picture unchanged. No fatal error or device loss.dev.py smokepasses.vk_draw.cppandvk_temporal.cpppass Linux and llvm-mingw-fsyntax-onlycompiles.test_dlss_game_aa.pyfails on the test commit and passes on the head.mise run teston a tree of this PR, its two sibling menu PRs andmain@7bc53f84: 888 passed, 12 failed, 13 skipped; the 12 fail onmain@7bc53f84too:test_dlssg,test_lifter,test_no_game_title,test_no_map_reload,test_present_acquire_ahead,test_present_geometry_trace,test_present_held_image,test_present_image_free,test_sync_watch_event,test_turf_budget,test_ui_renderer,test_vk_draw_overhead_lean.Still to test:
RX_VK_DLSS_GAME_AA=1. Only stills have been compared (by hand).Measurements
Verdict: DLSS and DLAA keep more texture detail in stills. Whether motion is better or worse is not known, and frame time was not measured.
Setup: Linux, RTX 3090, Market from the
market-entrancesave, 2560x1440, camera still, a launch per side; local contrast over brightness in three static regions, from full-size screenshots. Frame-to-frame change was read too, but two runs of identical behaviour differed several-fold (DLAA before the bloom: 0.17 to 0.33 and 0.50 to 0.76), so no stability result is claimed.Baseline: the same build with
RX_VK_DLSS_GAME_AA=1, which draws asmain@7bc53f84does, so one build serves both sides.7bc53f8471f44b61RX_VK_DLSS_GAME_AAis new and off by default (the pass is left out).Risks
DLSS now does all the anti-aliasing: thin or high-contrast edges could shimmer more than before in motion, mostly at lower render shares.
RX_VK_DLSS_GAME_AA=1restoresmain's picture. The programs are named by code hash; a game version with other code keeps its pass. No saves, settings or shader caches change.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.gpu/vk/switches.def.mainand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8e16e9JsGLrugow9vJQ
Tested in game: Linux (CachyOS), RTX 3090, Market at 2560x1440: DLAA and DLSS 67% draw with the game's AA pass left out and keep more texture detail in stills; switching to Off brings the pass back; smoke run from kokiri-start passed. Motion not judged by eye.
Screenshots, Market, RTX 3090, a roof at 4x, camera still. Left:
main's picture (RX_VK_DLSS_GAME_AA=1). Right: this PR.@Beanstalk windows nvidia: this PR against main with NVIDIA DLSS at Render resolution 67% and with DLAA, Kokiri Forest and Hyrule Field, turning the camera, screenshots of foliage and thin edges, frame times, and the log line
the game's own anti-aliasing is left out while NVIDIA DLSS drawsBeanstalk test farm · an earlier run: commit
a363ede(the newer results are in a comment below)Commit
a363ede· approved by HumanBean (reviewed) · dashboard⚠️ Note: The DLSS axis covers DLSS and DLAA; DLAA renders at full scale regardless of the render-resolution setting.
⚠️ Note: Still screenshots and a scripted camera turn cannot quantify motion shimmer, local contrast, or prove that the intended thin edges are visible; the frame-time measures begin after the turn.
⚠️ Note: The plan does not test restoring the game's anti-aliasing after switching DLSS off, other upscalers, HDR, or frame generation.
Started at 02:51 UTC.
windows+nvidia+dlssforest-field· frame time p99 (ms), main → PR at each leveldlss=1(reference)dlss=2windows+nvidia+dlssWhat was tested
What will be tested · AI plan (
gpt-6.1-terra)On Windows NVIDIA hardware with DLSS available, the farm will compare the PR with main in Kokiri Forest and Hyrule Field using DLSS at 67% render resolution and DLAA. Three starts per side will capture stationary foliage and edge screenshots, turn the camera, and measure frame times for 30 seconds per location and mode after warm-up. A crash, missing DLSS anti-aliasing log line, excessive screenshot difference, or a frame-time or GPU-time regression over 15% fails the PR. The run is uncapped at a fixed output size for each tester.
1or2.kokiri-start(settings vsync=2, resolution=3, frame_rate_cap=6, quality_preset=0, frame_generation=0; switchesHOS_OUTPUT_RES=gpu,RX_VK_AUTO_TUNE=0), then teleport to Kokiri Forest, take the picture forest-still to compare with main, move the stick, take the picture forest-turned, measure forest for 30 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field-still to compare with main, take the picture field-turned, measure field for 30 s (after 10 s warm-up); 3 runs on each side for each of 2 cells (1 game start a run).WIP: fix(vk): DLSS is given the 3D without the game's own anti-aliasingto fix(vk): DLSS is given the 3D without the game's own anti-aliasingPossibly related, for context:
Recommendation: Approve. The code is ready: only testing is left. The visual effect in motion remains unproven. Recommend approval; not approved on the forge.
The change removes the game's pre-upscale anti-aliasing while DLSS or DLAA is active, preserving more texture detail in the reported stills. It adds a per-frame image clear and synchronization, with visual quality in motion and the performance cost still to be established.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:12758: The default changes the picture in motion, but only stills have been judged. (more on the line) Do: Compare the merge base and this head in motion in Hyrule Field and Kokiri Forest, including DLSS Quality and DLAA, with repeated runs and the same settings; also test Windows NVIDIA and the listed HDR, pre-bloom and frame-generation paths.gpu/vk/vk_draw.cpp:12771: The replacement adds two full barriers and a clear on each weights dispatch, but its frame-time cost has not been measured. (more on the line) Do: Measure GPU time and frame-time distributions on the merge base and this head in the same scene and settings, with repeated interleaved runs. (@fixdoes its part first: Reduce synchronization or avoid the per-frame clear if a safe pass-through can be implemented without it.)@fixcan do L2.Questions (2) (not confirmed from the code; they don't hold the recommendation)
gpu/vk/vk_draw.cpp:12764: Can the supported game dispatch this weights shader with an unexpected output format or missing output while its edge input and later blend remain usable?tests/test_dlss_game_aa.py:42: Is there a specific frame or mode transition where the production decision returns the wrong result?Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven for the player-visible fix. One launch per side on a Linux RTX 3090 showed 8.4–8.6% more local contrast with DLAA and 9.6–13.2% with DLSS at 67%; DLSS frame-to-frame change also rose from 0.33–0.48 to 0.38–0.57. Motion was not judged, and these runs used an earlier base rather than the merge base.
Other systems: The decision is shared by DLSS and DLAA, including DLAA before bloom and DLSS frame generation. Other upscalers are gated out by temporal_mode(), but switching modes and a failed DLSS evaluation affect when the game's pass resumes. Windows NVIDIA, Native HDR, pre-bloom DLAA and frame generation remain untested according to the PR.
Switches: RX_VK_DLSS_GAME_AA is added, default off: the game's pass is skipped under DLSS. Setting it to 1 restores the pass. It has a switches.def row, but the reported stills do not yet establish that the default is best in motion on supported NVIDIA systems.
Reviewed:
a363ede4c1against3a0f7d8f7f: Read AGENTS.md, CONTRIBUTING.md, the PR template, the changed test and temporal header, the full diff and commit message; read the relevant dispatch, texture, temporal and standards sections. Skimmed the rest of the large changed renderer files, switches.def and upscaler documentation rather than reading them in full. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no builds, scripts or tests were run. The supplied CI checks are still running.
Overlaps and merge order: Not established from the offline checkout.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as HumanBean took it out of WIP. Nothing was run; a maintainer decides.
@ -12748,0 +12755,4 @@constexpr uint64_t kEdges = 0x26fe0c70ab9fc547ull, kWeights = 0x685adb41edc19de7ull;if (p.key != kEdges && p.key != kWeights) return false;static const bool kept = env_on("RX_VK_DLSS_GAME_AA");if (kept || !temporal_dlss_drawing()) return false;L1 (should fix): The default changes the picture in motion, but only stills have been judged.
When: With DLSS Quality or DLAA, foliage, hair and fences during camera movement can differ from the previous smoothed input; the reported static-region measurements cannot determine whether the added detail is worth any shimmer.
Do: Compare the merge base and this head in motion in Hyrule Field and Kokiri Forest, including DLSS Quality and DLAA, with repeated runs and the same settings; also test Windows NVIDIA and the listed HDR, pre-bloom and frame-generation paths.
@ -12748,0 +12768,4 @@if (!out || !out->image || out->aspect != VK_IMAGE_ASPECT_COLOR_BIT || out->format != VK_FORMAT_R8G8B8A8_UNORM)return false; // (not the image this was written for: the pass runs as the game has it)end_pass(cmd);full_barrier(cmd);L2 (should fix): The replacement adds two full barriers and a clear on each weights dispatch, but its frame-time cost has not been measured.
When: When DLSS draws, the clear and synchronization replace the edge and weights dispatches; the reported 0.056 ms for the old edge dispatch alone does not show the net effect or frame pacing.
Do: Measure GPU time and frame-time distributions on the merge base and this head in the same scene and settings, with repeated interleaved runs.
On the review's L2 (the clear's two barriers): the runs here were shared-mode, and their whole-frame GPU totals vary too much with other jobs to resolve a difference (DLSS 67%: 7.0 to 7.3 ms with the change, 7.2 to 10.1 ms without; DLAA: 8.7 to 13.8 against 8.1 to 8.2 ms). Not measured: it needs timed runs.
a363ede4c171f44b6155Pushed
71f44b61after a cold review of the branch, now test then fix:On the earlier review's L2: the clear keeps the renderer's full_barrier rather than hand-narrowed ones, with no timing to justify them. The earlier frame-to-frame stability figures are withdrawn: runs of identical behaviour differ several-fold.
@review
@Beanstalk windows nvidia: this PR against main with NVIDIA DLSS at Render resolution 67% and with DLAA, Kokiri Forest and Hyrule Field, turning the camera, screenshots of foliage and thin edges, frame times, and the log line
the game's own anti-aliasing is left out while NVIDIA DLSS drawsBeanstalk test farm · ⚠️ couldn't be judged on windows+nvidia+dlss
Commit
71f44b6· approved by HumanBean (reviewed) · dashboard⚠️ Note: DLAA renders at full scale regardless of the 67% resolution setting; the DLSS and DLAA matrix cells each compare with main.
⚠️ Note: Still screenshots and post-turn captures cannot judge shimmer during camera movement or quantify the claimed increase in local contrast; HDR, pre-bloom DLAA and frame generation are not exercised.
⚠️ Note: GPU pass totals indicate whether the run is GPU-bound; they do not isolate the new clear and barriers.
Done (started 08:52 UTC, last report 13:25 UTC). Comment
@Beanstalkto run it again.windows+nvidia+dlssforest-field· frame time p99 (ms), main → PR at each leveldlss=1(reference)dlss=2windows+nvidia+dlssCouldn't be judged: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own.
windows+nvidia+dlss, report 1:main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store'sWhat was tested
What will be tested · AI plan (
gpt-6.1-terra)On Windows NVIDIA hardware, this plan compares the PR with main using DLSS at 67% render resolution and DLAA in Kokiri Forest and Hyrule Field. Three starts per side capture stationary foliage and thin-edge screenshots, turn the camera, and measure frame and GPU times in 20-second segments; the run takes about 40 minutes per tester. A crash, missing anti-aliasing log line, excessive screenshot difference, or a frame-time or GPU-time regression above 15% fails the PR.
1or2.kokiri-start(settings vsync=2, resolution=3, frame_rate_cap=6, quality_preset=0, frame_generation=0; switchesHOS_OUTPUT_RES=gpu,RX_VK_AUTO_TUNE=0), then teleport to Kokiri Forest, take the picture forest-still to compare with main, move the stick, take the picture forest-turned, measure forest for 20 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field-still to compare with main, take the picture field-turned, measure field for 20 s (after 10 s warm-up); 3 runs on each side for each of 2 cells (1 game start a run).Measurements on `windows+nvidia+dlss`, for the PR description
Verdict: could not be judged on windows+nvidia+dlss (1 report).
Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss
NVIDIA GeForce RTX 3070 Ti, 621.47.0AMD Ryzen 9 5900XT 16-Core Processor, 64 GB RAMScene: forest-field, from the repository's save kokiri-start (vsync=2, resolution=3, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=gpu, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); forest-field: 3 game starts a side, forest 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)Nothing was measured: no metric came back.
Flags and settings
dlss1,2As Markdown for the PR description:
The testers' hardware
windows+nvidia+dlssNVIDIA GeForce RTX 3070 Ti, 621.47.0AMD Ryzen 9 5900XT 16-Core Processor, 64 GB RAMOn the measured main: the game runs used a tree on main @
7bc53f84, which adds #3209 (pause menu buttons) over this PR's base3a0f7d8fand touches no renderer code, so the numbers hold for this head.Recommendation: Approve. The code is ready: only testing is left. The change preserves more texture detail in the reported stills, but its effect on motion and its frame-time cost remain unknown. Those results are needed to judge the default. Recommend approval; not approved on the forge.
DLSS and DLAA receive the picture without the game's preceding anti-aliasing weights pass; the edge pass still runs so fallback weights have current input. This retains more still-image detail at the cost of an unmeasured clear and synchronization on each replaced dispatch.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:12758: The default changes the picture in motion, but only stills have been judged. When: With DLSS Quality or DLAA, foliage, hair and fences during camera movement can differ from the previous smoothed input; the reported static-region measurements cannot determine whether the added detail is worth any shimmer. Do: Compare the merge base and this head in motion in Hyrule Field and Kokiri Forest, including DLSS Quality and DLAA, with repeated runs and the same settings; also test Windows NVIDIA and the listed HDR, pre-bloom and frame-generation paths.gpu/vk/vk_draw.cpp:12771: The replacement adds two full barriers and a clear on each weights dispatch, but its frame-time cost has not been measured. When: When DLSS draws, the clear and synchronization replace the edge and weights dispatches; the reported 0.056 ms for the old edge dispatch alone does not show the net effect or frame pacing. Do: Measure GPU time and frame-time distributions on the merge base and this head in the same scene and settings, with repeated interleaved runs. (@fixdoes its part first: Reduce synchronization or avoid the per-frame clear if a safe pass-through can be implemented without it.)@fixcan do L2.Since the last review (on
a363ede4c1)Still open: L1 (The default changes the picture in motion, but only stills have been judged.); L2 (The replacement adds two full barriers and a clear on each weights dispatch, but its frame…)
Checks: Still running: 11 checks.
Also noticed (1; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven overall: one Linux RTX 3090 still-image comparison reports local contrast increases of 2.7–10.1% for DLAA and 11.7–12.2% for DLSS 67%. Motion quality and frame time have not been established.
Other systems: The change targets NVIDIA DLSS and DLAA; other upscalers retain the pass. DLAA before bloom retains it after recent upscale draws age out. Windows NVIDIA, HDR and frame generation remain untested in the reported runs.
Switches: RX_VK_DLSS_GAME_AA is new and defaults off, replacing the weights dispatch under DLSS; setting it to 1 restores the pass. Whether the default is right awaits motion and timing results.
Reviewed:
71f44b6155against3a0f7d8f7f: Read the PR diff, commit list, repository guidance and template, changed test and temporal header, and the changed renderer functions and surrounding call paths. Skimmed the larger renderer files, switch table and upscaler reference; those files were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run. The author reports Linux RTX 3090 in-game stills and smoke testing, syntax-only checks on Linux and Windows targets, and a game-free test passing at head; CI is still running.
Overlaps and merge order: The description mentions sibling menu PRs, but their identities and merge order are not provided.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
On L2: the replacement records no extra barrier. The weights dispatch it replaces had one before it ("barrier (dispatch)") and the blend dispatch after it recorded another. Now it is one before the clear and one after, and the blend dispatch's own is deduplicated by full_barrier (no work in between). In the runs on this head, barriers a frame are the same on both sides: DLAA 155-156 and 155-156 with the pass kept, DLSS 67% 155-156 and 155; dispatches 117-118 against 118-119. What is left unmeasured is the clear's GPU time against the weights dispatch's.
@review
Recommendation: Approve. The code is ready: only testing is left. The stills show more texture detail, but motion quality and the replacement clear's GPU cost remain unmeasured. Windows NVIDIA testing and CI are also still pending. Recommend approval; not approved on the forge.
DLSS and DLAA receive a picture without the game's own anti-aliasing when they draw the upscale. This preserves more detail in the reported stills, at the cost of an unmeasured change to motion quality and GPU time.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:12758: The default changes the picture in motion, but only stills have been judged. When: With DLSS Quality or DLAA, foliage, hair and fences during camera movement can differ from the previous smoothed input; the reported static-region measurements cannot determine whether the added detail is worth any shimmer. Do: Compare the merge base and this head in motion in Hyrule Field and Kokiri Forest, including DLSS Quality and DLAA, with repeated runs and the same settings; also test Windows NVIDIA and the listed HDR, pre-bloom and frame-generation paths.gpu/vk/vk_draw.cpp:12771: The clear's GPU cost relative to the weights dispatch remains unmeasured. When: Each replaced weights dispatch clears the image; the shared-mode frame totals vary too much to determine the time difference. Do: Measure repeated timed runs with the pass kept and with the clear, at the same scene and settings. (@fixdoes its part first: Reduce synchronization or avoid the per-frame clear if a safe pass-through can be implemented without it.)@fixcan do L2.Since the last review (on
71f44b6155)Still open: L1 (The default changes the picture in motion, but only stills have been judged.); L2 (The clear's GPU cost relative to the weights dispatch remains unmeasured.)
Checks: Still running: 11 checks.
Also noticed (1; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven in motion. The author's single-launch Linux RTX 3090 still comparisons report local contrast increases of 2.7–10.1% for DLAA and 11.7–12.2% for DLSS 67%; frame time and visual quality while moving were not established.
Other systems: The replacement is restricted to NVIDIA DLSS and DLAA drawing the upscale; DLAA before bloom and other upscalers retain the pass. Windows NVIDIA, native HDR and DLSS frame generation remain to be tested.
Switches: RX_VK_DLSS_GAME_AA is new and defaults off, leaving out the game's pass under DLSS; setting it to 1 restores the pass. It is documented as a kill switch, but motion results are needed to judge the default.
Reviewed:
71f44b6155against3a0f7d8f7f: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the full diff, vk_temporal.h and test_dlss_game_aa.py; inspected the changed functions and relevant dispatch references in vk_draw.cpp and vk_temporal.cpp. The larger renderer files, standards, switch table and upscaler documentation were only skimmed. docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The author reports Linux in-game still comparisons, syntax checks and a game-free test; motion testing, Windows NVIDIA testing and CI remain pending.
Overlaps and merge order: None identified in the supplied information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.