aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-22 06:57:16 +0200
committerhachem <im@hachem.wtf>2026-09-22 06:57:16 +0200
commitd7c1ced08d5d78fcb239550404db4e67d4357a19 (patch)
tree9c0e218b096d138075cbf6a48e2562d33a8f94ed /tools
parent270eda6f558c972ec86ad0580f1d3d18afc83a94 (diff)
fix: windows supportHEADmain
Diffstat (limited to 'tools')
-rwxr-xr-xtools/compile-shaders.sh11
-rwxr-xr-xtools/fetch-slang.sh4
2 files changed, 13 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"
diff --git a/tools/fetch-slang.sh b/tools/fetch-slang.sh
index 5229bf7..d94a63b 100755
--- a/tools/fetch-slang.sh
+++ b/tools/fetch-slang.sh
@@ -16,6 +16,10 @@ case "$(uname -s)-$(uname -m)" in
Darwin-x86_64) ASSET="macos-x86_64" ;;
Linux-x86_64) ASSET="linux-x86_64" ;;
Linux-aarch64|Linux-arm64) ASSET="linux-aarch64" ;;
+ MINGW*|MSYS*|CYGWIN*)
+ # git bash on windows: the Vulkan SDK already ships slangc.exe and
+ # spirv-cross.exe, and compile-shaders.sh picks them up from $VULKAN_SDK/Bin
+ echo "fetch-slang: nothing to fetch on windows, the Vulkan SDK's slangc.exe is used"; exit 0 ;;
*) echo "fetch-slang: unsupported platform $(uname -s)-$(uname -m)"; exit 1 ;;
esac