Measurement

The goal is the stall of a new shader in a frame, and how often it occurs. Measure the same scene and script on the build before the change and after it, three times each, with empty caches and with warm caches. Run without the validation layer for times.

Results

The menus of an Ounce game, 760 frames with one press each 20 frames, on the RTX 2080 (NVIDIA 615.78.08). Each build had a warm-up run first. The runs are few and the game's path through the menus changes from run to run, so the numbers show the mechanism, not a mean.

The bound of optimizing workers, measured

The menus with cold pipeline caches (vk_pipeline_cache=0, NVIDIA's disk cache off), one run each of 200 s:

Optimized pipelinesFramesFrames over 1 sThe draws' new pipelines' waits for a worker
none76012385 pipelines, 32.6 s in all, the longest 933 ms
one worker at most75512356 pipelines, 40.4 s in all, the longest 911 ms
no bound (six workers)52927the run ended before its stats line

With one optimizing worker the cold run behaves like a run with no optimized pipelines. With no bound the game made fewer frames and more than twice as many frames over 1 s. The runs take different paths through the menus, so these are single runs, not means. The renderer now uses one worker at most (PIPE_OPT_WORKERS).

The warm-up of the shipped programs, measured

So the warm-up of all 7,403 shipped programs would cost about 18 minutes of worker time in a first run and add about 380 MB to vk_pipelines.bin, for programs that a session mostly does not use (540 of 7,403 in these menus). The numbers do not allow it. A warm-up of the large programs only (the few of hundreds of KB of SPIR-V, whose parts take seconds) would cost little, and it is the next step: make their pre-rasterization parts from the shipped modules on the lowest queue, and keep them in the table of parts, so that a draw links them at once.


Made from docs/layers/gpu/pipeline-libraries.md at 69237645142c. GPL-3.0-or-later.