OSD: Add hardware info statistics

This commit is contained in:
JordanTheToaster 2024-07-20 03:58:31 +01:00 committed by Ty
parent 7086060724
commit 63e516ebfe
7 changed files with 67 additions and 41 deletions

View File

@ -126,6 +126,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.osdShowInputs, "EmuCore/GS", "OsdShowInputs", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.osdShowInputs, "EmuCore/GS", "OsdShowInputs", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.osdShowFrameTimes, "EmuCore/GS", "OsdShowFrameTimes", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.osdShowFrameTimes, "EmuCore/GS", "OsdShowFrameTimes", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.osdShowVersion, "EmuCore/GS", "OsdShowVersion", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.osdShowVersion, "EmuCore/GS", "OsdShowVersion", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.osdShowHardwareInfo, "EmuCore/GS", "OsdShowHardwareInfo", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.warnAboutUnsafeSettings, "EmuCore", "WarnAboutUnsafeSettings", true); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.warnAboutUnsafeSettings, "EmuCore", "WarnAboutUnsafeSettings", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.fxaa, "EmuCore/GS", "fxaa", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.fxaa, "EmuCore/GS", "fxaa", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.shadeBoost, "EmuCore/GS", "ShadeBoost", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.shadeBoost, "EmuCore/GS", "ShadeBoost", false);
@ -736,6 +737,9 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
dialog->registerWidgetHelp(m_ui.osdShowVersion, tr("Show PCSX2 Version"), tr("Unchecked"), dialog->registerWidgetHelp(m_ui.osdShowVersion, tr("Show PCSX2 Version"), tr("Unchecked"),
tr("Shows the current PCSX2 version on the top-right corner of the display")); tr("Shows the current PCSX2 version on the top-right corner of the display"));
dialog->registerWidgetHelp(m_ui.osdShowHardwareInfo, tr("Show Hardware Info"), tr("Unchecked"),
tr("Shows the current system hardware information on the OSD."));
dialog->registerWidgetHelp(m_ui.warnAboutUnsafeSettings, tr("Warn About Unsafe Settings"), tr("Checked"), dialog->registerWidgetHelp(m_ui.warnAboutUnsafeSettings, tr("Warn About Unsafe Settings"), tr("Checked"),
tr("Displays warnings when settings are enabled which may break games.")); tr("Displays warnings when settings are enabled which may break games."));
} }

View File

@ -1662,17 +1662,31 @@
</item> </item>
<item row="3" column="0" colspan="2"> <item row="3" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_6"> <layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0"> <item row="5" column="0">
<widget class="QCheckBox" name="osdShowResolution"> <widget class="QCheckBox" name="osdShowFrameTimes">
<property name="text"> <property name="text">
<string>Show Resolution</string> <string>Show Frame Times</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="2" column="0">
<widget class="QCheckBox" name="osdShowFPS"> <widget class="QCheckBox" name="osdShowVersion">
<property name="text"> <property name="text">
<string>Show FPS</string> <string>Show PCSX2 Version</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="osdShowIndicators">
<property name="text">
<string>Show Indicators</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="osdShowSpeed">
<property name="text">
<string>Show Speed Percentages</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -1690,24 +1704,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="4" column="0">
<widget class="QCheckBox" name="osdShowVersion"> <widget class="QCheckBox" name="osdShowGSStats">
<property name="text"> <property name="text">
<string>Show PCSX2 Version</string> <string>Show Statistics</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="5" column="1">
<widget class="QCheckBox" name="osdShowSpeed"> <widget class="QCheckBox" name="warnAboutUnsafeSettings">
<property name="text"> <property name="text">
<string>Show Speed Percentages</string> <string>Warn About Unsafe Settings</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="osdShowIndicators">
<property name="text">
<string>Show Indicators</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -1718,10 +1725,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="0" column="1">
<widget class="QCheckBox" name="osdShowGSStats"> <widget class="QCheckBox" name="osdShowFPS">
<property name="text"> <property name="text">
<string>Show Statistics</string> <string>Show FPS</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="osdShowResolution">
<property name="text">
<string>Show Resolution</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -1732,17 +1746,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="6" column="0">
<widget class="QCheckBox" name="osdShowFrameTimes"> <widget class="QCheckBox" name="osdShowHardwareInfo">
<property name="text"> <property name="text">
<string>Show Frame Times</string> <string>Show Hardware Info</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="warnAboutUnsafeSettings">
<property name="text">
<string>Warn About Unsafe Settings</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -628,6 +628,7 @@ struct Pcsx2Config
OsdShowInputs : 1, OsdShowInputs : 1,
OsdShowFrameTimes : 1, OsdShowFrameTimes : 1,
OsdShowVersion : 1, OsdShowVersion : 1,
OsdShowHardwareInfo : 1,
HWSpinGPUForReadbacks : 1, HWSpinGPUForReadbacks : 1,
HWSpinCPUForReadbacks : 1, HWSpinCPUForReadbacks : 1,
GPUPaletteConversion : 1, GPUPaletteConversion : 1,

View File

