#!/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