fix(vk): DLAA before the bloom keeps the game's upside-down viewport, and a DLAA before the bloom row turns it on #1678
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1678
Loading…
Reference in a new issue
No description provided.
Delete branch "pmwork-personal/Longshot:fix/dlss-pre-bloom-viewport"
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, RTX 5090 · Needs: Windows, other NVIDIA RTX cards (by hand)
TL;DR
With DLAA before the bloom on (#1652), the 3D picture could turn upside down while the HUD stayed upright, mostly when the
camera moved down (#1672). The cause: DLSS's own passes, run in the middle of the frame, set an upright viewport, and the
replay then skipped setting the game's upside-down one for the tone map. This PR resets the replay's bound state after
DLSS's passes, as it already does after the game's upscale. The order stays off by default, and a new Graphics row, DLAA
before the bloom, turns it on. On my PC the build without the fix flipped and the build with it did not.
Breakdown
RX_VK_DLSS_PRE_BLOOMstill sets it for one run.Why
#1652 runs DLAA on the scene before the game's bloom and tone map, at a place learned each frame. Players on v3.0.0-rc.8
saw the 3D upside down with the HUD upright when the camera moved down (RTX 5080, RTX 4070 Super), and #1675 turned the
order off by default. The cause is in the replay, not in the order: this fixes it, and gives players a row to turn the
order on. Fixes #1672.
How to reproduce
Seen on: Windows 11, NVIDIA GeForce RTX 5090, driver 621.24 (players: RTX 5080 with 621.24, RTX 4070 Super)
Settings and switches: Upscaler NVIDIA DLSS, Render resolution Native (DLAA), Threaded rendering Auto (On here);
RX_VK_DLSS_PRE_BLOOM=1on mainSteps: outdoors (Kakariko Village, Castle Town's market at night), move the camera down and up with the right stick
Expected: the picture stays upright
Actual: the 3D picture turns upside down while the HUD stays upright, in the frames where DLAA ran before the tone map (the log's
the first pass to read the scene after its last draw is program ab3681946f93594a)What changed
The replay draws every game draw with an upside-down viewport (
vk_draw.cppdynamic_state: NVN's +y is up, Vulkan'sdown) and sets it only when it differs from what it thinks bound. DLAA's commands in the middle of a draw (the pass ended,
DLSS's passes, the actor motion's draws with an upright viewport) changed that state behind its back. Where DLAA ran before
the tone map, a draw the scene's size, the tone map skipped its viewport and drew upside down. The game's upscale stand-in
already resets the bound state after the upscaler (
temporal_stand_in); the new place now does too.temporal_pre_bloom()ingpu/vk/vk_temporal.cppreturns whether it recorded commands;draw()ingpu/vk/vk_draw.cppthen callscb.reset()and pushes its descriptors again.pre_bloom_wanted()reads the row at each call and logs each change.gpu/vk/vk_menu.cppgets the row DLAA before the bloom under DLSS model (opts.dlss_pre_bloominvk_menu.h, saved asdlss_pre_bloom);upscaler_rows.hpre_bloom_shown()(NVIDIA DLSS where it runs) andpre_bloom_fixed()(changeable at DLAA only, or fixed while the switch sets it); its hint says why;RX_VK_DLSS_PRE_BLOOMoverrides it for one run.README.mdoptions table,docs/development.md,gpu/vk/switches.def(the switch is now the row's,player).gpu/vk/vk_dlss.cppnames why DLSS's feature takes HDR colour (the game's native HDR, or DLAA before the bloom); it said "the game's native HDR" for both.tests/test_dlss_pre_bloom.py/.cppcheck the reset, the descriptor push, the row and its rules;test_audio_output_menu.pyandtest_stick_dead_zone.pystand-ins get the new option, asini_keynames it.Measurements
Verdict: nothing to measure: a fix of a wrong picture and a menu row; the order's cost and quality are in #1652.
Flags and settings
Adds the DLAA before the bloom row (
dlss_pre_bloom=inlongshot_options.ini);RX_VK_DLSS_PRE_BLOOMnow overrides it.dlss_pre_bloom)RX_VK_DLSS_PRE_BLOOM=1on, else off=1on,=0off, over the rowTesting
Tested: on my PC (Windows 11 Pro build 26300, RTX 5090, driver 621.24, Threaded rendering On, my own settings with DLAA), on screen, outdoors with the camera moved down and up: a build of #1652 as merged (order on) showed the 3D upside down; the same build with this PR's viewport fix did not. Both runs' logs had DLAA learned before the tone map (
ab3681946f93594a) 7 times and before the bloom's first pass 7 times, so the frames that flipped came in both. This PR's whole change, built on the shared base (mainc507b98cwith #1652 and #1675), off-screen through the control bridge: the row reads Off at the start;option set dlss_pre_bloom 1logsNVIDIA DLAA before the game's bloom and tone map (DLAA before the bloom: on)and the next status counts frames drawn before the bloom;0logsafter ...again; DLSS's feature is made again for each, with no restart. The same build on my screen (my own settings: NVIDIA DLSS at Native (DLAA), frame generation 3x by DLSS FG): the row shows under DLSS model with its help and line, and On, Off and On again each applied at once (the log's place line, and DLSS's feature made again with HDR colour on, off and on); in that run DLAA ran before the tone map at least 6 times, the picture stayed upright at every camera angle, and the log has no error.tests/test_dlss_pre_bloom.pypasses;tests/run_all.py --changed: 229 pass, 20 fail, and the same 20 fail on main @1055077don this PC (test_bug_report, test_bug_report_defaults, test_crash_dialog, test_crt_options, test_damage_debug_menu, test_dev_packs, test_dlss_feature_size, test_draw_stream_visibility, test_fsr_uniform_ownership, test_hud_layout_row, test_linux_pressure, test_pipeline_play_cache, test_prepare_cache_save, test_psychov35_fsr3_fg, test_recorder_sync, test_switch_table, test_tested_configurations, test_upscaler_rows, test_vk_occlusion_queries, test_walk_key).Not tested: other RTX cards; native HDR and PsychoV35 with the order on.
Must be tested:
Risks
What could break: with the row On only: a draw after DLAA binds its pipeline, viewport and descriptors again, as after the game's upscale already; nothing changes with it Off (the default).
Turning it off: the row Off (the default), or
RX_VK_DLSS_PRE_BLOOM=0; or revert the commit.Compatibility: a new key,
dlss_pre_bloom=, inlongshot_options.ini(absent: Off); no save, cache or ABI change.Issues
Fixes #1672
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.Co-Authored-By: Claude Opus 5.5 [email protected]
🤖 Generated with Claude Code
Tested in game: Windows 11 Pro build 26300, NVIDIA GeForce RTX 5090, driver 621.24, Threaded rendering On, NVIDIA DLSS at Native (DLAA), on screen: outdoors with the camera moved down and up, a build of #1652 as merged (the order on) drew the 3D upside down and the same build with this PR's viewport fix did not; both logs had DLAA learned before the tone map (ab3681946f93594a) 7 times. This PR's whole change on the shared base (main
c507b98cwith #1652 and #1675), off-screen through the control bridge: the DLAA before the bloom row reads Off, option set 1 logs DLAA before the bloom and counts frames before the bloom, 0 logs it after again.New commit
a248a730: the DLSS feature's log now says why it takes HDR colour (the game's native HDR, or DLAA before the bloom); it said "the game's native HDR" for both. Testing updated: this PR's build on my screen (the row under DLSS model, On, Off and On again at once with frame generation on, the picture upright at every camera angle while DLAA ran before the tone map), and the checks: 229 pass, the same 20 fail on main.The Graphics tab on my screen (Windows 11, RTX 5090, 5120x2160, NVIDIA DLSS at Native (DLAA), frame generation 3x by DLSS FG).
After: this PR (its change on the shared base, main
c507b98cwith #1652 and #1675): the DLAA before the bloom row under DLSS model, On, with its help and line.Before: #1652 as merged (the same base): no such row; the order is set by
RX_VK_DLSS_PRE_BLOOMonly.Another case of the same order, for context: crawling through the low tunnel at the start of Bottom of the Well (child Link, the camera close and low), the 3D flickered; it stopped with
RX_VK_DLSS_PRE_BLOOM=0. v3.0.0-rc.8 (source a74a6465, plus my input-only change from #1349), Windows 11, RTX 5090, 5120x2880, NVIDIA DLSS at Native (DLAA), frame generation off. Two runs at the same spot, the order on and off; the lines that matter from each log:order on (flickers)
order off (no flicker)
The full logs are kept if you want them. I can run this PR's build in that tunnel with the row On if that helps.
mooki referenced this pull request2026-11-19 01:28:32 +00:00
mooki referenced this pull request2026-11-19 01:40:29 +00:00
mooki referenced this pull request2026-11-19 02:00:05 +00:00
mooki referenced this pull request2026-11-19 02:03:41 +00:00
mooki referenced this pull request2026-11-19 07:36:54 +00:00
mooki referenced this pull request2026-11-19 20:01:00 +00:00