@ -3154,6 +3154,9 @@ void FullscreenUI::DrawInterfaceSettingsPage()
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_PF_HEARTBEAT_ALT, "Show Frame Times"), DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_PF_HEARTBEAT_ALT, "Show Frame Times"),
FSUI_CSTR("Shows a visual history of frame times in the upper-left corner of the display."), "EmuCore/GS", "OsdShowFrameTimes", FSUI_CSTR("Shows a visual history of frame times in the upper-left corner of the display."), "EmuCore/GS", "OsdShowFrameTimes",
false); false);
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_PF_MONITOR_CODE, "Show Hardware Info"),
FSUI_CSTR("Shows the current system hardware information on the OSD."), "EmuCore/GS", "OsdShowHardwareInfo",
false);
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_EXCLAMATION, "Warn About Unsafe Settings"), DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_EXCLAMATION, "Warn About Unsafe Settings"),
FSUI_CSTR("Displays warnings when settings are enabled which may break games."), "EmuCore", "WarnAboutUnsafeSettings", true); FSUI_CSTR("Displays warnings when settings are enabled which may break games."), "EmuCore", "WarnAboutUnsafeSettings", true);

View File

@ -25,6 +25,7 @@
#include "USB/USB.h" #include "USB/USB.h"
#include "VMManager.h" #include "VMManager.h"
#include "svnrev.h" #include "svnrev.h"
#include "cpuinfo.h"
#include "common/BitUtils.h" #include "common/BitUtils.h"
#include "common/FileSystem.h" #include "common/FileSystem.h"
@ -191,6 +192,13 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
GSgetMemoryStats(text); GSgetMemoryStats(text);
if (!text.empty()) if (!text.empty())
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));
text.clear();
text.append_format("{} QF | {:.2f}ms | {:.2f}ms | {:.2f}ms",
MTGS::GetCurrentVsyncQueueSize() - 1, // we subtract one for the current frame
PerformanceMetrics::GetMinimumFrameTime(), PerformanceMetrics::GetAverageFrameTime(),
PerformanceMetrics::GetMaximumFrameTime());
DRAW_LINE(fixed_font, text.c_str(), IM_COL32(255, 255, 255, 255));
} }
if (GSConfig.OsdShowResolution) if (GSConfig.OsdShowResolution)
@ -203,15 +211,18 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
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));
} }
if (GSConfig.OsdShowCPU) if (GSConfig.OsdShowHardwareInfo)
{ {
text.clear(); text.clear();
text.append_format("{} QF | {:.2f}ms | {:.2f}ms | {:.2f}ms", text.append_format("CPU: {} ({}C/{}T)",
MTGS::GetCurrentVsyncQueueSize() - 1, // we subtract one for the current frame cpuinfo_get_package(0)->name,
PerformanceMetrics::GetMinimumFrameTime(), PerformanceMetrics::GetAverageFrameTime(), cpuinfo_get_cores_count(),
PerformanceMetrics::GetMaximumFrameTime()); 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));
}
if (GSConfig.OsdShowCPU)
{
text.clear(); text.clear();
if (EmuConfig.Speedhacks.EECycleRate != 0 || EmuConfig.Speedhacks.EECycleSkip != 0) if (EmuConfig.Speedhacks.EECycleRate != 0 || EmuConfig.Speedhacks.EECycleSkip != 0)
text.append_format("EE[{}/{}]: ", EmuConfig.Speedhacks.EECycleRate, EmuConfig.Speedhacks.EECycleSkip); text.append_format("EE[{}/{}]: ", EmuConfig.Speedhacks.EECycleRate, EmuConfig.Speedhacks.EECycleSkip);

View File

@ -631,6 +631,7 @@ Pcsx2Config::GSOptions::GSOptions()
OsdShowInputs = false; OsdShowInputs = false;
OsdShowFrameTimes = false; OsdShowFrameTimes = false;
OsdShowVersion = false; OsdShowVersion = false;
OsdShowHardwareInfo = false;
HWDownloadMode = GSHardwareDownloadMode::Enabled; HWDownloadMode = GSHardwareDownloadMode::Enabled;
HWSpinGPUForReadbacks = false; HWSpinGPUForReadbacks = false;
@ -838,6 +839,7 @@ void Pcsx2Config::GSOptions::LoadSave(SettingsWrapper& wrap)
SettingsWrapBitBool(OsdShowInputs); SettingsWrapBitBool(OsdShowInputs);
SettingsWrapBitBool(OsdShowFrameTimes); SettingsWrapBitBool(OsdShowFrameTimes);
SettingsWrapBitBool(OsdShowVersion); SettingsWrapBitBool(OsdShowVersion);
SettingsWrapBitBool(OsdShowHardwareInfo);
SettingsWrapBitBool(HWSpinGPUForReadbacks); SettingsWrapBitBool(HWSpinGPUForReadbacks);
SettingsWrapBitBool(HWSpinCPUForReadbacks); SettingsWrapBitBool(HWSpinCPUForReadbacks);

View File

@ -2370,8 +2370,7 @@ inline void LogUserPowerPlan()
} }
#endif #endif
#if 0 #if defined(_WIN32)
#if defined(__linux__) || defined(_WIN32)
void LogGPUCapabilities() void LogGPUCapabilities()
{ {
Console.WriteLn(Color_StrongBlack, "Graphics Adapters Detected:"); Console.WriteLn(Color_StrongBlack, "Graphics Adapters Detected:");
@ -2484,7 +2483,6 @@ void LogGPUCapabilities()
#endif #endif
} }
#endif #endif
#endif
void VMManager::LogCPUCapabilities() void VMManager::LogCPUCapabilities()
{ {
@ -2532,7 +2530,7 @@ void VMManager::LogCPUCapabilities()
} }
#endif #endif
#if 0 #if defined(_WIN32)
LogGPUCapabilities(); LogGPUCapabilities();
#endif #endif
} }