Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vulkan: Choose where Shaders are generated #2226

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions test_conformance/vulkan/shaders/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,21 @@ if(${Vulkan_glslang_binary} STREQUAL "Vulkan_glslang_binary-NOTFOUND")
else()
message(STATUS "Found glslang: ${Vulkan_glslang_binary}")

if(NOT DEFINED VULKAN_TEST_RESOURCES)
set(VULKAN_TEST_RESOURCES ${CMAKE_CURRENT_BINARY_DIR})
endif()

set(vulkan_spirv_files "")

add_custom_command(
OUTPUT buffer.spv
OUTPUT ${VULKAN_TEST_RESOURCES}/buffer.spv
COMMAND ${Vulkan_glslang_binary}
--target-env vulkan1.0
-o ${CMAKE_CURRENT_BINARY_DIR}/buffer.spv
-o ${VULKAN_TEST_RESOURCES}/buffer.spv
${CMAKE_CURRENT_SOURCE_DIR}/buffer.comp
DEPENDS buffer.comp
VERBATIM)
list(APPEND vulkan_spirv_files ${CMAKE_CURRENT_BINARY_DIR}/buffer.spv)
list(APPEND vulkan_spirv_files ${VULKAN_TEST_RESOURCES}/buffer.spv)

file(STRINGS "image2D_test_formats.txt" image2D_formats)

Expand All @@ -29,14 +33,14 @@ else()
configure_file(image2D.comp.in image2D_${GLSL_FORMAT}.comp)

add_custom_command(
OUTPUT image2D_${GLSL_FORMAT}.spv
OUTPUT ${VULKAN_TEST_RESOURCES}/image2D_${GLSL_FORMAT}.spv
COMMAND ${Vulkan_glslang_binary}
--target-env vulkan1.0
-o ${CMAKE_CURRENT_BINARY_DIR}/image2D_${GLSL_FORMAT}.spv
-o ${VULKAN_TEST_RESOURCES}/image2D_${GLSL_FORMAT}.spv
${CMAKE_CURRENT_BINARY_DIR}/image2D_${GLSL_FORMAT}.comp
DEPENDS image2D_${GLSL_FORMAT}.comp
VERBATIM)
list(APPEND vulkan_spirv_files ${CMAKE_CURRENT_BINARY_DIR}/image2D_${GLSL_FORMAT}.spv)
list(APPEND vulkan_spirv_files ${VULKAN_TEST_RESOURCES}/image2D_${GLSL_FORMAT}.spv)
endforeach()

add_custom_target(vulkan_shaders DEPENDS ${vulkan_spirv_files})
Expand Down
Loading