"$games/Game/Game" --shader-corpus="$PWD/corpus"
build/snx-shaderc corpus --validate --out translated
--validate needs spirv-val. --out writes SPIR-V modules for build comparisons.
The instruction decoder is generated at build time. src/nx/gpu/shader/sm53.decode lists each encoding (a
16-bit pattern of the word's top bits), and tools/decodetree (strict ISO C23, built for the build machine in a cross
build) checks it and writes a switch-based decoder into the build folder, so nothing is set up at run time.
Patterns that overlap must be in a { } group, which tries them in order: the narrower first. A new opcode is a
pattern there and an entry of SM53_OPS in translator.h (its O_ name and display name), from which decode.c
makes its trans_ function. ctest -R shader_decode checks that every opcode decodes.
[Debug] shader_corpus= in the game's INI does the same for every run. Where the game gets no command line
(Android), its INI's [Debug] diag=1 keeps each shader's entry in captures/shaders beside the game, for the same snx-shaderc.
Made from docs/dev/development.md at 69237645142c. GPL-3.0-or-later.