mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
VideoCommon/Statistics: Remove global system accessor from s_after_frame_event
Instead, we make the event take a reference to the system and then pass it in when the event is triggered. This does introduce two other accessors, but these are much easier to refactor out over time, and without modification to the existing event interface.
This commit is contained in:
@ -23,13 +23,12 @@ static Common::EventHook s_before_frame_event =
|
||||
BeforeFrameEvent::Register([] { g_stats.ResetFrame(); }, "Statistics::ResetFrame");
|
||||
|
||||
static Common::EventHook s_after_frame_event = AfterFrameEvent::Register(
|
||||
[] {
|
||||
DolphinAnalytics::PerformanceSample perf_sample;
|
||||
perf_sample.speed_ratio =
|
||||
Core::System::GetInstance().GetSystemTimers().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));
|
||||
[](const Core::System& system) {
|
||||
DolphinAnalytics::Instance().ReportPerformanceInfo({
|
||||
.speed_ratio = system.GetSystemTimers().GetEstimatedEmulationPerformance(),
|
||||
.num_prims = g_stats.this_frame.num_prims + g_stats.this_frame.num_dl_prims,
|
||||
.num_draw_calls = g_stats.this_frame.num_draw_calls,
|
||||
});
|
||||
},
|
||||
"Statistics::PerformanceSample");
|
||||
|
||||
|
Reference in New Issue
Block a user