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.
This commit is contained in:
JosJuice
2020-09-06 12:56:45 +02:00
parent db067104ed
commit 6eefc3c524
13 changed files with 37 additions and 8 deletions

View File

@ -21,6 +21,8 @@ public:
void InitBackendInfo() override;
static constexpr const char* NAME = "D3D";
private:
void FillBackendInfo();
};

View File

@ -29,7 +29,7 @@ namespace DX11
{
std::string VideoBackend::GetName() const
{
return "D3D";
return NAME;
}
std::string VideoBackend::GetDisplayName() const

View File

@ -27,7 +27,7 @@ namespace DX12
{
std::string VideoBackend::GetName() const
{
return "D3D12";
return NAME;
}
std::string VideoBackend::GetDisplayName() const

View File

@ -19,6 +19,8 @@ public:
std::string GetDisplayName() const override;
void InitBackendInfo() override;
static constexpr const char* NAME = "D3D12";
private:
void FillBackendInfo();
};

View File

@ -10,11 +10,14 @@ namespace Null
{
class VideoBackend final : public VideoBackendBase
{
public:
bool Initialize(const WindowSystemInfo& wsi) override;
void Shutdown() override;
std::string GetName() const override { return "Null"; }
std::string GetName() const override { return NAME; }
std::string GetDisplayName() const override;
void InitBackendInfo() override;
static constexpr const char* NAME = "Null";
};
} // namespace Null

View File

@ -13,6 +13,7 @@ namespace OGL
{
class VideoBackend : public VideoBackendBase
{
public:
bool Initialize(const WindowSystemInfo& wsi) override;
void Shutdown() override;
@ -21,6 +22,8 @@ class VideoBackend : public VideoBackendBase
void InitBackendInfo() override;
static constexpr const char* NAME = "OGL";
private:
bool InitializeGLExtensions(GLContext* context);
bool FillBackendInfo();

View File

@ -62,7 +62,7 @@ namespace OGL
{
std::string VideoBackend::GetName() const
{
return "OGL";
return NAME;
}
std::string VideoBackend::GetDisplayName() const

View File

@ -45,7 +45,7 @@ public:
std::string VideoSoftware::GetName() const
{
return "Software Renderer";
return NAME;
}
std::string VideoSoftware::GetDisplayName() const

View File

@ -19,5 +19,7 @@ class VideoSoftware : public VideoBackendBase
std::optional<std::string> GetWarningMessage() const override;
void InitBackendInfo() override;
static constexpr const char* NAME = "Software Renderer";
};
} // namespace SW

View File

@ -15,9 +15,11 @@ public:
bool Initialize(const WindowSystemInfo& wsi) override;
void Shutdown() override;
std::string GetName() const override { return "Vulkan"; }
std::string GetName() const override { return NAME; }
std::string GetDisplayName() const override { return _trans("Vulkan"); }
void InitBackendInfo() override;
void PrepareWindow(WindowSystemInfo& wsi) override;
static constexpr const char* NAME = "Vulkan";
};
} // namespace Vulkan