fix(vk): the start-up screen counts the compute pipelines and says when it writes the pipeline cache #721
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8015c9a
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
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
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!721
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/startup-wait-at-100"
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: none yet (game-free checks to run in CI) · Needs: Windows or Linux, a GPU with mesh shaders (any NVIDIA RTX, RDNA2+), a first start after a preparation
Why
On the first start after the shaders were prepared, the start-up screen can sit at Loading pipelines, 100%, every pipeline counted and "a few seconds left", for a long while before the game comes up. It isn't a hang, but it looks like one. The screen had stopped counting before the work was done: what it still did after that wasn't shown. Fixes #714.
How to reproduce
Seen on: v3.0.0-rc.4, reported on Discord (GPU, driver and OS not known yet). Read off the code: the path runs where programs load when the game makes them (
RX_VK_LOAD=create, the default on GPUs with mesh shaders).Settings and switches: defaults
Steps: prepare the shaders (the Builder or the launcher), then start the game: the first start after the preparation builds the noted pipelines into the pipeline cache (
precompile_warm).Expected: once the bar reads 100%, the screen soon moves on to "Starting the game".
Actual: after the noted pipelines,
precompile_warmbuilds every kept compute pipeline and then writes the whole pipeline cache (a GB and more). Through both the screen shows "32,623 / 32,623 pipelines", 100%, "a few seconds left": the compute pipelines were reported asprogress(total, total), and the write isn't counted at all.What changed
The compute pipelines the warm builds are now in its progress total from the start, so the bar holds under 100% while they're built and the time left covers them. Once the bar is full, the screen says what the start is still doing in place of "a few seconds left": "Saving the pipeline cache" while the cache is written, and "Getting the game ready" for anything else left (
precompile_at_create, the threads ending).gpu/vk/vk_draw.cpp,precompile_warm):program_cache_compute_keys()is taken before the noted pipelines (it is an in-memory index), and progress is reported overall_n = notes + compute pipelines. The compute pipelines are still only built once every note is done. The forcedpipeline_cache_save(true)is bracketed by a flag,prepare_saving()(declared invk_internal.h), and its time is logged:vk: precompile: the pipeline cache written out in N s.gpu/vk/vk_progress.h):StartupState::saving, andwaiting_text()choosing the text right under the bar.gpu/vk/vk_main.cpp's painter fillssavingfromprepare_saving().tests/test_startup_progress.pychecks the new texts (100% counted, saving, and the time left while there is work counted).tests/test_warm_bounded.pychecks that the warm counts its compute pipelines in the total and flags the cache's write.Measurements
Verdict: not measured yet. The wait itself isn't shortened: the same work is now counted and named on the screen. What's left to measure is that the bar now holds under 100% until the compute pipelines are built, and how long the cache write takes (the new log line).
Flags and settings
None
Testing
Tested: nothing yet. The change is read against the code paths. Per this PC's rules the checks aren't run here:
python -I -B tests/run_all.pyis left to the forge's CI.Not tested: a build on either platform; a start in the game; the
--prepare-shadersrun (the Builder's), whose bar now also counts the compute pipelines in its last part.Must be tested:
vk: compute pipelines: N of M, then "Saving the pipeline cache" under the bar, then "Starting the game". The log should havevk: precompile: the pipeline cache written out in N s(Test Farm: @Beanstalk the first start after preparing the shaders, watching the start-up screen at its end, and the log linesvk: precompile:)Risks
What could break: only the start-up screen's numbers and texts, and the Builder's progress bar's last part (now larger by the compute pipelines). What's built and when is unchanged.
Turning it off: revert the commit.
Compatibility: Nothing changes: no file format, cache, option or
MKWVK_API_VERSIONchange.Issues
Fixes #714
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). (not run on this PC: waiting for CI)third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here. (added; it fails onmainby reading it, since the checks look for code main doesn't have; passing here waits for CI)tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
WIP: fix(vk): the start-up screen counts the compute pipelines and says when it writes the pipeline cacheto fix(vk): the start-up screen counts the compute pipelines and says when it writes the pipeline cache