fix(vk): DLAA changing place before or after the bloom restarts its history, not the motion #2455

Open
Jiro113 wants to merge 2 commits from Jiro113/Longshot:fix/dlaa-place-motion into main
Contributor

Summary

When NVIDIA DLAA changes place, before the game's bloom or after it (the Insert menu's DLAA before the bloom row, or
a frame without the scene's linear colour, such as a loading screen), the renderer starts a new history for DLAA. That
is right: the two places see different pictures (linear light, or the tone-mapped one). But it also dropped that frame's
motion: its motion vectors were zeros, and the actors' motion was not drawn over them, although the camera and the
actors are the same on both sides of the bloom.

draw_engine now reads the engine's previous frame before the change of place resets it, and keeps it for the motion of
that one frame (moved). DLAA's own history still starts again (f.reset).

Nothing changes on screen on main. NGX's DLSS Frame Generation starts a new history with DLAA on that frame
(vk_dlss.cpp dlss_fg_inputs, f.reset). FSR 3.1's frame interpolation takes the chain's motion on that frame
instead of the camera's alone. The renderer's own frame generation does not read it. This is needed by DLSS Frame
Generation through NVIDIA Streamline (a pull request of its own, based on this one): Streamline's DLSS-G keeps its own
history, so it needs real motion on that frame.

Read first: gpu/vk/vk_temporal.cpp draw_engine (drawn, moved, seen), then tests/temporal_history_test.cpp.

Testing

Tested: Windows 11, RTX 4090, driver 621.24. Renderer built from this branch with NVIDIA's DLSS SDK, in nightly-786,
in a 1920x1080 window. Saved rows: Upscaler DLSS at native (DLAA), DLAA before the bloom on, Frame generation Fixed 2x
by DLSS FG (NGX).

  • In Hyrule Field, dlss_pre_bloom was changed six times, 5 s apart, through the control bridge
    (longshot_ctl.py option set):
    • each change was answered;
    • the log gave DLAA's place each time (upscaler: NVIDIA DLAA before/after the game's bloom and tone map, then
      NVIDIA DLAA draws before the game's bloom or draws OoT's upscale);
    • each change made a new DLSS feature (HDR colour on or off with the place);
    • NGX's DLSS FG was told to reset on those frames and kept making frames;
    • the game ran at 60.0 to 60.2 fps 5 s after each change, with no device lost, and exited normally.
  • The same six changes with Frame generation by FSR 3.1 FG: each was answered, the log gave DLAA's place each time
    and a new DLSS feature was made; FSR 3.1's frame interpolation made every other present across the six changes
    (fsr3fi: of the last 600 presents 600 made by FSR 3.1 in each window holding one); 59.5 to 60.0 fps 5 s after each
    change, no device lost, a normal exit.
  • The renderer builds on Linux (RX_VK_ONLY=1, Ubuntu 22.04 with tools.lock's clang) at fcb5889a8, with no warning.
  • tests/test_temporal_history.py (--cxx clang++): 6 failures on main ("a change of place lost the motion", for
    DLSS, FSR 4 and XeSS), passes here. tests/test_dlss_pre_bloom.py passes.
  • tests/run_all.py on Windows (llvm-mingw): every check that fails here fails on main 8aa5ab876 on this PC too, the
    same 32 (below). Nine more timed out in a first run made beside another; run again alone, they pass.
The 32 checks failing on main and here, on this PC

test_amd_subgroup_profiles, test_auto_handheld, test_bug_report, test_build_long_paths, test_crash_dialog,
test_crt_options, test_dev_ab, test_dev_build, test_dev_migrate, test_dev_packs, test_discover, test_flat_map,
test_game_menu_mouse_buttons, test_input_movie, test_job_queue, test_lift_lookups, test_linux_preflight,
test_make_game_cache, test_menu_text_field, test_pads_after_menu, test_perf_report, test_pipeline_share,
test_rdna2_mesh_only, test_readback_timeout_source, test_rumble_menu, test_sampler_admission, test_sdiv_overflow,
test_shader_profile_caps, test_target_image_reuse, test_vibration_menu, test_vram_compact, test_walk.

  • Limit of the run above: without the game's native HDR, changing DLAA before the bloom also changes the DLSS
    feature's HDR colour, so the feature is made again on that frame and draw_engine gives it no motion (ready == 2,
    moved = 0), with this change as before it. The six changes show that changing place still works; they do not show
    a frame where the kept motion is used. tests/test_temporal_history.py is what shows the fix.

