#!/usr/bin/env bash

BASEDIR=$(dirname "$0")
TARGETDIR="$BASEDIR/../content/shaders"
GLSL=${GLSL:="glslc"}

rm $TARGETDIR/*.spv

# Tris
$GLSL $BASEDIR/Tris.vert -o $TARGETDIR/Tris.vs.spv
$GLSL $BASEDIR/Tris.frag -o $TARGETDIR/Tris.fs.spv
$GLSL $BASEDIR/Tris.vert $BASEDIR/Tris.frag -o $TARGETDIR/Tris.spv

# Color
$GLSL $BASEDIR/Color.vert -o $TARGETDIR/Color.vs.spv
$GLSL $BASEDIR/Color.frag -o $TARGETDIR/Color.fs.spv

# Sky
$GLSL $BASEDIR/Sky.vert -o $TARGETDIR/Sky.vs.spv
$GLSL $BASEDIR/Sky.frag -o $TARGETDIR/Sky.fs.spv

# Voxel
$GLSL $BASEDIR/Voxel.vert -o $TARGETDIR/Voxel.vs.spv
$GLSL $BASEDIR/Voxel.frag -o $TARGETDIR/Voxel.fs.spv
$GLSL $BASEDIR/Voxel.vert -DINSTANCED -o $TARGETDIR/Voxel.ins.vs.spv
$GLSL $BASEDIR/Voxel.frag -DINSTANCED -o $TARGETDIR/Voxel.ins.fs.spv

$GLSL $BASEDIR/Voxel.vert -DGEOMETRY -o $TARGETDIR/Voxel.geo.vs.spv
$GLSL $BASEDIR/Voxel.geom -DGEOMETRY -o $TARGETDIR/Voxel.geo.gs.spv
$GLSL $BASEDIR/Voxel.frag -DGEOMETRY -o $TARGETDIR/Voxel.geo.fs.spv
$GLSL $BASEDIR/Voxel.vert -DGEOMETRY -DINSTANCED -o $TARGETDIR/Voxel.geo.ins.vs.spv
$GLSL $BASEDIR/Voxel.geom -DGEOMETRY -DINSTANCED -o $TARGETDIR/Voxel.geo.ins.gs.spv
$GLSL $BASEDIR/Voxel.frag -DGEOMETRY -DINSTANCED -o $TARGETDIR/Voxel.geo.ins.fs.spv