diff options
| author | Stenzek <stenzek@gmail.com> | 2018-05-31 04:23:45 -0700 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2018-11-07 05:41:09 -0800 |
| commit | 673f1963a068fb7d5cd8af9bb209c7633950e8f8 (patch) | |
| tree | 1a14f48e96c8f58fe5e648282632e376cc711b24 /Source/Core/VideoBackends/Vulkan/VulkanContext.cpp | |
| parent | c7a2b1572bba57d78bea78455f9cd1ab95cd36db (diff) | |
Vulkan: Support macOS via MoltenVK
The path to the MoltenVK library can be specified by the
LIBMOLTENVK_PATH environment variable, otherwise it assumes it is
located in the application bundle's Contents/MacOS directory.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/VulkanContext.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/VulkanContext.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp index 52f0088239..a1f093ccf1 100644 --- a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp +++ b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp @@ -186,6 +186,9 @@ bool VulkanContext::SelectInstanceExtensions(ExtensionList* extension_list, bool #elif defined(VK_USE_PLATFORM_ANDROID_KHR) if (enable_surface && !SupportsExtension(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, true)) return false; +#elif defined(VK_USE_PLATFORM_MACOS_MVK) + if (enable_surface && !SupportsExtension(VK_MVK_MACOS_SURFACE_EXTENSION_NAME, true)) + return false; #endif // VK_EXT_debug_report @@ -833,6 +836,13 @@ void VulkanContext::InitDriverDetails() driver = DriverDetails::DRIVER_UNKNOWN; } +#ifdef __APPLE__ + // Vulkan on macOS goes through Metal, and is not susceptible to the same bugs + // as the vendor's native Vulkan drivers. We use a different driver fields to + // differentiate MoltenVK. + driver = DriverDetails::DRIVER_PORTABILITY; +#endif + DriverDetails::Init(DriverDetails::API_VULKAN, vendor, driver, static_cast<double>(m_device_properties.driverVersion), DriverDetails::Family::UNKNOWN); |
