Improve FPS/VPS Counting and Revamp Appearance

This commit is contained in:
Sam Belliveau
2022-10-26 15:17:15 -04:00
committed by Admiral H. Curtiss
parent 5e442f6ffa
commit edb2c90b38
15 changed files with 196 additions and 72 deletions

View File

@ -45,6 +45,27 @@ void AdvancedWidget::CreateWidgets()
{
auto* main_layout = new QVBoxLayout;
// Performance
auto* performance_box = new QGroupBox(tr("Performance Statistics"));
auto* performance_layout = new QGridLayout();
performance_box->setLayout(performance_layout);
m_show_fps = new GraphicsBool(tr("Show FPS"), Config::GFX_SHOW_FPS);
m_show_vps = new GraphicsBool(tr("Show VPS"), Config::GFX_SHOW_VPS);
m_show_speed = new GraphicsBool(tr("Show % Speed"), Config::GFX_SHOW_SPEED);
m_show_speed_colors = new GraphicsBool(tr("Show Speed Colors"), Config::GFX_SHOW_SPEED_COLORS);
m_perf_samp_window = new GraphicsInteger(0, 10000, Config::GFX_PERF_SAMP_WINDOW, 100);
m_log_render_time =
new GraphicsBool(tr("Log Render Time to File"), Config::GFX_LOG_RENDER_TIME_TO_FILE);
performance_layout->addWidget(m_show_fps, 0, 0);
performance_layout->addWidget(m_show_vps, 1, 0);
performance_layout->addWidget(m_show_speed, 0, 1);
performance_layout->addWidget(new QLabel(tr("Performance Sample Window (ms):")), 2, 0);
performance_layout->addWidget(m_perf_samp_window, 2, 1);
performance_layout->addWidget(m_log_render_time, 3, 0);
performance_layout->addWidget(m_show_speed_colors, 3, 1);
// Debugging
auto* debugging_box = new QGroupBox(tr("Debugging"));
auto* debugging_layout = new QGridLayout();
@ -155,6 +176,7 @@ void AdvancedWidget::CreateWidgets()
experimental_layout->addWidget(m_defer_efb_access_invalidation, 0, 0);
experimental_layout->addWidget(m_manual_texture_sampling, 0, 1);
main_layout->addWidget(performance_box);
main_layout->addWidget(debugging_box);
main_layout->addWidget(utility_box);
main_layout->addWidget(texture_dump_box);
@ -214,6 +236,32 @@ void AdvancedWidget::OnEmulationStateChanged(bool running)
void AdvancedWidget::AddDescriptions()
{
static const char TR_SHOW_FPS_DESCRIPTION[] =
QT_TR_NOOP("Shows the number of distinct frames rendered per second as a measure of "
"visual smoothness.<br><br><dolphin_emphasis>If unsure, leave this "
"unchecked.</dolphin_emphasis>");
static const char TR_SHOW_VPS_DESCRIPTION[] =
QT_TR_NOOP("Shows the number of frames rendered per second as a measure of "
"emulation speed.<br><br><dolphin_emphasis>If unsure, leave this "
"unchecked.</dolphin_emphasis>");
static const char TR_SHOW_SPEED_DESCRIPTION[] =
QT_TR_NOOP("Shows the % speed of emulation compared to full speed."
"<br><br><dolphin_emphasis>If unsure, leave this "
"unchecked.</dolphin_emphasis>");
static const char TR_SHOW_SPEED_COLORS_DESCRIPTION[] =
QT_TR_NOOP("Changes the color of the FPS counter depending on emulation speed."
"<br><br><dolphin_emphasis>If unsure, leave this "
"checked.</dolphin_emphasis>");
static const char TR_PERF_SAMP_WINDOW_DESCRIPTION[] =
QT_TR_NOOP("The amount of time the FPS and VPS counters will sample over."
"<br><br>The higher the value, the more stable the FPS/VPS counter will be, "
"but the slower it will be slower to update."
"<br><br><dolphin_emphasis>If unsure, leave this "
"at 1000ms.</dolphin_emphasis>");
static const char TR_LOG_RENDERTIME_DESCRIPTION[] = QT_TR_NOOP(
"Logs the render time of every frame to User/Logs/render_time.txt.<br><br>Use this "
"feature to measure Dolphin's performance.<br><br><dolphin_emphasis>If "
"unsure, leave this unchecked.</dolphin_emphasis>");
static const char TR_WIREFRAME_DESCRIPTION[] =
QT_TR_NOOP("Renders the scene as a wireframe.<br><br><dolphin_emphasis>If unsure, leave "
"this unchecked.</dolphin_emphasis>");
@ -331,10 +379,17 @@ void AdvancedWidget::AddDescriptions()
static const char IF_UNSURE_UNCHECKED[] =
QT_TR_NOOP("<dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
m_show_fps->SetDescription(tr(TR_SHOW_FPS_DESCRIPTION));
m_show_vps->SetDescription(tr(TR_SHOW_VPS_DESCRIPTION));
m_show_speed->SetDescription(tr(TR_SHOW_SPEED_DESCRIPTION));
m_log_render_time->SetDescription(tr(TR_LOG_RENDERTIME_DESCRIPTION));
m_show_speed_colors->SetDescription(tr(TR_SHOW_SPEED_COLORS_DESCRIPTION));
m_enable_wireframe->SetDescription(tr(TR_WIREFRAME_DESCRIPTION));
m_show_statistics->SetDescription(tr(TR_SHOW_STATS_DESCRIPTION));
m_enable_format_overlay->SetDescription(tr(TR_TEXTURE_FORMAT_DESCRIPTION));
m_enable_api_validation->SetDescription(tr(TR_VALIDATION_LAYER_DESCRIPTION));
m_perf_samp_window->SetDescription(tr(TR_PERF_SAMP_WINDOW_DESCRIPTION));
m_dump_textures->SetDescription(tr(TR_DUMP_TEXTURE_DESCRIPTION));
m_dump_mip_textures->SetDescription(tr(TR_DUMP_MIP_TEXTURE_DESCRIPTION));
m_dump_base_textures->SetDescription(tr(TR_DUMP_BASE_TEXTURE_DESCRIPTION));

View File

@ -35,6 +35,12 @@ private:
GraphicsBool* m_show_statistics;
GraphicsBool* m_enable_format_overlay;
GraphicsBool* m_enable_api_validation;
GraphicsBool* m_show_fps;
GraphicsBool* m_show_vps;
GraphicsBool* m_show_speed;
GraphicsBool* m_show_speed_colors;
GraphicsInteger* m_perf_samp_window;
GraphicsBool* m_log_render_time;
// Utility
GraphicsBool* m_prefetch_custom_textures;

View File

@ -87,10 +87,7 @@ void GeneralWidget::CreateWidgets()
auto* m_options_box = new QGroupBox(tr("Other"));
auto* m_options_layout = new QGridLayout();
m_show_fps = new GraphicsBool(tr("Show FPS"), Config::GFX_SHOW_FPS);
m_show_ping = new GraphicsBool(tr("Show NetPlay Ping"), Config::GFX_SHOW_NETPLAY_PING);
m_log_render_time =
new GraphicsBool(tr("Log Render Time to File"), Config::GFX_LOG_RENDER_TIME_TO_FILE);
m_autoadjust_window_size =
new GraphicsBool(tr("Auto-Adjust Window Size"), Config::MAIN_RENDER_WINDOW_AUTOSIZE);
m_show_messages =
@ -99,14 +96,11 @@ void GeneralWidget::CreateWidgets()
m_options_box->setLayout(m_options_layout);
m_options_layout->addWidget(m_show_fps, 0, 0);
m_options_layout->addWidget(m_log_render_time, 0, 1);
m_options_layout->addWidget(m_render_main_window, 0, 0);
m_options_layout->addWidget(m_autoadjust_window_size, 1, 0);
m_options_layout->addWidget(m_render_main_window, 1, 0);
m_options_layout->addWidget(m_autoadjust_window_size, 1, 1);
m_options_layout->addWidget(m_show_messages, 2, 0);
m_options_layout->addWidget(m_show_ping, 2, 1);
m_options_layout->addWidget(m_show_messages, 0, 1);
m_options_layout->addWidget(m_show_ping, 1, 1);
// Other
auto* shader_compilation_box = new QGroupBox(tr("Shader Compilation"));
@ -226,17 +220,9 @@ void GeneralWidget::AddDescriptions()
"if emulation speed is below 100%.<br><br><dolphin_emphasis>If unsure, leave "
"this "
"unchecked.</dolphin_emphasis>");
static const char TR_SHOW_FPS_DESCRIPTION[] =
QT_TR_NOOP("Shows the number of frames rendered per second as a measure of "
"emulation speed.<br><br><dolphin_emphasis>If unsure, leave this "
"unchecked.</dolphin_emphasis>");
static const char TR_SHOW_NETPLAY_PING_DESCRIPTION[] = QT_TR_NOOP(
"Shows the player's maximum ping while playing on "
"NetPlay.<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
static const char TR_LOG_RENDERTIME_DESCRIPTION[] = QT_TR_NOOP(
"Logs the render time of every frame to User/Logs/render_time.txt.<br><br>Use this "
"feature to measure Dolphin's performance.<br><br><dolphin_emphasis>If "
"unsure, leave this unchecked.</dolphin_emphasis>");
static const char TR_SHOW_NETPLAY_MESSAGES_DESCRIPTION[] =
QT_TR_NOOP("Shows chat messages, buffer changes, and desync alerts "
"while playing NetPlay.<br><br><dolphin_emphasis>If unsure, leave "
@ -281,12 +267,8 @@ void GeneralWidget::AddDescriptions()
m_enable_fullscreen->SetDescription(tr(TR_FULLSCREEN_DESCRIPTION));
m_show_fps->SetDescription(tr(TR_SHOW_FPS_DESCRIPTION));
m_show_ping->SetDescription(tr(TR_SHOW_NETPLAY_PING_DESCRIPTION));
m_log_render_time->SetDescription(tr(TR_LOG_RENDERTIME_DESCRIPTION));
m_autoadjust_window_size->SetDescription(tr(TR_AUTOSIZE_DESCRIPTION));
m_show_messages->SetDescription(tr(TR_SHOW_NETPLAY_MESSAGES_DESCRIPTION));

View File

@ -49,9 +49,7 @@ private:
GraphicsBool* m_enable_fullscreen;
// Options
GraphicsBool* m_show_fps;
GraphicsBool* m_show_ping;
GraphicsBool* m_log_render_time;
GraphicsBool* m_autoadjust_window_size;
GraphicsBool* m_show_messages;
GraphicsBool* m_render_main_window;