fix(vk): six rows of the switch table say what the code does #1302

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix/switch-table-rows into main 2026-11-17 02:23:49 +00:00
Owner

Type: fix · Risk: low · Tested on: Linux, RTX 3090 · Needs: none

Why

The switch table of #1300 was written from one reading of each switch's code. A second reading of the 106 rows that decide defaults (the hw and attempt kinds) found six that say something the code doesn't do. The worst: RX_VK_PRESENT_THREAD was listed as on for NVIDIA GPUs, and it is off on every PC unless set. A wrong row misleads whoever decides which switches to remove or turn on.

How to reproduce

Seen on: any PC, by reading gpu/vk/switches.def on main
Settings and switches: none
Steps: read the row of RX_VK_PRESENT_THREAD, then present_thread_on() in gpu/vk/vk_replay.cpp
Expected: the row says the presenter thread is off unless the switch is set
Actual: the row says "on for NVIDIA GPUs (vendor 0x10DE), off elsewhere" (that rule only reserves the thread's queue, in gpu/vk/vk_main.cpp)

What changed

Six rows of gpu/vk/switches.def say what the code does. No code changes.

  • RX_VK_PRESENT_THREAD: kind hw to attempt; off on every PC unless set.
  • RX_VK_MESH_OPT: every AMD driver but RADV, not only AMD's proprietary one.
  • RX_VK_IMAGE_PREALLOC: 8% of the heap in 2 to 12 blocks under 8 GB, 15% in 2 to 24 above.
  • RX_VK_READBACK_EARLY: off with the render thread too; on for every GPU that is not discrete.
  • RX_VK_TEX_MAX_DIM, RX_VK_TEX_SKIP_MB: the low-VRAM rule spelled out (Minimum's settings, and 4.5 GiB or less allowed or an integrated GPU with 16 GB of RAM or less).

Measurements

Verdict: nothing to measure: six texts in a table the start's report prints a kind from.

Flags and settings

None

Testing

Tested: Linux, RTX 3090 (NVIDIA 620.70), a dev pack over base 8e9cfc3a: started from the Kokiri Forest save, standing and turning, with RX_VK_PRESENT_THREAD=0 and a misspelt RX_VK_FRAME_LOG_X=1 set. The start logged RX_VK_PRESENT_THREAD=0 (attempt), the misspelt name as no switch, and a path's value as <a path> (the last edit of #1300, not run in the game until now).

Not tested: tests/test_switch_table.py was not run on this PC (no checks are run here). The other 465 rows (diag, kill, tune, player) have had one reading only.

Must be tested:

  • None

Risks

What could break: nothing in the game: the table's texts are only printed.

Turning it off: revert the commit

Compatibility: Nothing changes

Issues

See #1300

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.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named). Not run on this PC; left to the forge's checks.
  • 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.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8dzCsAL3UdW7ft8ptL9

**Type:** fix · **Risk:** low · **Tested on:** Linux, RTX 3090 · **Needs:** none ## Why The switch table of #1300 was written from one reading of each switch's code. A second reading of the 106 rows that decide defaults (the `hw` and `attempt` kinds) found six that say something the code doesn't do. The worst: `RX_VK_PRESENT_THREAD` was listed as on for NVIDIA GPUs, and it is off on every PC unless set. A wrong row misleads whoever decides which switches to remove or turn on. ## How to reproduce **Seen on:** any PC, by reading `gpu/vk/switches.def` on main **Settings and switches:** none **Steps:** read the row of `RX_VK_PRESENT_THREAD`, then `present_thread_on()` in `gpu/vk/vk_replay.cpp` **Expected:** the row says the presenter thread is off unless the switch is set **Actual:** the row says "on for NVIDIA GPUs (vendor 0x10DE), off elsewhere" (that rule only reserves the thread's queue, in `gpu/vk/vk_main.cpp`) ## What changed Six rows of `gpu/vk/switches.def` say what the code does. No code changes. - `RX_VK_PRESENT_THREAD`: kind `hw` to `attempt`; off on every PC unless set. - `RX_VK_MESH_OPT`: every AMD driver but RADV, not only AMD's proprietary one. - `RX_VK_IMAGE_PREALLOC`: 8% of the heap in 2 to 12 blocks under 8 GB, 15% in 2 to 24 above. - `RX_VK_READBACK_EARLY`: off with the render thread too; on for every GPU that is not discrete. - `RX_VK_TEX_MAX_DIM`, `RX_VK_TEX_SKIP_MB`: the low-VRAM rule spelled out (Minimum's settings, and 4.5 GiB or less allowed or an integrated GPU with 16 GB of RAM or less). ## Measurements **Verdict:** nothing to measure: six texts in a table the start's report prints a kind from. ### Flags and settings None ## Testing **Tested:** Linux, RTX 3090 (NVIDIA 620.70), a dev pack over base 8e9cfc3a: started from the Kokiri Forest save, standing and turning, with `RX_VK_PRESENT_THREAD=0` and a misspelt `RX_VK_FRAME_LOG_X=1` set. The start logged `RX_VK_PRESENT_THREAD=0 (attempt)`, the misspelt name as no switch, and a path's value as `<a path>` (the last edit of #1300, not run in the game until now). **Not tested:** `tests/test_switch_table.py` was not run on this PC (no checks are run here). The other 465 rows (`diag`, `kill`, `tune`, `player`) have had one reading only. **Must be tested:** - None ## Risks **What could break:** nothing in the game: the table's texts are only printed. **Turning it off:** revert the commit **Compatibility:** Nothing changes ## Issues See #1300 ## 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`. - [ ] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). Not run on this PC; left to the forge's checks. - [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. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8dzCsAL3UdW7ft8ptL9
fix(vk): six rows of the switch table say what the code does
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 17s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
Third-party parts / As their notes say (pull_request) Successful in 24s
PR description / Description follows the template (pull_request_target) Failing after 4s
d0fdb7467d
A second reading of the hw and attempt rows of gpu/vk/switches.def (#1300). RX_VK_PRESENT_THREAD is off on every PC
unless set (attempt, not hw: only its queue is reserved on NVIDIA); RX_VK_MESH_OPT, RX_VK_IMAGE_PREALLOC,
RX_VK_READBACK_EARLY, RX_VK_TEX_MAX_DIM and RX_VK_TEX_SKIP_MB state their whole rule.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dzCsAL3UdW7ft8ptL9
Author
Owner

Tested in game: RTX 3090, NVIDIA 620.70, Linux: a dev pack over base 8e9cfc3a, from the Kokiri Forest save, standing and turning at 2560x1440 with RX_VK_PRESENT_THREAD=0 and a misspelt RX_VK_FRAME_LOG_X=1 set. The start logged RX_VK_PRESENT_THREAD=0 (attempt), the misspelt name as no switch and a path as ; the scene drew.

Tested in game: RTX 3090, NVIDIA 620.70, Linux: a dev pack over base 8e9cfc3a, from the Kokiri Forest save, standing and turning at 2560x1440 with RX_VK_PRESENT_THREAD=0 and a misspelt RX_VK_FRAME_LOG_X=1 set. The start logged RX_VK_PRESENT_THREAD=0 (attempt), the misspelt name as no switch and a path as <a path>; the scene drew.
HumanBean changed title from WIP: fix(vk): six rows of the switch table say what the code does to fix(vk): six rows of the switch table say what the code does 2026-11-17 02:23:36 +00:00
HumanBean deleted branch fix/switch-table-rows 2026-11-17 02:23:50 +00:00
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!1302
No description provided.