Fail when shader can't be compiled (fixes #4857)

This commit is contained in:
Dennis Felsing 2022-03-21 16:32:45 +01:00
parent e632859707
commit 3341fb13f9

View file

@ -162,9 +162,15 @@ if(NOT FOUND_MATCHING_SHA256_FILE)
generate_shader_file("-DTW_QUAD_TEXTURED" "-DTW_PUSH_CONST" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/quad.frag" "data/shader/vulkan/quad_push_textured.frag.spv")
generate_shader_file("-DTW_QUAD_TEXTURED" "-DTW_PUSH_CONST" "${PROJECT_SOURCE_DIR}/data/shader/vulkan/quad.vert" "data/shader/vulkan/quad_push_textured.vert.spv")
execute_process(${GLSLANG_VALIDATOR_COMMAND_LIST})
execute_process(${GLSLANG_VALIDATOR_COMMAND_LIST} RESULT_VARIABLE STATUS)
if(STATUS AND NOT STATUS EQUAL 0)
message(FATAL_ERROR "${GLSLANG_VALIDATOR_COMMAND_LIST} failed")
endif()
if(SPIRV_OPTIMIZER_PROGRAM_FOUND)
execute_process(${SPIRV_OPTIMIZER_COMMAND_LIST})
execute_process(${SPIRV_OPTIMIZER_COMMAND_LIST} RESULT_VARIABLE STATUS)
if(STATUS AND NOT STATUS EQUAL 0)
message(FATAL_ERROR "${SPIRV_OPTIMIZER_COMMAND_LIST} failed")
endif()
file(REMOVE ${GLSLANG_VALIDATOR_DELETE_LIST})
endif()