Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoBackendBase: Prefer Vulkan over OGL on macOS Mojave and newer #9962

Merged
merged 1 commit into from Aug 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 16 additions & 1 deletion Source/Core/VideoCommon/VideoBackendBase.cpp
Expand Up @@ -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
Expand All @@ -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>());
Expand Down