mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Core: Move CountPerformanceMarker to VideoInterface to eliminate a Throttle call. PerformanceMetrics: Fixes/Cleanups.
This commit is contained in:
@ -3,8 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <deque>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "VideoCommon/PerformanceTracker.h"
|
||||
@ -25,15 +25,17 @@ public:
|
||||
PerformanceMetrics(PerformanceMetrics&&) = delete;
|
||||
PerformanceMetrics& operator=(PerformanceMetrics&&) = delete;
|
||||
|
||||
// Count Functions
|
||||
void Reset();
|
||||
|
||||
void CountFrame();
|
||||
void CountVBlank();
|
||||
|
||||
// Call from CPU thread.
|
||||
void CountThrottleSleep(DT sleep);
|
||||
void CountPerformanceMarker(Core::System& system, s64 cyclesLate);
|
||||
void AdjustClockSpeed(s64 ticks, u32 new_ppc_clock, u32 old_ppc_clock);
|
||||
void CountPerformanceMarker(s64 ticks, u32 ticks_per_second);
|
||||
|
||||
// Getter Functions
|
||||
// Getter Functions. May be called from any thread.
|
||||
double GetFPS() const;
|
||||
double GetVPS() const;
|
||||
double GetSpeed() const;
|
||||
@ -45,14 +47,20 @@ public:
|
||||
private:
|
||||
PerformanceTracker m_fps_counter{"render_times.txt"};
|
||||
PerformanceTracker m_vps_counter{"vblank_times.txt"};
|
||||
PerformanceTracker m_speed_counter{std::nullopt, std::chrono::seconds{1}};
|
||||
|
||||
double m_graph_max_time = 0.0;
|
||||
|
||||
std::atomic<double> m_speed{};
|
||||
std::atomic<double> m_max_speed{};
|
||||
u8 m_time_index = 0;
|
||||
std::array<TimePoint, 256> m_real_times{};
|
||||
std::array<u64, 256> m_core_ticks{};
|
||||
|
||||
struct PerfSample
|
||||
{
|
||||
TimePoint clock_time;
|
||||
TimePoint work_time;
|
||||
s64 core_ticks;
|
||||
};
|
||||
|
||||
std::deque<PerfSample> m_samples;
|
||||
DT m_time_sleeping{};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user