VideoCommon: Added an option to showcase internal resolution, EFB width x height as screen overlay. Option to turn it on is a checkbox in screen on the OSD settings, in debug. This supports enhancements.

This commit is contained in:
Elyas Hue
2026-04-14 10:07:16 +02:00
parent 914f5c5621
commit fb4ff3e51b
8 changed files with 54 additions and 1 deletions

View File

@@ -11,6 +11,7 @@
#include "Common/HookableEvent.h"
#include "Core/Config/GraphicsSettings.h"
#include "Core/Core.h"
#include "VideoCommon/FramebufferManager.h"
#include "VideoCommon/VideoConfig.h"
PerformanceMetrics::PerformanceMetrics()
@@ -88,6 +89,20 @@ double PerformanceMetrics::GetFPS() const
return m_fps_counter.GetHzAvg();
}
u32 PerformanceMetrics::GetEFBWidth() const
{
if (g_framebuffer_manager)
return g_framebuffer_manager->GetEFBWidth();
return 0;
}
u32 PerformanceMetrics::GetEFBHeight() const
{
if (g_framebuffer_manager)
return g_framebuffer_manager->GetEFBHeight();
return 0;
}
double PerformanceMetrics::GetVPS() const
{
return m_vps_counter.GetHzAvg();
@@ -124,6 +139,8 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
const double fps = GetFPS();
const double vps = GetVPS();
const double speed = GetSpeed();
const u32 width = GetEFBWidth();
const u32 height = GetEFBHeight();
static ImVec2 last_display_size(-1.0f, -1.0f);
@@ -318,6 +335,26 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
ImGui::End();
}
if (g_ActiveConfig.bShowInternalResolution)
{
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), set_next_position_condition,
ImVec2(1.0f, 0.0f));
ImGui::SetNextWindowBgAlpha(bg_alpha);
if (ImGui::Begin("ResolutionStats", nullptr, imgui_flags))
{
if (stack_vertically)
window_y += ImGui::GetWindowHeight() + window_padding;
else
window_x -= ImGui::GetWindowWidth() + window_padding;
clamp_window_position();
ImGui::TextColored(ImVec4(r, g, b, 1.0f), "Res: %ux%u", width, height);
}
ImGui::End();
}
if (g_ActiveConfig.bShowVPS || g_ActiveConfig.bShowVTimes)
{
// Position in the top-right corner of the screen.