mirror of
https://github.com/glfw/glfw.git
synced 2026-01-11 15:23:17 +01:00
Cocoa: Add basic support for Vulkan via MoltenVK
This adds basic support for MoltenVK, a Vulkan implementation on top of Metal, on macOS 10.11 and later. It looks for MoltenVK in the process via RTLD_DEFAULT symbol lookup if _GLFW_VULKAN_STATIC is disabled. glfwCreateWindowSurface now creates and sets a CAMetalLayer for the window content view, which is required for MoltenVK to function. You must help CMake find MoltenVK for the Vulkan test to be built. Fixes #870.
This commit is contained in:
@@ -20,6 +20,13 @@ if (WIN32)
|
||||
"$ENV{VULKAN_SDK}/Bin32"
|
||||
"$ENV{VK_SDK_PATH}/Bin32")
|
||||
endif()
|
||||
elseif (APPLE)
|
||||
find_library(VULKAN_LIBRARY MoltenVK)
|
||||
if (VULKAN_LIBRARY)
|
||||
set(VULKAN_STATIC_LIBRARY ${VULKAN_LIBRARY})
|
||||
find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
|
||||
"${VULKAN_LIBRARY}/Headers")
|
||||
endif()
|
||||
else()
|
||||
find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
|
||||
"$ENV{VULKAN_SDK}/include")
|
||||
|
||||
Reference in New Issue
Block a user