feat(menu): a Shader loading row, When needed or Before the title (from 32 GB of RAM) #2321

Open
Veix wants to merge 1 commit from Veix/Longshot:feat/shader-loading-row into main
Contributor

Summary

RX_VK_LOAD=start (every shader program loaded before the title) gets a row in the menu, so a player can choose it without editing longshot_env.txt. Nothing changes for anyone who doesn't choose it.

The Graphics tab's GPU and memory section gets Shader loading: When needed (the default, the game's behaviour until now: programs loaded as the game makes them, with load_default.h's safety net that switches an install to loading before the title when play waited too long for loads) or Before the title (start, as RX_VK_LOAD=start). It applies after a restart, like GPU device beside it. Before the title is only for PCs with 32 GB of RAM or more (28 GB reported, what a 32 GB PC shows), and only where the shader preparation runs at the start (it loads the programs inside it; not with RX_VK_PRECOMPILE=0 or in a build that is not a release). Where it cannot apply, the row is held, shows When needed (what applies) and its line says why; a saved Before the title stays in longshot_options.ini for a PC where it can. Before the title loads the programs the shader lists name; one they do not name yet can still be loaded the first time the game makes it. RX_VK_LOAD still wins for the run, the row shown held by it, as the ASTC and Intel rows are by their switches. The log says which decided: "programs are loaded before the title (start): the Shader loading row: Before the title".

