Merge pull request #9962 from OatmealDome/macos-vulkan-default
VideoBackendBase: Prefer Vulkan over OGL on macOS Mojave and newer
This commit is contained in:
commit
35bf5e3839
|
@ -214,6 +214,10 @@ const std::vector<std::unique_ptr<VideoBackendBase>>& VideoBackendBase::GetAvail
|
||||||
std::vector<std::unique_ptr<VideoBackendBase>> backends;
|
std::vector<std::unique_ptr<VideoBackendBase>> backends;
|
||||||
|
|
||||||
// OGL > D3D11 > D3D12 > Vulkan > SW > Null
|
// 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
|
#ifdef HAS_OPENGL
|
||||||
backends.push_back(std::make_unique<OGL::VideoBackend>());
|
backends.push_back(std::make_unique<OGL::VideoBackend>());
|
||||||
#endif
|
#endif
|
||||||
|
@ -222,7 +226,18 @@ const std::vector<std::unique_ptr<VideoBackendBase>>& VideoBackendBase::GetAvail
|
||||||
backends.push_back(std::make_unique<DX12::VideoBackend>());
|
backends.push_back(std::make_unique<DX12::VideoBackend>());
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_VULKAN
|
#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
|
#endif
|
||||||
#ifdef HAS_OPENGL
|
#ifdef HAS_OPENGL
|
||||||
backends.push_back(std::make_unique<SW::VideoSoftware>());
|
backends.push_back(std::make_unique<SW::VideoSoftware>());
|
||||||
|
|
Loading…
Reference in New Issue