#!/bin/sh # tools/build_shaders.sh -- compile the GLSL shaders to SPIR-V. # # Uses the vendored glslangValidator (no network, no system install). # Run from the repository root: sh tools/build_shaders.sh set -e DIR=$(dirname "$0")/.. GLSLANG="$DIR/tools/bin/glslangValidator" if [ ! -x "$GLSLANG" ]; then chmod +x "$GLSLANG" 2>/dev/null || true fi if [ ! -x "$GLSLANG" ]; then echo "build_shaders: glslangValidator not found at $GLSLANG" >&2 exit 1 fi echo "compiling shaders/triangle.vert -> shaders/triangle.vert.spv" "$GLSLANG" -V "$DIR/shaders/triangle.vert" -o "$DIR/shaders/triangle.vert.spv" echo "compiling shaders/triangle.frag -> shaders/triangle.frag.spv" "$GLSLANG" -V "$DIR/shaders/triangle.frag" -o "$DIR/shaders/triangle.frag.spv" echo "shaders ok"