diff options
| author | Dentomologist <dentomologist@gmail.com> | 2026-07-05 13:28:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-05 13:28:31 -0700 |
| commit | 774200dcf4ccea148ef357cc8cf86d8eab4446da (patch) | |
| tree | 4cc18c009a9639916a7b18a650b9453c4aba43c7 /Source/Core/VideoCommon/PerformanceMetrics.cpp | |
| parent | acf6060a5419d4adf61b1603c19916d5482e644a (diff) | |
| parent | be1df92153d94b276fee69182d4774e7bfc1b3f1 (diff) | |
Merge pull request #14689 from JosJuice/android-internal-resolution-display
VideoCommon: Use XFB for internal resolution stats
Diffstat (limited to 'Source/Core/VideoCommon/PerformanceMetrics.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PerformanceMetrics.cpp | 57 |
1 files changed, 23 insertions, 34 deletions
diff --git a/Source/Core/VideoCommon/PerformanceMetrics.cpp b/Source/Core/VideoCommon/PerformanceMetrics.cpp index fccc8ae38e..98efa64108 100644 --- a/Source/Core/VideoCommon/PerformanceMetrics.cpp +++ b/Source/Core/VideoCommon/PerformanceMetrics.cpp @@ -11,7 +11,6 @@ #include "Common/HookableEvent.h" #include "Core/Config/GraphicsSettings.h" #include "Core/Core.h" -#include "VideoCommon/FramebufferManager.h" #include "VideoCommon/VideoConfig.h" PerformanceMetrics::PerformanceMetrics() @@ -89,20 +88,6 @@ 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(); @@ -123,6 +108,11 @@ void PerformanceMetrics::SetLatestFramePresentationOffset(DT offset) m_frame_presentation_offset.store(offset, std::memory_order_relaxed); } +void PerformanceMetrics::SetLatestFrameBufferSize(u32 width, u32 height) +{ + m_frame_buffer_size.store(FrameBufferSize{width, height}, std::memory_order_relaxed); +} + void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale) { m_vps_counter.UpdateStats(); @@ -139,8 +129,6 @@ 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); @@ -335,49 +323,50 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale) ImGui::End(); } - if (g_ActiveConfig.bShowInternalResolution) + if (g_ActiveConfig.bShowVPS || g_ActiveConfig.bShowVTimes) { + // Position in the top-right corner of the screen. 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 (ImGui::Begin("VPSStats", 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); + if (g_ActiveConfig.bShowVPS) + ImGui::TextColored(ImVec4(r, g, b, 1.0f), "VPS:%7.2lf", vps); + if (g_ActiveConfig.bShowVTimes) + { + ImGui::TextColored(ImVec4(r, g, b, 1.0f), "dt:%6.2lfms", + DT_ms(m_vps_counter.GetDtAvg()).count()); + ImGui::TextColored(ImVec4(r, g, b, 1.0f), " ±:%6.2lfms", + DT_ms(m_vps_counter.GetDtStd()).count()); + } } ImGui::End(); } - if (g_ActiveConfig.bShowVPS || g_ActiveConfig.bShowVTimes) + if (g_ActiveConfig.bShowInternalResolution) { - // Position in the top-right corner of the screen. ImGui::SetNextWindowPos(ImVec2(window_x, window_y), set_next_position_condition, ImVec2(1.0f, 0.0f)); ImGui::SetNextWindowBgAlpha(bg_alpha); - if (ImGui::Begin("VPSStats", nullptr, imgui_flags)) + 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(); - if (g_ActiveConfig.bShowVPS) - ImGui::TextColored(ImVec4(r, g, b, 1.0f), "VPS:%7.2lf", vps); - if (g_ActiveConfig.bShowVTimes) - { - ImGui::TextColored(ImVec4(r, g, b, 1.0f), "dt:%6.2lfms", - DT_ms(m_vps_counter.GetDtAvg()).count()); - ImGui::TextColored(ImVec4(r, g, b, 1.0f), " ±:%6.2lfms", - DT_ms(m_vps_counter.GetDtStd()).count()); - } + + const FrameBufferSize size = m_frame_buffer_size.load(std::memory_order_relaxed); + ImGui::TextColored(ImVec4(r, g, b, 1.0f), "XFB res: %ux%u", size.width, size.height); } ImGui::End(); } |
