Files
AVA2/tools/compile_scene_shaders.py
shenandshen 281418f351 Fix cross-platform rendering and optimize frame performance
Correct selection orientation, game-entry lifecycle, mounted NPCs, labels and skill panels. Add the native GPU scene path, resident geometry, bounded texture and Python caches, and collision broad phase.

Pin the independently maintained Metin2 SDK through a submodule and document reproducible setup. Include rendering regressions and macOS packaging improvements.

Validation: client Debug build and 12 targeted client tests passed; SDK build and all 14 SDK tests passed.
2026-10-11 17:55:53 -07:00

19 lines
932 B
Python

#!/usr/bin/env python3
"""Rebuild the embedded Vulkan shaders with glslc; Metal uses the same source semantics."""
from pathlib import Path
import subprocess
import tempfile
root = Path(__file__).resolve().parents[1]
parts = ['// Generated by tools/compile_scene_shaders.py; do not edit.\n#pragma once\n']
with tempfile.TemporaryDirectory() as tmp:
for stage in ('vert', 'frag'):
source = root / 'src/eter_render/shaders' / ('scene.' + stage)
binary = Path(tmp) / stage
subprocess.run(['glslc', str(source), '-o', str(binary)], check=True)
data = binary.read_bytes()
parts.append('alignas(4) inline constexpr unsigned char scene_' + stage + '_spv[] = {\n')
for start in range(0, len(data), 24):
parts.append(','.join(str(v) for v in data[start:start+24]) + ',\n')
parts.append('};\n')
(root / 'src/eter_render/shaders/SceneSpirv.h').write_text(''.join(parts))