fix(vk): Auto settings take SteamDeck=1 as a handheld only on an integrated GPU #559

Merged
HumanBean merged 2 commits from zeldaootr/Longshot:auto-steamdeck-flag-discrete-gpu into main 2026-11-15 18:40:05 +00:00
Contributor

Type: fix · Risk: low · Tested on: Linux x86-64 (game-free check) · Needs: Linux desktop with a discrete GPU in Steam's Gaming Mode; Steam Deck (unchanged case)

Why

On a desktop PC with a graphics card, running the game from Steam's Gaming Mode (Big Picture on SteamOS-like systems such as Bazzite) makes Auto (this PC) pick the Steam Deck's lowest settings, because Steam sets SteamDeck=1 there too.

How to reproduce

Seen on: Linux x86-64, game-free (the real auto_profile choice with a stand-in GPU); in the game it needs a desktop in Steam's Gaming Mode, which nobody has run yet
Settings and switches: a first start (no longshot_options.ini), Quality preset Auto (this PC); SteamDeck=1 in the environment, as Steam's Gaming Mode sets it
Steps: on main aa95d35f with this PR's test added (57edd6c3), run python -I -B tests/test_auto_handheld.py; in the game, start from Gaming Mode on a desktop with a discrete card and read the vk: Auto (this PC) lines in longshot_log.txt
Expected: an RX 7900 XTX gets tier 5 and an RX 6600 tier 3, as on the desktop
Actual: both are taken for a handheld: handheld 1 (want 0), tier 1 (want 5): handheld: Minimum

What changed

Auto (this PC) now takes SteamDeck=1 as a handheld only when the GPU is integrated, so a desktop card under Gaming Mode gets its own tier; the Deck is still known by its APU's names.

  • vk: auto_profile() in gpu/vk/vk_main.cpp counts SteamDeck=1 as a handheld only when the GPU is integrated; the Deck's own APU names (Custom GPU 0405, Custom GPU 0932) still count on their own.
  • tests: tests/test_auto_handheld.py runs the real auto_profile choice for an RX 7900 XTX and an RX 6600 with and without SteamDeck=1, the Deck itself, and another integrated GPU under Gaming Mode.

Measurements

Verdict: fixed in the game-free test (2 of 2 desktop cards under SteamDeck=1 taken for a handheld on main, 0 with this PR, two interleaved rounds); not yet seen in the game: waiting for test request T-WX8A.

Hardware: Linux x86-64 server (Ubuntu 24.04), no GPU or game used; gcc 13.3, clang 23.1.5
Scene: no game: the game-free check
Method: python3 -I -B tests/test_auto_handheld.py at the test-only commit 57edd6c3 (main aa95d35f plus the test) and at f6b7e719, twice each, alternating
How to reproduce: check out each commit and run the command above

Before: main @ aa95d35f (with the test, 57edd6c3) After: this PR @ f6b7e719
desktop cards under SteamDeck=1 taken for a handheld, of 2 (both rounds the same) 2 0
57edd6c3 r1: FAIL RX 7900 XTX under Steam's Gaming Mode (SteamDeck=1): handheld 1 (want 0), tier 1 (want 5): handheld: Minimum; the game's own upscaler
57edd6c3 r1: FAIL RX 6600 under Steam's Gaming Mode (SteamDeck=1): handheld 1 (want 0), tier 1 (want 3): handheld: Minimum; the game's own upscaler
f6b7e719 r1: ok   RX 7900 XTX under Steam's Gaming Mode (SteamDeck=1): tier 5 (24560 MB of video memory: tier 5; the game's own upscaler)
(round 2 the same on both commits)

Flags and settings

None

Testing

Tested: Linux x86-64, game-free. The new test fails on the test-only commit 57edd6c3 and passes at f6b7e719 (this branch rebased onto main aa95d35f), twice each, alternating, and under tests/run_all.py with g++ 13.3 and with clang 23.1.5 as CXX at both commits. At the tip, the 32 checks that read gpu/vk/vk_main.cpp or the new test: 29 passed, 2 skipped, and test_appimage_player_build failed as it does on main aa95d35f. Before the rebase the same at e995566f and 9762f1a6 (main 7ff5256e).

