mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-18 20:15:56 +00:00
MacNativeGames now translates each shader's default bind state when it builds and keeps only other variants in its shared list, so the list at origin/HEAD has 134 rows of 1.4.3 shaders. prepare_shaders.py seeds the default variant of every shader it finds and reads the list through tools/shader_list.py, which adds the V rows older revisions held. On 1.4.3 that prepares 29,587 variants in 7 min with 0 translation failures, and every one of the 1,095 variants the field and intro runs met in play is among them. The installer's dev path and make_release.py read the list the same way. Also record that 1.2.1 loads saves 1.4.3 wrote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
1.5 KiB
Python
29 lines
1.5 KiB
Python
"""The MacNativeGames shared shader list (refs/MacNativeGames games/totk/assets/shader_list.tsv, MIT; docs/shader-list.md
|
|
there) as our tools read it: every row of one revision, plus the V rows of every older revision that it dropped.
|
|
|
|
MacNativeGames prunes V rows its own runtime no longer needs: default variants, which its seed translates for every
|
|
shader (1.4.3 on 2026-10-22, 1.0.0 to 1.2.1 on 2026-10-25), and variants that differ only in vertex input or colour
|
|
output types (2026-10-26). Our answers (runtime/gfx_shader.c) still tell those apart, so a dropped row names a variant
|
|
our play meets: at 1340bee the list alone has 134 rows of 1.4.3 shaders, its history 24,839, and of 1.2.1 6,771 and
|
|
25,238. A row no draw asks for costs one translation. No copy of the list goes into the repository.
|
|
"""
|
|
import subprocess
|
|
|
|
PATH = 'games/totk/assets/shader_list.tsv'
|
|
|
|
|
|
def git(repo, *args):
|
|
return subprocess.run(['git', '-C', str(repo), *args], check=True, capture_output=True, encoding='utf-8').stdout
|
|
|
|
|
|
def history(repo, rev='origin/HEAD'):
|
|
"""rev's list, then each V row of an older revision that no newer one has, newest first."""
|
|
lines = git(repo, 'show', f'{rev}:{PATH}').splitlines()
|
|
seen = set(lines)
|
|
for h in git(repo, 'log', '--format=%H', rev, '--', PATH).split()[1:]:
|
|
for line in git(repo, 'show', f'{h}:{PATH}').splitlines():
|
|
if line.startswith('V\t') and line not in seen:
|
|
seen.add(line)
|
|
lines.append(line)
|
|
return '\n'.join(lines) + '\n'
|