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 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-10 06:16:58 -05:00
parent b6beb72c8d
commit 32901bb337
2 changed files with 11 additions and 1 deletions

View File

@@ -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:

View File

@@ -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)