From 37f64f1364bf8b93d04d15d9e31418b4010c872b Mon Sep 17 00:00:00 2001 From: SlowRiot Date: Thu, 9 Jan 2025 01:16:55 +0000 Subject: [PATCH] validate shaders if they're being recompiled --- build.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 3b9c9a1..c801c18 100755 --- a/build.sh +++ b/build.sh @@ -43,7 +43,16 @@ for file in "${compiled_resources[@]}"; do ((++compiled_resources_up_to_date)) fi done -echo "Compiled resources: $((compiled_resources_total - compiled_resources_up_to_date)) updated, $compiled_resources_up_to_date up to date ($compiled_resources_total total)" +compiled_resources_updated=$((compiled_resources_total - compiled_resources_up_to_date)) +echo "Compiled resources: $compiled_resources_updated updated, $compiled_resources_up_to_date up to date ($compiled_resources_total total)" + +if [ "$compiled_resources_updated" != 0 ]; then + # validate shaders + if ! [ -z "$(which naga)" ]; then + echo "Validating shaders with naga-cli" + naga --bulk-validate render/shaders/*.wgsl || exit 1 + fi +fi cd "$build_dir"