Skip to content

Commit

Permalink
validate shaders if they're being recompiled
Browse files Browse the repository at this point in the history
  • Loading branch information
slowriot committed Jan 9, 2025
1 parent 642a849 commit 37f64f1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 37f64f1

Please sign in to comment.