forked from OsnaCS/plantex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use glslangValidator in Travis-CI to validate our shaders... hopefull…
…y fixing OsnaCS#187
- Loading branch information
Showing
4 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# check for validator folder (travis caching) | ||
if [ ! -d "validator/" ]; then | ||
echo "need to install glslangValidator..." | ||
mkdir validator/ | ||
cd validator/ | ||
wget "https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang/Install/Linux/glslangValidator" | ||
chmod +x glslangValidator | ||
cd ../ | ||
echo "installed glslangValidator to $PWD/validator/glslangValidator" | ||
else | ||
echo "using cached glslangValidator" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit -o nounset | ||
|
||
echo "" | ||
echo "=== Validating Shaders ==============" | ||
|
||
SHADER_DIR=`find $PWD -name shader` | ||
|
||
ERROR_TMP=".shader_errors" | ||
trap "rm $ERROR_TMP; exit" SIGHUP SIGINT SIGTERM | ||
|
||
# Make sure only shaders are in client/shader/ for this to work | ||
for shader in $SHADER_DIR/*; do | ||
echo "Validating: `basename $shader` ..." | ||
if ! glslangValidator -s $shader > /dev/null; | ||
then | ||
echo "=== ERRORS in `basename $shader` =============" >> $ERROR_TMP | ||
glslangValidator $shader | grep "ERROR" >> $ERROR_TMP | ||
echo "" >> $ERROR_TMP | ||
fi | ||
done | ||
|
||
echo "" | ||
echo "=== Validating Shaders Done! ============" | ||
|
||
if [ -s $ERROR_TMP ] | ||
then | ||
echo "" | ||
echo "=== FOUND ERRORS IN SOME SHADERS! ==============" | ||
echo "" | ||
ERROR=1 | ||
# Print Errors & Cleanup | ||
cat $ERROR_TMP | ||
rm $ERROR_TMP | ||
else | ||
echo "" | ||
echo "=== Shaders seem fine! ==============" | ||
ERROR=0 | ||
fi | ||
|
||
test $ERROR == 0 |