2022-10-07 23:30:44 +02:00
|
|
|
#!/bin/sh
|
|
|
|
WDIR=$HOME/c++/vulkan
|
2022-10-27 00:53:40 +02:00
|
|
|
SHADER_DIR=$WDIR/shaders
|
|
|
|
SOURCE_DIR=$WDIR/src/shaders
|
2022-10-07 23:30:44 +02:00
|
|
|
|
2022-10-27 00:53:40 +02:00
|
|
|
mkdir -p "${SHADER_DIR}"
|
2022-10-07 23:30:44 +02:00
|
|
|
|
2022-10-27 00:53:40 +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}
|
2022-10-27 00:53:40 +02:00
|
|
|
fi
|
|
|
|
done
|
2022-10-07 23:30:44 +02:00
|
|
|
|
|
|
|
|