From 6eefc3c524a8530a3cb24b5c797288e156bec1db Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 6 Sep 2020 12:56:45 +0200 Subject: Make default graphics backend not show up as empty Fixes https://bugs.dolphin-emu.org/issues/12245. I considered making a change to DolphinQt instead of the core, but then additional effort would've been required to add the same fix to the Android GUI once we start using the new config system there. --- Source/Core/VideoCommon/VideoBackendBase.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/VideoBackendBase.cpp') diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp index 5e7337c767..b32cff86e3 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.cpp +++ b/Source/Core/VideoCommon/VideoBackendBase.cpp @@ -197,9 +197,21 @@ u16 VideoBackendBase::Video_GetBoundingBox(int index) return result; } +// This function is called at static initialization, so we can't rely on s_default_backend being set +std::string VideoBackendBase::GetDefaultBackendName() +{ +#ifdef HAS_OPENGL + return OGL::VideoBackend::NAME; +#elif defined(_WIN32) + return DX11::VideoBackend::NAME; +#else + return Vulkan::VideoBackend::NAME; +#endif +} + void VideoBackendBase::PopulateList() { - // OGL > D3D11 > Vulkan > SW > Null + // OGL > D3D11 > D3D12 > Vulkan > SW > Null #ifdef HAS_OPENGL g_available_video_backends.push_back(std::make_unique()); #endif -- cgit v1.2.3