summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/VulkanContext.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/VulkanContext.cpp
parentd9cacf6f5a5c1b5b97e6b29f665ee15fdf38fc50 (diff)
parent0c0d66809d9c029c0468982725ab63be48500081 (diff)
Merge pull request #7039 from stenzek/moltenvk
Vulkan: macOS support via MoltenVK
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/VulkanContext.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/VulkanContext.cpp10
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);