diff options
| author | hachem <im@hachem.wtf> | 2026-09-22 06:33:59 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-22 06:33:59 +0200 |
| commit | 53fa01afb052fd64c99e87fd53c22654e796b64f (patch) | |
| tree | 6294a1816fa98efccd8f699142daa28102a91c29 /tools/compile-shaders.sh | |
| parent | ec2839ecbfc3f28b3f335489ae7611b60fba82c5 (diff) | |
chore: windows support in premake and the shader scripts
Diffstat (limited to 'tools/compile-shaders.sh')
| -rwxr-xr-x | tools/compile-shaders.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/compile-shaders.sh b/tools/compile-shaders.sh index 5da5d9a..a5d786e 100755 --- a/tools/compile-shaders.sh +++ b/tools/compile-shaders.sh @@ -14,8 +14,15 @@ set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" -SLANGC="${SLANGC:-$ROOT/tools/slang/bin/slangc}" -SPIRV_CROSS="${SPIRV_CROSS:-$(command -v spirv-cross || echo spirv-cross)}" +# the vulkan sdk ships both tools (git bash on windows); tools/slang + brew otherwise. +if [ -z "${SLANGC:-}" ]; then + if [ -n "${VULKAN_SDK:-}" ] && [ -x "$VULKAN_SDK/Bin/slangc.exe" ]; then SLANGC="$VULKAN_SDK/Bin/slangc.exe" + else SLANGC="$ROOT/tools/slang/bin/slangc"; fi +fi +if [ -z "${SPIRV_CROSS:-}" ]; then + if [ -n "${VULKAN_SDK:-}" ] && [ -x "$VULKAN_SDK/Bin/spirv-cross.exe" ]; then SPIRV_CROSS="$VULKAN_SDK/Bin/spirv-cross.exe" + else SPIRV_CROSS="$(command -v spirv-cross || echo spirv-cross)"; fi +fi SRC="$ROOT/assets/shaders" OUT="$SRC/generated" |
