From d08b80828d4ccdbcc677ebf189b06338f0b8bff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Wed, 21 Oct 2020 21:41:28 +0200 Subject: [PATCH] VideoCommon: Simplify VideoBackendBase::GetDefaultBackendName Now we can just call GetDefaultVideoBackend to get the default backend and get its name by calling GetName. --- Source/Core/VideoCommon/VideoBackendBase.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp index d793727ebc..ef490c60c8 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.cpp +++ b/Source/Core/VideoCommon/VideoBackendBase.cpp @@ -206,16 +206,10 @@ static VideoBackendBase* GetDefaultVideoBackend() return backends.front().get(); } -// 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 + auto* default_backend = GetDefaultVideoBackend(); + return default_backend ? default_backend->GetName() : ""; } const std::vector>& VideoBackendBase::GetAvailableBackends()