1#!/bin/bash 2# Copyright 2016-2021 The Khronos Group Inc. 3# SPDX-License-Identifier: Apache-2.0 4 5OPTS=$@ 6 7if [ -z "$SPIRV_CROSS_PATH" ]; then 8 echo "Building spirv-cross" 9 make -j$(nproc) 10 SPIRV_CROSS_PATH="./spirv-cross" 11fi 12 13export PATH="./external/glslang-build/output/bin:./external/spirv-tools-build/output/bin:.:$PATH" 14echo "Using glslangValidation in: $(which glslangValidator)." 15echo "Using spirv-opt in: $(which spirv-opt)." 16echo "Using SPIRV-Cross in: \"$SPIRV_CROSS_PATH\"." 17 18./test_shaders.py shaders ${OPTS} --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 19./test_shaders.py shaders ${OPTS} --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 20./test_shaders.py shaders-no-opt ${OPTS} --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 21./test_shaders.py shaders-msl ${OPTS} --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 22./test_shaders.py shaders-msl ${OPTS} --msl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 23./test_shaders.py shaders-msl-no-opt ${OPTS} --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 24./test_shaders.py shaders-hlsl ${OPTS} --hlsl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 25./test_shaders.py shaders-hlsl ${OPTS} --hlsl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 26./test_shaders.py shaders-hlsl-no-opt ${OPTS} --hlsl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 27./test_shaders.py shaders-reflection ${OPTS} --reflect --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 28./test_shaders.py shaders-ue4 ${OPTS} --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 29./test_shaders.py shaders-ue4 ${OPTS} --msl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 30./test_shaders.py shaders-ue4-no-opt ${OPTS} --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1 31 32