fix(vk): Frame generation by offers DLSS FG, not Auto #1041
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1041
Loading…
Reference in a new issue
No description provided.
Delete branch "pmwork-personal/Longshot:fix/fg-provider-row"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: fix · Risk: low · Tested on: Windows 11, game-free checks; in game: two runs each (RTX 5090) · Needs: Windows RTX 40/50 by hand; an AMD or Intel GPU; Linux with an NVIDIA GPU
Why
The Insert menu's Frame generation by row offered only Auto and Built-in FG, and Auto's text named whoever made
the last frames. The game's own menus (the title screen, the file select, movies) give NVIDIA DLSS Frame Generation no
Upscaler picture to make frames from, so the built-in one made theirs. A player who opens the Insert menu there reads
"Auto: Built-in FG" and thinks Auto chose the built-in one, with no way to choose DLSS FG: the report on Discord (an RTX
4080 Super on v3.0.0-rc.4) saw exactly that after several restarts, while the FPS counter in play said DLSS FG. Players
asked for DLSS FG as a choice of its own, in place of Auto, and for no silent fall back to the built-in one.
A second report on Discord (an RTX 5080 on nightly-287) found that the row offered DLSS FG only once play started. NGX is
asked about frame generation only by
dlss_fg_frames()(at the first frame-generation set, Frame generation 2x or more)and
dlss_fg_inputs()(at the first frame with DLSS inputs, in play, whatever Frame generation is). So a player whostarts with Frame generation Off gets NGX's answer only once play starts: in that log, "DLSS Frame Gen (NGX): available,
up to 5 made frames" comes right after the first DLSS feature is made, in play, at frame 1230. With Frame generation on
from the start, main asks at the start-up screen too (in the author's run at 3x, before the title screen), but its row
still named the built-in one until DLSS-G had inputs in play. At the end of that run, of the last 600
presents 528 were made by DLSS-G and 64 by the built-in one without new inputs (the game's own menus, the case this PR
now shows as the game's frames alone).
Addresses #408: on an RTX 4090 the FPS counter changed from "DLSS FG" to the built-in one each time the game's pause or inventory menu opened, and back when it closed. DLSS-G has no Upscaler picture to make frames from there, so it cannot stay on; with this PR it no longer falls back without a word: those screens show the game's own frames, and the row and the counter say "DLSS FG paused".
Another player's log shows the same on main @
e4d035e9(nightly-325), RTX 5060 Ti, NVIDIA 621.24, Frame generation 3x.In play, DLSS drew 600 of each 600 frames and DLSS-G made 600 of each 600 presents, for about 4 minutes. In the pause menu,
DLSS drew nothing, and the renderer's own made 600 of each 600 presents "without new inputs (no DLSS/DLAA this frame)",
at 3x: once for about 70 s, then for the last 4.5 minutes of the log. The player read this as frame generation that works
in the menus and in play. With this PR, play does not change, and those menu screens show the game's own 60 fps.
How to reproduce
Seen on: Windows 11, RTX 4080 Super, newest driver, v3.0.0-rc.4 (a player's report); main @
53f96d78on Windows 11, RTX 5090Settings and switches: Upscaler NVIDIA DLSS or DLAA, Frame generation 2x to 4x, Frame generation by at its default (Auto)
Steps: start the game; at the title screen, open the Insert menu, Graphics tab, Frame generation by. Then load a save and open it again in play.
Expected: the row names the choice, DLSS Frame Generation, which makes the frames in play, and says what happens where it cannot make them
Actual: the row reads "Auto: Built-in FG" at the title screen and "Auto: DLSS FG" in play; its only other value is Built-in FG, and the built-in one makes the title screen's frames. The log at the title screen:
What changed
The row is now the choice itself: DLSS FG (the default) and Built-in FG, with no Auto. DLSS FG is offered only
where it runs: NGX is asked once a run, at the start-up screen and when the menu opens, and where it cannot run the row
has Built-in FG alone and its line says why. At DLSS FG, the game's own menus, movies and loading screens now show the
game's own frames only, not the built-in one's, and the row's line and the FPS counter say "DLSS FG paused"; play is as
before.
tx_framegen_by()ingpu/vk/vk_menu.cppnames the choice (DLSS FG or Built-in FG), not who made the lastframes;
framegen_by_fixed()and arow_fixed()clause keep the row at Built-in FG where DLSS FG cannot run (the savedvalue is kept) and at DLSS FG with
RX_VK_DLSS_FG=1;hn_framegen_by()says "DLSS FG cannot run: " (DLSS's ownreason, shared with the Upscaler row through the new
dlss_why_text()), "DLSS FG paused: ..." where the sets are thegame's alone, and "Not DLSS FG now: " when another makes the frames, every line among the variants
measure_help()makes room for;framegen_maker_name()gives the FPS counter "DLSS FG paused". The menu's open andprobe_upscalers_soon()calldlss_fg_probe()afterdlss_probe().dlss_fg_unavailable()ingpu/vk/vk_dlss.cppsays, without a lock, why DLSS-G cannot run for the rest of therun;
dlss_fg_probe()asks NGX once under the Fg lock, asdlss_fg_frames()does;fg_start()marksansweredateach return, so the menu never reads its "until NGX says yes" state as a no;
dlss_fg_holds()is true at DLSS FG, on atemporal Upscaler (
temporal_wanted()), where the game asked for no gameplay upscale in this frame or the two before(the new
temporal_scene_now()ingpu/vk/vk_temporal.cpp, a frame numbertemporal_upscale()stamps before anyengine runs), for a set skipped for no Upscaler picture: the game's own menus, movies and loading screens. In play the
game asks every frame, so an Upscaler that draws nothing there (failed, refused, not this frame) leaves the sets to the
built-in one, as before;
dlss_fg_forced()tells the rowabout
RX_VK_DLSS_FG=1.framegen_record()ingpu/vk/vk_framegen.cppleaves such a set the game's frame alone (neitherFSR 3.1's frames nor the built-in one's), noted as the new
FgMaker::DlssPaused.report_default()loses its "Auto" name for this row; with nothing to choose the row is never a change.gpu/vk/menu_i18n.h.scripts/screenshots/menu.cpp: stand-ins for the new calls.tests/test_framegen_by_row.py(new);tests/present_source_crop_test.cppruns a held set through the realframegen_record();test_bug_report_defaults.py,test_upscaler_rows.py,test_menu_keys.pyandtest_crt_options.pyfollow the code.Measurements
Verdict: two runs each, interleaved (main, this PR, main, this PR). The title screen is as designed in both pairs: main shows about 54.6 of the game's frames a second with 2 built-in frames each, this PR the game's own alone at about 164.8 a second (V-Sync's 165 Hz), with the row and the counter as the test expects (the author's reading of the first pair: "As expected"). In play DLSS-G makes 600 of 600 frames on both builds in both pairs. The game's frame rate in play is not shown to differ: 47.0 against 47.2 in the first pair; 45.3 against 42.1 in the second, where this PR's run stood at another spot of the same map with 11% more draws a frame (3167 against 2860), so that pair's play numbers do not compare. The change acts only where DLSS-G has no Upscaler picture (the title screen, the game's menus, movies and loading); in play it changes nothing by design, and DLSS-G made all the frames in all four runs.
Measured at
6863feb4on main1764fed2. The PR was then rebased onto maine4d035e9(5 commits: an audio output device row, the mouse inversion, the render thread's core, docs, CI) with no change to its own code; the numbers hold, as none of those commits touches frame generation, the Upscaler or this row, and the render thread's change acts on both columns alike. After the measurements a self-review made the pause stricter (76f1d3c8: only where the game asks for no gameplay upscale, in place of "the Upscaler did not fail for good"); for the measured title screen and play it changes nothing (the title screen asks for none; in play DLSS-G had its inputs on every set), and the game's pause screen was not measured again with it.Hardware: Windows 11, RTX 5090, driver 621.24, Ryzen 7 9800X3D; a 5120x2160 display at 165 Hz
Scene: the title screen, then the same save in play in Market_Child; 5120x2160, Upscaler NVIDIA DLAA (preset M, 5120x2160), Frame generation 3x, Frame generation by at its default, V-Sync On, NVIDIA Reflex as set
Method: one options file for every run (the author's own); the game's frame rate from longshot_log.txt's
N presents, X fpslines (the game's own frames, about every 2 seconds; the title screen's windows before play, the play windows with more than 2500 draws a frame); DLSS-G's 600-present lines; the row's text read with the control bridge (option get frame_generation_by). First pair by hand: the author's run of each build. Second pair driven by the control bridge (scripts/longshot_ctl.py): the title screen for 10 s, A until play, 60 s standing still, the game's pause screen for 5 s, quitHow to reproduce: a dev runtime of each commit on one base with the same options file and save (scripts/dev_packs.py); the second pair's route as in Method
1764fed21764fed2)(The 600-present line's "the renderer's own made the rest" is main's text; in this PR, at DLSS FG on a temporal Upscaler, those "without new inputs" sets are the game's frames alone, as the presents' rate shows.)
In the second pair this PR's run went from the title screen into play by itself, 23 s after the start, with no input from the bridge (the log shows none) and at another spot of the save's map than main's run, which needed 5 presses of A. Why is not proven: it was not the game's Skip title screen (off in this options file) and not the bridge (its first press came after play began); the intro movie stopped after 9 s where main's ran 28 s, as a button press stops it, while two controllers were connected and the game's window was in front.
Screenshots
From headless runs (
HOS_HEADLESS,RX_VK_SHOT_MENU=1, the menu walked byRX_VK_MENU_SCRIPT) with the same options file: no window, so no V-Sync and no frame generation. The counter's numbers in them are not a player's, and the row's line is the choice's own, not the title screen's "DLSS FG paused" or main's "Auto: Built-in FG" (those were read on screen: Testing). The menu was opened during the game's intro.The pictures are in this comment (two pairs, captioned like the Measurements columns, each marked headless): the row and its line,
Auto | Built-in FGbefore andDLSS FG | Built-in FGafter, and the title screen with the counter.Flags and settings
A menu row's values and what DLSS FG does in the game's own menus change.
frame_generation_by=)RX_VK_DLSS_FG=1Testing
Tested: game-free checks on Windows 11 (llvm-mingw):
tests/test_framegen_by_row.py(fails on main, passes here),tests/test_present_source_crop.py(a held set: the game's frame alone, no FSR 3.1 or built-in passes),tests/test_bug_report_defaults.py(its two cases for this row pass; its auto-profile case, "Auto-controlled shadow_res missing", fails on main too),test_menu_i18n.py,test_dlssg_runtime.py,test_vsync_row.py,test_upscaler_rows.py,test_menu_keys.py,test_readme_menu_rows.py,test_menu_sections.py,test_framegen_preset.py;tests/run_all.pyon this head (76f1d3c8, on maine4d035e9): 598 passed, 22 failed, 44 skipped; main @e4d035e9on the same PC: 592 passed, 27 failed, 44 skipped. Every failure here fails on main too (test_auto_handheld, test_bug_report, test_bug_report_defaults, test_crash_dialog, test_crt_options, test_finish_output, test_fsr_uniform_ownership, test_guest_imported, test_hardware_report, test_import_reach, test_linux_preflight, test_make_game_cache, test_missing_nup, test_pads_after_menu, test_parallel_init_order, test_pending_guest_import, test_portable_builder_startup, test_replay_write_order, test_run_all_changed, test_tested_configurations, test_vk_occlusion_queries, test_walk_key); main's others failed only under the full run's load.test_crt_options.pyfails on main at its ownkVramBudgetscut; it gets the stand-in for this PR'sframegen_by_fixed()so it compiles once that is fixed. The game and the renderer build with NVIDIA DLSS on Windows (dev packs of this change on1764fed2(measured) and of this head one4d035e9).In game: two runs of main @
1764fed2and two of this PR @6863feb4, interleaved, on Windows 11, RTX 5090, driver 621.24, from one base with the same options file and save; the first pair by hand, the second driven by the control bridge (Measurements). The bridge read the row: main "Auto: Built-in FG" at the title screen and "Auto: DLSS FG" in play, this PR "DLSS FG" at the first screen, the title screen and in play. The author's reading of the title screen on both builds (the row, its line and the FPS counter, steps 0 and 1 of the test), asked "At the title screen, did the row and FPS counter show what the test file said?": "As expected". The test expects main's "Auto: Built-in FG" with "Base N, Built-in FG", and this PR's "DLSS FG" with "DLSS FG paused: ..." and "Base N, DLSS FG paused". In play, on the game's pause screen and with Built-in FG chosen (steps 2 to 5) there are no separate readings: the logs and the bridge only (Measurements). Pictures of the row and its line on each build come from headless runs (RX_VK_SHOT_MENU), without frame generation.Not tested: play at the same spot on both builds (the second pair's runs stood at different spots); Built-in FG chosen in the menu, in a run; an AMD or Intel GPU (the row with Built-in FG alone and "DLSS FG cannot run: DLSS and DLAA: need an NVIDIA RTX GPU."); an RTX 20 or 30 (DLSS yes, frame generation no); Linux.
docs/images/guide/settings-graphics.pngstill shows the row as "Auto | Built-in FG": its capture tool runs on Linux only (to do, see Risks).Must be tested:
docs/images/guide/settings-graphics.pngwithscripts/screenshots/capture_menu.py(Linux only), expecting the row to read "DLSS FG | Built-in FG" where it now shows "Auto | Built-in FG" (by hand: a tester with Linux)Risks
What could break: NGX is now asked about frame generation at the start-up screen on every NVIDIA GPU DLSS runs on, also with Frame generation Off (before: at the first frame-generation set at 2x or more, or, with Frame generation Off, at the first frame with DLSS inputs in play, as in the RTX 5080 report); a driver whose NGX misbehaves on that question would meet it at the start. At DLSS FG, any frame where the game asks for no gameplay upscale (its menus, movies and loading screens, in play too) is now shown without made frames, at the game's own rate; a frame where it asks for one but the Upscaler draws nothing keeps the built-in one, as on main. The Guide's Graphics image goes stale (
scripts/check_guide_screenshots.py --review-sourcesalready asks for a review on main; this adds the fixture andvk_dlss.h).Turning it off: RX_VK_DLSS_FG=0 (no DLSS-G for the run, and no question), Built-in FG on the row (the built-in one everywhere, as before), or revert the commit.
Compatibility: longshot_options.ini keeps its key and numbers: a 0 from before (Auto) is DLSS FG where it runs, else Built-in FG, as before; 1 stays Built-in FG. An older build reads this one's 0 as Auto. No change to saves, the caches or the vk ABI (
gpu/vk/vk_api.huntouched). The changed texts were translated by the author with AI help in all 13 languages: a native speaker's look is welcome.Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.docs/tested/for each new measured run (format indocs/tested-configurations.md).mainand passing here.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
The row had two values, Auto and Built-in FG. Auto's text named who made the last frames ("Auto: Built-in FG"), and the game's own menus (the title screen, the file select, movies) give DLSS Frame Generation no Upscaler picture, so the built-in one made their frames. A player who opened the Insert menu there read that Auto had picked the built-in one, and DLSS FG was in none of the row's choices. Now the row is the choice itself: DLSS FG (0, the default, the old Auto's number, so an options file from before keeps it) and Built-in FG (1). DLSS FG is offered only where it runs: NGX is asked once a run at the start-up screen and when the menu opens (dlss_fg_probe), and dlss_fg_unavailable says why not for the run (no NVIDIA DLSS in the build, DLSS not running here with dlss_why's reason, RX_VK_DLSS_FG=0, NGX's no, its feature given up). There the row has Built-in FG alone (row_fixed, the saved value kept) and its line says "DLSS FG cannot run: <why>". RX_VK_DLSS_FG=1 fixes it at DLSS FG for the run and says so. At DLSS FG on a temporal Upscaler, a set with no picture from it (the game's own menus, movies, loading screens) is the game's frame alone, not FSR 3.1's or the built-in one's (dlss_fg_holds): the row's line and the FPS counter say "DLSS FG paused". Play is as before: its sets have the Upscaler's picture, and with an Upscaler that is not temporal the built-in one still makes the frames ("Not DLSS FG now: <why>"). The bug report no longer names an Auto default. Co-Authored-By: Claude Opus 5.5 <[email protected]>The earlier check, an Upscaler that failed for good (temporal_failed), missed the states where it gives no inputs in play without failing for good: a DLSS feature NGX refused, no DLSS mode for the render size, a frame it skipped. At DLSS FG those sets showed the game's frame alone in play. The test is now whether the game asked for its gameplay upscale in this frame or the two before (temporal_scene_now, a frame number temporal_upscale stamps before any engine runs). The game's own menus, movies and loading screens ask for none: their sets stay the game's frames alone ("DLSS FG paused"). In play the game asks every frame, so an Upscaler that draws nothing leaves the sets to the built-in frame generation, as on main. Co-Authored-By: Claude Opus 5.5 <[email protected]>Tested in game: Windows 11, RTX 5090, NVIDIA 621.24, 5120x2160 at 165 Hz, DLAA, Frame generation 3x, V-Sync On: dev runtimes of main
1764fed2and of this PR at 6863feb4 on one base, two runs each (by hand and through the control bridge). Title screen: Frame generation by reads DLSS FG with its line 'DLSS FG paused: ...', the FPS counter 'DLSS FG paused', the game's own frames only (about 165 a second, none made); main reads 'Auto: Built-in FG'. In play DLSS-G made 600 of 600 frames on both. The stricter pause check of76f1d3c8was built and checked game-free, not yet run in the game.Screenshots for the description's Screenshots section, from headless runs (
HOS_HEADLESS,RX_VK_SHOT_MENU=1, the Insert menu walked byRX_VK_MENU_SCRIPT) with the same options file as the measured runs.Headless means no window, so no V-Sync and no frame generation: the FPS counter's numbers here are not a player's and name no frame maker, and the row's line is the choice's own, not the title screen's "DLSS FG paused" or main's "Auto: Built-in FG" (those were read on screen in a window: see Testing). The menu was opened during the game's intro.
Frame generation by, selected, with its line
1764fed2(headless)The title screen and the FPS counter
1764fed2(headless)Possibly related, for context:
@Beanstalk Linux with an NVIDIA RTX 40 or 50 (DLSS Frame Generation): build this PR's branch and start the game with Upscaler NVIDIA DLSS or DLAA, Frame generation 2x or more, Frame generation by at its default, and the FPS counter on.
Please report the GPU, driver and distribution, a screenshot of the row at the title screen and one in play, and the log's "DLSS Frame Gen (NGX)" lines.
@pmwork-personal only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it.This request was for76f1d3c, and the PR has changed since (6c52fe5), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.Code review only (read at
76f1d3c8; nothing built or run here). The change does what Why and What changed say. The menu, the probe, the pause and the bug report's defaults read right. The lock order is new but consistent:menu_ticknow takesg.muunderpresent_image_mu, and I found no path that takesg.muordev.present_mufirst and thenpresent_image_mu. The live line's buffers are sized for every variant. All 13 tables keep%sin the new texts.Blocking
tests/test_framegen_by_row.pyhas a brace counter of its own (block(), line 44). AGENTS.md says a new check cuts withtests/srccut.py(block,between). That one names the source and marker when a marker is missing or appears twice, and here several markers would silently cut the wrong span if they appeared twice. Please move the check tosrccut.block(andfoundwhere it cuts by regex).Suggestions
dlss_fg_close()(vk_dlss.cpp:1161) returns at!fg_asked(), which the probe now reaches often. Before this PR,g.paramswas allocated only once DLSS-G was asked for. Nowdlss_fg_probe()allocates it at the start-up screen on every NVIDIA GPU where DLSS-G is available, also with Built-in FG chosen or Frame generation Off. A player at Built-in FG then exits withg.paramsnever destroyed andg.closednever set. A start-up probe still running at a fast exit is then not stopped byclosed. Dropping that early return, or closing wheneverg.params || g.feature, would cover both.76f1d3c8(temporal_scene_now) has also not been run in the game, as Testing says. The pause screen and a movie are the cases worth a run, since a game frame that asks for no upscale in play would now pause too.temporal_scene_now()allows 2 frames. Each time play gives way to a menu, the first 2-3 sets still go to the built-in one before the pause starts. That is fine, but the FPS counter's majority over 64 sets will show Built-in FG for a moment. Worth a word in the comment if it is meant.Overlap
framegen_by == 2to the same row,fg_askedandframegen_record. This PR'stx_framegen_byreads any non-0 as "Built-in FG", andframegen_by_fixed()would fix the row at Built-in FG over a saved 2. Whichever lands second has to rework the row. I'd take this one first, since it changes the row's meaning.Not approved: the PR is WIP, and its Must be tested runs (Built-in FG chosen in play on RTX 40/50, AMD/Intel, Linux NVIDIA) aren't posted yet.
🤖 Generated with Claude Code
@ -0,0 +41,4 @@raise SystemExit("FAIL: " + why)def block(text, marker):A brace counter of its own: AGENTS.md asks a new check to cut with tests/srccut.py (block, between), so a missing or doubled marker stops with one message naming it.
WIP: fix(vk): Frame generation by offers DLSS FG, not Autoto fix(vk): Frame generation by offers DLSS FG, not Auto