Still to test:

  • A change of place that keeps the DLSS feature, where the kept motion is used: with the game's native HDR on, or
    across a frame without the scene's linear colour (a loading screen). By hand, this PC.

Measurements

Verdict: the motion is kept on the frame where DLAA changes place: the test fails on main and passes here. There is
no cost to measure: the game ran at 60 fps after each change (Testing).

Setup: Windows 11, tests/test_temporal_history.py --cxx clang++ (llvm-mingw), which builds
tests/temporal_history_test.cpp around draw_engine's own history decision cut from vk_temporal.cpp.

Before: main @ 8aa5ab876 After: this PR @ fcb5889a8
A change of place, the engine's frame before 1 or 2 frames back: motion kept (DLSS, FSR 4, XeSS) 6 failures, "a change of place lost the motion" passes
The same with no frame before, or one 3 frames back: no motion passes passes

Risks

  • If the frame before the change was drawn with a different camera cut, its motion would be wrong for that one frame.
    This is the same check as on any other frame (at most two frames apart, and the camera's reprojection). DLAA's history
    starts again anyway.
  • A revert is enough. Nothing changes after updating: no setting, no file.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary When NVIDIA DLAA changes place, before the game's bloom or after it (the Insert menu's **DLAA before the bloom** row, or a frame without the scene's linear colour, such as a loading screen), the renderer starts a new history for DLAA. That is right: the two places see different pictures (linear light, or the tone-mapped one). But it also dropped that frame's motion: its motion vectors were zeros, and the actors' motion was not drawn over them, although the camera and the actors are the same on both sides of the bloom. `draw_engine` now reads the engine's previous frame before the change of place resets it, and keeps it for the motion of that one frame (`moved`). DLAA's own history still starts again (`f.reset`). Nothing changes on screen on main. NGX's DLSS Frame Generation starts a new history with DLAA on that frame (`vk_dlss.cpp` `dlss_fg_inputs`, `f.reset`). FSR 3.1's frame interpolation takes the chain's motion on that frame instead of the camera's alone. The renderer's own frame generation does not read it. This is needed by DLSS Frame Generation through NVIDIA Streamline (a pull request of its own, based on this one): Streamline's DLSS-G keeps its own history, so it needs real motion on that frame. Read first: `gpu/vk/vk_temporal.cpp` `draw_engine` (`drawn`, `moved`, `seen`), then `tests/temporal_history_test.cpp`. ## Testing **Tested:** Windows 11, RTX 4090, driver 621.24. Renderer built from this branch with NVIDIA's DLSS SDK, in nightly-786, in a 1920x1080 window. Saved rows: Upscaler DLSS at native (DLAA), DLAA before the bloom on, Frame generation Fixed 2x by DLSS FG (NGX). - In Hyrule Field, `dlss_pre_bloom` was changed six times, 5 s apart, through the control bridge (`longshot_ctl.py option set`): - each change was answered; - the log gave DLAA's place each time (`upscaler: NVIDIA DLAA before/after the game's bloom and tone map`, then `NVIDIA DLAA draws before the game's bloom` or `draws OoT's upscale`); - each change made a new DLSS feature (HDR colour on or off with the place); - NGX's DLSS FG was told to reset on those frames and kept making frames; - the game ran at 60.0 to 60.2 fps 5 s after each change, with no device lost, and exited normally. - The same six changes with Frame generation by FSR 3.1 FG: each was answered, the log gave DLAA's place each time and a new DLSS feature was made; FSR 3.1's frame interpolation made every other present across the six changes (`fsr3fi: of the last 600 presents 600 made by FSR 3.1` in each window holding one); 59.5 to 60.0 fps 5 s after each change, no device lost, a normal exit. - The renderer builds on Linux (`RX_VK_ONLY=1`, Ubuntu 22.04 with tools.lock's clang) at fcb5889a8, with no warning. - `tests/test_temporal_history.py` (`--cxx clang++`): 6 failures on main ("a change of place lost the motion", for DLSS, FSR 4 and XeSS), passes here. `tests/test_dlss_pre_bloom.py` passes. - `tests/run_all.py` on Windows (llvm-mingw): every check that fails here fails on main 8aa5ab876 on this PC too, the same 32 (below). Nine more timed out in a first run made beside another; run again alone, they pass. <details><summary>The 32 checks failing on main and here, on this PC</summary> test_amd_subgroup_profiles, test_auto_handheld, test_bug_report, test_build_long_paths, test_crash_dialog, test_crt_options, test_dev_ab, test_dev_build, test_dev_migrate, test_dev_packs, test_discover, test_flat_map, test_game_menu_mouse_buttons, test_input_movie, test_job_queue, test_lift_lookups, test_linux_preflight, test_make_game_cache, test_menu_text_field, test_pads_after_menu, test_perf_report, test_pipeline_share, test_rdna2_mesh_only, test_readback_timeout_source, test_rumble_menu, test_sampler_admission, test_sdiv_overflow, test_shader_profile_caps, test_target_image_reuse, test_vibration_menu, test_vram_compact, test_walk. </details> - Limit of the run above: without the game's native HDR, changing **DLAA before the bloom** also changes the DLSS feature's HDR colour, so the feature is made again on that frame and `draw_engine` gives it no motion (`ready == 2`, `moved = 0`), with this change as before it. The six changes show that changing place still works; they do not show a frame where the kept motion is used. `tests/test_temporal_history.py` is what shows the fix. **Still to test:** - A change of place that keeps the DLSS feature, where the kept motion is used: with the game's native HDR on, or across a frame without the scene's linear colour (a loading screen). By hand, this PC. ## Measurements **Verdict:** the motion is kept on the frame where DLAA changes place: the test fails on main and passes here. There is no cost to measure: the game ran at 60 fps after each change (Testing). Setup: Windows 11, `tests/test_temporal_history.py --cxx clang++` (llvm-mingw), which builds `tests/temporal_history_test.cpp` around `draw_engine`'s own history decision cut from `vk_temporal.cpp`. | | Before: main @ 8aa5ab876 | After: this PR @ fcb5889a8 | |---|---|---| | A change of place, the engine's frame before 1 or 2 frames back: motion kept (DLSS, FSR 4, XeSS) | 6 failures, "a change of place lost the motion" | passes | | The same with no frame before, or one 3 frames back: no motion | passes | passes | ## Risks - If the frame before the change was drawn with a different camera cut, its motion would be wrong for that one frame. This is the same check as on any other frame (at most two frames apart, and the camera's reprojection). DLAA's history starts again anyway. - A revert is enough. Nothing changes after updating: no setting, no file. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tests/temporal_history_test.cpp runs draw_engine's own history decision (cut from vk_temporal.cpp) for DLSS, FSR 4
and XeSS on a frame that moves the engine across the bloom: the engine's history starts again, and the frame's
motion stays when the engine drew the frame before at the other place (not after a gap of more than two frames, nor
with no frame before). On main the motion is lost: 6 failures, "a change of place lost the motion".

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(vk): DLAA changing place before or after the bloom restarts its history, not the motion
Some checks failed
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 8s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
fcb5889a80
When DLAA moves before or after the bloom (the Insert menu's row, or a frame without the scene's linear colour),
draw_engine started a new history for the engine and for the motion alike: that frame's motion vectors were zeros
and the actors' poses were not drawn over them, although the camera and the actors are the same either side of the
bloom.

draw_engine now reads the engine's frame before ahead of the changes that zero it and keeps it across a change of
place (moved), for the camera's and the actors' motion; the engine's own history still starts again (f.reset). The
frame generations here take that frame's reset as before (NGX's: dlss_fg_inputs, !f.reset), so main shows no
difference; DLSS Frame Generation through NVIDIA Streamline, a pull request of its own, takes its reset from the
motion, and needs it.

tests/temporal_history_test.cpp checks the decision, tests/test_dlss_pre_bloom.py the code's order.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Tested in game: Windows 11, RTX 4090, driver 621.24; nightly-786 with this branch's renderer built with NVIDIA's DLSS SDK, in a 1920x1080 window, Hyrule Field. Saved rows: Upscaler DLSS at native (DLAA), DLAA before the bloom on, Frame generation Fixed 2x by DLSS FG (NGX). dlss_pre_bloom changed six times, 5 s apart, through the control bridge: each change answered, DLAA's place logged each time, a new DLSS feature each time, NGX's DLSS FG told to reset on those frames and kept making frames, 60.0 to 60.2 fps after each change, no device lost, a normal exit. The same six changes with Frame generation by FSR 3.1 FG: FSR 3.1 made every other present across them, 59.5 to 60.0 fps, no device lost, a normal exit.

Tested in game: Windows 11, RTX 4090, driver 621.24; nightly-786 with this branch's renderer built with NVIDIA's DLSS SDK, in a 1920x1080 window, Hyrule Field. Saved rows: Upscaler DLSS at native (DLAA), DLAA before the bloom on, Frame generation Fixed 2x by DLSS FG (NGX). dlss_pre_bloom changed six times, 5 s apart, through the control bridge: each change answered, DLAA's place logged each time, a new DLSS feature each time, NGX's DLSS FG told to reset on those frames and kept making frames, 60.0 to 60.2 fps after each change, no device lost, a normal exit. The same six changes with Frame generation by FSR 3.1 FG: FSR 3.1 made every other present across them, 59.5 to 60.0 fps, no device lost, a normal exit.
Member

Possibly related, for context:

  • issue #1449 Complete the temporal upscalers' motion vectors for content that moves without bones (water, foliage, projectiles, particles) — Broader temporal motion-vector coverage; this fixes lost motion on a history reset, not missing object motion.
  • issue #1606 The upscalers give up a frame whenever any texture is destroyed anywhere, though their own depth and colour were not touched — Separate upscaler-history fallback issue; both touch temporal history but different cause.
  • PR #1652 feat(vk): NVIDIA DLAA before the game's bloom and tone map — Merged change introduced DLAA-before-bloom routing that this PR handles at transitions.
Possibly related, for context: - issue #1449 Complete the temporal upscalers' motion vectors for content that moves without bones (water, foliage, projectiles, particles) — Broader temporal motion-vector coverage; this fixes lost motion on a history reset, not missing object motion. - issue #1606 The upscalers give up a frame whenever any texture is destroyed anywhere, though their own depth and colour were not touched — Separate upscaler-history fallback issue; both touch temporal history but different cause. - PR #1652 feat(vk): NVIDIA DLAA before the game's bloom and tone map — Merged change introduced DLAA-before-bloom routing that this PR handles at transitions.
Jiro113 changed title from WIP: fix(vk): DLAA changing place before or after the bloom restarts its history, not the motion to fix(vk): DLAA changing place before or after the bloom restarts its history, not the motion 2026-11-24 11:50:32 +00:00
Author
Contributor

Second review pass: no code change. Testing now says what the in-game run does not show. Without the game's native HDR, changing DLAA's place also makes a new DLSS feature on that frame, which gets no motion with or without this fix. So the six changes show that the place changes; only tests/test_temporal_history.py shows the kept motion. Still to test has the case that uses it. The branch merges without conflict on main be663a08a, and #2456 carries its two commits unchanged.

Second review pass: no code change. Testing now says what the in-game run does not show. Without the game's native HDR, changing DLAA's place also makes a new DLSS feature on that frame, which gets no motion with or without this fix. So the six changes show that the place changes; only `tests/test_temporal_history.py` shows the kept motion. Still to test has the case that uses it. The branch merges without conflict on `main` `be663a08a`, and #2456 carries its two commits unchanged.
Jiro113 force-pushed fix/dlaa-place-motion from fcb5889a80
Some checks failed
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 8s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 060916b23c
Some checks are pending
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 27s
2026-11-25 20:54:27 +00:00
Compare
Some checks are pending
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 27s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/dlaa-place-motion:Jiro113-fix/dlaa-place-motion'
git switch 'Jiro113-fix/dlaa-place-motion'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2455
No description provided.