Merge pull request #6502 from ameerj/vendor-title

main: Add GPU Vendor name to running title bar
This commit is contained in:
Morph
2021-06-28 14:51:49 -04:00
committed by GitHub
9 changed files with 100 additions and 10 deletions

View File

@ -104,6 +104,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
#include "input_common/main.h"
#include "util/overlay_dialog.h"
#include "video_core/gpu.h"
#include "video_core/renderer_base.h"
#include "video_core/shader_notify.h"
#include "yuzu/about_dialog.h"
#include "yuzu/bootmanager.h"
@ -1426,7 +1427,8 @@ void GMainWindow::BootGame(const QString& filename, std::size_t program_index, S
const auto instruction_set_suffix = is_64bit ? " (64-bit)" : " (32-bit)";
title_name += instruction_set_suffix;
LOG_INFO(Frontend, "Booting game: {:016X} | {} | {}", title_id, title_name, title_version);
UpdateWindowTitle(title_name, title_version);
const auto gpu_vendor = system.GPU().Renderer().GetDeviceVendor();
UpdateWindowTitle(title_name, title_version, gpu_vendor);
loading_screen->Prepare(system.GetAppLoader());
loading_screen->show();
@ -2855,8 +2857,8 @@ void GMainWindow::MigrateConfigFiles() {
}
}
void GMainWindow::UpdateWindowTitle(const std::string& title_name,
const std::string& title_version) {
void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_view title_version,
std::string_view gpu_vendor) {
const auto branch_name = std::string(Common::g_scm_branch);
const auto description = std::string(Common::g_scm_desc);
const auto build_id = std::string(Common::g_build_id);
@ -2869,7 +2871,8 @@ void GMainWindow::UpdateWindowTitle(const std::string& title_name,
if (title_name.empty()) {
setWindowTitle(QString::fromStdString(window_title));
} else {
const auto run_title = fmt::format("{} | {} | {}", window_title, title_name, title_version);
const auto run_title =
fmt::format("{} | {} | {} | {}", window_title, title_name, title_version, gpu_vendor);
setWindowTitle(QString::fromStdString(run_title));
}
}