summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PerformanceMetrics.cpp
AgeCommit message (Collapse)Author
2026-02-06PerformanceMetrics: Clamp graph minimum auto sizeDentomologist
Add a minimum value for the automatic size of the performance metrics graph. The graph can still be manually resized smaller than this limit. This prevents the graph from automatically resizing itself to be too small to contain the full graph and legend, which happened when using native resolution with `Auto-Adjust Window Size` enabled.
2026-02-06PerformanceMetrics: Fix automatic graph resizingDentomologist
Fix a bug causing the performance graph to not resize when the render window changed size: * When changing the render window size during emulation the performance graph wouldn't update its size until the next emulation session. * When changing the render window size with no emulation active (by changing the Internal Resolution with Auto-Adjust Window Size enabled) the performance graph wouldn't update its size until the second emulation session after the change. Before explaining why the bug happened, here are some details about Dear ImGui (henceforth ImGui) for context: * In order to allow programs to specify initial ImGui window sizes while also allowing the user to resize them, `SetNextWindowSize` takes a flag from the `ImGuiCond_` enum specifying under what circumstances that function should actually have any effect. * ImGuiCond_FirstUseEver causes ImGui to only apply the command when the window doesn't have any saved size information for that session or in the ini file specified by `ImGui::GetIO().IniFilename`. Since we set that filename to `nullptr`, in practice the resize command is applied on the first frame of each ImGui/emulation session. * Qt saves the most recent size of the render window across emulation (and even Dolphin) sessions, which is then used to set the initial value of `ImGui::GetIO().DisplaySize` in the next emulation session. * It takes multiple frames for the size of the render window to update when changed by setting the internal resolution. This means that `ImGui::GetIO().DisplaySize` will have a stale value in the intervening frames, and specifically for the first few frames of emulation if the resolution was changed beforehand. When changing the resolution during emulation the call to `SetNextWindowSize` had no effect because of the `ImGuiCond_FirstUseEver` flag. `DisplaySize` would be updated several frames later, and then the next emulation session would update the graph size on its first frame. When changing the resolution outside emulation and then starting a game, the call to SetNextWindowSize on the first frame took effect but used the stale value of `DisplaySize`. `DisplaySize` would be updated a few frames later, but the graph wouldn't be resized until the first frame of the second emulation session. This commit fixes the issue by using the `ImGuiCond_Always` flag in the performance graph's call to `SetNextWindowSize` when the render window size changes.
2026-02-06PerformanceMetrics: Add padding below graphDentomologist
Add vertical padding between the performance graph (when it's enabled) and the FPS/VPS/Speed overlays.
2025-11-11VideoCommon/PerformanceMetrics: Display current offset between the latest ↵Jordan Woyak
frame presentation time and the intended presentation time in the "Show Frame Times" box.
2025-09-25OSD / Imgui: Add font size spinbox to Interface Pane.TryTwo
Adjust some imgui windows to work better with different font sizes.
2025-06-14Source: Remove redundant lambda parameter listsDr. Dystopia
2025-04-28Core, VideoCommon: Fix crash at shutdown due to destructor orderingMihai Brodschi
Previously, PerformanceTracker registered a callback to be updated on emulation state changes. PerformanceTrackers live in a global variable (g_perf_metrics) within libvideocommon. The callback was stored in a global variable in libcore. This created a race condition at shutdown between these libraries, when the PerfTracker's destructor tried to unregister the callback. Notify the PerfTracker directly from libcore, without callbacks, since Core.cpp already references g_perf_metrics explicitly. Also rename Core::CallOnStateChangedCallbacks to NotifyStateChanged to better reflect what it's doing.
2025-04-25Merge pull request #13487 from ↵Tilka
Dentomologist/performancemetrics_fix_window_arrangement PerformanceMetrics: Fix window arrangement
2025-04-05PerformanceMetrics: Fix window arrangementDentomologist
Fix overlays stacking on top of each other or not moving to the edge of the screen when enabling or disabling overlays while emulation is active. This change only applies when Config::GFX_MOVABLE_PERFORMANCE_METRICS is False.
2025-04-02Core: Move CountPerformanceMarker to VideoInterface to eliminate a Throttle ↵Jordan Woyak
call. PerformanceMetrics: Fixes/Cleanups.
2025-03-27Fix shadowed variable warnings and missing declarationsJoshua Vandaële
- PPCSymbolDB: Resolve shadowed variable warnings - PerformanceMetrics: Resolve shadowed variable warnings - SWEfbInterface: Add missing declarations
2025-03-23Merge pull request #13398 from jordan-woyak/perf-trackerJMC47
PerformanceTracker: Eliminate mutex. General cleanups.
2025-03-15PerformanceTracker: Use SPSCQueue and atomic to eliminate need for a mutex. ↵Jordan Woyak
Clean up some math.
2025-03-14Core: Remove unused GetActualEmulationSpeed function and related ↵Jordan Woyak
variables/functions.
2025-03-14PerformanceMetrics: Eliminated a mutex. Code cleanups.Jordan Woyak
2025-02-24PerformanceMetrics: Add clamping, resetting on resize, and settingDentomologist
Clamp overlays to the render window (with some padding), reset their positions when the render window changes sizes, and add a setting to enable moving the overlays (off by default, .ini only for now).
2025-02-06Merge pull request #13330 from ↵Admiral H. Curtiss
Dentomologist/performancemetrics_allow_moving_overlays PerformanceMetrics: Allow users to move overlays
2025-02-02PerformanceMetrics: Allow users to move overlaysDentomologist
Allow users to move the FPS, VPS, Speed, and Performance Graph overlays.
2025-02-02PerformanceMetrics: Call ImGui::End() unconditionallyDentomologist
Move ImGui::End() calls out of if(ImGui::Begin()) blocks. Quoting from ImGui::Begin's function comment in imgui.cpp: "You always need to call ImGui::End() even if false is returned." In practice this didn't cause problems because the windows don't have title bars and thus can't be collapsed, and so the block containing ::End would always run, but let's do it the right way.
2023-03-11HW/VideoInterface: Refactor to class.Admiral H. Curtiss
2023-01-29Tie Speed to CPU Speed and not VPSSam Belliveau
2023-01-06CoreTiming: Throttle Before Every Event Using ChronoSam Belliveau
2023-01-06PerformanceMetrics: Fix Line Width Issue on Non HiDPI ScreensSam Belliveau
2022-12-23New FrameTime/VBlank Analyzer + GraphSam Belliveau