Not tested: The case fixed, in the game: a desktop with a discrete card under Steam's Gaming Mode (this PC has no Gaming Mode session). The unchanged case on a Steam Deck (still Minimum).

Must be tested:

  • Linux desktop with a discrete AMD or NVIDIA card, in Steam's Gaming Mode (Bazzite, gamescope-session): back up and delete longshot_options.ini, start the game from Gaming Mode, expecting the vk: Auto (this PC) lines in longshot_log.txt to name the card's tier, not handheld or Minimum (by hand, test request T-WX8A: post those lines, SteamDeck from the launch environment, the GPU and OS)
  • Steam Deck: the same first start, expecting the vk: Auto (this PC) lines still to say Minimum (by hand, T-WX8A)

Risks

What could break: a handheld whose GPU Vulkan reports as discrete, or another handheld that relies on SteamDeck=1 alone with a discrete-typed GPU, would now get desktop settings from Auto. The Deck itself is matched by its APU name as before.

Turning it off: revert the commit; a player can always pick a preset by hand.

Compatibility: only a first start's Auto choice changes, on a desktop under Gaming Mode; an existing longshot_options.ini keeps its settings.

Issues

None filed. Conflicts in intent with #225 (a Steam Deck profile, on by itself on a Deck), also open: the two should be read together and one chosen (or reconciled) before either merges.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main. Onto main aa95d35f, no conflict; the test and fix commits are the same changes as before (git patch-id).
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named). The full suite on main aa95d35f (Linux, g++ 13.3, the Vulkan headers set): 528 passed, 15 failed, 50 skipped; on this branch the new test and the 32 checks that read the changed file ran, with no failure that main does not have (see Testing). The 15 that fail on main: test_appimage_player_build, test_bake_portability, test_cpm_discovery, test_crash_dialog, test_env_on, test_lift_cache, test_lift_cleanup_error, test_make_game_cache, test_mods_size_table, test_options_budget_once, test_pipeline_tour, test_readback_late, test_vk_pgo, test_walk_key and nx2/test_texture_init_barrier.py.
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • A game-free test added for the fix, failing on main and passing here.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. Not built whole after the rebase; gpu/vk/vk_main.cpp at f6b7e719 checked whole (-fsyntax-only -Wall -Wextra, the build's defines) with clang 23.1.5 for Linux and llvm-mingw 20261104 for Windows: the same diagnostics as main aa95d35f's (50 and 53), none new. Before the rebase, the combined branch 27553c83 linked longshot_vk.dll (llvm-mingw 20261104, RX_VK_ONLY=1 RX_RELEASE=1 RX_TARGET=windows) and longshot_vk.so.
**Type:** fix · **Risk:** low · **Tested on:** Linux x86-64 (game-free check) · **Needs:** Linux desktop with a discrete GPU in Steam's Gaming Mode; Steam Deck (unchanged case) ## Why On a desktop PC with a graphics card, running the game from Steam's Gaming Mode (Big Picture on SteamOS-like systems such as Bazzite) makes Auto (this PC) pick the Steam Deck's lowest settings, because Steam sets `SteamDeck=1` there too. ## How to reproduce **Seen on:** Linux x86-64, game-free (the real `auto_profile` choice with a stand-in GPU); in the game it needs a desktop in Steam's Gaming Mode, which nobody has run yet **Settings and switches:** a first start (no `longshot_options.ini`), Quality preset Auto (this PC); `SteamDeck=1` in the environment, as Steam's Gaming Mode sets it **Steps:** on `main` aa95d35f with this PR's test added (57edd6c3), run `python -I -B tests/test_auto_handheld.py`; in the game, start from Gaming Mode on a desktop with a discrete card and read the `vk: Auto (this PC)` lines in `longshot_log.txt` **Expected:** an RX 7900 XTX gets tier 5 and an RX 6600 tier 3, as on the desktop **Actual:** both are taken for a handheld: `handheld 1 (want 0), tier 1 (want 5): handheld: Minimum` ## What changed Auto (this PC) now takes `SteamDeck=1` as a handheld only when the GPU is integrated, so a desktop card under Gaming Mode gets its own tier; the Deck is still known by its APU's names. - vk: `auto_profile()` in `gpu/vk/vk_main.cpp` counts `SteamDeck=1` as a handheld only when the GPU is integrated; the Deck's own APU names (`Custom GPU 0405`, `Custom GPU 0932`) still count on their own. - tests: `tests/test_auto_handheld.py` runs the real `auto_profile` choice for an RX 7900 XTX and an RX 6600 with and without `SteamDeck=1`, the Deck itself, and another integrated GPU under Gaming Mode. ## Measurements **Verdict:** fixed in the game-free test (2 of 2 desktop cards under `SteamDeck=1` taken for a handheld on `main`, 0 with this PR, two interleaved rounds); not yet seen in the game: waiting for test request T-WX8A. Hardware: Linux x86-64 server (Ubuntu 24.04), no GPU or game used; gcc 13.3, clang 23.1.5 Scene: no game: the game-free check Method: `python3 -I -B tests/test_auto_handheld.py` at the test-only commit 57edd6c3 (main aa95d35f plus the test) and at f6b7e719, twice each, alternating How to reproduce: check out each commit and run the command above | | Before: main @ aa95d35f (with the test, 57edd6c3) | After: this PR @ f6b7e719 | |---|---|---| | desktop cards under `SteamDeck=1` taken for a handheld, of 2 (both rounds the same) | 2 | 0 | ``` 57edd6c3 r1: FAIL RX 7900 XTX under Steam's Gaming Mode (SteamDeck=1): handheld 1 (want 0), tier 1 (want 5): handheld: Minimum; the game's own upscaler 57edd6c3 r1: FAIL RX 6600 under Steam's Gaming Mode (SteamDeck=1): handheld 1 (want 0), tier 1 (want 3): handheld: Minimum; the game's own upscaler f6b7e719 r1: ok RX 7900 XTX under Steam's Gaming Mode (SteamDeck=1): tier 5 (24560 MB of video memory: tier 5; the game's own upscaler) (round 2 the same on both commits) ``` ### Flags and settings None ## Testing **Tested:** Linux x86-64, game-free. The new test fails on the test-only commit 57edd6c3 and passes at f6b7e719 (this branch rebased onto `main` aa95d35f), twice each, alternating, and under `tests/run_all.py` with g++ 13.3 and with clang 23.1.5 as `CXX` at both commits. At the tip, the 32 checks that read `gpu/vk/vk_main.cpp` or the new test: 29 passed, 2 skipped, and `test_appimage_player_build` failed as it does on `main` aa95d35f. Before the rebase the same at e995566f and 9762f1a6 (main 7ff5256e). **Not tested:** The case fixed, in the game: a desktop with a discrete card under Steam's Gaming Mode (this PC has no Gaming Mode session). The unchanged case on a Steam Deck (still Minimum). **Must be tested:** - Linux desktop with a discrete AMD or NVIDIA card, in Steam's Gaming Mode (Bazzite, gamescope-session): back up and delete `longshot_options.ini`, start the game from Gaming Mode, expecting the `vk: Auto (this PC)` lines in `longshot_log.txt` to name the card's tier, not handheld or Minimum (by hand, test request T-WX8A: post those lines, `SteamDeck` from the launch environment, the GPU and OS) - Steam Deck: the same first start, expecting the `vk: Auto (this PC)` lines still to say Minimum (by hand, T-WX8A) ## Risks **What could break:** a handheld whose GPU Vulkan reports as discrete, or another handheld that relies on `SteamDeck=1` alone with a discrete-typed GPU, would now get desktop settings from Auto. The Deck itself is matched by its APU name as before. **Turning it off:** revert the commit; a player can always pick a preset by hand. **Compatibility:** only a first start's Auto choice changes, on a desktop under Gaming Mode; an existing `longshot_options.ini` keeps its settings. ## Issues None filed. Conflicts in intent with https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/225 (a Steam Deck profile, on by itself on a Deck), also open: the two should be read together and one chosen (or reconciled) before either merges. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. Onto main aa95d35f, no conflict; the test and fix commits are the same changes as before (`git patch-id`). - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). The full suite on main aa95d35f (Linux, g++ 13.3, the Vulkan headers set): 528 passed, 15 failed, 50 skipped; on this branch the new test and the 32 checks that read the changed file ran, with no failure that `main` does not have (see Testing). The 15 that fail on main: `test_appimage_player_build`, `test_bake_portability`, `test_cpm_discovery`, `test_crash_dialog`, `test_env_on`, `test_lift_cache`, `test_lift_cleanup_error`, `test_make_game_cache`, `test_mods_size_table`, `test_options_budget_once`, `test_pipeline_tour`, `test_readback_late`, `test_vk_pgo`, `test_walk_key` and `nx2/test_texture_init_barrier.py`. - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. Not built whole after the rebase; `gpu/vk/vk_main.cpp` at f6b7e719 checked whole (`-fsyntax-only -Wall -Wextra`, the build's defines) with clang 23.1.5 for Linux and llvm-mingw 20261104 for Windows: the same diagnostics as `main` aa95d35f's (50 and 53), none new. Before the rebase, the combined branch 27553c83 linked `longshot_vk.dll` (llvm-mingw 20261104, `RX_VK_ONLY=1 RX_RELEASE=1 RX_TARGET=windows`) and `longshot_vk.so`.
Assisted-by: Claude
fix(vk): Auto (this PC) takes SteamDeck=1 as a handheld only on an integrated GPU
Some checks failed
beanstalk/approval Test farm not requested
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
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
9762f1a690
Assisted-by: Claude
Author
Contributor

Filled in: the full game-free suite on the combined branch, the Windows and Linux builds, and the test request T-WX8A. Still work in progress until a Steam Deck run is in.

Filled in: the full game-free suite on the combined branch, the Windows and Linux builds, and the test request T-WX8A. Still work in progress until a Steam Deck run is in.
Author
Contributor

Rebased onto main aa95d35f with no conflict (the same two changes, git patch-id; main changed gpu/vk/vk_main.cpp in four merges since 7ff5256e, none in auto_profile()) and the description moved to the current template.
The game-free test was run again on the new base (2 of 2 desktop cards taken for a handheld at the test-only commit, 0 at the tip, two rounds, g++ and clang); still WIP until T-WX8A has a desktop Gaming Mode run and a Deck run.

Rebased onto `main` aa95d35f with no conflict (the same two changes, `git patch-id`; `main` changed `gpu/vk/vk_main.cpp` in four merges since 7ff5256e, none in `auto_profile()`) and the description moved to the current template. The game-free test was run again on the new base (2 of 2 desktop cards taken for a handheld at the test-only commit, 0 at the tip, two rounds, g++ and clang); still WIP until T-WX8A has a desktop Gaming Mode run and a Deck run.
zeldaootr force-pushed auto-steamdeck-flag-discrete-gpu from 9762f1a690
Some checks failed
beanstalk/approval Test farm not requested
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
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to f6b7e71916
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
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
PR description / Description follows the template (pull_request_target) Successful in 6s
2026-11-15 16:43:55 +00:00
Compare
HumanBean changed title from WIP: fix(vk): Auto settings take SteamDeck=1 as a handheld only on an integrated GPU to fix(vk): Auto settings take SteamDeck=1 as a handheld only on an integrated GPU 2026-11-15 18:36:31 +00:00
HumanBean deleted branch auto-steamdeck-flag-discrete-gpu 2026-11-15 18:40:05 +00:00
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
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
PR description / Description follows the template (pull_request_target) Successful in 6s
Some workflows are waiting to be reviewed.
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!559
No description provided.