Keep the runtime's shaders in the repository as source only, and compile them when the game is built.

The fifteen headers of SPIR-V words under runtime/ are no longer tracked. tools/build_shaders.py builds all of them:
the GLSL with glslc, the SPIR-V assembly with spirv-as, and the two shaders assembled in Python from their scripts.
build_game.py builds the missing and the stale ones before it compiles the runtime, and the build kit, the launcher
release and the AppImage build them before they copy runtime/, so a player's PC still needs no shader compiler.
git ignores the headers and check_content.py refuses a compiled shader in a commit. The headers built this way are
byte for byte the ones removed here. vk_mvobj_fs.h is now mvobj_fs_spv.h, named like the others.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-10 01:53:41 -05:00
parent 202fc247d0
commit d15d4e2fbd
29 changed files with 176 additions and 6193 deletions

View File

@@ -70,7 +70,7 @@ from pathlib import Path
import check_isa
import romfs_index
from build_shaders import stale as stale_shaders
import build_shaders
from check_content import GENERATED_MARKER
WIN = os.name == 'nt'
@@ -899,9 +899,7 @@ def main():
copy_romfs_patches(args.version, out)
global RUNTIME
RUNTIME = (args.runtime or RUNTIME).resolve()
stale = stale_shaders(RUNTIME)
if stale:
sys.exit(f'{stale[0]}: its SPIR-V header no longer matches; run python tools/build_shaders.py')
build_shaders.build(RUNTIME) # the runtime's own shaders: the headers the sources below include, when missing or stale
skip = {s for s in args.skip_runtime.split(',') if s}
main_out = (ROOT / 'build' / args.version).resolve()
pairs = None