From 682d9c5c50e647ca6a634b3e959b437be089f045 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Tue, 10 Nov 2026 14:52:25 -0500 Subject: [PATCH] A draw does not wait for the fast link of a mesh pipeline that is known to be compiling. A draw whose pipeline is missing waits up to 3 ms for its fast link before it is skipped, 6 ms a frame in all. A mesh pipeline has no stage libraries and gets no fast link, so for the 0.2 to 1.1 s of its compile every frame that drew with it lost those milliseconds and skipped the draw all the same. Once such a pipeline has been building for longer than the 8 ms a cached one needs, its draws are skipped at once, as the one-shot mesh draws already are. Not run in the game yet. Co-Authored-By: Claude Fable 5.2 --- runtime/vk_exec_draw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/vk_exec_draw.c b/runtime/vk_exec_draw.c index 1f22d537..8e5eea68 100644 --- a/runtime/vk_exec_draw.c +++ b/runtime/vk_exec_draw.c @@ -3974,6 +3974,9 @@ static int prepare_draw_ex(VkExec *ex, int prim, int32_t count, int restart, int if (linking) t0 = kern_now_ns(); else w0 = t0 ? t0 : wait_ms ? kern_now_ns() : 0; vk_exec_ahead(ex); + // A mesh pipeline that is known to be compiling gets no fast link, so the few milliseconds a draw waits + // for one are lost in every frame that meets it until the compile ends, 0.2 to 1.1 s later (MESH_WAIT_MS). + if (wait_ms && linking && mesh && vk_pipeline_building_ms(&s) > MESH_WAIT_MS) wait_ms = 0; if (wait_ms) p = vk_pipeline_graphics_async(&s, &info, &pending, wait_ms); } if (t0 && budget) {