vulkan-project/compile.sh

17 lines
353 B
Bash
Raw 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
echo "compiling ${file}"
glslc ${SOURCE_DIR}/${file} -o ${SHADER_DIR}/$(basename ${file}).spv
fi
done
2022-10-07 23:30:44 +02:00