Merge pull request #10614 from xcfrg/shader-backend-status-bar

yuzu: add opengl shader backend info in status bar
This commit is contained in:
liamwhite 2023-06-09 09:46:11 -04:00 committed by GitHub
commit 4d395b3b72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -101,6 +101,12 @@ const std::map<Settings::RendererBackend, QString> Config::renderer_backend_text
{Settings::RendererBackend::Null, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Null"))}, {Settings::RendererBackend::Null, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Null"))},
}; };
const std::map<Settings::ShaderBackend, QString> Config::shader_backend_texts_map = {
{Settings::ShaderBackend::GLSL, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "GLSL"))},
{Settings::ShaderBackend::GLASM, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "GLASM"))},
{Settings::ShaderBackend::SPIRV, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "SPIRV"))},
};
// This shouldn't have anything except static initializers (no functions). So // This shouldn't have anything except static initializers (no functions). So
// QKeySequence(...).toString() is NOT ALLOWED HERE. // QKeySequence(...).toString() is NOT ALLOWED HERE.
// This must be in alphabetical order according to action name as it must have the same order as // This must be in alphabetical order according to action name as it must have the same order as

View File

@ -54,6 +54,7 @@ public:
static const std::map<bool, QString> use_docked_mode_texts_map; static const std::map<bool, QString> use_docked_mode_texts_map;
static const std::map<Settings::GPUAccuracy, QString> gpu_accuracy_texts_map; static const std::map<Settings::GPUAccuracy, QString> gpu_accuracy_texts_map;
static const std::map<Settings::RendererBackend, QString> renderer_backend_texts_map; static const std::map<Settings::RendererBackend, QString> renderer_backend_texts_map;
static const std::map<Settings::ShaderBackend, QString> shader_backend_texts_map;
static constexpr UISettings::Theme default_theme{ static constexpr UISettings::Theme default_theme{
#ifdef _WIN32 #ifdef _WIN32

View File

@ -4116,7 +4116,13 @@ void GMainWindow::UpdateDockedButton() {
void GMainWindow::UpdateAPIText() { void GMainWindow::UpdateAPIText() {
const auto api = Settings::values.renderer_backend.GetValue(); const auto api = Settings::values.renderer_backend.GetValue();
const auto renderer_status_text = Config::renderer_backend_texts_map.find(api)->second; const auto renderer_status_text = Config::renderer_backend_texts_map.find(api)->second;
renderer_status_button->setText(renderer_status_text.toUpper()); renderer_status_button->setText(
api == Settings::RendererBackend::OpenGL
? tr("%1 %2").arg(
renderer_status_text.toUpper(),
Config::shader_backend_texts_map.find(Settings::values.shader_backend.GetValue())
->second)
: renderer_status_text.toUpper());
} }
void GMainWindow::UpdateFilterText() { void GMainWindow::UpdateFilterText() {