diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-02-20 03:35:04 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-02-27 02:22:03 +0100 |
commit | 3b4e4003336c94527339a2a9ad7d52875974258f (patch) | |
tree | 18e6e1125ff486ff3f9bd2985af7830cd7838f22 /src/common/profiler_reporting.h | |
parent | PerfStats: Add method to get the instantaneous time ratio (diff) | |
download | yuzu-3b4e4003336c94527339a2a9ad7d52875974258f.tar yuzu-3b4e4003336c94527339a2a9ad7d52875974258f.tar.gz yuzu-3b4e4003336c94527339a2a9ad7d52875974258f.tar.bz2 yuzu-3b4e4003336c94527339a2a9ad7d52875974258f.tar.lz yuzu-3b4e4003336c94527339a2a9ad7d52875974258f.tar.xz yuzu-3b4e4003336c94527339a2a9ad7d52875974258f.tar.zst yuzu-3b4e4003336c94527339a2a9ad7d52875974258f.zip |
Diffstat (limited to 'src/common/profiler_reporting.h')
-rw-r--r-- | src/common/profiler_reporting.h | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/src/common/profiler_reporting.h b/src/common/profiler_reporting.h deleted file mode 100644 index e9ce6d41c..000000000 --- a/src/common/profiler_reporting.h +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2015 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include <chrono> -#include <cstddef> -#include <vector> -#include "common/synchronized_wrapper.h" - -namespace Common { -namespace Profiling { - -using Clock = std::chrono::high_resolution_clock; -using Duration = Clock::duration; - -struct ProfilingFrameResult { - /// Time since the last delivered frame - Duration interframe_time; - - /// Time spent processing a frame, excluding VSync - Duration frame_time; -}; - -class ProfilingManager final { -public: - ProfilingManager(); - - /// This should be called after swapping screen buffers. - void BeginFrame(); - /// This should be called before swapping screen buffers. - void FinishFrame(); - - /// Get the timing results from the previous frame. This is updated when you call FinishFrame(). - const ProfilingFrameResult& GetPreviousFrameResults() const { - return results; - } - -private: - Clock::time_point last_frame_end; - Clock::time_point this_frame_start; - - ProfilingFrameResult results; -}; - -struct AggregatedDuration { - Duration avg, min, max; -}; - -struct AggregatedFrameResult { - /// Time since the last delivered frame - AggregatedDuration interframe_time; - - /// Time spent processing a frame, excluding VSync - AggregatedDuration frame_time; - - float fps; -}; - -class TimingResultsAggregator final { -public: - TimingResultsAggregator(size_t window_size); - - void Clear(); - - void AddFrame(const ProfilingFrameResult& frame_result); - - AggregatedFrameResult GetAggregatedResults() const; - - size_t max_window_size; - size_t window_size; - size_t cursor; - - std::vector<Duration> interframe_times; - std::vector<Duration> frame_times; -}; - -ProfilingManager& GetProfilingManager(); -SynchronizedRef<TimingResultsAggregator> GetTimingResultsAggregator(); - -} // namespace Profiling -} // namespace Common |