summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_base.h2
-rw-r--r--src/video_core/renderer_opengl/gl_device.cpp33
-rw-r--r--src/video_core/renderer_opengl/gl_device.h3
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.h4
-rw-r--r--src/video_core/renderer_vulkan/renderer_vulkan.h4
-rw-r--r--src/video_core/vulkan_common/vulkan_device.cpp21
-rw-r--r--src/video_core/vulkan_common/vulkan_device.h3
-rw-r--r--src/yuzu/main.cpp11
-rw-r--r--src/yuzu/main.h4
9 files changed, 75 insertions, 10 deletions
diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h
index 320ee8d30..63d8ad42a 100644
--- a/src/video_core/renderer_base.h
+++ b/src/video_core/renderer_base.h
@@ -42,6 +42,8 @@ public:
42 42
43 [[nodiscard]] virtual RasterizerInterface* ReadRasterizer() = 0; 43 [[nodiscard]] virtual RasterizerInterface* ReadRasterizer() = 0;
44 44
45 [[nodiscard]] virtual std::string GetDeviceVendor() const = 0;
46
45 // Getter/setter functions: 47 // Getter/setter functions:
46 // ------------------------ 48 // ------------------------
47 49
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp
index 3f4532ca7..3d2674232 100644
--- a/src/video_core/renderer_opengl/gl_device.cpp
+++ b/src/video_core/renderer_opengl/gl_device.cpp
@@ -202,13 +202,13 @@ Device::Device() {
202 LOG_ERROR(Render_OpenGL, "OpenGL 4.6 is not available"); 202 LOG_ERROR(Render_OpenGL, "OpenGL 4.6 is not available");
203 throw std::runtime_error{"Insufficient version"}; 203 throw std::runtime_error{"Insufficient version"};
204 } 204 }
205 const std::string_view vendor = reinterpret_cast<const char*>(glGetString(GL_VENDOR)); 205 vendor_name = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
206 const std::string_view version = reinterpret_cast<const char*>(glGetString(GL_VERSION)); 206 const std::string_view version = reinterpret_cast<const char*>(glGetString(GL_VERSION));
207 const std::vector extensions = GetExtensions(); 207 const std::vector extensions = GetExtensions();
208 208
209 const bool is_nvidia = vendor == "NVIDIA Corporation"; 209 const bool is_nvidia = vendor_name == "NVIDIA Corporation";
210 const bool is_amd = vendor == "ATI Technologies Inc."; 210 const bool is_amd = vendor_name == "ATI Technologies Inc.";
211 const bool is_intel = vendor == "Intel"; 211 const bool is_intel = vendor_name == "Intel";
212 212
213#ifdef __unix__ 213#ifdef __unix__
214 const bool is_linux = true; 214 const bool is_linux = true;
@@ -275,6 +275,31 @@ Device::Device() {
275 } 275 }
276} 276}
277 277
278std::string Device::GetVendorName() const {
279 if (vendor_name == "NVIDIA Corporation") {
280 return "NVIDIA";
281 }
282 if (vendor_name == "ATI Technologies Inc.") {
283 return "AMD";
284 }
285 if (vendor_name == "Intel" || vendor_name == "Intel Open Source Technology Center") {
286 return "INTEL";
287 }
288 if (vendor_name == "Mesa Project") {
289 return "MESA";
290 }
291 if (vendor_name == "Mesa/X.org") {
292 return "LLVMPIPE";
293 }
294 if (vendor_name == "AMD") {
295 return "RADEONSI";
296 }
297 if (vendor_name == "nouveau") {
298 return "NOUVEAU";
299 }
300 return vendor_name;
301}
302
278Device::Device(std::nullptr_t) { 303Device::Device(std::nullptr_t) {
279 max_uniform_buffers.fill(std::numeric_limits<u32>::max()); 304 max_uniform_buffers.fill(std::numeric_limits<u32>::max());
280 uniform_buffer_alignment = 4; 305 uniform_buffer_alignment = 4;
diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h
index f24bd0c7b..2c2b13767 100644
--- a/src/video_core/renderer_opengl/gl_device.h
+++ b/src/video_core/renderer_opengl/gl_device.h
@@ -22,6 +22,8 @@ public:
22 explicit Device(); 22 explicit Device();
23 explicit Device(std::nullptr_t); 23 explicit Device(std::nullptr_t);
24 24
25 [[nodiscard]] std::string GetVendorName() const;
26
25 u32 GetMaxUniformBuffers(Tegra::Engines::ShaderType shader_type) const noexcept { 27 u32 GetMaxUniformBuffers(Tegra::Engines::ShaderType shader_type) const noexcept {
26 return max_uniform_buffers[static_cast<std::size_t>(shader_type)]; 28 return max_uniform_buffers[static_cast<std::size_t>(shader_type)];
27 } 29 }
@@ -130,6 +132,7 @@ private:
130 static bool TestVariableAoffi(); 132 static bool TestVariableAoffi();
131 static bool TestPreciseBug(); 133 static bool TestPreciseBug();
132 134
135 std::string vendor_name;
133 std::array<u32, Tegra::Engines::MaxShaderTypes> max_uniform_buffers{}; 136 std::array<u32, Tegra::Engines::MaxShaderTypes> max_uniform_buffers{};
134 std::array<BaseBindings, Tegra::Engines::MaxShaderTypes> base_bindings{}; 137 std::array<BaseBindings, Tegra::Engines::MaxShaderTypes> base_bindings{};
135 size_t uniform_buffer_alignment{}; 138 size_t uniform_buffer_alignment{};
diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h
index cc19a110f..0b66f8332 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.h
+++ b/src/video_core/renderer_opengl/renderer_opengl.h
@@ -70,6 +70,10 @@ public:
70 return &rasterizer; 70 return &rasterizer;
71 } 71 }
72 72
73 [[nodiscard]] std::string GetDeviceVendor() const override {
74 return device.GetVendorName();
75 }
76
73private: 77private:
74 /// Initializes the OpenGL state and creates persistent objects. 78 /// Initializes the OpenGL state and creates persistent objects.
75 void InitOpenGLObjects(); 79 void InitOpenGLObjects();
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.h b/src/video_core/renderer_vulkan/renderer_vulkan.h
index 72071316c..d7d17e110 100644
--- a/src/video_core/renderer_vulkan/renderer_vulkan.h
+++ b/src/video_core/renderer_vulkan/renderer_vulkan.h
@@ -47,6 +47,10 @@ public:
47 return &rasterizer; 47 return &rasterizer;
48 } 48 }
49 49
50 [[nodiscard]] std::string GetDeviceVendor() const override {
51 return device.GetDriverName();
52 }
53
50private: 54private:
51 void Report() const; 55 void Report() const;
52 56
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp
index 64206b3d2..c52cd246b 100644
--- a/src/video_core/vulkan_common/vulkan_device.cpp
+++ b/src/video_core/vulkan_common/vulkan_device.cpp
@@ -531,6 +531,27 @@ bool Device::IsFormatSupported(VkFormat wanted_format, VkFormatFeatureFlags want
531 return (supported_usage & wanted_usage) == wanted_usage; 531 return (supported_usage & wanted_usage) == wanted_usage;
532} 532}
533 533
534std::string Device::GetDriverName() const {
535 switch (driver_id) {
536 case VK_DRIVER_ID_AMD_PROPRIETARY:
537 return "AMD";
538 case VK_DRIVER_ID_AMD_OPEN_SOURCE:
539 return "AMDVLK";
540 case VK_DRIVER_ID_MESA_RADV:
541 return "RADV";
542 case VK_DRIVER_ID_NVIDIA_PROPRIETARY:
543 return "NVIDIA";
544 case VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS:
545 return "INTEL";
546 case VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA:
547 return "ANV";
548 case VK_DRIVER_ID_MESA_LLVMPIPE:
549 return "LAVAPIPE";
550 default:
551 return vendor_name;
552 }
553}
554
534void Device::CheckSuitability(bool requires_swapchain) const { 555void Device::CheckSuitability(bool requires_swapchain) const {
535 std::bitset<REQUIRED_EXTENSIONS.size()> available_extensions; 556 std::bitset<REQUIRED_EXTENSIONS.size()> available_extensions;
536 bool has_swapchain = false; 557 bool has_swapchain = false;
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h
index 67d70cd22..c5504467d 100644
--- a/src/video_core/vulkan_common/vulkan_device.h
+++ b/src/video_core/vulkan_common/vulkan_device.h
@@ -45,6 +45,9 @@ public:
45 /// Reports a shader to Nsight Aftermath. 45 /// Reports a shader to Nsight Aftermath.
46 void SaveShader(const std::vector<u32>& spirv) const; 46 void SaveShader(const std::vector<u32>& spirv) const;
47 47
48 /// Returns the name of the VkDriverId reported from Vulkan.
49 std::string GetDriverName() const;
50
48 /// Returns the dispatch loader with direct function pointers of the device. 51 /// Returns the dispatch loader with direct function pointers of the device.
49 const vk::DeviceDispatch& GetDispatchLoader() const { 52 const vk::DeviceDispatch& GetDispatchLoader() const {
50 return dld; 53 return dld;
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index be8933c5c..f4dd53b9b 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -104,6 +104,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
104#include "input_common/main.h" 104#include "input_common/main.h"
105#include "util/overlay_dialog.h" 105#include "util/overlay_dialog.h"
106#include "video_core/gpu.h" 106#include "video_core/gpu.h"
107#include "video_core/renderer_base.h"
107#include "video_core/shader_notify.h" 108#include "video_core/shader_notify.h"
108#include "yuzu/about_dialog.h" 109#include "yuzu/about_dialog.h"
109#include "yuzu/bootmanager.h" 110#include "yuzu/bootmanager.h"
@@ -1418,7 +1419,8 @@ void GMainWindow::BootGame(const QString& filename, std::size_t program_index, S
1418 std::filesystem::path{filename.toStdU16String()}.filename()); 1419 std::filesystem::path{filename.toStdU16String()}.filename());
1419 } 1420 }
1420 LOG_INFO(Frontend, "Booting game: {:016X} | {} | {}", title_id, title_name, title_version); 1421 LOG_INFO(Frontend, "Booting game: {:016X} | {} | {}", title_id, title_name, title_version);
1421 UpdateWindowTitle(title_name, title_version); 1422 const auto gpu_vendor = system.GPU().Renderer().GetDeviceVendor();
1423 UpdateWindowTitle(title_name, title_version, gpu_vendor);
1422 1424
1423 loading_screen->Prepare(system.GetAppLoader()); 1425 loading_screen->Prepare(system.GetAppLoader());
1424 loading_screen->show(); 1426 loading_screen->show();
@@ -2847,8 +2849,8 @@ void GMainWindow::MigrateConfigFiles() {
2847 } 2849 }
2848} 2850}
2849 2851
2850void GMainWindow::UpdateWindowTitle(const std::string& title_name, 2852void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_view title_version,
2851 const std::string& title_version) { 2853 std::string_view gpu_vendor) {
2852 const auto branch_name = std::string(Common::g_scm_branch); 2854 const auto branch_name = std::string(Common::g_scm_branch);
2853 const auto description = std::string(Common::g_scm_desc); 2855 const auto description = std::string(Common::g_scm_desc);
2854 const auto build_id = std::string(Common::g_build_id); 2856 const auto build_id = std::string(Common::g_build_id);
@@ -2860,7 +2862,8 @@ void GMainWindow::UpdateWindowTitle(const std::string& title_name,
2860 if (title_name.empty()) { 2862 if (title_name.empty()) {
2861 setWindowTitle(QString::fromStdString(window_title)); 2863 setWindowTitle(QString::fromStdString(window_title));
2862 } else { 2864 } else {
2863 const auto run_title = fmt::format("{} | {} | {}", window_title, title_name, title_version); 2865 const auto run_title =
2866 fmt::format("{} | {} | {} | {}", window_title, title_name, title_version, gpu_vendor);
2864 setWindowTitle(QString::fromStdString(run_title)); 2867 setWindowTitle(QString::fromStdString(run_title));
2865 } 2868 }
2866} 2869}
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 11f152cbe..5c199155a 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -287,8 +287,8 @@ private:
287 InstallResult InstallNSPXCI(const QString& filename); 287 InstallResult InstallNSPXCI(const QString& filename);
288 InstallResult InstallNCA(const QString& filename); 288 InstallResult InstallNCA(const QString& filename);
289 void MigrateConfigFiles(); 289 void MigrateConfigFiles();
290 void UpdateWindowTitle(const std::string& title_name = {}, 290 void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {},
291 const std::string& title_version = {}); 291 std::string_view gpu_vendor = {});
292 void UpdateStatusBar(); 292 void UpdateStatusBar();
293 void UpdateStatusButtons(); 293 void UpdateStatusButtons();
294 void UpdateUISettings(); 294 void UpdateUISettings();