diff options
| author | Dentomologist <dentomologist@gmail.com> | 2026-05-25 12:17:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-25 12:17:29 -0700 |
| commit | 379a1a7109a9d5659fd81f79aa9d9abcf7914817 (patch) | |
| tree | 1bb7c212a8a2db9166ebdf881156783065942c19 /Source/Core/VideoCommon | |
| parent | 25a6205ffb69a265f3774af38a0a73b19780487e (diff) | |
| parent | fb4ff3e51b2c41f9fc44116916fc2deb1cfa366a (diff) | |
Merge pull request #14607 from elyashue/internal-resolution-display
VideoCommon: Added option for showcasing internal resolution
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/PerformanceMetrics.cpp | 37 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/PerformanceMetrics.h | 3 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.cpp | 1 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.h | 1 |
4 files changed, 41 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/PerformanceMetrics.cpp b/Source/Core/VideoCommon/PerformanceMetrics.cpp index 9676eb3b33..fccc8ae38e 100644 --- a/Source/Core/VideoCommon/PerformanceMetrics.cpp +++ b/Source/Core/VideoCommon/PerformanceMetrics.cpp @@ -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. diff --git a/Source/Core/VideoCommon/PerformanceMetrics.h b/Source/Core/VideoCommon/PerformanceMetrics.h index 6a6260a611..538360a05b 100644 --- a/Source/Core/VideoCommon/PerformanceMetrics.h +++ b/Source/Core/VideoCommon/PerformanceMetrics.h @@ -41,7 +41,8 @@ public: double GetVPS() const; double GetSpeed() const; double GetMaxSpeed() const; - + u32 GetEFBWidth() const; + u32 GetEFBHeight() const; // Call from any thread. void SetLatestFramePresentationOffset(DT offset); diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index 8685adcf15..448f447741 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -106,6 +106,7 @@ void VideoConfig::Refresh() iCropCustomBottom = Config::Get(Config::GFX_CROP_CUSTOM_BOTTOM); iSafeTextureCache_ColorSamples = Config::Get(Config::GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES); bShowFPS = Config::Get(Config::GFX_SHOW_FPS); + bShowInternalResolution = Config::Get(Config::GFX_SHOW_INTERNAL_RESOLUTION); bShowFTimes = Config::Get(Config::GFX_SHOW_FTIMES); bShowVPS = Config::Get(Config::GFX_SHOW_VPS); bShowVTimes = Config::Get(Config::GFX_SHOW_VTIMES); diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index 48dc095286..ec06f4a606 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -250,6 +250,7 @@ struct VideoConfig final // Information bool bShowFPS = false; + bool bShowInternalResolution = false; bool bShowFTimes = false; bool bShowVPS = false; bool bShowVTimes = false; |
