Build the mesh pipelines' stage libraries ahead of their draws, at the preparation and at boot.

The preparation and the boot build the stage libraries of single shaders. A mesh pipeline's pre-rasterization
library needs its mesh stage and its task stage together, and its fragment shader library depends on what that mesh
stage leaves unwritten, so only a pipeline record names what they are made of.

Every listed mesh pipeline the preparation builds and every recorded one the boot queues now notes its two shader
libraries, each key once. The preparation builds them on every core after the listed pipelines and before the
pipeline cache is saved, inside the marker that covers a driver dying on a listed pipeline. The boot builds them on
one thread at idle priority beside the game, behind the memory gate, with the rest of the library prebuild
(lib_prebuild = 0 leaves it out). Each is destroyed once built, which leaves it in the pipeline caches and the
driver's own, as for the single shaders' libraries.

A mesh pipeline of known stages that a draw meets with other targets, another blend state or sample count then finds
its libraries in the caches and is linked, where it was compiled whole. The recorded and listed mesh pipelines are
still built whole ahead of play, also on a machine that leaves the rest of the shared list to its first draw.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 22:30:02 -05:00
parent 89ed3ffd17
commit 1a206434e0
3 changed files with 162 additions and 4 deletions

View File

@@ -4,8 +4,10 @@ A game folder records every graphics pipeline a run builds in pipeline-keys.bin
keys": the pipeline state with its shaders named by input id) and every shader variant in shader-answers.bin
(runtime/gfx_shader.c "answers met in play": stage, code hash, input id, translator answers). The next start of that
folder builds its recorded pipelines ahead of play; another install, or the same one after its caches were removed,
meets each of them in play first. A mesh pipeline met that way has no stage libraries to be linked from, so its draws
are left out of the picture for its whole compile, 0.2 to 1.1 s.
meets each of them in play first. A mesh pipeline met that way is compiled then, 0.2 to 1.1 s with its draws left out
of the picture: all of it where mesh pipelines have no stage libraries, and otherwise the library of its task and
mesh stages, which is most of it and which only a pipeline record names (runtime/vk_pipeline.c "mesh pipelines' stage
libraries ahead of their draws").
This tool folds the two files of any number of game folders into one list file; a list file made before can stand
in for a folder, so a list grows by the folders played since. Beside the shader variants the pipelines name, the list