Headers are regenerated only if shaders' source code was modified.
This commit is contained in:
parent
9e4fe8b410
commit
6dc79cf193
|
@ -8,6 +8,20 @@ SHADER_SRC=( "shader.vert" "shader.frag" )
|
||||||
# Number of shaders
|
# Number of shaders
|
||||||
SHADERS_NUMBER=${#SHADER_SRC[@]}
|
SHADERS_NUMBER=${#SHADER_SRC[@]}
|
||||||
OUTPUT="shader_src.h"
|
OUTPUT="shader_src.h"
|
||||||
|
UPDATE=false
|
||||||
|
|
||||||
|
# Check if it is necessary to regenerate headers
|
||||||
|
for filename in "${SHADER_SRC[@]}"
|
||||||
|
do
|
||||||
|
if [[ $filename -nt $OUTPUT ]]; then
|
||||||
|
UPDATE=true
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ $UPDATE == false ]]; then
|
||||||
|
echo "Headers are up-to-date."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# Prepare GLSL source to be included in C array
|
# Prepare GLSL source to be included in C array
|
||||||
function processSrc {
|
function processSrc {
|
||||||
|
|
Loading…
Reference in New Issue