summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VideoBackendBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/VideoBackendBase.cpp')
-rw-r--r--Source/Core/VideoCommon/VideoBackendBase.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp
index 1f93517dd1..cadbd08024 100644
--- a/Source/Core/VideoCommon/VideoBackendBase.cpp
+++ b/Source/Core/VideoCommon/VideoBackendBase.cpp
@@ -214,6 +214,10 @@ const std::vector<std::unique_ptr<VideoBackendBase>>& VideoBackendBase::GetAvail
std::vector<std::unique_ptr<VideoBackendBase>> backends;
// OGL > D3D11 > D3D12 > Vulkan > SW > Null
+ //
+ // On macOS Mojave and newer, we prefer Vulkan over OGL due to outdated drivers.
+ // However, on macOS High Sierra and older, we still prefer OGL due to its older Metal version
+ // missing several features required by the Vulkan backend.
#ifdef HAS_OPENGL
backends.push_back(std::make_unique<OGL::VideoBackend>());
#endif
@@ -222,7 +226,18 @@ const std::vector<std::unique_ptr<VideoBackendBase>>& VideoBackendBase::GetAvail
backends.push_back(std::make_unique<DX12::VideoBackend>());
#endif
#ifdef HAS_VULKAN
- backends.push_back(std::make_unique<Vulkan::VideoBackend>());
+#ifdef __APPLE__
+ // If we can run the Vulkan backend, emplace it at the beginning of the vector so
+ // it takes precedence over OpenGL.
+ if (__builtin_available(macOS 10.14, *))
+ {
+ backends.emplace(backends.begin(), std::make_unique<Vulkan::VideoBackend>());
+ }
+ else
+#endif
+ {
+ backends.push_back(std::make_unique<Vulkan::VideoBackend>());
+ }
#endif
#ifdef HAS_OPENGL
backends.push_back(std::make_unique<SW::VideoSoftware>());