vulkan-project/compile.sh

19 lines
396 B
Bash
Raw Permalink Normal View History

2022-10-07 23:30:44 +02:00
#!/bin/sh
WDIR=$HOME/c++/vulkan
SHADER_DIR=$WDIR/shaders
SOURCE_DIR=$WDIR/src/shaders
2022-10-07 23:30:44 +02:00
mkdir -p "${SHADER_DIR}"
2022-10-07 23:30:44 +02:00
for file in $(ls ${SOURCE_DIR}); do
ext="${file##*.}"
if [[ $ext == "vert" ]] || [[ $ext == "frag" ]]; then
2022-10-29 16:06:48 +02:00
src=${SOURCE_DIR}/${file}
dst=${SHADER_DIR}/$(basename ${file}).spv
echo "compiling $src to $dst"
glslc ${src} -o ${dst}
fi
done
2022-10-07 23:30:44 +02:00