feat(vk): DLSS Frame Generation through NVIDIA Streamline, at an even pace #2456
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2456
Loading…
Reference in a new issue
No description provided.
Delete branch "Jiro113/Longshot:feat/streamline-dlssg"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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).
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, andslIsFeatureSupportedto agree. Otherwise everything runs as onmain. 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=0keeps NGX.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.
RX_VK_DLSSG_HOLD). When the present iswithin 1.5 ms of a line fitted through its last 60 presents, it is held to that line (
RX_VK_DLSSG_HOLD_GRID).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 gameholds one present for 22 ms, which turns it back (
RX_VK_DLSSG_TOGGLE). This is bounded: three asks in a row, thensilences that double, and six a minute at most.
python -I scripts/fetch.py streamline --accept-nvidia-license [--game <game folder>]fetches NVIDIAStreamline's SDK the way NGX's is fetched (SHA-256 checked);
--gameputs its runtime in that game folder.longshot-buildercompiles DLSS FG through Streamline only for a Windows build with--upscaler dlssand adeveloper's
LONGSHOT_SL_SDK=<sdk folder>, and downloads nothing of it. A build withoutLONGSHOT_SL_SDKcompilesnone of it and behaves as main.
vulkan-dlss.ymlbuilds 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-revchanged), with Streamline 2.14.16's seven files besidelongshot.exe. Saved rows: Frame generationFixed 2x by DLSS FG, Upscaler DLSS at native (DLAA) before the bloom.
Streamline started for DLSS Frame Generationand4 images;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).own present queue, three times each, and each pacing switch off twice (Measurements).
off (the Insert menu is open)on each opening,on, 2xon each closing;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.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).
HOS_FPS_MAX), full screen:on, 2xeach time; the layer saw 60, 180 and up to 225 presents a second;ran at 102 to 110 fps;
holds only at 60 fps (
k,...,0in the layer's CSV;upscalers.mdnow says the reader can read there);Streamline shut down for the exit (result 0), no two-second wait, and thegame 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: novk: Streamlineline; NGX's DLSS FG made 600 of the last 600presents in Hyrule Field; 59.8 to 60.8 fps; exit in 1.07 s.
LONGSHOT_SL_SDKon Windows, and on Linux (RX_VK_ONLY=1, Ubuntu 22.04 withtools.lock's clang, without it) at
126baef74, with no warning. The layer's manifest andsl.interposer.dllarereached 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.pyon Windows (llvm-mingw): every check that fails here fails on main8aa5ab876on 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);test_dlssg.py,test_dlssg_pace.py(which builds and runsdlssg_rules_test.cpp,dlssg_pace_test.cppanddlssg_law_test.cpp),test_sl_sdk.py,test_dlssg_fatal_end.py.cargo test -p build-compile -p build-driver: the failures aremain's own on this PC (2 and 7); the two newtests 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.
nightly-786, RTX 4090, driver 621.24. The rebased head's renderer does not load in nightly-786's
longshot.exeanddid not run in the game.
teardown, exit code 0xC0000409 after about 12 s; with it exit code 3 in under 1 s, the FATAL line last in the log.
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:
even (by hand).
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).
does not go through it in this runline,then the game as without Streamline (by hand).
@Beanstalkonce abuild with Streamline exists on the farm).
vulkan-dlss.yml: the back end builds with NGX, Streamline and FSR 4 (by hand, a maintainer: Run workflow).changed domain).
scripts/screenshots/check_menu_capture.pyon 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:
+59.5 s from the pan's start.
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.
8aa5ab876, from the code of126baef74(since then only comments,docs and CI changed).
8aa5ab876(NGX DLSS-G)126baef74(Streamline)followed, 2 s apart, and the third turned it back at +12 s. The run was at 99.5 % after that.
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 %):
RX_VK_DLSSG_TOGGLE=0RX_VK_DLSSG_HOLD_GRID=0RX_VK_DLSSG_HOLD=0RX_VK_DLSSG_RECT=0The rectangle was measured again, three runs against three:
It stays on: the same evenness, with 0.8 ms less latency.
The switches ship at those values:
RX_VK_DLSSG_HOLD13000,RX_VK_DLSSG_HOLD_GRID1500 andRX_VK_DLSSG_TOGGLE22000 µs,
RX_VK_DLSSG_RECTon.RX_VK_DLSSGandRX_VK_DLSSG_LAYERship on: each turns its part off, to compare orto get round a fault.
RX_VK_DLSSG_LAYER_CSVships unset: it writes what the layer sees to a file, for measuring. Thenew 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_FSR4andRX_VK_XESS.The three settings were chosen from the experiment branch, on the same PC and scene:
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.
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
mainbe663a08a. The driver was at its defaultsettings. The same pan, 3 runs against 3, interleaved, each a timed job of the PC's queue: the fixes (
prslf) againstthe 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.
pace as it was.
nightly-786 (
host version mismatch: host has 45, expected 48), and this PC has no full game build atbe663a08ayet. 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 likeLONGSHOT_NGX_SDK.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.
LONGSHOT_NGX_SDKandLONGSHOT_SL_SDKare unset by default. A build without them has neither DLSS norStreamline, as on
mainwithoutLONGSHOT_NGX_SDK; a build with--upscaler dlssand both has both.ee61b0fd1, the 8 failing onmaintoo.test_longshot_ctl'stest_the_session_follows_a_relaunchfails now and then on this PC, onmainand on a branchthat does not touch it (1 run in 3 alone): a race on
relaunched_gameinscripts/longshot_bridge.py, which thisdiff does not touch. A fix of its own is to come.
Risks
vulkan-1.dll's place for the whole run, so everyVulkan 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=0never starts it.queue: the game's present waits 13 ms.
(up to 30 ms while the game loads). This happens a few times a minute at most, and is bounded.
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).
RX_VK_DLSSG_HOLD=0with the toggle on reads the uneven law most of the time. Itasks 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.mdsays so).VK_EXT_present_timing,VK_KHR_present_id2and calibrated timestamps on the device.RX_VK_DLSSG_LAYER=0leavesit out. The folder beside
longshot_vk.dllmust be writable for its manifest.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.
end of the renderer ends the process at once with exit code 3, before the DLLs detach, after writing the last
performance summary.
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.
generation by row's DLSS FG means Streamline (after a restart). Nothing changes in
longshot_options.ini.Checklist
Ready for review
main; the title is a Conventional Commit. (#2455's two commits come first here: thenote at the top, merge #2455 first or with this one.)
mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen: the Insert menu's Framegeneration by row, changed on
mainand here (comment below); the pacing shows in Measurements, not in a still.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 Framegeneration Off), so the image is retained:
source-review-dbf03654.md. Reviewed from the sources and the image, notfrom a new capture.
scripts/check_guide_screenshots.py --review-sourcespasses.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
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.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.
main (NGX), the same change: Built-in FG makes the frames at once (120 FPS, "Base 60, FG intégrée").
Two things these show:
gpu/vk/menu_i18n.hhas 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.126baef741b9276a763cReview fixes and a rebase on
mainbe663a08a(headb9276a763).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.
LONGSHOT_SL_SDK), and CI's DLSSworkflow to
longshot-builder compile.WIP: feat(vk): DLSS Frame Generation through NVIDIA Streamline, at an even paceto feat(vk): DLSS Frame Generation through NVIDIA Streamline, at an even paceb9276a763cee61b0fd1eSecond review pass (head
ee61b0fd1, rebased onmainbe663a08a):dlssg_activeanddlssg_restart_needed. The Graphics image is retained after a source review (source-review-dbf03654.md), andcheck_guide_screenshots.py --review-sourcespasses.upscalers.mdand the commit messages (Reflex's frame limit, floors outside 40 to 52 Hz, the floor read at each swapchain). The formerwip(local)commit is nowfeat(vk).be663a08a. The fixes ran on the previous base: 3 runs against 3, twice (Tested).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.