Merge pull request #12641 from jordan-woyak/d3d-before-ogl

VideoCommon: Prefer D3D11/12 over OpenGL on Windows.
This commit is contained in:
Jordan Woyak 2024-03-20 18:21:48 -05:00 committed by GitHub
commit 76a74daac2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 5 deletions

View File

@ -232,18 +232,17 @@ const std::vector<std::unique_ptr<VideoBackendBase>>& VideoBackendBase::GetAvail
static auto s_available_backends = [] {
std::vector<std::unique_ptr<VideoBackendBase>> backends;
// OGL > D3D11 > D3D12 > Vulkan > SW > Null
// On macOS, we prefer Vulkan over OpenGL due to OpenGL support being deprecated by Apple.
#ifdef HAS_OPENGL
backends.push_back(std::make_unique<OGL::VideoBackend>());
#endif
#ifdef _WIN32
backends.push_back(std::make_unique<DX11::VideoBackend>());
backends.push_back(std::make_unique<DX12::VideoBackend>());
#endif
#ifdef HAS_OPENGL
backends.push_back(std::make_unique<OGL::VideoBackend>());
#endif
#ifdef HAS_VULKAN
#ifdef __APPLE__
// Emplace the Vulkan backend at the beginning so it takes precedence over OpenGL.
// On macOS, we prefer Vulkan over OpenGL due to OpenGL support being deprecated by Apple.
backends.emplace(backends.begin(), std::make_unique<Vulkan::VideoBackend>());
#else
backends.push_back(std::make_unique<Vulkan::VideoBackend>());