Pipeline state list: the pipelines met in play, by hashes and state, built before the game on a new install or update #939
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!939
Loading…
Reference in a new issue
No description provided.
Delete branch "pipeline-state-list"
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?
Pipelines need draw state as well as shaders. A first start, of a new install or of a new build, still makes every graphics pipeline, and every texture variant of a program, the first time it is drawn.
hookshot_pipelines.bin(the precompile's notes) only helps the next start of the same build: its stamp drops it on any back-end change. #772's prediction also reads those notes, so it has nothing to work from on a first start.Change
hookshot_pipeline_states.bin(beside the game, written as pipelines are made) holds each pipeline as:Each record is 528 bytes. It holds no game code: the stages come back from the player's own
hookshot_shaders.bin. Unlike the notes, the list is good for any build.prepare_run(once per back-end build) reads that list andhookshot_pipeline_states_shipped.bin:precompile_runbuilds them before the title. The prediction then also has notes on a first start.Shipping:
nx2/make_game.pyputswork/pipeline_states.bin, when there is one, beside the game as the shipped list.nx2/pipeline_states.pyshows and merges lists, so a maintainer's play-through, or players' lists, become the shipped one.Off switch:
RX_VK_NO_STATE_LIST=1turns both recording and reading off.Refactor: the pipeline key is one function (
pipeline_key) for draws and the list.Test:
tests/test_pipeline_states.pychecks that the record size and magic agree between the back end and the tool, that merging keeps each pipeline once, and that make_game ships the list only when there is one.Measured (RTX 3090, Linux, fresh first start, no caches, the same Kokiri Forest route each run with input timed in game frames, headless)
Main (
232eecbd) against main plus this PR, with a list recorded on one earlier run of the same route (1,001 pipelines, 725 programs, 68 texture variants; all were made at prepare, none failed):The list came from the same route, so this is the best case. A list from a full play-through would cover the rest of the game the same way; one from a different route covers only what the two share.
Closing to keep the queue clear — please rebase on current main and reopen; thanks!