diff --git a/.gitignore b/.gitignore index e6165a5..de6476a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Mac. +.DS_Store + # Vim temporary files (apparently) *~ # Visual studio stuff diff --git a/thirdparty/sokol-shdc-mac-arm64 b/thirdparty/sokol-shdc-mac-arm64 new file mode 100755 index 0000000..354b7ad Binary files /dev/null and b/thirdparty/sokol-shdc-mac-arm64 differ diff --git a/unix_run_codegen.sh b/unix_run_codegen.sh new file mode 100755 index 0000000..d675697 --- /dev/null +++ b/unix_run_codegen.sh @@ -0,0 +1,27 @@ +set -e + +if [ -d gen ]; then + echo "Codegen dir already exists" +else + mkdir gen +fi + +echo Shader Gen + + +unameOut="$(uname -s)" +# https://stackoverflow.com/questions/3466166/how-to-check-if-running-in-cygwin-mac-or-linux + +case "${unameOut}" in + Darwin*) + if [[ $(uname -m) == 'arm64' ]]; then + SHADER_EXECUTABLE="thirdparty/sokol-shdc-mac-arm64" + else + echo "Haven't downloaded the x64 macos shader binary yet, sorry" + fi;; + + Linux*) echo "Linux not supported yet.";; + *) echo "No idea what this machine is dude, sorry";; +esac + +$SHADER_EXECUTABLE --input threedee.glsl --output gen/threedee.glsl.h --slang glsl300es:hlsl5:glsl330 \ No newline at end of file