diff options
| author | Connor McLaughlin <stenzek@gmail.com> | 2018-11-30 21:55:30 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-30 21:55:30 +1000 |
| commit | 6388992f62098c5d0c6af5bf2f091330ed29de94 (patch) | |
| tree | 468b74064cfd5672a90983d58da87243dff82ce4 /Source/Core/VideoBackends/Vulkan/SwapChain.cpp | |
| parent | d9cacf6f5a5c1b5b97e6b29f665ee15fdf38fc50 (diff) | |
| parent | 0c0d66809d9c029c0468982725ab63be48500081 (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.cpp | 13 |
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 |
