From 32901bb337b183d2a40c3ddc4b2e3b8568e98615 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Tue, 10 Nov 2026 06:16:58 -0500 Subject: [PATCH] Build the runtime's shader headers before make_game.py compiles, so a source checkout builds again. tools/make_game.py has its own compile step and did not build runtime/*_spv.h, which the repository no longer holds: from a source checkout (the Linux path of docs/README-BuildKit.md) every runtime file that includes one failed to compile. A kit carries the headers built, so nothing is stale there and no shader compiler is looked for. Pull request #405 by mooki000, taken as it is. Not run on Linux here. Co-Authored-By: Claude Fable 5.2 --- docs/README-BuildKit.md | 4 +++- tools/make_game.py | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/README-BuildKit.md b/docs/README-BuildKit.md index cb48cdb9..bf37ea75 100644 --- a/docs/README-BuildKit.md +++ b/docs/README-BuildKit.md @@ -80,7 +80,9 @@ RADV). It takes clang, clang++ and lld from `PATH` and links against the system' pinned 3.4.0 into `toolchain/vma/` and checks its hash. 2. The shader translator: a kit with `bin/nx2navi_xlate` has it; from a source checkout, build it once with - `python tools/build_xlate.py` (needs the .NET 10 SDK). The build copies it beside the game. + `python tools/build_xlate.py` (needs the .NET 10 SDK). The build copies it beside the game. A kit also carries the + runtime's own shaders compiled; from a source checkout the build compiles them first, with `glslc`, `spirv-as` and + `spirv-val` (on Arch the packages `shaderc` and `spirv-tools`). 3. Build, then play: diff --git a/tools/make_game.py b/tools/make_game.py index 65ed86be..deaa1c69 100644 --- a/tools/make_game.py +++ b/tools/make_game.py @@ -1199,6 +1199,14 @@ def step_compile(out, cache_dir, msys, jobs, romfs_job=None, update=False): gen.mkdir(parents=True, exist_ok=True) obj.mkdir(parents=True, exist_ok=True) rt = KIT / 'runtime' + # The runtime's own shaders are in the repository as source only: from a source checkout their headers are not + # there until they are built, and every runtime file that includes one would fail to compile. A kit carries them + # built, so nothing is stale there and no shader compiler is looked for. + import build_shaders + stale = build_shaders.stale(rt) + if stale: + say(f' compiling {len(stale)} of the runtime\'s own shaders (runtime/*_spv.h)') + build_shaders.build(rt, stale) clang, clangxx, env, vma = toolchain(msys) if not romfs_job: romfs_index(out, gen)