mirror of https://github.com/PCSX2/pcsx2.git
OSD: Add GPU Info (#11808)
* OSD: Add GPU Info * Qt: More Translatable Strings
This commit is contained in:
parent
e8e0b97f6d
commit
d12ef2b17c
|
@ -528,7 +528,7 @@ void GSUpdateDisplayWindow()
|
||||||
{
|
{
|
||||||
if (!g_gs_device->UpdateWindow())
|
if (!g_gs_device->UpdateWindow())
|
||||||
{
|
{
|
||||||
Host::ReportErrorAsync("Error", "Failed to change window after update. The log may contain more information.");
|
Host::ReportErrorAsync("Error", TRANSLATE_SV("GS", "Failed to change window after update. The log may contain more information."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -805,6 +805,7 @@ public:
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
std::string m_name = "Unknown";
|
||||||
FeatureSupport m_features;
|
FeatureSupport m_features;
|
||||||
u32 m_max_texture_size = 0;
|
u32 m_max_texture_size = 0;
|
||||||
|
|
||||||
|
@ -870,6 +871,9 @@ public:
|
||||||
GSDevice();
|
GSDevice();
|
||||||
virtual ~GSDevice();
|
virtual ~GSDevice();
|
||||||
|
|
||||||
|
/// Returns a string containing current adapter in use.
|
||||||
|
const std::string& GetName() const { return m_name; }
|
||||||
|
|
||||||
/// Returns a string representing the specified API.
|
/// Returns a string representing the specified API.
|
||||||
static const char* RenderAPIToString(RenderAPI api);
|
static const char* RenderAPIToString(RenderAPI api);
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ bool GSDevice11::Create(GSVSyncMode vsync_mode, bool allow_present_throttle)
|
||||||
{
|
{
|
||||||
Host::ReportErrorAsync("GS",
|
Host::ReportErrorAsync("GS",
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Failed to create D3D device: 0x{:08X}. A GPU which supports Direct3D Feature Level 10.0 is required.",
|
TRANSLATE_FS("GS", "Failed to create D3D device: 0x{:08X}. A GPU which supports Direct3D Feature Level 10.0 is required."),
|
||||||
hr));
|
hr));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,10 @@ bool GSDevice11::Create(GSVSyncMode vsync_mode, bool allow_present_throttle)
|
||||||
|
|
||||||
wil::com_ptr_nothrow<IDXGIDevice> dxgi_device;
|
wil::com_ptr_nothrow<IDXGIDevice> dxgi_device;
|
||||||
if (m_dev.try_query_to(&dxgi_device) && SUCCEEDED(dxgi_device->GetParent(IID_PPV_ARGS(dxgi_adapter.put()))))
|
if (m_dev.try_query_to(&dxgi_device) && SUCCEEDED(dxgi_device->GetParent(IID_PPV_ARGS(dxgi_adapter.put()))))
|
||||||
|
{
|
||||||
Console.WriteLn(fmt::format("D3D Adapter: {}", D3D::GetAdapterName(dxgi_adapter.get())));
|
Console.WriteLn(fmt::format("D3D Adapter: {}", D3D::GetAdapterName(dxgi_adapter.get())));
|
||||||
|
m_name = D3D::GetAdapterName(dxgi_adapter.get());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Console.Error("Failed to obtain D3D adapter name.");
|
Console.Error("Failed to obtain D3D adapter name.");
|
||||||
|
|
||||||
|
|
|
@ -690,6 +690,8 @@ bool GSDevice12::Create(GSVSyncMode vsync_mode, bool allow_present_throttle)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_name = D3D::GetAdapterName(m_adapter.get());
|
||||||
|
|
||||||
if (!CreateDescriptorHeaps() || !CreateCommandLists() || !CreateTimestampQuery())
|
if (!CreateDescriptorHeaps() || !CreateCommandLists() || !CreateTimestampQuery())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -855,8 +855,10 @@ bool GSDeviceMTL::Create(GSVSyncMode vsync_mode, bool allow_present_throttle)
|
||||||
Console.Warning("Metal: Couldn't find adapter %s, using default", GSConfig.Adapter.c_str());
|
Console.Warning("Metal: Couldn't find adapter %s, using default", GSConfig.Adapter.c_str());
|
||||||
m_dev = GSMTLDevice(MRCTransfer(MTLCreateSystemDefaultDevice()));
|
m_dev = GSMTLDevice(MRCTransfer(MTLCreateSystemDefaultDevice()));
|
||||||
if (!m_dev.dev)
|
if (!m_dev.dev)
|
||||||
Host::ReportErrorAsync("No Metal Devices Available", "No Metal-supporting GPUs were found. PCSX2 requires a Metal GPU (available on all macs from 2012 onwards).");
|
Host::ReportErrorAsync(TRANSLATE_SV("GSDeviceMTL", "No Metal Devices Available"), TRANSLATE_SV("GSDeviceMTL", "No Metal-supporting GPUs were found. PCSX2 requires a Metal GPU (available on all Macs from 2012 onwards)."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_name = [[m_dev.dev name] UTF8String];
|
||||||
m_queue = MRCTransfer([m_dev.dev newCommandQueue]);
|
m_queue = MRCTransfer([m_dev.dev newCommandQueue]);
|
||||||
|
|
||||||
m_pass_desc = MRCTransfer([MTLRenderPassDescriptor new]);
|
m_pass_desc = MRCTransfer([MTLRenderPassDescriptor new]);
|
||||||
|
|
|
@ -184,6 +184,9 @@ bool GSDeviceOGL::Create(GSVSyncMode vsync_mode, bool allow_present_throttle)
|
||||||
if (!CheckFeatures(buggy_pbo))
|
if (!CheckFeatures(buggy_pbo))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Store adapter name currently in use
|
||||||
|
m_name = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
|
||||||
|
|
||||||
SetSwapInterval();
|
SetSwapInterval();
|
||||||
|
|
||||||
// Render a frame as soon as possible to clear out whatever was previously being displayed.
|
// Render a frame as soon as possible to clear out whatever was previously being displayed.
|
||||||
|
@ -635,7 +638,7 @@ bool GSDeviceOGL::CheckFeatures(bool& buggy_pbo)
|
||||||
if (!GLAD_GL_VERSION_3_3)
|
if (!GLAD_GL_VERSION_3_3)
|
||||||
{
|
{
|
||||||
Host::ReportErrorAsync(
|
Host::ReportErrorAsync(
|
||||||
"GS", fmt::format("OpenGL renderer is not supported. Only OpenGL {}.{}\n was found", major_gl, minor_gl));
|
"GS", fmt::format(TRANSLATE_FS("GSDeviceOGL", "OpenGL renderer is not supported. Only OpenGL {}.{}\n was found"), major_gl, minor_gl));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2054,7 +2054,7 @@ bool GSDeviceVK::Create(GSVSyncMode vsync_mode, bool allow_present_throttle)
|
||||||
|
|
||||||
if (!CheckFeatures())
|
if (!CheckFeatures())
|
||||||
{
|
{
|
||||||
Host::ReportErrorAsync("GS", "Your GPU does not support the required Vulkan features.");
|
Host::ReportErrorAsync("GS", TRANSLATE_SV("GSDeviceVK", "Your GPU does not support the required Vulkan features."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2539,6 +2539,9 @@ bool GSDeviceVK::CreateDeviceAndSwapChain()
|
||||||
// Read device physical memory properties, we need it for allocating buffers
|
// Read device physical memory properties, we need it for allocating buffers
|
||||||
vkGetPhysicalDeviceProperties(m_physical_device, &m_device_properties);
|
vkGetPhysicalDeviceProperties(m_physical_device, &m_device_properties);
|
||||||
|
|
||||||
|
// Stores the GPU name
|
||||||
|
m_name = m_device_properties.deviceName;
|
||||||
|
|
||||||
// We need this to be at least 32 byte aligned for AVX2 stores.
|
// We need this to be at least 32 byte aligned for AVX2 stores.
|
||||||
m_device_properties.limits.minUniformBufferOffsetAlignment =
|
m_device_properties.limits.minUniformBufferOffsetAlignment =
|
||||||
std::max(m_device_properties.limits.minUniformBufferOffsetAlignment, static_cast<VkDeviceSize>(32));
|
std::max(m_device_properties.limits.minUniformBufferOffsetAlignment, static_cast<VkDeviceSize>(32));
|
||||||
|
|
|
@ -213,12 +213,18 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
|
||||||
|
|
||||||
if (GSConfig.OsdShowHardwareInfo)
|
if (GSConfig.OsdShowHardwareInfo)
|
||||||
{
|
{
|
||||||
|
// CPU
|
||||||
text.clear();
|
text.clear();
|
||||||
text.append_format("CPU: {} ({}C/{}T)",
|
text.append_format("CPU: {} ({}C/{}T)",
|
||||||
cpuinfo_get_package(0)->name,
|
cpuinfo_get_package(0)->name,
|
||||||
cpuinfo_get_cores_count(),
|
cpuinfo_get_cores_count(),
|
||||||
cpuinfo_get_processors_count());
|
cpuinfo_get_processors_count());
|
||||||
DRAW_LINE(fixed_font, text.c_str(), IM_COL32(255, 255, 255, 255));
|
DRAW_LINE(fixed_font, text.c_str(), IM_COL32(255, 255, 255, 255));
|
||||||
|
|
||||||
|
// GPU
|
||||||
|
text.clear();
|
||||||
|
text.append_format("GPU: {}", g_gs_device->GetName());
|
||||||
|
DRAW_LINE(fixed_font, text.c_str(), IM_COL32(255, 255, 255, 255));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GSConfig.OsdShowCPU)
|
if (GSConfig.OsdShowCPU)
|
||||||
|
|
Loading…
Reference in New Issue