From e903d627315415e1457b3bcf24664fbf4b68743b Mon Sep 17 00:00:00 2001 From: Pawel Lapinski Date: Wed, 28 Feb 2018 10:19:19 +0100 Subject: [PATCH] Updated compile_shaders.sh bash script. --- Project/compile_shaders.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Project/compile_shaders.sh b/Project/compile_shaders.sh index 94599c1..7491dfb 100644 --- a/Project/compile_shaders.sh +++ b/Project/compile_shaders.sh @@ -13,17 +13,20 @@ folder=$1/Data function convert { - if [ -f "./$folder/shader.$1" ]; then - echo "Converting $1 shader..." - glslangValidator -V -H -o $folder/$1.spv $folder/shader.$1 > $folder/$1.spv.txt + if [ -f "./$folder/$1.$2" ]; then + echo "Converting $1.$2 shader..." + glslangValidator -V -H -o $folder/$1.$2.spv $folder/$1.$2 > $folder/$1.$2.spv.txt fi } if [ "$1" == "" ]; then - echo "No arguments provided! Please specify subfolder and number." - echo "Example usage: source compile_shaders.sh Tutorials/03" + echo "No arguments provided! Please specify folder and shader file name without extension." + echo "Example usage: source compile_shaders.sh Tutorials/03 shader" +elif [ "$2" == "" ]; then + echo "Shader name not provided! Please specify folder name and shader file name without extension." + echo "Example usage: source compile_shaders.sh Tutorials/03 shader" else echo "Converting GLSL shaders into SPIR-V assembly in the '$folder' folder." - convert vert - convert frag + convert $2 vert + convert $2 frag fi