summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
diff options
context:
space:
mode:
authorConnor McLaughlin <stenzek@gmail.com>2018-11-30 21:55:30 +1000
committerGitHub <noreply@github.com>2018-11-30 21:55:30 +1000
commit6388992f62098c5d0c6af5bf2f091330ed29de94 (patch)
tree468b74064cfd5672a90983d58da87243dff82ce4 /Source/Core/VideoBackends/Vulkan/SwapChain.cpp
parentd9cacf6f5a5c1b5b97e6b29f665ee15fdf38fc50 (diff)
parent0c0d66809d9c029c0468982725ab63be48500081 (diff)
Merge pull request #7039 from stenzek/moltenvk
Vulkan: macOS support via MoltenVK
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/SwapChain.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/SwapChain.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/SwapChain.cpp b/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
index 5222d88114..ffddfe4d07 100644
--- a/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
+++ b/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
@@ -118,6 +118,19 @@ VkSurfaceKHR SwapChain::CreateVulkanSurface(VkInstance instance, void* display_h
return surface;
+#elif defined(VK_USE_PLATFORM_MACOS_MVK)
+ VkMacOSSurfaceCreateInfoMVK surface_create_info = {
+ VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK, nullptr, 0, hwnd};
+
+ VkSurfaceKHR surface;
+ VkResult res = vkCreateMacOSSurfaceMVK(instance, &surface_create_info, nullptr, &surface);
+ if (res != VK_SUCCESS)
+ {
+ LOG_VULKAN_ERROR(res, "vkCreateMacOSSurfaceMVK failed: ");
+ return VK_NULL_HANDLE;
+ }
+
+ return surface;
#else
return VK_NULL_HANDLE;
#endif