Generate the SPIR-V shaders automatically at build time (#2200)

Add custom commands and targets to automatically assemble and validate
the SPIR-V shaders used by the test.

Automatic assembly depends on finding `python3`, `spirv-as` and
`spirv-val`. `SPIRV_TOOLS_DIR` can be defined by the user during
configuration to provide an override path. Default behaviour assumes
that the binaries exist in `PATH`.

---------

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
This commit is contained in:
Ahmed Hesham
2025-02-11 16:43:37 +00:00
committed by GitHub
parent a8b32b2720
commit ecd012737f
4 changed files with 507 additions and 2 deletions

View File

@@ -40,6 +40,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang"
add_cxx_flag_if_supported(-Wno-narrowing)
endif()
set(${MODULE_NAME}_SOURCES ${SPIRV_NEW_SOURCES} ${TEST_HARNESS_SOURCES})
set(${MODULE_NAME}_SOURCES ${${MODULE_NAME}_SOURCES} ${TEST_HARNESS_SOURCES})
include(../CMakeCommon.txt)
add_subdirectory(spirv_asm)
add_dependencies(${${MODULE_NAME}_OUT} spirv_new_binaries)