diff --git a/tools/prepare_shaders.py b/tools/prepare_shaders.py index 4535f708..4bb8985d 100644 --- a/tools/prepare_shaders.py +++ b/tools/prepare_shaders.py @@ -68,6 +68,15 @@ def read_list(path): return shader_list.history(ROOT / 'refs' / 'MacNativeGames') +def pipeline_variants(key): + """The vertex and fragment variant names of an R/B row's pipeline key. Since MacNativeGames f024ef04 (2026-10-28) the + TotK list keeps keys packed, "::"; older revisions and contribution files + hold the whole key in hex, "\\0\\0" + a Metal descriptor (docs/shader-list.md there).""" + if ':' in key: + return key.split(':', 2)[:2] + return [n.decode('ascii', 'replace') for n in bytes.fromhex(key).split(b'\0')[:2]] + + def parse_list(text): """V rows as (key, deps); priority per shader key from the warm rows (variant names start with the key).""" variants, prio = [], {} @@ -85,10 +94,9 @@ def parse_list(text): elif f[0] == 'C' and len(f) == 3: warm(f[1][:64], f[2]) elif f[0] in ('R', 'B') and len(f) >= 3: - names = bytes.fromhex(f[1]).split(b'\0')[:2] # "\0\0" + a Metal descriptor - for n in names: + for n in pipeline_variants(f[1]): if len(n) >= 64: - warm(n[:64].decode('ascii', 'replace'), f[-1]) + warm(n[:64], f[-1]) return variants, prio