diff options
| author | Scott Mansell <phiren@gmail.com> | 2023-01-31 00:46:10 +1300 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2023-01-31 19:41:24 +1300 |
| commit | 0da69055d9f41d838bdf94b66805540c746eaa7d (patch) | |
| tree | 74363fda70c41594e6a24d64d8e62bc78d26685f /Source/Core/VideoCommon/Statistics.cpp | |
| parent | 2a18b34a73f4f1bc798dab0a5eec46c222ec7429 (diff) | |
Split out everying remaining from Swap
Diffstat (limited to 'Source/Core/VideoCommon/Statistics.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Statistics.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/Statistics.cpp b/Source/Core/VideoCommon/Statistics.cpp index a6b7eb8167..a1ab6122ab 100644 --- a/Source/Core/VideoCommon/Statistics.cpp +++ b/Source/Core/VideoCommon/Statistics.cpp @@ -8,11 +8,28 @@ #include <imgui.h> +#include "Core/DolphinAnalytics.h" +#include "Core/HW/SystemTimers.h" + #include "VideoCommon/BPFunctions.h" #include "VideoCommon/VideoCommon.h" #include "VideoCommon/VideoConfig.h" +#include "VideoCommon/VideoEvents.h" Statistics g_stats; + +static EventHook s_before_frame_event = BeforeFrameEvent::Register([] { + g_stats.ResetFrame(); +}, "Statistics::ResetFrame"); + +static EventHook s_after_frame_event = AfterFrameEvent::Register([] { + DolphinAnalytics::PerformanceSample perf_sample; + perf_sample.speed_ratio = SystemTimers::GetEstimatedEmulationPerformance(); + perf_sample.num_prims = g_stats.this_frame.num_prims + g_stats.this_frame.num_dl_prims; + perf_sample.num_draw_calls = g_stats.this_frame.num_draw_calls; + DolphinAnalytics::Instance().ReportPerformanceInfo(std::move(perf_sample)); +}, "Statistics::PerformanceSample"); + static bool clear_scissors; void Statistics::ResetFrame() |
