GPU: Add MoltenVK as dependencies to Vulkan SDK.

MoltenVK is part of the vulkan SDK. Blender requires the vulkan SDK
to compile. This patch adds the MoltenVK includes and libraries to
the Vulkan includes and libraries.
This commit is contained in:
Jeroen Bakker
2022-11-22 14:04:36 +01:00
parent 51f56e71cb
commit dd5fdb9370
4 changed files with 14 additions and 7 deletions

View File

@@ -1244,9 +1244,6 @@ endif()
if(WITH_VULKAN_BACKEND)
list(APPEND BLENDER_GL_LIBRARIES ${VULKAN_LIBRARIES})
if(APPLE)
list(APPEND BLENDER_GL_LIBRARIES ${MOLTENVK_LIBRARIES})
endif()
endif()
# -----------------------------------------------------------------------------

View File

@@ -101,8 +101,20 @@ if(WITH_USD)
endif()
if(WITH_VULKAN_BACKEND)
find_package(Vulkan REQUIRED)
find_package(MoltenVK REQUIRED)
if(EXISTS ${LIBDIR}/vulkan)
set(VULKAN_FOUND On)
set(VULKAN_ROOT_DIR ${LIBDIR}/vulkan/macOS)
set(VULKAN_INCLUDE_DIR ${VULKAN_ROOT_DIR}/include)
set(VULKAN_LIBRARY ${VULKAN_ROOT_DIR}/lib/libvulkan.1.dylib)
set(VULKAN_INCLUDE_DIRS ${VULKAN_INCLUDE_DIR} ${MOLTENVK_INCLUDE_DIRS})
set(VULKAN_LIBRARIES ${VULKAN_LIBRARY} ${MOLTENVK_LIBRARIES})
else()
message(WARNING "Vulkan SDK was not found, disabling WITH_VULKAN_BACKEND")
set(WITH_VULKAN_BACKEND OFF)
endif()
endif()
if(WITH_OPENSUBDIV)

View File

@@ -935,7 +935,7 @@ if(WITH_VULKAN_BACKEND)
set(VULKAN_LIBRARY ${VULKAN_ROOT_DIR}/lib/vulkan-1.lib)
set(VULKAN_LIBRARIES ${VULKAN_LIBRARY})
else()
message(WARNING "Vulkan was not found, disabling WITH_VULKAN_BACKEND")
message(WARNING "Vulkan SDK was not found, disabling WITH_VULKAN_BACKEND")
set(WITH_VULKAN_BACKEND OFF)
endif()
endif()

View File

@@ -85,12 +85,10 @@ if(WITH_VULKAN_BACKEND)
list(APPEND INC_SYS
${VULKAN_INCLUDE_DIRS}
${MOLTENVK_INCLUDE_DIRS}
)
list(APPEND LIB
${VULKAN_LIBRARIES}
${MOLTENVK_LIBRARIES}
)
add_definitions(-DWITH_VULKAN_BACKEND)