From 87551c76181cf3b393e6780dd8fba569b3fcbdd6 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Tue, 10 Nov 2026 14:56:56 -0500 Subject: [PATCH] An update that carries the shaders over builds the kit's current pipeline list, and a GPU without mesh shaders skips the list's mesh pipelines. The carry path of an update does not run the shader preparation: it runs --warm-shaders, which builds the listed pipelines from the seed-pipeline-keys.bin the game folder already has. make_game.py now writes that file from the kit's list first, so a newer list reaches an updated install. Its shader variants are not translated on this path; a record whose variant the folder has neither prepared nor met is left out and counted. On a GPU that has no mesh shaders every mesh record failed with a log line each. They are counted in the step's line instead. Co-Authored-By: Claude Fable 5.2 --- runtime/vk_pipeline.c | 12 ++++++++---- tools/make_game.py | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/runtime/vk_pipeline.c b/runtime/vk_pipeline.c index 52865614..2cfa06f2 100644 --- a/runtime/vk_pipeline.c +++ b/runtime/vk_pipeline.c @@ -5898,7 +5898,7 @@ static int seed_pipelines(const char *dir) { gfx_shader_prewarm((const uint8_t(*)[32])ids, u, sh, cpus, procs < 1 ? 1 : procs); static const char note[] = "the listed pipelines are being built; a run that finds this file skips them\n"; plat_file_write_atomic(mark, note, sizeof note - 1); - uint32_t queued = 0, dropped = 0, known = 0, other = 0, mesh = 0; + uint32_t queued = 0, dropped = 0, known = 0, other = 0, mesh = 0, no_mesh = 0; plat_mutex_lock(&P.lock); uint32_t built0 = K.built, failed0 = K.failed; K.loading = 1; @@ -5917,6 +5917,10 @@ static int seed_pipelines(const char *dir) { other++; continue; } + if (is_mesh(&s) && !vk_ctx()->has_mesh_shader) { // this GPU draws no mesh pipeline + no_mesh++; + continue; + } if (!is_mesh(&s) && P.indep && fs && gfx_shader_stage(vs) == GFX_STAGE_VS) { // its vertex output union, as the boot GfxShaderIo io[32]; vs_outs(vs, fs, io); @@ -5953,9 +5957,9 @@ static int seed_pipelines(const char *dir) { char msg[640]; snprintf(msg, sizeof msg, "prepare-pipelines: %zu listed pipelines: %u built (%u mesh), %u failed, %u the same as one " "built before, %u without a shader this game version or its shader cache has, %u vertex pipelines left to " - "their first draw (NX2NAVI_PREPARE_PIPELINES=%s); on %d threads in %.0f ms; pipeline cache %s", n, built, - mesh, failed, known, dropped, other, all ? "all" : "mesh", nt ? nt : 1, now_ms() - t0, - saved ? "saved" : "not saved (builds kept running)"); + "their first draw (NX2NAVI_PREPARE_PIPELINES=%s), %u mesh pipelines this GPU cannot draw; on %d threads in " + "%.0f ms; pipeline cache %s", n, built, mesh, failed, known, dropped, other, all ? "all" : "mesh", no_mesh, + nt ? nt : 1, now_ms() - t0, saved ? "saved" : "not saved (builds kept running)"); printf("%s\n", msg); fflush(stdout); rt_log("vk_pipeline: %s", msg); diff --git a/tools/make_game.py b/tools/make_game.py index b931f777..39767037 100644 --- a/tools/make_game.py +++ b/tools/make_game.py @@ -1622,6 +1622,20 @@ def shader_run(cmd, cwd=None): return rc +def refresh_pipeline_seed(out): + """The kit's pipeline list (tools/pipeline_list.py) as the game folder's seed-pipeline-keys.bin, so that an update + which carries the shaders over builds a newer list's pipelines too: `--warm-shaders` builds from that file. The + list's shader variants are not translated on this path, so a record whose variant this folder has neither prepared + nor met is left out by the game, which counts those in its line.""" + lst = KIT / 'tools' / 'data' / 'pipeline_list.bin' + if not lst.is_file(): + return + import pipeline_list + got = pipeline_list.unpack(lst.read_bytes()) + if got: + (out / 'seed-pipeline-keys.bin').write_bytes(got[1]) + + def warm_driver_cache(out): """After an update that carries the shaders over: every prepared stage library is built into the graphics driver's cache again (`nx2navi.exe --warm-shaders`). It takes seconds while the driver still has them. It takes minutes when @@ -1633,6 +1647,7 @@ def warm_driver_cache(out): exe = out / EXE_NAME if not exe.is_file() or not (out / 'shader-prepared.bin').is_file(): return + refresh_pipeline_seed(out) say(" the prepared shaders are built into the graphics driver's cache again") t0 = time.monotonic() try: