feat(vk): DLSS Frame Generation through NVIDIA Streamline, at an even pace #2456

Open
Jiro113 wants to merge 36 commits from Jiro113/Longshot:feat/streamline-dlssg into main
Contributor

Merge #2455 first, or together with this one: this PR carries #2455's two commits at the bottom of its stack, and DLSS-G needs them.

Summary

DLSS Frame Generation can now go through NVIDIA Streamline 2.14.16 instead of NGX's own DLSS-G. On an RTX 4090 at 2x
with the game at 60 fps, 97.1 % of the 120 Hz screen intervals land within 0.5 ms of 8.333 ms, against 8.5 % for main's
DLSS FG through NGX. The generated frames reach the screen at even times, where main alternates short and long ones.

This is ported from Hookshot's pull request 1944 (https://git.notrexed.dev/Hookshot/Hookshot/pulls/1944), with its
author kept as Co-Authored-By, and finished with a pacing of the game's presents. See #1350.

Based on #2455: its two commits come first here, and this pull request stays WIP until it merges (Checklist).

  • No new setting. In a Windows game built with Streamline's SDK, Streamline starts before Vulkan when the saved
    rows ask DLSS FG for frames: Frame generation Fixed, by DLSS FG, with a temporal Upscaler. It also needs an NVIDIA
    card, NVIDIA's signature on sl.interposer.dll, and slIsFeatureSupported to agree. Otherwise everything runs as on
    main. When a change of those rows brings Streamline in or out, closing the menu asks for a restart. Auto never goes
    through Streamline. RX_VK_DLSSG=0 keeps NGX.
  • Under Streamline the renderer makes no frames and runs no Reflex of its own: Streamline's Reflex and latency
    markers replace them. When DLSS-G cannot run on the GPU chosen, it gives up for the run and the renderer goes on as
    before, over Streamline's loader.
  • The pacing. The game's present is held 13 ms after the game's own frame (RX_VK_DLSSG_HOLD). When the present is
    within 1.5 ms of a line fitted through its last 60 presents, it is held to that line (RX_VK_DLSSG_HOLD_GRID).
  • The driver's two laws. NVIDIA's driver meters DLSS-G's presents by one of two laws, and one of them is uneven. A
    long screen gap flips it. Longshot's own Vulkan layer under Streamline reads which law is active from the presents'
    screen times (VK_EXT_present_timing), and passes everything on unchanged. When it reads the uneven law, the game
    holds one present for 22 ms, which turns it back (RX_VK_DLSSG_TOGGLE). This is bounded: three asks in a row, then
    silences that double, and six a minute at most.
  • Build. python -I scripts/fetch.py streamline --accept-nvidia-license [--game <game folder>] fetches NVIDIA
    Streamline's SDK the way NGX's is fetched (SHA-256 checked); --game puts its runtime in that game folder.
    longshot-builder compiles DLSS FG through Streamline only for a Windows build with --upscaler dlss and a
    developer's LONGSHOT_SL_SDK=<sdk folder>, and downloads nothing of it. A build without LONGSHOT_SL_SDK compiles
    none of it and behaves as main. vulkan-dlss.yml builds the back end with it too. No launcher asks for Streamline,
    so merging changes nothing for players (a follow-up).

Read first:

  • gpu/vk/vk_dlssg.cpp: start, give-up, and each frame;
  • gpu/vk/dlssg_rules.h: when it starts;
  • gpu/vk/dlssg_pace.h: the hold and the line;
  • gpu/vk/dlssg_law.h: the reader;
  • gpu/vk/vk_dlssg_layer.cpp: the layer;
  • docs/dev/reference/upscalers.md, "DLSS FG through Streamline".

Testing

