Skip to content

Commit

Permalink
Unecessary flag check
Browse files Browse the repository at this point in the history
  • Loading branch information
W2Wizard committed Oct 8, 2024
1 parent 6f9878f commit 838167b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions tools/compile_shader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# See README in the root project for more information.
# -----------------------------------------------------------------------------

# If no arguments have been given, exit with error code 1
# If no arguments have been given
if [ "$#" -ne 2 ]; then
echo "ERROR: missing arguments, use as follows: $0 <ShaderFile> <Mode>" 1>&2
exit 1
fi

# If file cannot be found, exit with error code 2
# If file cannot be found
if [ ! -f "$1" ]; then
echo "ERROR: shader file not found: $1" 1>&2
exit 2
Expand All @@ -31,15 +31,10 @@ echo "#include \"MLX42/MLX42_Int.h\""
echo ""

{
# Start building the shader string
if [ "$2" -eq 1 ]; then
# Output WASM specific lines
if [ "$2" -eq 1 ]; then # Output WASM specific lines
echo "const char* ${SHADERTYPE}_shader = \"#version 300 es\\n\""
if [ "$SHADERTYPE" = "frag" ]; then
echo " \"precision mediump float;\""
fi
else
# Non-Wasm, output the original shader version
echo " \"precision mediump float;\""
else # Non-Wasm, output the original shader version
echo "const char* ${SHADERTYPE}_shader = \"$(sed -n '1{p;q;}' "$1")\\n\""
fi

Expand Down

0 comments on commit 838167b

Please sign in to comment.