fix(linux): a start from the Steam Deck's Game Mode no longer compiles every pipeline the preparation built #900
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
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
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!900
Loading…
Reference in a new issue
No description provided.
Delete branch "zeldaootr/Longshot:radv-vrs-key-switch"
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: Steam Deck OLED (SteamOS 3.9.5, RADV, Mesa 26.2.0-devel); Linux game-free checks · Needs: none
Why
On a Steam Deck, every start from Game Mode compiled again all 32,438 pipelines the preparation had built: about 25-30 minutes at "Loading pipelines" before the title, where a start from the desktop loaded them in about 20 seconds. Game Mode sets
RADV_FORCE_VRS_CONFIG_FILE(Steam's Half Rate Shading switch) for everything it starts, and while that file exists RADV gives every graphics pipeline another key, so neither our pipeline cache nor the driver's finds what the preparation made.The cause was measured on the Deck before the fix:
1x1(as Game Mode's does) or empty: the start compiles, about 20 pipelines a second.No issue on the tracker covers it (searched: VRS, RADV_FORCE_VRS, half rate shading, Game Mode, shader cache).
How to reproduce
Seen on: SteamOS 3.9.5 (Steam Deck OLED), RADV VANGOGH, Mesa 26.2.0-devel
Settings and switches: defaults
Steps: prepare outside Game Mode (the Builder, or a start from the desktop), then start from Steam in Game Mode. From a shell the same shows with
printf 1x1 > <scratch>/vrs-1x1.txtand a start withRADV_FORCE_VRS_CONFIG_FILE=<scratch>/vrs-1x1.txt.Expected: the precompile loads its pipelines in seconds.
Actual:
vk: noted pipelines: 6374 of 38345 pipelines in 10 s...8932 of 38345 pipelines in 130 s, about 20 a second.What changed
The game drops Game Mode's
RADV_FORCE_VRS_CONFIG_FILEbefore Vulkan loads, by default, and says so in its log.RX_VK_HALF_RATE_SHADING=1keeps it for a player who wants Steam's Half Rate Shading and accepts the compile.host/hos_main.cdriver_env_choose(), in the Linuxmainafterlongshot_env.txtis read (so the switch works from there) and before the window or anything else can load Vulkan:LONGSHOT_DRIVER_ENV_SET. That variable is for the renderer's driver cache line in the sibling PR "fix(vk): the start names the driver's shader cache ..."; with this PR alone nothing reads it.driver_env_log()ingame_main).RADV_FORCE_VRS, a rate someone set by hand, is never touched. Game Mode doesn't set it.docs/development.md's row forRX_VK_HALF_RATE_SHADING, anddocs/tested/2026-11-15-gamemode-vrs-zeldaootr-deck01.mdfor the Deck run.tests/test_driver_env_choose.pycutsdriver_env_chooseout ofhos_main.c, compiles it and runs it against a1x1file, an empty file,=0,=1, a name with no file, an empty value, no variable, andRADV_FORCE_VRSset; it also checks the call's place inmainand the log line ingame_main. The stand-in intests/display_startup_failure_test.cppfollows.Beyond the Deck:
/tmpRADV sees.hos_relaunch.c) starts again from the first environment, and that start drops it again. Processes the game starts inherit the dropped state.Measurements
Verdict: fixed. With Game Mode's variable set, the start no longer compiles: the precompile took 12.5-18.9 s and the title came in 45-51 s, against about 20 pipelines a second (25-30 minutes) before; the same as the starts without the variable.
Baseline: the Before column is an earlier Deck build of main @
aa95d35fwith other open PRs (the same caches and scene), from the session that found the cause; main itself was not run in the After session. The After column is the local integrationvrs-verify(bfc69759): main @aa95d35fwith this PR and its two siblings. Their changes don't move these numbers: one adds log lines, the other writes the cache only after a precompile of 30 s or more, and none of these starts took that long. Rebased since onto main @f637b42d: main's changes tohost/hos_main.cin between (a comment, the saves move) don't touch the driver's environment, so the numbers hold.Hardware: Steam Deck OLED, AMD Custom GPU 0932 (RADV VANGOGH), Mesa 26.2.0-devel (git-5c65d4fc31), SteamOS 3.9.5 (20261023.100), 16 GB
Scene: the start-up, up to the title; scratch game folders, each start with a fresh copy of the same warm caches; headless, defaults, the precompile at its default
Method: the start's
vk: precompile: ... in N msandvk: noted pipelines: N of M pipelines in T slines, and the time to the title. After: 4 starts interleaved a, b, b, a; with 2 runs each the median is their mean. Before: one start per arm, stopped at 150 s while compiling.How to reproduce:
printf 1x1 > <scratch>/vrs/vrs-1x1.txt; arm b setsRADV_FORCE_VRS_CONFIG_FILEto it, arm a doesn'taa95d35f(with other open PRs)d3680c96(invrs-verifybfc69759)1x1file, precompileFlags and settings
One new switch; by default the variable is dropped.
RX_VK_HALF_RATE_SHADING=1RADV_FORCE_VRS_CONFIG_FILE=11, Steam's Half Rate Shading reaches the game, and a start in Game Mode compiles its own pipelines=1checked game-free onlyLONGSHOT_DRIVER_ENV_SETRADV_FORCE_VRS_CONFIG_FILEwhen droppedTesting
Tested:
tests/test_driver_env_choose.py: fails at the test commit (08711eba,host/hos_main.c has no driver_env_choose) and passes at the fix.host/hos_main.csyntax-checked with gcc for Linux and llvm-mingw clang for Windows (stand-ins for the two generated headers it includes): no errors, as main, and no warnings in the new code with-Wall -Wextra. The Linux game build itself ran on the Deck.tests/run_all.pyon Linux: 529 passed, 18 failed, 79 skipped (tools this PC lacks), 8 at once, on this PR merged with its two siblings onto main @f637b42d. The 18 fail the same way on main @f637b42drun alone:test_appimage_player_build,test_bake_portability,test_crash_dialog,test_crt_options,test_env_on,test_lift_cache,test_lift_cleanup_error,test_linux_preflight,test_linux_update,test_make_game_cache,test_missing_nup,test_mods_size_table,test_options_budget_once,test_pipeline_tour,test_readback_late,test_vk_occlusion_queries,test_vk_pgo,test_walk_key. The checks that read this PR's files pass, among themtest_driver_env_choose,test_driver_cache_env,test_precompile_save,test_pipeline_cache_save,test_prepare_stall,test_display_startup_failureandtest_tested_configurations.Not tested:
RX_VK_HALF_RATE_SHADING=1in the game (the start then compiles, as before this PR; the game-free check covers that the variable is kept and the log says so); a start through Steam in Game Mode itself, rather than the variable set by hand (Game Mode's session sets the same variable to a file holding1x1, which is what arm b set).Must be tested: None.
Risks
What could break: Steam's Half Rate Shading no longer reaches Longshot unless
RX_VK_HALF_RATE_SHADING=1. A player whose caches were last written by a start in Game Mode may have them under the VRS keys only, and then compiles the noted pipelines once more after updating.Turning it off:
RX_VK_HALF_RATE_SHADING=1inlongshot_env.txtor the environment.Compatibility: the pipeline keys in Game Mode become those of every other start, so the caches the preparation made are found. Nothing is translated again; saves,
longshot_options.iniand the vk ABI are unchanged.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.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.