Tested: Windows 11, RTX 4090, driver 621.24, 5120x1440 240 Hz VRR HDR10. Nightly-786 with this branch's renderer,
built from this head's code before its rebase onto 8aa5ab876 (since then only comments, docs, CI and main's
.tooling-rev changed), with Streamline 2.14.16's seven files beside longshot.exe. Saved rows: Frame generation
Fixed 2x by DLSS FG, Upscaler DLSS at native (DLAA) before the bloom.

  • Start. Streamline starts from the saved rows with no environment variable. The log shows:
    • Streamline started for DLSS Frame Generation and 4 images;
    • the layer's lines (present timing follows the game's frame, metering law is read);
    • ready (up to 2x), on, 2x, and the pacing line (13.0, 1.5 and 22.0 ms).
  • Timed runs. 17 timed runs of a scripted 60 s pan in Hyrule Field, interleaved: this PR, main, and NGX with its
    own present queue, three times each, and each pacing switch off twice (Measurements).
  • Insert menu, in a 1920x1080 window without focus:
    • opened twice and closed twice: off (the Insert menu is open) on each opening, on, 2x on each closing;
    • nothing refused, no device lost;
    • captures of the Frame generation rows (comment below).
    • Frame generation by, changed from DLSS FG to Built-in FG and back: here the help says the change takes effect
      after a restart, with the hint NVIDIA Streamline makes DLSS FG's frames in this run, and no other frames can be made beside it: this choice makes its frames after a restart.; on main, Built-in FG made frames at once.
    • In that window DLSS-G presented no frames of its own: the layer saw 60 presents a second throughout, and the
      counter showed 60 FPS, "Base 60, DLSS FG". Main's DLSS FG through NGX, in the same window, showed 120 FPS. In a
      1920x1080 window with the focus, DLSS-G made its frames: 120 presents a second at the layer, the game at 59.2 to
      60.6 fps (Risks).
  • Other frame rates, the game capped at 30, 90 and 120 (HOS_FPS_MAX), full screen:
    • on, 2x each time; the layer saw 60, 180 and up to 225 presents a second;
    • at 120, Streamline's Reflex held the frames shown to 224 fps (112 of the game's) on this 240 Hz screen; the game
      ran at 102 to 110 fps;
    • no toggle held a present. At 90 the reader read the uneven law and asked once, and the game let the ask go: it
      holds only at 60 fps (k,...,0 in the layer's CSV; upscalers.md now says the reader can read there);
    • nothing refused, no device lost.
  • Exit, on all 8 runs with Streamline: Streamline shut down for the exit (result 0), no two-second wait, and the
    game left by itself with code 0 in 1.03 to 3.91 s, against 1.03 to 2.23 s in the 6 runs without Streamline on this
    PC. The 3.91 s run was an Insert menu run whose twin on main took 2.23 s; the other seven took 3.07 s at most.
  • RX_VK_DLSSG=0, the same build, full screen: no vk: Streamline line; NGX's DLSS FG made 600 of the last 600
    presents in Hyrule Field; 59.8 to 60.8 fps; exit in 1.07 s.
  • Checks:
    • the renderer builds with and without LONGSHOT_SL_SDK on Windows, and on Linux (RX_VK_ONLY=1, Ubuntu 22.04 with
      tools.lock's clang, without it) at 126baef74, with no warning. The layer's manifest and sl.interposer.dll are
      reached through wide-character calls, the rest through the game's UTF-8 code page; not run from a folder with
      non-ASCII characters;
    • 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). Seven more timed out in a first run made beside another; run again alone, they pass. Of the
      checks that read a changed file, three need a tool this PC lacks and are left to CI: test_fsr3fi_hudless_colour
      (glslang) and the two test_portable_builder_* (dotnet); two more ran with their Python packages and pass
      (test_nup_stand_in, test_prompt_speed);
    • new game-free checks, all passing: test_dlssg.py, test_dlssg_pace.py (which builds and runs
      dlssg_rules_test.cpp, dlssg_pace_test.cpp and dlssg_law_test.cpp), test_sl_sdk.py, test_dlssg_fatal_end.py.
    • cargo test -p build-compile -p build-driver: the failures are main's own on this PC (2 and 7); the two new
      tests pass (streamline_s_flags_go_to_its_two_files_only,
      streamline_s_sdk_is_taken_for_a_windows_build_with_its_headers_only).
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.

  • The second review's fixes ran in the game on this PR's code before the rebase (ee478810d plus the four commits),
    nightly-786, RTX 4090, driver 621.24. The rebased head's renderer does not load in nightly-786's longshot.exe and
    did not run in the game.
    • A fatal end 70 s into a run (a local trigger, never committed): without the fix a crash in the DLSS-G plugin at
      teardown, exit code 0xC0000409 after about 12 s; with it exit code 3 in under 1 s, the FATAL line last in the log.
    • 3 runs against 3, twice. First series: the bad law took one run's window after three asks that changed nothing.
      Second series: 99.3 % of the 120 Hz intervals within 0.5 ms against 99.0 %, median latency 23.52 ms against
      23.53 ms, no time in the bad law, no false toggle. One run in six shows the episode here, none in six without the
      fixes; three against three does not tell a rare effect apart.

Still to test:

  • RTX 50 at 3x and 4x: the slider stops where Streamline says, frames are made, no toggle (by hand, an RTX 50 owner).
  • A 120 or 144 Hz VRR screen: Reflex's frame limit holds the game under 60 fps, the hold steps aside, the pace stays
    even (by hand).
  • VRR off: the reader stays quiet, at worst three toggles then silence (by hand).
  • The driver's other state, where its present timing follows DLSS-G's made frame: the combination shipped here was
    measured only in the state where it follows the game's frame (Risks). Expect the same pace after a restart of the PC
    that brings that state back (by hand, this PC).
  • A laptop whose game runs on the integrated GPU, or an old driver: one does not go through it in this run line,
    then the game as without Streamline (by hand).
  • The NVIDIA app's DLSS override on: a line says Streamline takes NVIDIA's plugins; the pace to measure again (by hand).
  • RTX 20 and 30, AMD and Intel GPUs in a build with Streamline: nothing of it loads (by hand, or @Beanstalk once a
    build with Streamline exists on the farm).
  • Linux: the game behaves as main (by hand, a Linux tester; the build is in Tested).
  • vulkan-dlss.yml: the back end builds with NGX, Streamline and FSR 4 (by hand, a maintainer: Run workflow).
  • A swapchain whose time domain changes during a run: the reader starts again (game-free only so far; no run here
    changed domain).
  • Giving up when the Upscaler row's engine does not run, and Threaded rendering Off: game-free only so far.
  • A fatal end with the game's statistics on: the last performance summary is written (game-free only so far).
  • scripts/screenshots/check_menu_capture.py on Linux: the capture's program links with the two new stand-ins.

Measurements

Verdict: 97.1 % of the 120 Hz intervals land within 0.5 ms, against 8.5 % on main. Every run of the PR is above
every run of main (92.8 % against 9.6 % at most). Latency is 1.2 ms higher (screen minus the game's present).

Setup:

  • Windows 11, RTX 4090, driver 621.24, 5120x1440 240 Hz with VRR and HDR10.
  • Nightly-786, DLSS, DLSS Frame Generation 2x, game capped at 60 fps.
  • A scripted 60 s camera pan in Hyrule Field. PresentMon recorded every displayed present, over the window +1 to
    +59.5 s from the pan's start.
  • Job queue in timing mode, with 60 s of no input before each run.
  • One warm-up run of the PR. Then three runs each of the PR, main, and NGX with its own present queue, interleaved
    with two runs of each switch off. The order was: PR, main, NGX, toggle, line, hold, rectangle, PR, rectangle, hold,
    line, toggle, NGX, main, PR, NGX, main.
  • Latencies are medians.
  • The PR's renderer was built before the rebase onto 8aa5ab876, from the code of 126baef74 (since then only comments,
    docs and CI changed).
Before: main @ 8aa5ab876 (NGX DLSS-G) After: this PR @ 126baef74 (Streamline)
120 Hz intervals within 0.5 ms of 8.333 ms 8.5 % (6.4, 9.4, 9.6) 97.1 % (92.8, 99.3, 99.1)
Latency, screen minus the game's present (median) 22.35 ms 23.51 ms
Toggles / false toggles in the window – 3 / 0 (all in the 92.8 % run)
  • In the 92.8 % run, the driver turned to its uneven law at +6 s with no long screen gap before it. Three toggles
    followed, 2 s apart, and the third turned it back at +12 s. The run was at 99.5 % after that.
  • One of those three toggles left a 24.03 ms screen gap; the others left 23.05 and 23.49 ms. Over whole runs (loading
    included, 8 runs) there were 14 toggles, none of them false, and each series of asks turned the law back within
    three.

Each pacing switch off, in the same series (two runs each, against the PR's 97.1 %):

Switch Share within 0.5 ms Latency
RX_VK_DLSSG_TOGGLE=0 89.5 and 99.6 % 23.5 ms
RX_VK_DLSSG_HOLD_GRID=0 89.8 and 88.7 % 23.5 ms
RX_VK_DLSSG_HOLD=0 54.6 and 38.6 % 18.1 ms
RX_VK_DLSSG_RECT=0 98.9 and 99.2 % 24.3 ms

The rectangle was measured again, three runs against three:

  • without it: 98.97 % (99.2, 99.3, 98.4);
  • with it: 97.8 % (99.8, 98.8, 94.8), where one run met an uneven-law stretch;
  • outside those stretches: 98.97 % without it, against 99.1 % with it.

It stays on: the same evenness, with 0.8 ms less latency.

The switches ship at those values: RX_VK_DLSSG_HOLD 13000, RX_VK_DLSSG_HOLD_GRID 1500 and RX_VK_DLSSG_TOGGLE
22000 µs, RX_VK_DLSSG_RECT on. RX_VK_DLSSG and RX_VK_DLSSG_LAYER ship on: each turns its part off, to compare or
to get round a fault. RX_VK_DLSSG_LAYER_CSV ships unset: it writes what the layer sees to a file, for measuring. The
new text also names switches main already has, unchanged: LONGSHOT_PREPARE_ONLY, RX_VK_DLSS_DIR, RX_VK_DLSS_FG,
RX_VK_FRAMEGEN, RX_VK_FRAMEGEN_MULT, RX_VK_FSR, RX_VK_FSR4 and RX_VK_XESS.

The three settings were chosen from the experiment branch, on the same PC and scene:

Arm Share within 0.5 ms
Streamline 2x as ported 41 to 55 %
+ hold 13000 µs 89.3 to 91.1 % under the even law, 36 to 45 % under the uneven one
+ line 1500 µs 98.7 % under the even law (90.3 % without)
+ toggle (24 ms then), layer reading the law 98.2 % (97.1 to 99.3, 3 runs) against 87.8 % (83.7 to 95.3) without
150 s runs: toggle against none 98.7 % (99.0, 98.7, 98.3) against 90.6 % (99.1, 79.4, 93.2)
  • The toggle's hold, 22 ms against 24 ms. There were 15 and 12 toggles, and every one changed the law. The screen
    gaps were 20.98 to 22.94 ms against 22.25 to 27.49 ms. 24 ms had failed three times, with gaps of 28 to 29 ms, so
    22 ms ships. Those runs were in the driver state where its present timing follows the made frame. In the state of
    the series above (where it follows the game's frame), 7 of 21 toggles left the uneven law, and the next ask turned it
    back.
  • For reference, NGX's DLSS-G with a present queue of its own, plus two more open changes (#2183, #2184), reaches
    89.3 % in the same series (89.4, 87.1 and 91.4 %). Every run of this PR is above every run of it. Its latency is
    20.8 ms.

Again on 2026-11-25, after the review's fixes and the rebase on main be663a08a. The driver was at its default
settings. The same pan, 3 runs against 3, interleaved, each a timed job of the PC's queue: the fixes (prslf) against
the head before them (prsle, the toggle's hold from the display's VRR floor). Every run: NGX and Streamline started,
no driver event, the game in front.

Fixes Before the fixes
120 Hz intervals within 0.5 ms of 8.333 ms, % 99.10 99.10
Latency, screen minus the game's present, median, ms 23.57 23.53
Time in the uneven law, % 0 0
Toggles with no uneven law before them 0 0
  • The uneven law did not come in these six runs, so the toggle was not put to the test here; the fixes leave the even
    pace as it was.
  • The renderer measured is the fixes before the rebase (the same code). The rebased renderer does not start in
    nightly-786 (host version mismatch: host has 45, expected 48), and this PC has no full game build at be663a08a
    yet. The rebase changes no renderer file of this PR; it ports the Streamline SDK's handling to the Rust builder
    (#2286): LONGSHOT_SL_SDK, read like LONGSHOT_NGX_SDK.
  • The toggle's hold from the display's VRR floor (HDMI EDID) ran in the game on 2026-11-24: the 48 Hz floor gives
    22 ms, 2 runs against 2 at a fixed 22 ms, 99.15 % against 99.3 %. Other floors are covered by game-free tests only.
  • Builds: LONGSHOT_NGX_SDK and LONGSHOT_SL_SDK are unset by default. A build without them has neither DLSS nor
    Streamline, as on main without LONGSHOT_NGX_SDK; a build with --upscaler dlss and both has both.
  • Game-free checks after the rebase: 261 pass, 8 fail, 12 are skipped at ee61b0fd1, the 8 failing on main too.
    test_longshot_ctl's test_the_session_follows_a_relaunch fails now and then on this PC, on main and on a branch
    that does not touch it (1 run in 3 alone): a race on relaunched_game in scripts/longshot_bridge.py, which this
    diff does not touch. A fix of its own is to come.

Risks

  • Streamline's loader. Once Streamline starts, its loader takes vulkan-1.dll's place for the whole run, so every
    Vulkan call of the renderer goes through it. It starts only when the rows ask DLSS FG at a fixed multiplier on an
    NVIDIA PC, in a build that has it. RX_VK_DLSSG=0 never starts it.
  • Presents. Under Streamline the presents are made on the render thread, and the presenter thread is off.
  • Latency. Screen minus the game's present is 1.2 ms above main and 2.7 ms above NGX's DLSS FG with its own present
    queue: the game's present waits 13 ms.
  • The toggle's gap. Each time the driver's law turns uneven, the toggle leaves one screen gap of 21.5 to 24.2 ms
    (up to 30 ms while the game loads). This happens a few times a minute at most, and is bounded.
  • The driver's two states. The driver's present timing follows either DLSS-G's made frame or the game's frame. Which
    one is a state of the driver that changed across restarts on this PC. The reader reads both, but the shipped
    combination was measured only in the second state (Still to test).
  • Comparing without the hold. RX_VK_DLSSG_HOLD=0 with the toggle on reads the uneven law most of the time. It
    asks 4 to 5 times a run, each ask a 28 to 31 ms screen gap. Turn the toggle off too when comparing without the hold
    (upscalers.md says so).
  • The layer. The layer adds one structure in front of the plugin's present chain. While Streamline runs, it enables
    VK_EXT_present_timing, VK_KHR_present_id2 and calibrated timestamps on the device. RX_VK_DLSSG_LAYER=0 leaves
    it out. The folder beside longshot_vk.dll must be writable for its manifest.
  • A window without focus. There DLSS-G through Streamline made no frames (60 presents a second, the counter at
    60 FPS), where main's DLSS FG through NGX made them (120 FPS). With the focus it makes them, in a window as in full
    screen.
  • Exit. The exit waits up to two seconds for a present or a Reflex sleep before it shuts Streamline down. A fatal
    end of the renderer ends the process at once with exit code 3, before the DLLs detach, after writing the last
    performance summary.
  • An Upscaler that cannot run here. With a temporal Upscaler row whose engine does not run on this PC, Streamline
    gives up on the first game frame with the menu closed: DLSS-G and its Reflex limit go off, and the renderer's own
    frame generation takes over, as in a build without Streamline. Not played in the game.
  • After updating: nothing changes for a launcher build, which has no Streamline. In a build with it, the Frame
    generation by row's DLSS FG means Streamline (after a restart). Nothing changes in longshot_options.ini.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (#2455's two commits come first here: the
    note at the top, merge #2455 first or with this one.)
  • 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 switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Screenshots of the same spot on main and here, for a change that shows on screen: the Insert menu's Frame
    generation by row, changed on main and here (comment below); the pacing shows in Measurements, not in a still.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

The guide's Graphics capture reviews four files this changes (gpu/vk/menu/framegen.cpp, gpu/vk/vk_dlss.h,
gpu/vk/vk_framegen.h, gpu/vk/vk_internal.h). The Frame generation by row is not pictured (the capture has Frame
generation Off), so the image is retained: source-review-dbf03654.md. Reviewed from the sources and the image, not
from a new capture. scripts/check_guide_screenshots.py --review-sources passes.

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

**Merge https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2455 first, or together with this one: this PR carries #2455's two commits at the bottom of its stack, and DLSS-G needs them.** ## Summary DLSS Frame Generation can now go through NVIDIA Streamline 2.14.16 instead of NGX's own DLSS-G. On an RTX 4090 at 2x with the game at 60 fps, 97.1 % of the 120 Hz screen intervals land within 0.5 ms of 8.333 ms, against 8.5 % for main's DLSS FG through NGX. The generated frames reach the screen at even times, where main alternates short and long ones. This is ported from Hookshot's pull request 1944 (https://git.notrexed.dev/Hookshot/Hookshot/pulls/1944), with its author kept as `Co-Authored-By`, and finished with a pacing of the game's presents. See #1350. Based on #2455: its two commits come first here, and this pull request stays WIP until it merges (Checklist). - **No new setting.** In a Windows game built with Streamline's SDK, Streamline starts before Vulkan when the saved rows ask DLSS FG for frames: Frame generation Fixed, by DLSS FG, with a temporal Upscaler. It also needs an NVIDIA card, NVIDIA's signature on `sl.interposer.dll`, and `slIsFeatureSupported` to agree. Otherwise everything runs as on main. When a change of those rows brings Streamline in or out, closing the menu asks for a restart. Auto never goes through Streamline. `RX_VK_DLSSG=0` keeps NGX. - **Under Streamline** the renderer makes no frames and runs no Reflex of its own: Streamline's Reflex and latency markers replace them. When DLSS-G cannot run on the GPU chosen, it gives up for the run and the renderer goes on as before, over Streamline's loader. - **The pacing.** The game's present is held 13 ms after the game's own frame (`RX_VK_DLSSG_HOLD`). When the present is within 1.5 ms of a line fitted through its last 60 presents, it is held to that line (`RX_VK_DLSSG_HOLD_GRID`). - **The driver's two laws.** NVIDIA's driver meters DLSS-G's presents by one of two laws, and one of them is uneven. A long screen gap flips it. Longshot's own Vulkan layer under Streamline reads which law is active from the presents' screen times (`VK_EXT_present_timing`), and passes everything on unchanged. When it reads the uneven law, the game holds one present for 22 ms, which turns it back (`RX_VK_DLSSG_TOGGLE`). This is bounded: three asks in a row, then silences that double, and six a minute at most. - **Build.** `python -I scripts/fetch.py streamline --accept-nvidia-license [--game <game folder>]` fetches NVIDIA Streamline's SDK the way NGX's is fetched (SHA-256 checked); `--game` puts its runtime in that game folder. `longshot-builder` compiles DLSS FG through Streamline only for a Windows build with `--upscaler dlss` and a developer's `LONGSHOT_SL_SDK=<sdk folder>`, and downloads nothing of it. A build without `LONGSHOT_SL_SDK` compiles none of it and behaves as main. `vulkan-dlss.yml` builds the back end with it too. No launcher asks for Streamline, so merging changes nothing for players (a follow-up). Read first: - `gpu/vk/vk_dlssg.cpp`: start, give-up, and each frame; - `gpu/vk/dlssg_rules.h`: when it starts; - `gpu/vk/dlssg_pace.h`: the hold and the line; - `gpu/vk/dlssg_law.h`: the reader; - `gpu/vk/vk_dlssg_layer.cpp`: the layer; - `docs/dev/reference/upscalers.md`, "DLSS FG through Streamline". ## Testing **Tested:** Windows 11, RTX 4090, driver 621.24, 5120x1440 240 Hz VRR HDR10. Nightly-786 with this branch's renderer, built from this head's code before its rebase onto 8aa5ab876 (since then only comments, docs, CI and main's `.tooling-rev` changed), with Streamline 2.14.16's seven files beside `longshot.exe`. Saved rows: Frame generation Fixed 2x by DLSS FG, Upscaler DLSS at native (DLAA) before the bloom. - **Start.** Streamline starts from the saved rows with no environment variable. The log shows: - `Streamline started for DLSS Frame Generation` and `4 images`; - the layer's lines (`present timing follows the game's frame`, `metering law is read`); - `ready (up to 2x)`, `on, 2x`, and the pacing line (13.0, 1.5 and 22.0 ms). - **Timed runs.** 17 timed runs of a scripted 60 s pan in Hyrule Field, interleaved: this PR, main, and NGX with its own present queue, three times each, and each pacing switch off twice (Measurements). - **Insert menu**, in a 1920x1080 window without focus: - opened twice and closed twice: `off (the Insert menu is open)` on each opening, `on, 2x` on each closing; - nothing refused, no device lost; - captures of the Frame generation rows (comment below). - Frame generation by, changed from DLSS FG to Built-in FG and back: here the help says the change takes effect after a restart, with the hint `NVIDIA Streamline makes DLSS FG's frames in this run, and no other frames can be made beside it: this choice makes its frames after a restart.`; on main, Built-in FG made frames at once. - In that window DLSS-G presented no frames of its own: the layer saw 60 presents a second throughout, and the counter showed 60 FPS, "Base 60, DLSS FG". Main's DLSS FG through NGX, in the same window, showed 120 FPS. In a 1920x1080 window with the focus, DLSS-G made its frames: 120 presents a second at the layer, the game at 59.2 to 60.6 fps (Risks). - **Other frame rates**, the game capped at 30, 90 and 120 (`HOS_FPS_MAX`), full screen: - `on, 2x` each time; the layer saw 60, 180 and up to 225 presents a second; - at 120, Streamline's Reflex held the frames shown to 224 fps (112 of the game's) on this 240 Hz screen; the game ran at 102 to 110 fps; - no toggle held a present. At 90 the reader read the uneven law and asked once, and the game let the ask go: it holds only at 60 fps (`k,...,0` in the layer's CSV; `upscalers.md` now says the reader can read there); - nothing refused, no device lost. - **Exit**, on all 8 runs with Streamline: `Streamline shut down for the exit (result 0)`, no two-second wait, and the game left by itself with code 0 in 1.03 to 3.91 s, against 1.03 to 2.23 s in the 6 runs without Streamline on this PC. The 3.91 s run was an Insert menu run whose twin on main took 2.23 s; the other seven took 3.07 s at most. - **`RX_VK_DLSSG=0`**, the same build, full screen: no `vk: Streamline` line; NGX's DLSS FG made 600 of the last 600 presents in Hyrule Field; 59.8 to 60.8 fps; exit in 1.07 s. - **Checks:** - the renderer builds with and without `LONGSHOT_SL_SDK` on Windows, and on Linux (`RX_VK_ONLY=1`, Ubuntu 22.04 with tools.lock's clang, without it) at 126baef74, with no warning. The layer's manifest and `sl.interposer.dll` are reached through wide-character calls, the rest through the game's UTF-8 code page; not run from a folder with non-ASCII characters; - `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). Seven more timed out in a first run made beside another; run again alone, they pass. Of the checks that read a changed file, three need a tool this PC lacks and are left to CI: `test_fsr3fi_hudless_colour` (glslang) and the two `test_portable_builder_*` (dotnet); two more ran with their Python packages and pass (`test_nup_stand_in`, `test_prompt_speed`); - new game-free checks, all passing: `test_dlssg.py`, `test_dlssg_pace.py` (which builds and runs `dlssg_rules_test.cpp`, `dlssg_pace_test.cpp` and `dlssg_law_test.cpp`), `test_sl_sdk.py`, `test_dlssg_fatal_end.py`. - `cargo test -p build-compile -p build-driver`: the failures are `main`'s own on this PC (2 and 7); the two new tests pass (`streamline_s_flags_go_to_its_two_files_only`, `streamline_s_sdk_is_taken_for_a_windows_build_with_its_headers_only`). <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> - The second review's fixes ran in the game on this PR's code before the rebase (ee478810d plus the four commits), nightly-786, RTX 4090, driver 621.24. The rebased head's renderer does not load in nightly-786's `longshot.exe` and did not run in the game. - A fatal end 70 s into a run (a local trigger, never committed): without the fix a crash in the DLSS-G plugin at teardown, exit code 0xC0000409 after about 12 s; with it exit code 3 in under 1 s, the FATAL line last in the log. - 3 runs against 3, twice. First series: the bad law took one run's window after three asks that changed nothing. Second series: 99.3 % of the 120 Hz intervals within 0.5 ms against 99.0 %, median latency 23.52 ms against 23.53 ms, no time in the bad law, no false toggle. One run in six shows the episode here, none in six without the fixes; three against three does not tell a rare effect apart. **Still to test:** - RTX 50 at 3x and 4x: the slider stops where Streamline says, frames are made, no toggle (by hand, an RTX 50 owner). - A 120 or 144 Hz VRR screen: Reflex's frame limit holds the game under 60 fps, the hold steps aside, the pace stays even (by hand). - VRR off: the reader stays quiet, at worst three toggles then silence (by hand). - The driver's other state, where its present timing follows DLSS-G's made frame: the combination shipped here was measured only in the state where it follows the game's frame (Risks). Expect the same pace after a restart of the PC that brings that state back (by hand, this PC). - A laptop whose game runs on the integrated GPU, or an old driver: one `does not go through it in this run` line, then the game as without Streamline (by hand). - The NVIDIA app's DLSS override on: a line says Streamline takes NVIDIA's plugins; the pace to measure again (by hand). - RTX 20 and 30, AMD and Intel GPUs in a build with Streamline: nothing of it loads (by hand, or `@Beanstalk` once a build with Streamline exists on the farm). - Linux: the game behaves as main (by hand, a Linux tester; the build is in Tested). - `vulkan-dlss.yml`: the back end builds with NGX, Streamline and FSR 4 (by hand, a maintainer: Run workflow). - A swapchain whose time domain changes during a run: the reader starts again (game-free only so far; no run here changed domain). - Giving up when the Upscaler row's engine does not run, and Threaded rendering Off: game-free only so far. - A fatal end with the game's statistics on: the last performance summary is written (game-free only so far). - `scripts/screenshots/check_menu_capture.py` on Linux: the capture's program links with the two new stand-ins. ## Measurements **Verdict:** 97.1 % of the 120 Hz intervals land within 0.5 ms, against 8.5 % on main. Every run of the PR is above every run of main (92.8 % against 9.6 % at most). Latency is 1.2 ms higher (screen minus the game's present). Setup: - Windows 11, RTX 4090, driver 621.24, 5120x1440 240 Hz with VRR and HDR10. - Nightly-786, DLSS, DLSS Frame Generation 2x, game capped at 60 fps. - A scripted 60 s camera pan in Hyrule Field. PresentMon recorded every displayed present, over the window +1 to +59.5 s from the pan's start. - Job queue in timing mode, with 60 s of no input before each run. - One warm-up run of the PR. Then three runs each of the PR, main, and NGX with its own present queue, interleaved with two runs of each switch off. The order was: PR, main, NGX, toggle, line, hold, rectangle, PR, rectangle, hold, line, toggle, NGX, main, PR, NGX, main. - Latencies are medians. - The PR's renderer was built before the rebase onto 8aa5ab876, from the code of 126baef74 (since then only comments, docs and CI changed). | | Before: main @ 8aa5ab876 (NGX DLSS-G) | After: this PR @ 126baef74 (Streamline) | |---|---|---| | 120 Hz intervals within 0.5 ms of 8.333 ms | 8.5 % (6.4, 9.4, 9.6) | 97.1 % (92.8, 99.3, 99.1) | | Latency, screen minus the game's present (median) | 22.35 ms | 23.51 ms | | Toggles / false toggles in the window | – | 3 / 0 (all in the 92.8 % run) | - In the 92.8 % run, the driver turned to its uneven law at +6 s with no long screen gap before it. Three toggles followed, 2 s apart, and the third turned it back at +12 s. The run was at 99.5 % after that. - One of those three toggles left a 24.03 ms screen gap; the others left 23.05 and 23.49 ms. Over whole runs (loading included, 8 runs) there were 14 toggles, none of them false, and each series of asks turned the law back within three. Each pacing switch off, in the same series (two runs each, against the PR's 97.1 %): | Switch | Share within 0.5 ms | Latency | |---|---|---| | `RX_VK_DLSSG_TOGGLE=0` | 89.5 and 99.6 % | 23.5 ms | | `RX_VK_DLSSG_HOLD_GRID=0` | 89.8 and 88.7 % | 23.5 ms | | `RX_VK_DLSSG_HOLD=0` | 54.6 and 38.6 % | 18.1 ms | | `RX_VK_DLSSG_RECT=0` | 98.9 and 99.2 % | 24.3 ms | The rectangle was measured again, three runs against three: - without it: 98.97 % (99.2, 99.3, 98.4); - with it: 97.8 % (99.8, 98.8, 94.8), where one run met an uneven-law stretch; - outside those stretches: 98.97 % without it, against 99.1 % with it. It stays on: the same evenness, with 0.8 ms less latency. The switches ship at those values: `RX_VK_DLSSG_HOLD` 13000, `RX_VK_DLSSG_HOLD_GRID` 1500 and `RX_VK_DLSSG_TOGGLE` 22000 µs, `RX_VK_DLSSG_RECT` on. `RX_VK_DLSSG` and `RX_VK_DLSSG_LAYER` ship on: each turns its part off, to compare or to get round a fault. `RX_VK_DLSSG_LAYER_CSV` ships unset: it writes what the layer sees to a file, for measuring. The new text also names switches main already has, unchanged: `LONGSHOT_PREPARE_ONLY`, `RX_VK_DLSS_DIR`, `RX_VK_DLSS_FG`, `RX_VK_FRAMEGEN`, `RX_VK_FRAMEGEN_MULT`, `RX_VK_FSR`, `RX_VK_FSR4` and `RX_VK_XESS`. The three settings were chosen from the experiment branch, on the same PC and scene: | Arm | Share within 0.5 ms | |---|---| | Streamline 2x as ported | 41 to 55 % | | + hold 13000 µs | 89.3 to 91.1 % under the even law, 36 to 45 % under the uneven one | | + line 1500 µs | 98.7 % under the even law (90.3 % without) | | + toggle (24 ms then), layer reading the law | 98.2 % (97.1 to 99.3, 3 runs) against 87.8 % (83.7 to 95.3) without | | 150 s runs: toggle against none | 98.7 % (99.0, 98.7, 98.3) against 90.6 % (99.1, 79.4, 93.2) | - **The toggle's hold, 22 ms against 24 ms.** There were 15 and 12 toggles, and every one changed the law. The screen gaps were 20.98 to 22.94 ms against 22.25 to 27.49 ms. 24 ms had failed three times, with gaps of 28 to 29 ms, so 22 ms ships. Those runs were in the driver state where its present timing follows the made frame. In the state of the series above (where it follows the game's frame), 7 of 21 toggles left the uneven law, and the next ask turned it back. - **For reference**, NGX's DLSS-G with a present queue of its own, plus two more open changes (#2183, #2184), reaches 89.3 % in the same series (89.4, 87.1 and 91.4 %). Every run of this PR is above every run of it. Its latency is 20.8 ms. **Again on 2026-11-25, after the review's fixes and the rebase on `main` `be663a08a`.** The driver was at its default settings. The same pan, 3 runs against 3, interleaved, each a timed job of the PC's queue: the fixes (`prslf`) against the head before them (`prsle`, the toggle's hold from the display's VRR floor). Every run: NGX and Streamline started, no driver event, the game in front. | | Fixes | Before the fixes | |---|---|---| | 120 Hz intervals within 0.5 ms of 8.333 ms, % | 99.10 | 99.10 | | Latency, screen minus the game's present, median, ms | 23.57 | 23.53 | | Time in the uneven law, % | 0 | 0 | | Toggles with no uneven law before them | 0 | 0 | - The uneven law did not come in these six runs, so the toggle was not put to the test here; the fixes leave the even pace as it was. - The renderer measured is the fixes before the rebase (the same code). The rebased renderer does not start in nightly-786 (`host version mismatch: host has 45, expected 48`), and this PC has no full game build at `be663a08a` yet. The rebase changes no renderer file of this PR; it ports the Streamline SDK's handling to the Rust builder (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2286): `LONGSHOT_SL_SDK`, read like `LONGSHOT_NGX_SDK`. - The toggle's hold from the display's VRR floor (HDMI EDID) ran in the game on 2026-11-24: the 48 Hz floor gives 22 ms, 2 runs against 2 at a fixed 22 ms, 99.15 % against 99.3 %. Other floors are covered by game-free tests only. - Builds: `LONGSHOT_NGX_SDK` and `LONGSHOT_SL_SDK` are unset by default. A build without them has neither DLSS nor Streamline, as on `main` without `LONGSHOT_NGX_SDK`; a build with `--upscaler dlss` and both has both. - Game-free checks after the rebase: 261 pass, 8 fail, 12 are skipped at ee61b0fd1, the 8 failing on `main` too. `test_longshot_ctl`'s `test_the_session_follows_a_relaunch` fails now and then on this PC, on `main` and on a branch that does not touch it (1 run in 3 alone): a race on `relaunched_game` in `scripts/longshot_bridge.py`, which this diff does not touch. A fix of its own is to come. ## Risks - **Streamline's loader.** Once Streamline starts, its loader takes `vulkan-1.dll`'s place for the whole run, so every Vulkan call of the renderer goes through it. It starts only when the rows ask DLSS FG at a fixed multiplier on an NVIDIA PC, in a build that has it. `RX_VK_DLSSG=0` never starts it. - **Presents.** Under Streamline the presents are made on the render thread, and the presenter thread is off. - **Latency.** Screen minus the game's present is 1.2 ms above main and 2.7 ms above NGX's DLSS FG with its own present queue: the game's present waits 13 ms. - **The toggle's gap.** Each time the driver's law turns uneven, the toggle leaves one screen gap of 21.5 to 24.2 ms (up to 30 ms while the game loads). This happens a few times a minute at most, and is bounded. - **The driver's two states.** The driver's present timing follows either DLSS-G's made frame or the game's frame. Which one is a state of the driver that changed across restarts on this PC. The reader reads both, but the shipped combination was measured only in the second state (Still to test). - **Comparing without the hold.** `RX_VK_DLSSG_HOLD=0` with the toggle on reads the uneven law most of the time. It asks 4 to 5 times a run, each ask a 28 to 31 ms screen gap. Turn the toggle off too when comparing without the hold (`upscalers.md` says so). - **The layer.** The layer adds one structure in front of the plugin's present chain. While Streamline runs, it enables `VK_EXT_present_timing`, `VK_KHR_present_id2` and calibrated timestamps on the device. `RX_VK_DLSSG_LAYER=0` leaves it out. The folder beside `longshot_vk.dll` must be writable for its manifest. - **A window without focus.** There DLSS-G through Streamline made no frames (60 presents a second, the counter at 60 FPS), where main's DLSS FG through NGX made them (120 FPS). With the focus it makes them, in a window as in full screen. - **Exit.** The exit waits up to two seconds for a present or a Reflex sleep before it shuts Streamline down. A fatal end of the renderer ends the process at once with exit code 3, before the DLLs detach, after writing the last performance summary. - **An Upscaler that cannot run here.** With a temporal Upscaler row whose engine does not run on this PC, Streamline gives up on the first game frame with the menu closed: DLSS-G and its Reflex limit go off, and the renderer's own frame generation takes over, as in a build without Streamline. Not played in the game. - **After updating:** nothing changes for a launcher build, which has no Streamline. In a build with it, the Frame generation by row's DLSS FG means Streamline (after a restart). Nothing changes in `longshot_options.ini`. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. (#2455's two commits come first here: the note at the top, merge #2455 first or with this one.) - [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 switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Screenshots of the same spot on `main` and here, for a change that shows on screen: the Insert menu's Frame generation by row, changed on `main` and here (comment below); the pacing shows in Measurements, not in a still. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. The guide's Graphics capture reviews four files this changes (`gpu/vk/menu/framegen.cpp`, `gpu/vk/vk_dlss.h`, `gpu/vk/vk_framegen.h`, `gpu/vk/vk_internal.h`). The Frame generation by row is not pictured (the capture has Frame generation Off), so the image is retained: `source-review-dbf03654.md`. Reviewed from the sources and the image, not from a new capture. `scripts/check_guide_screenshots.py --review-sources` passes. ### 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 are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
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
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]>
Port of Hookshot's pull request 1944 (its commit e2710ebb2) onto main:
https://git.notrexed.dev/Hookshot/Hookshot/pulls/1944

NVIDIA Streamline 2.14.16 on Vulkan with manual hooking: its loader in place
of vulkan-1.dll's, DLSS Frame Generation from the temporal upscaler's depth
and motion, Reflex and the latency markers through Streamline, and its
shutdown when the window closes. Built in only with LONGSHOT_SL_SDK, and
turned on by RX_VK_DLSSG=1..3 as in the port; the next commits tie it to the
Frame generation rows, drop that switch's values and add the pacing.

Under Streamline the renderer makes no frames of its own, runs no Reflex of
its own and presents on the render thread. The shutdown takes main's
QueueMutex, as dlss_fg_close does.

Co-Authored-By: j64esatxzdrhfg <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
No new row and no new choice. In a build with NVIDIA Streamline, on Windows with an NVIDIA GPU, when the saved
rows ask DLSS FG for frames (Frame generation Fixed, by DLSS FG, a temporal Upscaler) Streamline is started
before Vulkan and makes them; anywhere else, and whenever Streamline does not start or says the GPU does not
run DLSS-G, NGX's DLSS Frame Generation makes them as on main (dlssg_rules.h). A change of those rows that
starts or stops Streamline takes a restart, said on the Frame generation by row. RX_VK_DLSSG=0 never starts it;
the port's RX_VK_DLSSG=1..3 are gone.

Pacing of the game's own presents (dlssg_pace.h), each with its switch:
- RX_VK_DLSSG_HOLD: a game frame's present goes to Streamline a fixed time after the game's own present
  (13000 us at 60 fps and under, the same share of the frame above);
- RX_VK_DLSSG_HOLD_GRID: the hold counts from the line through the game's last 60 presents when the present
  is within 1500 us of it;
- RX_VK_DLSSG_TOGGLE: one present held 22000 us when NVIDIA's driver meters DLSS-G's presents unevenly (2x,
  the game near 60 fps, at Reflex's cap). The value is kToggleUs.

What reads the driver's metering is Longshot's own Vulkan layer under Streamline (vk_dlssg_layer.cpp, inside
longshot_vk.dll, its manifest written beside it): it reads when the plugin's presents reach the screen
(VK_EXT_present_timing) and passes every call through unchanged. Its reader (dlssg_law.h) asks for the toggle
after two uneven half seconds in a row, abstains when it reads too few, and bounds its asks. Without the layer,
without present timing or with RX_VK_DLSSG_LAYER=0 nothing is read and no present is held for it.

Also: Streamline gives up for the run, and the renderer goes on as without it, when a plugin's function is
missing or the GPU chosen does not run DLSS-G; DLSS-G is told where the game's picture is in the swapchain
image (RX_VK_DLSSG_RECT=0: the whole image); the instance is made without the layer when the loader refuses
it; Streamline's shutdown is the window's close when its loader is the renderer's. The diagnostics of the
investigation (probes, Reflex log, cap, queue mode, the separate present-timing log) are not ported.

A build without LONGSHOT_SL_SDK compiles vk_dlssg.cpp and vk_dlssg_layer.cpp as stubs: nothing of this runs.
nx2/build.py gives Streamline's headers to those two files alone (SL_SOURCES).

Game-free tests: tests/dlssg_rules_test.cpp (when Streamline starts), tests/dlssg_pace_test.cpp (hold, grid,
where the toggle fits), tests/dlssg_law_test.cpp (the reader's rule on synthetic times), tests/test_dlssg.py
(the code's order), and the fixtures of the checks that cut the functions changed here.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
scripts/fetch.py streamline runs scripts/sl_sdk.py (the port's: Streamline 2.14.16 from NVIDIA's release,
every file checked against its SHA-256, NVIDIA's licenses accepted as for NGX with --accept-nvidia-license),
with the development folder's sdk/sl as its default folder. nx2/make_game.py --fetch-sl-sdk no longer needs
LONGSHOT_SL_SDK (work/sl-sdk, as NGX's folder) and downloads nothing for the Linux game, where Streamline has
no runtime: a launcher passes the same arguments on both systems. The Builder drops LONGSHOT_SL_SDK from the
build's environment, as it does NGX's, FSR's and XeSS's folders: a build is with Streamline only when its
arguments ask. Nothing of NVIDIA's enters the repository.

tests/test_sl_sdk.py, tests/test_make_game_sl.py and tests/builder_cli check it without a download.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs/dev/reference/upscalers.md: when Streamline makes DLSS FG's frames, what the renderer leaves to it, the
driver's two ways of metering its presents, the hold, the grid and the toggle, Longshot's layer under it and
its pitfalls. Switches, the build (LONGSHOT_SL_SDK, fetch.py streamline), setup, and the user guide's
Frame generation by row and advanced page.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first_pixel_out the driver gives for the second present of a DLSS-G batch follows either the batch before's made
frame (from the first present's call of the batch before, near 6.6 ms: the reader's band) or its game frame, shown
8.3 ms later (near 14 to 15 ms). Which one is the driver's state, not the game's: on one RTX 4090 with driver 621.24 and
the same build, the game frame after VRR was turned off and on and again the next morning, the made frame after a
restart. In the second state the reader read nothing and no toggle was asked.

The reader now has a band for each: 5.5 to 9 ms with L2 over 0.20 ms, and 11.5 to 17 ms with L2 over 0.50 ms, which
takes only batches a 60 fps frame apart. Each half second is read in the band most of its values fall in (at least 10;
the made frame's on a tie), and an ask needs two L2 half seconds of the same band. The layer's CSV gives each half
second's band; its log says which frame the times follow, and once when the law has not been read for 30 s.

Replayed offline on the layer's CSV: the same asks as before on 41 runs in the first state; 81 asks on 16 runs in the
second, 77 of them while the screen showed L2. In the game in the second state (24/11, 7 runs): every half second read
in the game frame's band outside pauses; 7 toggles, none false, 6 of them turned the law back to even.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured on the RTX 4090 (series F and G, 24/11): with RX_VK_DLSSG_HOLD=0 and the toggle on, the
layer's reader reads the uneven law most of the time and asks 4 to 5 times a run, each a 28 to 31 ms
screen gap (54.6 and 38.6 % of the 120 Hz intervals within 0.5 ms). RX_VK_DLSSG_RECT=0 is as even
outside the uneven-law stretches (98.97 % against 99.1 %, 3 runs each) and costs 0.8 ms of latency.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
vulkan-dlss.yml (by hand) fetches Streamline's headers and licenses with scripts/fetch.py streamline --build-only, as
it fetches NGX's, and builds longshot_vk.dll with LONGSHOT_SL_SDK beside LONGSHOT_NGX_SDK and LONGSHOT_FSR: the log
must say each of the three. The imports check is unchanged: Streamline's DLLs are loaded at run time from beside
longshot.exe, not linked (a build with it imports only Windows' own, as the one measured in the game).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(upscalers): the law's reader can read off 60 fps; the game lets its ask go
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 6s
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
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
126baef741
In the game at 90 fps (2x, 24/11, RTX 4090, driver 621.24), the made image's band took the reader's values (x near
6 ms): 40 half seconds read of 136, one ask, which the game let go (Hold::toggle_fits; the layer's CSV k,...,0), so no
present was held. dlssg_law.h, dlssg_pace.h and upscalers.md said the reader read nothing off 60 fps; they now say it
can, and that the game holds only at 2x with the game at 60 fps. No code changes.

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

Tested in game: Windows 11, RTX 4090, driver 621.24, 5120x1440 240 Hz VRR HDR10; nightly-786 with this branch's renderer (built from this head's code before its rebase onto 8aa5ab876) and Streamline 2.14.16's files beside longshot.exe; saved rows Frame generation Fixed 2x by DLSS FG, DLAA before the bloom. Hyrule Field: Streamline started from the saved rows, its layer read the driver's law, on 2x with the pacing; 17 interleaved timed pans (PresentMon): 97.1 % of 120 Hz intervals within 0.5 ms against 8.5 % on main. Insert menu opened and closed twice (off then on 2x), Frame generation by changed (restart hint here, Built-in FG at once on main). Caps 30, 90 and 120: on 2x, no toggle held, nothing refused, no device lost. RX_VK_DLSSG=0: NGX's DLSS FG as on main. A focused window makes DLSS-G frames, a window without focus does not (main's NGX does). Every exit: Streamline shut down result 0, code 0.

Tested in game: Windows 11, RTX 4090, driver 621.24, 5120x1440 240 Hz VRR HDR10; nightly-786 with this branch's renderer (built from this head's code before its rebase onto 8aa5ab876) and Streamline 2.14.16's files beside longshot.exe; saved rows Frame generation Fixed 2x by DLSS FG, DLAA before the bloom. Hyrule Field: Streamline started from the saved rows, its layer read the driver's law, on 2x with the pacing; 17 interleaved timed pans (PresentMon): 97.1 % of 120 Hz intervals within 0.5 ms against 8.5 % on main. Insert menu opened and closed twice (off then on 2x), Frame generation by changed (restart hint here, Built-in FG at once on main). Caps 30, 90 and 120: on 2x, no toggle held, nothing refused, no device lost. RX_VK_DLSSG=0: NGX's DLSS FG as on main. A focused window makes DLSS-G frames, a window without focus does not (main's NGX does). Every exit: Streamline shut down result 0, code 0.
Author
Contributor

Screenshots for the checklist: the Insert menu (French), Frame generation by changed from DLSS FG to Built-in FG, in a 1920x1080 window, RTX 4090, driver 621.24, the same saved rows (Fixed 2x by DLSS FG, DLAA before the bloom).

This PR, with NVIDIA Streamline running: the row shows the restart badge and the hint, and DLSS FG keeps making frames until the restart.

Frame generation by, this PR

main (NGX), the same change: Built-in FG makes the frames at once (120 FPS, "Base 60, FG intégrée").

Frame generation by, main

Two things these show:

  • The 60 FPS in the first shot is the window without focus: DLSS-G through Streamline makes no frames there (Risks, "A window without focus"); with the focus it makes them.
  • The new hint is in English in a French menu: gpu/vk/menu_i18n.h has no line for it yet, as for other new texts. The row's own help still says it changes at once, which holds without Streamline; the badge and the hint say otherwise under it.
Screenshots for the checklist: the Insert menu (French), Frame generation by changed from DLSS FG to Built-in FG, in a 1920x1080 window, RTX 4090, driver 621.24, the same saved rows (Fixed 2x by DLSS FG, DLAA before the bloom). **This PR**, with NVIDIA Streamline running: the row shows the restart badge and the hint, and DLSS FG keeps making frames until the restart. ![Frame generation by, this PR](https://git.magicbean.dev/attachments/498648fc-0f64-4adc-ab4d-7d56208396ad) **main** (NGX), the same change: Built-in FG makes the frames at once (120 FPS, "Base 60, FG intégrée"). ![Frame generation by, main](https://git.magicbean.dev/attachments/8d4d7a01-0248-4b44-ae70-d6a0ea941f69) Two things these show: - The 60 FPS in the first shot is the window without focus: DLSS-G through Streamline makes no frames there (Risks, "A window without focus"); with the focus it makes them. - The new hint is in English in a French menu: `gpu/vk/menu_i18n.h` has no line for it yet, as for other new texts. The row's own help still says it changes at once, which holds without Streamline; the badge and the hint say otherwise under it.
Jiro113 force-pushed feat/streamline-dlssg from 126baef741
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 6s
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
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to b9276a763c
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
Website / Website builds (pull_request) Has been cancelled
Website / Website preview, build (pull_request) Has been cancelled
Website / Website preview, upload (pull_request) Has been cancelled
2026-11-25 09:59:13 +00:00
Compare
Author
Contributor

Review fixes and a rebase on main be663a08a (head b9276a763).

  • Fixed after a review of the whole diff: a temporal engine that does not run no longer leaves DLSS-G paused for the
    session; no hold without threaded rendering; an HDMI VRR block with no maximum keeps its floor; the toggle's log
    lines (an invalid value, after a give-up, repeated asks); the made-frame debt clamped at 0; the EDID read bounded by
    its own end; dead code and small duplicates; doc lines that no longer matched the code. One commit each, the first
    two with a game-free test that failed before.
  • The rebase ports the Streamline SDK's handling to the Rust builder of #2286 (LONGSHOT_SL_SDK), and CI's DLSS
    workflow to longshot-builder compile.
  • Measured again at the driver's default settings: 99.10 % within 0.5 ms, as before the fixes (Measurements, new part).
  • Out of WIP. #2455 must be merged first, or together with this PR (note at the top).
Review fixes and a rebase on `main` `be663a08a` (head `b9276a763`). - Fixed after a review of the whole diff: a temporal engine that does not run no longer leaves DLSS-G paused for the session; no hold without threaded rendering; an HDMI VRR block with no maximum keeps its floor; the toggle's log lines (an invalid value, after a give-up, repeated asks); the made-frame debt clamped at 0; the EDID read bounded by its own end; dead code and small duplicates; doc lines that no longer matched the code. One commit each, the first two with a game-free test that failed before. - The rebase ports the Streamline SDK's handling to the Rust builder of #2286 (`LONGSHOT_SL_SDK`), and CI's DLSS workflow to `longshot-builder compile`. - Measured again at the driver's default settings: 99.10 % within 0.5 ms, as before the fixes (Measurements, new part). - Out of WIP. **#2455 must be merged first, or together with this PR** (note at the top).
Jiro113 changed title from WIP: feat(vk): DLSS Frame Generation through NVIDIA Streamline, at an even pace to feat(vk): DLSS Frame Generation through NVIDIA Streamline, at an even pace 2026-11-25 10:00:27 +00:00
Jiro113 force-pushed feat/streamline-dlssg from b9276a763c
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
Website / Website builds (pull_request) Has been cancelled
Website / Website preview, build (pull_request) Has been cancelled
Website / Website preview, upload (pull_request) Has been cancelled
to ee61b0fd1e
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Blocked by required conditions
CI / longshot-builder end to end (synthetic game) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
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 builds (pull_request) Blocked by required conditions
Website / Website preview, build (pull_request) Blocked by required conditions
Website / Website preview, upload (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Failing after 7s
2026-11-25 12:36:23 +00:00
Compare
Author
Contributor

Second review pass (head ee61b0fd1, rebased on main be663a08a):

  • Fixed, each with a game-free test that failed before:
    • a fatal end of the renderer under Streamline now keeps exit code 3; it used to crash in the DLSS-G plugin at teardown (checked in the game, see Tested);
    • the layer's law reader starts again when the swapchain's time domain changes.
  • The guide's capture program has stand-ins for dlssg_active and dlssg_restart_needed. The Graphics image is retained after a source review (source-review-dbf03654.md), and check_guide_screenshots.py --review-sources passes.
  • The review's open points are settled in upscalers.md and the commit messages (Reflex's frame limit, floors outside 40 to 52 Hz, the floor read at each swapchain). The former wip(local) commit is now feat(vk).
  • History rewritten (force-pushed): three commits change content or message, the rest only their hash.
  • The rebased head's renderer did not run in the game: nightly-786's executable does not load a renderer built on be663a08a. The fixes ran on the previous base: 3 runs against 3, twice (Tested).
Second review pass (head `ee61b0fd1`, rebased on `main` `be663a08a`): - Fixed, each with a game-free test that failed before: - a fatal end of the renderer under Streamline now keeps exit code 3; it used to crash in the DLSS-G plugin at teardown (checked in the game, see Tested); - the layer's law reader starts again when the swapchain's time domain changes. - The guide's capture program has stand-ins for `dlssg_active` and `dlssg_restart_needed`. The Graphics image is retained after a source review (`source-review-dbf03654.md`), and `check_guide_screenshots.py --review-sources` passes. - The review's open points are settled in `upscalers.md` and the commit messages (Reflex's frame limit, floors outside 40 to 52 Hz, the floor read at each swapchain). The former `wip(local)` commit is now `feat(vk)`. - History rewritten (force-pushed): three commits change content or message, the rest only their hash. - The rebased head's renderer did not run in the game: nightly-786's executable does not load a renderer built on `be663a08a`. The fixes ran on the previous base: 3 runs against 3, twice (Tested).
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Blocked by required conditions
CI / longshot-builder end to end (synthetic game) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
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 builds (pull_request) Blocked by required conditions
Website / Website preview, build (pull_request) Blocked by required conditions
Website / Website preview, upload (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Failing after 7s
This pull request has changes conflicting with the target branch.
  • .circleci/shared.yml
  • docs/dev/reference/ci.md
  • docs/user/images/guide/manifest.json
  • scripts/screenshots/menu.cpp
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/streamline-dlssg:Jiro113-feat/streamline-dlssg'
git switch 'Jiro113-feat/streamline-dlssg'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!2456
No description provided.