diff options
| author | 2017-02-19 18:35:04 -0800 | |
|---|---|---|
| committer | 2017-02-26 17:22:03 -0800 | |
| 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.gz yuzu-3b4e4003336c94527339a2a9ad7d52875974258f.tar.xz yuzu-3b4e4003336c94527339a2a9ad7d52875974258f.zip | |
Remove built-in (non-Microprofile) profiler
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 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <chrono> | ||
| 8 | #include <cstddef> | ||
| 9 | #include <vector> | ||
| 10 | #include "common/synchronized_wrapper.h" | ||
| 11 | |||
| 12 | namespace Common { | ||
| 13 | namespace Profiling { | ||
| 14 | |||
| 15 | using Clock = std::chrono::high_resolution_clock; | ||
| 16 | using Duration = Clock::duration; | ||
| 17 | |||
| 18 | struct ProfilingFrameResult { | ||
| 19 | /// Time since the last delivered frame | ||
| 20 | Duration interframe_time; | ||
| 21 | |||
| 22 | /// Time spent processing a frame, excluding VSync | ||
| 23 | Duration frame_time; | ||
| 24 | }; | ||
| 25 | |||
| 26 | class ProfilingManager final { | ||
| 27 | public: | ||
| 28 | ProfilingManager(); | ||
| 29 | |||
| 30 | /// This should be called after swapping screen buffers. | ||
| 31 | void BeginFrame(); | ||
| 32 | /// This should be called before swapping screen buffers. | ||
| 33 | void FinishFrame(); | ||
| 34 | |||
| 35 | /// Get the timing results from the previous frame. This is updated when you call FinishFrame(). | ||
| 36 | const ProfilingFrameResult& GetPreviousFrameResults() const { | ||
| 37 | return results; | ||
| 38 | } | ||
| 39 | |||
| 40 | private: | ||
| 41 | Clock::time_point last_frame_end; | ||
| 42 | Clock::time_point this_frame_start; | ||
| 43 | |||
| 44 | ProfilingFrameResult results; | ||
| 45 | }; | ||
| 46 | |||
| 47 | struct AggregatedDuration { | ||
| 48 | Duration avg, min, max; | ||
| 49 | }; | ||
| 50 | |||
| 51 | struct AggregatedFrameResult { | ||
| 52 | /// Time since the last delivered frame | ||
| 53 | AggregatedDuration interframe_time; | ||
| 54 | |||
| 55 | /// Time spent processing a frame, excluding VSync | ||
| 56 | AggregatedDuration frame_time; | ||
| 57 | |||
| 58 | float fps; | ||
| 59 | }; | ||
| 60 | |||
| 61 | class TimingResultsAggregator final { | ||
| 62 | public: | ||
| 63 | TimingResultsAggregator(size_t window_size); | ||
| 64 | |||
| 65 | void Clear(); | ||
| 66 | |||
| 67 | void AddFrame(const ProfilingFrameResult& frame_result); | ||
| 68 | |||
| 69 | AggregatedFrameResult GetAggregatedResults() const; | ||
| 70 | |||
| 71 | size_t max_window_size; | ||
| 72 | size_t window_size; | ||
| 73 | size_t cursor; | ||
| 74 | |||
| 75 | std::vector<Duration> interframe_times; | ||
| 76 | std::vector<Duration> frame_times; | ||
| 77 | }; | ||
| 78 | |||
| 79 | ProfilingManager& GetProfilingManager(); | ||
| 80 | SynchronizedRef<TimingResultsAggregator> GetTimingResultsAggregator(); | ||
| 81 | |||
| 82 | } // namespace Profiling | ||
| 83 | } // namespace Common | ||