Why 32 GB: Before the title held about 10 GB more RAM and 1 GB more video memory here (the PC under Testing, 2560x1440 DLAA, RX_VK_LOAD=start against RX_VK_LOAD=create on main 753fb5af with #2312 (the speaker's sound search, nothing of the loading), the process's memory read every few seconds):

When needed (create) Before the title (start)
At the title: RAM in use (working set) 8.9 GB 19.7 GB
At the title: private memory 11.9 GB 23.8 GB
Castle Town, the scripted route's second stay: RAM in use 12.4 GB 22.6 GB
Castle Town: private memory 19.9 GB 31.3 GB
Castle Town: video memory 6.6 GB 7.7 GB

What has to fit in RAM is the working set: 22.6 GB with Before the title. The private memory (31.3 GB) is what the process has committed; Windows backs it with the page file, which it sizes itself by default.

Read first: load_default::asked in gpu/vk/load_default.h, programs_load_decide in gpu/vk/vk_programs.cpp, the row in gpu/vk/menu/gpu.cpp.

Testing

Tested: Windows 11, RTX 4070 SUPER 12 GB, driver 621.24, Ryzen 9 9900X, 64 GB of RAM. In the game: the row at When needed, the log "programs are loaded when the game makes them (create): the default where the GPU has mesh shaders"; set to Before the title in the menu and the game restarted: the log said "programs are loaded before the title (start): the Shader loading row: Before the title", and longshot_options.ini kept shader_loading=1.
On the head 70dec8c8 (on main d02cac0f): the row at Before the title, the log line above; set to When needed in the menu, the row showed it with "Restart needed" (pictures in the review answer); with RX_VK_PRECOMPILE=0 and the row saved at Before the title the log said "programs are loaded when the game makes them (create)" and "the Shader loading row's Before the title is left aside: the shader preparation does not run".
tests/load_default_test.cpp checks the rule (RX_VK_LOAD first; Before the title only from 28 GB and only with the shader preparation; When needed asks nothing) and fails to build on main (no load_default::asked); tests/test_load_default.py, tests/test_menu_ini_keys.py (the new key) and tests/test_settings_table.py (the settings page's new line) and the menu checks (tests/test_menu_*: modules, module slots, sections, hooks, i18n, model, rows, locked button, keys, environment overrides, restart, restart slots, setting walk, size, mouse, help paragraphs) pass on the head. tests/run_all.py --changed origin/main on 0e32bc10: 114 passed, 2 failed, 7 skipped; the 2 (test_dev_packs, test_saveload_warm_cache) fail on main 753fb5af in the same environment. The head started again after the rebase: the same log line.

Still to test:

  • A PC with less than 32 GB of RAM: the row held at When needed with its line, by hand

Measurements

Nothing to measure for speed: When needed is the game's behaviour until now, and Before the title is RX_VK_LOAD=start; the memory that chose the 32 GB line is in the Summary.

Risks

No risk for anyone who leaves the row as it is: When needed is the game's behaviour until now, safety net included. Before the title is what RX_VK_LOAD=start has done all along, and only offered where the RAM it takes is there. A revert is enough. After updating, a player sees one more row; longshot_options.ini gets shader_loading=0 with the next save.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A check under tests/ that reads changed source is updated, not weakened.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

Written with the help of an AI coding agent.

## Summary **`RX_VK_LOAD=start` (every shader program loaded before the title) gets a row in the menu, so a player can choose it without editing `longshot_env.txt`. Nothing changes for anyone who doesn't choose it.** The Graphics tab's GPU and memory section gets **Shader loading**: **When needed** (the default, the game's behaviour until now: programs loaded as the game makes them, with `load_default.h`'s safety net that switches an install to loading before the title when play waited too long for loads) or **Before the title** (`start`, as `RX_VK_LOAD=start`). It applies after a restart, like GPU device beside it. Before the title is only for PCs with 32 GB of RAM or more (28 GB reported, what a 32 GB PC shows), and only where the shader preparation runs at the start (it loads the programs inside it; not with `RX_VK_PRECOMPILE=0` or in a build that is not a release). Where it cannot apply, the row is held, shows When needed (what applies) and its line says why; a saved Before the title stays in `longshot_options.ini` for a PC where it can. Before the title loads the programs the shader lists name; one they do not name yet can still be loaded the first time the game makes it. `RX_VK_LOAD` still wins for the run, the row shown held by it, as the ASTC and Intel rows are by their switches. The log says which decided: "programs are loaded before the title (start): the Shader loading row: Before the title". Why 32 GB: Before the title held about 10 GB more RAM and 1 GB more video memory here (the PC under Testing, 2560x1440 DLAA, `RX_VK_LOAD=start` against `RX_VK_LOAD=create` on `main` 753fb5af with #2312 (the speaker's sound search, nothing of the loading), the process's memory read every few seconds): | | When needed (create) | Before the title (start) | |---|---|---| | At the title: RAM in use (working set) | 8.9 GB | 19.7 GB | | At the title: private memory | 11.9 GB | 23.8 GB | | Castle Town, the scripted route's second stay: RAM in use | 12.4 GB | 22.6 GB | | Castle Town: private memory | 19.9 GB | 31.3 GB | | Castle Town: video memory | 6.6 GB | 7.7 GB | What has to fit in RAM is the working set: 22.6 GB with Before the title. The private memory (31.3 GB) is what the process has committed; Windows backs it with the page file, which it sizes itself by default. Read first: `load_default::asked` in `gpu/vk/load_default.h`, `programs_load_decide` in `gpu/vk/vk_programs.cpp`, the row in `gpu/vk/menu/gpu.cpp`. ## Testing **Tested:** Windows 11, RTX 4070 SUPER 12 GB, driver 621.24, Ryzen 9 9900X, 64 GB of RAM. In the game: the row at When needed, the log "programs are loaded when the game makes them (create): the default where the GPU has mesh shaders"; set to Before the title in the menu and the game restarted: the log said "programs are loaded before the title (start): the Shader loading row: Before the title", and `longshot_options.ini` kept `shader_loading=1`. On the head 70dec8c8 (on `main` d02cac0f): the row at Before the title, the log line above; set to When needed in the menu, the row showed it with "Restart needed" (pictures in the review answer); with `RX_VK_PRECOMPILE=0` and the row saved at Before the title the log said "programs are loaded when the game makes them (create)" and "the Shader loading row's Before the title is left aside: the shader preparation does not run". `tests/load_default_test.cpp` checks the rule (`RX_VK_LOAD` first; Before the title only from 28 GB and only with the shader preparation; When needed asks nothing) and fails to build on `main` (no `load_default::asked`); `tests/test_load_default.py`, `tests/test_menu_ini_keys.py` (the new key) and `tests/test_settings_table.py` (the settings page's new line) and the menu checks (`tests/test_menu_*`: modules, module slots, sections, hooks, i18n, model, rows, locked button, keys, environment overrides, restart, restart slots, setting walk, size, mouse, help paragraphs) pass on the head. `tests/run_all.py --changed origin/main` on 0e32bc10: 114 passed, 2 failed, 7 skipped; the 2 (`test_dev_packs`, `test_saveload_warm_cache`) fail on `main` 753fb5af in the same environment. The head started again after the rebase: the same log line. **Still to test:** - A PC with less than 32 GB of RAM: the row held at When needed with its line, by hand ## Measurements Nothing to measure for speed: When needed is the game's behaviour until now, and Before the title is `RX_VK_LOAD=start`; the memory that chose the 32 GB line is in the Summary. ## Risks **No risk for anyone who leaves the row as it is: When needed is the game's behaviour until now, safety net included.** Before the title is what `RX_VK_LOAD=start` has done all along, and only offered where the RAM it takes is there. A revert is enough. After updating, a player sees one more row; `longshot_options.ini` gets `shader_loading=0` with the next save. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. Written with the help of an AI coding agent.
feat(menu): a Shader loading row, When needed or Before the title (from 32 GB of RAM)
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 14s
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
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (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
Website / Website on Cloudflare (pull_request) Has been cancelled
9a6afa364a
RX_VK_LOAD=start was the only way to have every shader program loaded before the title. The Graphics tab's GPU and
memory section gets a row for it: When needed (the default, as before: load_default.h's choice with its safety net)
or Before the title (start). Before the title holds about 10 GB more RAM and 1 GB more video memory (measured on an
RTX 4070 SUPER in Castle Town: 22.6 against 12.4 GB in use), so it is offered from 32 GB of RAM (28 GB reported) and
the row says why where it is not. RX_VK_LOAD still wins for the run, the row shown held by it. Applies after a restart.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Tested in game: Windows 11, RTX 4070 SUPER 12 GB, driver 621.24, 64 GB of RAM: the row set to Before the title in the menu and the game restarted; the log said 'programs are loaded before the title (start): the Shader loading row: Before the title', and longshot_options.ini kept shader_loading=1. At When needed the log gave the default as before. The rebased head started again with the same line.

Tested in game: Windows 11, RTX 4070 SUPER 12 GB, driver 621.24, 64 GB of RAM: the row set to Before the title in the menu and the game restarted; the log said 'programs are loaded before the title (start): the Shader loading row: Before the title', and longshot_options.ini kept shader_loading=1. At When needed the log gave the default as before. The rebased head started again with the same line.
Member

Possibly related, for context:

  • issue #388 Game: on 16 GB of RAM the game's memory outgrows RAM within a minute of loading a save, then swap fills on area changes until RAM is at 0 — Low-RAM reports motivate the RAM-gated loading choice
  • issue #1474 Idea: on Windows, hold less memory for pipelines after the start: the cache file rule (#416) and the module release (#223) Linux has, once measured — Discusses memory cost of loading programs before the title
  • PR #975 fix(vk): GPUs on the compute fallback load programs when the game makes them, not all 32,645 pipelines before the title — Merged change establishing the current load-at-create default and safety net
Possibly related, for context: - issue #388 Game: on 16 GB of RAM the game's memory outgrows RAM within a minute of loading a save, then swap fills on area changes until RAM is at 0 — Low-RAM reports motivate the RAM-gated loading choice - issue #1474 Idea: on Windows, hold less memory for pipelines after the start: the cache file rule (#416) and the module release (#223) Linux has, once measured — Discusses memory cost of loading programs before the title - PR #975 fix(vk): GPUs on the compute fallback load programs when the game makes them, not all 32,645 pipelines before the title — Merged change establishing the current load-at-create default and safety net
Owner
@review
Owner

Can you include screenshot and make sure the text shown to users say this is only for 32GB machines

Can you include screenshot and make sure the text shown to users say this is only for 32GB machines
BeanBot left a comment

Recommendation: Request changes. The new row can promise loading before the title when startup preparation is disabled or skipped, and it can display a saved choice that the game has ignored. The 32 GB eligibility threshold also needs validation near that limit.

The row exposes the existing startup shader-loading mode without requiring an environment variable. It preserves the existing default, but its availability and explanatory text do not cover all paths through the loader.

Blocking (1): must change before merging.

  1. L1 gpu/vk/load_default.h:33: The row requests start even when shader preparation will not run, so its advertised choice does not load programs before the title. (more on the line) Do: Make the row reflect whether startup preparation can actually run, and either enable the required preparation for this choice or hold the choice with an explanation when it cannot run.

Should fix (2): not blocking, but worth doing before merging.

  • L2 gpu/vk/menu/gpu.cpp:87: On a machine below the RAM threshold, a saved Before the title value remains displayed and cannot be changed even though the loader ignores it. (more on the line) Do: Display the effective automatic choice while preserving or clearing the saved preference deliberately, and allow the player to select When needed on a lower-memory machine.
  • L3 docs/user/graphics-and-controls.md:267: The description promises that every program is loaded before the title and nothing is loaded during play, but start mode only preloads listed programs. (more on the line) Do: Describe startup loading as covering listed programs and acknowledge that unlisted programs can still load during play; correct the matching menu hint.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L4 gpu/vk/load_default.h:26: The threshold offers the memory-heavy mode on a 32 GB PC, but the reported run used 64 GB and reached 31.3 GB of private memory. (more on the line) Do: Run the selected mode on a 32 GB system through the measured route, including a representative AMD or Steam Deck-class configuration where applicable, and record commit usage, paging, startup and frame pacing against When needed. (@fix does its part first: Raise the eligibility threshold until a lower limit is demonstrated safe.)

@fix can do L1, L2, L3 and L4.

Checks: Failing on this head, which is behind its base, where it passes: PR description / Description follows the template (pull_request_target). @rebase (or @fix) brings it up to date and runs it again; not held against it. Still running: 10 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes: the author reports selecting Before the title, restarting, and seeing the corresponding log and saved value on Windows with an RTX 4070 SUPER and 64 GB RAM. The reported comparison shows 22.6 versus 12.4 GB working set and 7.7 versus 6.6 GB VRAM in Castle Town, but does not establish safety on a 32 GB machine.

Other systems: The option affects startup and shader loading on Windows and Linux, including AMD, NVIDIA, Steam Deck and fallback GPUs. The reported game run covers one Windows NVIDIA system; preparation-disabled and skipped-preparation paths can bypass the promised startup work.

Switches: No environment switch is added or changed. The saved shader_loading option defaults to 0, preserving the existing automatic choice and safety net; 1 requests the existing RX_VK_LOAD=start mode when reported RAM is at least 28 GiB. RX_VK_LOAD still takes precedence.

Reviewed: 9a6afa364a against 0e32bc100d: Read the repository rules, available PR template, standards, diff, commit and changed small files; traced menu initialization, RAM detection, loading choice, preparation and saving. Skimmed the larger changed renderer and menu files and surrounding callers rather than reading those files in full. docs/review-checklist.md and ../Tooling/AGENTS.md were absent. No generated files or recorded runs were changed.; nothing run (a code review).

Checked and fine:

  • The option is initialized before programs_load_decide reads it, and the default leaves the existing safety-net choice intact.
  • The saved key and settings-table row are added; the commit records AI assistance.
  • No game-derived output, generated shader header, third-party change or renderer API change appears in the diff.

Testing: Read-only review; no commands from the project, builds or tests were run. The author reports an in-game Windows run and passing targeted checks; CI is still running.

Overlaps and merge order: Not checked; network access was unavailable.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The new row can promise loading before the title when startup preparation is disabled or skipped, and it can display a saved choice that the game has ignored. The 32 GB eligibility threshold also needs validation near that limit. The row exposes the existing startup shader-loading mode without requiring an environment variable. It preserves the existing default, but its availability and explanatory text do not cover all paths through the loader. **Blocking (1)**: must change before merging. 1. **L1** `gpu/vk/load_default.h:33`: The row requests start even when shader preparation will not run, so its advertised choice does not load programs before the title. (more on the line) **Do:** Make the row reflect whether startup preparation can actually run, and either enable the required preparation for this choice or hold the choice with an explanation when it cannot run. **Should fix (2)**: not blocking, but worth doing before merging. - **L2** `gpu/vk/menu/gpu.cpp:87`: On a machine below the RAM threshold, a saved Before the title value remains displayed and cannot be changed even though the loader ignores it. (more on the line) **Do:** Display the effective automatic choice while preserving or clearing the saved preference deliberately, and allow the player to select When needed on a lower-memory machine. - **L3** `docs/user/graphics-and-controls.md:267`: The description promises that every program is loaded before the title and nothing is loaded during play, but start mode only preloads listed programs. (more on the line) **Do:** Describe startup loading as covering listed programs and acknowledge that unlisted programs can still load during play; correct the matching menu hint. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4** `gpu/vk/load_default.h:26`: The threshold offers the memory-heavy mode on a 32 GB PC, but the reported run used 64 GB and reached 31.3 GB of private memory. (more on the line) **Do:** Run the selected mode on a 32 GB system through the measured route, including a representative AMD or Steam Deck-class configuration where applicable, and record commit usage, paging, startup and frame pacing against When needed. *(`@fix` does its part first: Raise the eligibility threshold until a lower limit is demonstrated safe.)* `@fix` can do L1, L2, L3 and L4. **Checks:** Failing on this head, which is behind its base, where it passes: `PR description / Description follows the template (pull_request_target)`. `@rebase` (or `@fix`) brings it up to date and runs it again; not held against it. Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: the author reports selecting Before the title, restarting, and seeing the corresponding log and saved value on Windows with an RTX 4070 SUPER and 64 GB RAM. The reported comparison shows 22.6 versus 12.4 GB working set and 7.7 versus 6.6 GB VRAM in Castle Town, but does not establish safety on a 32 GB machine. **Other systems:** The option affects startup and shader loading on Windows and Linux, including AMD, NVIDIA, Steam Deck and fallback GPUs. The reported game run covers one Windows NVIDIA system; preparation-disabled and skipped-preparation paths can bypass the promised startup work. **Switches:** No environment switch is added or changed. The saved shader_loading option defaults to 0, preserving the existing automatic choice and safety net; 1 requests the existing RX_VK_LOAD=start mode when reported RAM is at least 28 GiB. RX_VK_LOAD still takes precedence. **Reviewed:** 9a6afa364ada against 0e32bc100dbe: Read the repository rules, available PR template, standards, diff, commit and changed small files; traced menu initialization, RAM detection, loading choice, preparation and saving. Skimmed the larger changed renderer and menu files and surrounding callers rather than reading those files in full. docs/review-checklist.md and ../Tooling/AGENTS.md were absent. No generated files or recorded runs were changed.; nothing run (a code review). **Checked and fine:** - The option is initialized before programs_load_decide reads it, and the default leaves the existing safety-net choice intact. - The saved key and settings-table row are added; the commit records AI assistance. - No game-derived output, generated shader header, third-party change or renderer API change appears in the diff. **Testing:** Read-only review; no commands from the project, builds or tests were run. The author reports an in-game Windows run and passing targeted checks; CI is still running. **Overlaps and merge order:** Not checked; network access was unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -263,0 +264,4 @@
- **Shader loading:** When needed loads each of the game's shader programs from the shader cache the first time the game
makes it, which takes the least memory; if play waits too long for them, the game loads them all before the title from
the next start by itself. Before the title loads every one before the title: a longer start and about 10 GB more RAM
and 1 GB more video memory (measured on an RTX 4070 SUPER), and nothing is loaded in play. It needs 32 GB of RAM and
Member

L3 (should fix): The description promises that every program is loaded before the title and nothing is loaded during play, but start mode only preloads listed programs.

When: A kept program without a listed pipeline is read at its first draw unless RX_VK_LOAD_UNLISTED is enabled, so a player can still encounter a first-use load after choosing Before the title.

Do: Describe startup loading as covering listed programs and acknowledge that unlisted programs can still load during play; correct the matching menu hint.

**L3** (should fix): The description promises that every program is loaded before the title and nothing is loaded during play, but start mode only preloads listed programs. *When:* A kept program without a listed pipeline is read at its first draw unless RX_VK_LOAD_UNLISTED is enabled, so a player can still encounter a first-use load after choosing Before the title. **Do:** Describe startup loading as covering listed programs and acknowledge that unlisted programs can still load during play; correct the matching menu hint.
@ -23,0 +23,4 @@
/// Before the title holds about 10 GB more RAM than at create calls (measured 2026-11-23 on an RTX 4070 SUPER with mesh shaders,
/// Castle Town: 22.6 against 12.4 GB in use, 31.3 against 19.9 GB private; 1 GB more video memory). The Shader loading row offers
/// it from 32 GB of RAM: a PC sold with 32 GB reports a little less (the part the hardware keeps), so from 28 GB
constexpr unsigned long long kStartRamMin = 28ull << 30;
Member

L4 (should fix): The threshold offers the memory-heavy mode on a 32 GB PC, but the reported run used 64 GB and reached 31.3 GB of private memory.

When: A player with 28–32 GiB reported RAM can select the mode while the game and other processes compete for memory; the supplied run does not show whether the mode remains usable under that constraint.

Do: Run the selected mode on a 32 GB system through the measured route, including a representative AMD or Steam Deck-class configuration where applicable, and record commit usage, paging, startup and frame pacing against When needed.

**L4** (should fix): The threshold offers the memory-heavy mode on a 32 GB PC, but the reported run used 64 GB and reached 31.3 GB of private memory. *When:* A player with 28–32 GiB reported RAM can select the mode while the game and other processes compete for memory; the supplied run does not show whether the mode remains usable under that constraint. **Do:** Run the selected mode on a 32 GB system through the measured route, including a representative AMD or Steam Deck-class configuration where applicable, and record commit usage, paging, startup and frame pacing against When needed.
@ -23,0 +30,4 @@
inline const char* asked(const char* env, int row, unsigned long long ram) {
if (env) return env;
if (row == 1 && start_allowed(ram)) return "start";
return nullptr;
Member

L1 (blocking): The row requests start even when shader preparation will not run, so its advertised choice does not load programs before the title.

When: With RX_VK_PRECOMPILE=0, or in a non-release build, precompile_wanted() is false; choose() still accepts the row's start request, but precompile_run() is not called. Programs are then read on first draw despite the row and log saying they were loaded before the title. A build whose preparation was skipped also returns before precompile_run().

Do: Make the row reflect whether startup preparation can actually run, and either enable the required preparation for this choice or hold the choice with an explanation when it cannot run.

**L1** (blocking): The row requests start even when shader preparation will not run, so its advertised choice does not load programs before the title. *When:* With RX_VK_PRECOMPILE=0, or in a non-release build, precompile_wanted() is false; choose() still accepts the row's start request, but precompile_run() is not called. Programs are then read on first draw despite the row and log saying they were loaded before the title. A build whose preparation was skipped also returns before precompile_run(). **Do:** Make the row reflect whether startup preparation can actually run, and either enable the required preparation for this choice or hold the choice with an explanation when it cannot run.
@ -55,0 +84,4 @@
.restart = true,
.preset_exempt = true,
.locked = []() -> const char* { // (why: RX_VK_LOAD holds it, or under 32 GB of RAM: hn_shader_loading's line)
if (getenv("RX_VK_LOAD")) return hn_shader_loading(0, -1);
Member

L2 (should fix): On a machine below the RAM threshold, a saved Before the title value remains displayed and cannot be changed even though the loader ignores it.

When: Copy an options file with shader_loading=1 from a larger machine to a 16 GB machine. asked() falls back to the automatic choice, while the locked row still displays Before the title; the player cannot clear that saved choice in the menu.

Do: Display the effective automatic choice while preserving or clearing the saved preference deliberately, and allow the player to select When needed on a lower-memory machine.

**L2** (should fix): On a machine below the RAM threshold, a saved Before the title value remains displayed and cannot be changed even though the loader ignores it. *When:* Copy an options file with shader_loading=1 from a larger machine to a 16 GB machine. asked() falls back to the automatic choice, while the locked row still displays Before the title; the player cannot clear that saved choice in the menu. **Do:** Display the effective automatic choice while preserving or clearing the saved preference deliberately, and allow the player to select When needed on a lower-memory machine.
Veix force-pushed feat/shader-loading-row from 9a6afa364a
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 14s
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
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (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
Website / Website on Cloudflare (pull_request) Has been cancelled
to 70dec8c884
Some checks are pending
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
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 / Website build and checks (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 11s
2026-11-23 17:49:37 +00:00
Compare
Author
Contributor

Done: the row now says it is only for PCs with 32 GB of RAM or more, and it only offers Before the title where it can really happen (screenshot below).

Rebased onto main d02cac0f (one conflict in programs_load_decide: main's new rule that a start marker is only followed with enough RAM is kept as it is; the row's choice is taken first). The PR is one commit again, 70dec8c8.

  • 32 GB in the text (HumanBean's request): the row's help line, its hint for Before the title, the reason shown where it is locked and the docs' table now say "only for PCs with 32 GB of RAM or more".
  • L1: load_default::asked gets whether the shader preparation runs (precompile_wanted()). Without it (RX_VK_PRECOMPILE=0, a build that is not a release) the row asks for nothing, the menu locks it with that reason, and the log says the row's Before the title was left aside and why. RX_VK_LOAD=start set by hand still does what it says. tests/load_default_test.cpp has both cases.
  • L2: where Before the title cannot apply (under 32 GB, or no preparation) the row shows When needed, which is what applies. A saved Before the title stays in longshot_options.ini as the player's choice, for a PC where it can apply (an options file copied from a bigger PC), so nothing is cleared behind the player's back.
  • L3: the hint and the docs now say that the programs the shader lists name are loaded before the title, and that one the lists do not name yet can still be loaded the first time the game makes it.
  • L4: the 31.3 GB is private memory (commit), not RAM in use. The game's working set, what has to fit in RAM, was 22.6 GB in Castle Town with Before the title (12.4 GB with When needed); the commit is backed by the page file, which Windows sizes itself by default. 22.6 GB plus Windows fits a 32 GB PC, so the line stays at 32 GB.

Checks on the head: tests/test_load_default.py, tests/test_menu_ini_keys.py, tests/test_switch_table.py and the menu checks (test_menu_modules, test_menu_module_slots, test_menu_sections, test_menu_hooks, test_menu_i18n, test_menu_model, test_menu_rows_model, test_menu_locked_button, test_menu_env_overrides, test_menu_keys, test_menu_restart, test_menu_restart_slots, test_menu_setting_walk, test_menu_size, test_menu_hit, test_menu_help_paragraphs, test_menu_i18n_count) and tests/test_settings_table.py pass.

The row on this PC (64 GB), at Before the title and after a change to When needed:

Shader loading at Before the title

Shader loading changed to When needed

And with RX_VK_PRECOMPILE=0, the row saved at Before the title, the log: "programs are loaded when the game makes them (create)" and "the Shader loading row's Before the title is left aside: the shader preparation does not run (RX_VK_PRECOMPILE=0, or a build that is not a release), and start loads the programs inside it".

**Done: the row now says it is only for PCs with 32 GB of RAM or more, and it only offers Before the title where it can really happen (screenshot below).** Rebased onto `main` d02cac0f (one conflict in `programs_load_decide`: `main`'s new rule that a start marker is only followed with enough RAM is kept as it is; the row's choice is taken first). The PR is one commit again, 70dec8c8. - **32 GB in the text** (HumanBean's request): the row's help line, its hint for Before the title, the reason shown where it is locked and the docs' table now say "only for PCs with 32 GB of RAM or more". - **L1**: `load_default::asked` gets whether the shader preparation runs (`precompile_wanted()`). Without it (`RX_VK_PRECOMPILE=0`, a build that is not a release) the row asks for nothing, the menu locks it with that reason, and the log says the row's Before the title was left aside and why. `RX_VK_LOAD=start` set by hand still does what it says. `tests/load_default_test.cpp` has both cases. - **L2**: where Before the title cannot apply (under 32 GB, or no preparation) the row shows When needed, which is what applies. A saved Before the title stays in `longshot_options.ini` as the player's choice, for a PC where it can apply (an options file copied from a bigger PC), so nothing is cleared behind the player's back. - **L3**: the hint and the docs now say that the programs the shader lists name are loaded before the title, and that one the lists do not name yet can still be loaded the first time the game makes it. - **L4**: the 31.3 GB is private memory (commit), not RAM in use. The game's working set, what has to fit in RAM, was 22.6 GB in Castle Town with Before the title (12.4 GB with When needed); the commit is backed by the page file, which Windows sizes itself by default. 22.6 GB plus Windows fits a 32 GB PC, so the line stays at 32 GB. Checks on the head: `tests/test_load_default.py`, `tests/test_menu_ini_keys.py`, `tests/test_switch_table.py` and the menu checks (`test_menu_modules`, `test_menu_module_slots`, `test_menu_sections`, `test_menu_hooks`, `test_menu_i18n`, `test_menu_model`, `test_menu_rows_model`, `test_menu_locked_button`, `test_menu_env_overrides`, `test_menu_keys`, `test_menu_restart`, `test_menu_restart_slots`, `test_menu_setting_walk`, `test_menu_size`, `test_menu_hit`, `test_menu_help_paragraphs`, `test_menu_i18n_count`) and `tests/test_settings_table.py` pass. The row on this PC (64 GB), at Before the title and after a change to When needed: ![Shader loading at Before the title](https://git.magicbean.dev/attachments/c43a71a5-84fb-4b50-bba5-3237234ea9b0) ![Shader loading changed to When needed](https://git.magicbean.dev/attachments/76248547-2f95-4b30-846a-a7b3d068a9d8) And with `RX_VK_PRECOMPILE=0`, the row saved at Before the title, the log: "programs are loaded when the game makes them (create)" and "the Shader loading row's Before the title is left aside: the shader preparation does not run (RX_VK_PRECOMPILE=0, or a build that is not a release), and start loads the programs inside it".
Some checks are pending
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
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 / Website build and checks (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 11s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/shader-loading-row:Veix-feat/shader-loading-row'
git switch 'Veix-feat/shader-loading-row'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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!2321
No description provided.