mirror of
https://github.com/opus-tango/IntroductionToVulkan.git
synced 2026-03-20 03:55:26 +00:00
Updated compile_shaders.sh bash script.
This commit is contained in:
@@ -13,17 +13,20 @@
|
|||||||
folder=$1/Data
|
folder=$1/Data
|
||||||
|
|
||||||
function convert {
|
function convert {
|
||||||
if [ -f "./$folder/shader.$1" ]; then
|
if [ -f "./$folder/$1.$2" ]; then
|
||||||
echo "Converting $1 shader..."
|
echo "Converting $1.$2 shader..."
|
||||||
glslangValidator -V -H -o $folder/$1.spv $folder/shader.$1 > $folder/$1.spv.txt
|
glslangValidator -V -H -o $folder/$1.$2.spv $folder/$1.$2 > $folder/$1.$2.spv.txt
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
echo "No arguments provided! Please specify subfolder and number."
|
echo "No arguments provided! Please specify folder and shader file name without extension."
|
||||||
echo "Example usage: source compile_shaders.sh Tutorials/03"
|
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
|
else
|
||||||
echo "Converting GLSL shaders into SPIR-V assembly in the '$folder' folder."
|
echo "Converting GLSL shaders into SPIR-V assembly in the '$folder' folder."
|
||||||
convert vert
|
convert $2 vert
|
||||||
convert frag
|
convert $2 frag
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user