Keep the fast link's waits at 3 ms a pipeline and 6 ms a frame.

The 8 ms and 16 ms tried in their place left fewer draws out in a scripted walk, but in play a frame that takes 10 to 14 ms longer felt worse to the player than one that is left out, in two sessions on the same install. The wait stays counted once for each pipeline, and a frame that has left a draw out already still waits for nothing more.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 08:49:26 -05:00
parent b5aea4808b
commit baad032500
5 changed files with 31 additions and 33 deletions

View File

@@ -161,9 +161,9 @@ of them.
What this step leaves for play, and the shared pipeline list. The step translates every shader's default variant
and the shader list's variants and builds each one's stage library or compute pipeline. A whole graphics pipeline
is built ahead at the start of a game folder that has drawn it before (`pipeline-keys.bin`) or whose release
listed it (below); a pipeline met for the first time is linked from its stage libraries in 2 to 8 ms, which its
first draw waits for (`pipe_link_draw_ms`, 8 ms from the pipeline's first miss; `runtime/vk_exec_draw.c`
`link_budget`), except a mesh
listed it (below); a pipeline met for the first time is linked from its stage libraries in 2 to 8 ms, of which its
first draw waits 3 (`pipe_link_draw_ms`, from the pipeline's first miss; `runtime/vk_exec_draw.c` `link_budget`),
except a mesh
pipeline, which has no libraries and compiles whole (0.2 to 1.1 s, its draws left out of the picture meanwhile),
and many of them on a first visit add up to hitches. `tools/pipeline_list.py merge` folds the `pipeline-keys.bin`
and `shader-answers.bin` of game folders that were played, and lists made before, into a pipeline list, with the

View File

@@ -24,19 +24,17 @@ for the launcher; a GPU with Vulkan 1.3 and `VK_EXT_external_memory_host` (curre
1,769 draws wait for their pipelines, 461 ms in all, the longest frame 88 ms. In a first walk through Kakariko
Village on fresh caches no draw waited for a pipeline with the list, where 634 pipelines were missed without it, and
the first minute had 10 frames over 25 ms instead of 137. `pipe_seed = 0` in nx2navi.ini leaves the list out.
- **A pipeline the list does not have costs its frame less.** Such a pipeline is linked from the shader libraries the
install prepared, and its first draw waits for that. The wait was 3 ms for each draw, just under what the link
takes: in a first-visit session on a new install 66 of 87 such draws gave up at the end of it, and their frame was
then not shown, so the picture before it stayed for one frame more. Of the 67 pipelines that session met outside
the list, 61 were ready within 8 ms. The wait is now 8 ms, counted once for each pipeline from the first draw that
needed it, so a pipeline the driver has to compile costs one frame that much and the frames after it nothing
(`pipe_link_draw_ms`, and `pipe_link_ms` for all the pipelines of one frame, now 16). A frame that has already
left a draw out waits for nothing more. In a walk through Kakariko with no pipeline recorded at all, the picture
stood still 15 times instead of 50 and 1 frame was shown incomplete instead of 22, with the frame times unchanged.
- **Less waiting for a pipeline the list does not have.** Such a pipeline is linked from the shader libraries the
install prepared, and its draws waited 3 ms for that in every frame until it was there. The 3 ms are now counted
once for each pipeline, from the first draw that needed it, and a frame that has already left a draw out waits for
nothing more: a pipeline the driver has to compile costs one frame the wait and the frames after it nothing.
`pipe_link_draw_ms` and `pipe_link_ms` set longer waits, which leave fewer draws out of a frame and make that frame
longer.
- **Compute shader variants are prepared too.** The list now carries the 629 compute shader variants met in play. No
pipeline record names a compute shader, so a variant the shader list lacked was translated on the frame that first
used it, 30 and 38 ms in two frames of that session. Fourteen of the list's variants are of shaders the preparation
does not read from the game yet, three of that session's four among them: those are still translated at first use.
used it, 30 and 38 ms in two frames of one first-visit session. Fourteen of the list's variants are of shaders the
preparation does not read from the game yet, three of that session's four among them: those are still translated at
first use.
- **The draw replay runs on several CPU cores by default** (`replay_workers = 3`; contributed by epicmeme546): a
frame's large groups of draws are recorded on three threads beside the one that submits them. On an RX 7900 XT in
Hyrule Field it gave 51.7 instead of 43.6 fps standing. `replay_workers = 0` records on one thread as before; try