feat(prepare): Compile shaders All / Most / None, Most skipping the predicted pipelines #158
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!158
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:feat/compile-shaders"
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?
Why
The shader preparation before a first start (after a build, an update or a new driver) takes about 7 minutes on an RTX 3090 with a 12-core CPU, and longer on smaller PCs. A third of it builds predicted pipelines for program variants no list names, and play almost never asks for them.
What changed
Work in progress. Planned, in this order:
gpu/vk/vk_draw.cpp), so a tour can tell how often a prediction is used.Flags and settings
Measurements
main:
d40506c5(2026-11-13)this PR: feat/compile-shaders @ (to fill)
Hardware: RTX 3090, NVIDIA driver on Linux, 12-core / 24-thread CPU, 30 GB RAM
Method: full cold preparation on a fresh folder with an empty driver cache, the log's phase lines; tours to follow.
Preparation so far (one PC, cold, Builder-style):
All takes about 1.4 times as long as Most.
Also measured and dropped: one pipeline cache per build thread on all 24 CPUs builds the 25,337 listed pipelines in 136 s against 137-140 s on today's 16 threads with one shared cache. The compile is bound by the 12 physical cores.
Still to measure: a tour of 10 minutes or more over several areas, on a folder prepared with the predicted pipelines and on one prepared without them, comparing pipelines compiled in play, waits, draws left out, frames over 33 ms, and how many predicted pipelines play met. This decides the default.
Testing
Tested: the preparation timings above.
Not tested: everything else so far (work in progress).
Needs other testers:
Screenshots
To come: the choice and its tooltip in the launcher and the Builder.
Risk and rollback
On Most, a draw that would have used a predicted pipeline compiles it in play: a hitch. The tours measure how often that happens; All brings back today's behaviour.
Issues
None
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.Early result from the first tour, on a folder prepared with Most (no predicted pipelines). RTX 3090, Linux, first start after the preparation; about 8 minutes of play walking Kokiri Forest, Kakariko and the Market. The log counts against the 50,547 pipelines an All preparation predicts.
Limits: the Hyrule Field walk was cut short (the PC ran low on memory and the run was stopped), and the PC swapped heavily during the run, so its frame times are not valid and are not reported. The counts above don't depend on that.
Next: the same tour on a folder prepared with All to compare, a full Field walk, and then the choice itself (coded, not built or tested yet).
WIP: feat(prepare): Compile shaders All / Most / None, Most skipping the predicted pipelinesto WIP: feat(prepare): Compile shaders All / Most, Most (the default) skipping the predicted pipelinesPushed
b9c17d3a(renderer: a preparation builds the predicted pipelines only on All; --compile-shaders all|most and RX_VK_COMPILE_SHADERS, default Most) and4da99bc8(an All / Most choice beside "Prepare shaders now" in the Builders, make_game.py --compile-shaders kept in the options file, the launcher setting, README and docs). None and the fix for pop-in after a preparation in the game's own process are split out to a follow-up PR.Not yet checked on these commits: the build, tests/run_all.py, a cold default preparation (predictions skipped), an All preparation through make_game, the flag and options-file checks. Running now; results will follow here. The WPF Builder could not be compiled here (no .NET on this PC).
Second tour, on a folder prepared with All (today's behaviour), RTX 3090: predicted pipelines play met 0 of 50,547, compiled in play 0 (71 from the driver's cache), draws left out 0, waits 0. The driver kept 32 of 32 sampled predictions, so they were present and never asked for. Frame times void (the PC swapped).
WIP: feat(prepare): Compile shaders All / Most, Most (the default) skipping the predicted pipelinesto feat(prepare): Compile shaders All / Most / None, Most skipping the predicted pipelinesChecks after the merge, on binaries built from
4da99bc8(main1d6b832ahas no renderer or host change over it). RTX 3090, Linux, each folder a fresh copy:longshot --prepare-shaders), no choice set: "vk: Compile shaders: Most (the default): the predicted pipelines are left out"; no prediction ran (38,809 programs, 25,337 noted pipelines).make_game.py --update <folder> --compile-shaders all: wrote compile_shaders=1 into longshot_options.ini and ran the preparation with--compile-shaders all: "Compile shaders: All (RX_VK_COMPILE_SHADERS)", 50,547 predicted pipelines built.--compile-shaders mostover that file: "Most (RX_VK_COMPILE_SHADERS)", no prediction, and the earlier preparation's prediction marker and key files are removed.Wall times of these runs are not reported: the PC swapped heavily. The test that #158 left failing and a progress-bar jump on Most are fixed in #164 (merged).
Not checked: the WPF Builder (no .NET here), Windows, AMD.