vulkan-project/compile.sh
2022-10-29 16:06:48 +02:00

19 lines
396 B
Bash
Executable File

#!/bin/sh
WDIR=$HOME/c++/vulkan
SHADER_DIR=$WDIR/shaders
SOURCE_DIR=$WDIR/src/shaders
mkdir -p "${SHADER_DIR}"
for file in $(ls ${SOURCE_DIR}); do
ext="${file##*.}"
if [[ $ext == "vert" ]] || [[ $ext == "frag" ]]; then
src=${SOURCE_DIR}/${file}
dst=${SHADER_DIR}/$(basename ${file}).spv
echo "compiling $src to $dst"
glslc ${src} -o ${dst}
fi
done