diff options
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/command_processor.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 586ad62b6..e031871e8 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | #include <boost/range/algorithm/fill.hpp> | 5 | #include <boost/range/algorithm/fill.hpp> |
| 6 | 6 | ||
| 7 | #include "common/profiler.h" | ||
| 8 | |||
| 7 | #include "clipper.h" | 9 | #include "clipper.h" |
| 8 | #include "command_processor.h" | 10 | #include "command_processor.h" |
| 9 | #include "math.h" | 11 | #include "math.h" |
| @@ -25,6 +27,8 @@ static int float_regs_counter = 0; | |||
| 25 | 27 | ||
| 26 | static u32 uniform_write_buffer[4]; | 28 | static u32 uniform_write_buffer[4]; |
| 27 | 29 | ||
| 30 | Common::Profiling::TimingCategory category_drawing("Drawing"); | ||
| 31 | |||
| 28 | static inline void WritePicaReg(u32 id, u32 value, u32 mask) { | 32 | static inline void WritePicaReg(u32 id, u32 value, u32 mask) { |
| 29 | 33 | ||
| 30 | if (id >= registers.NumIds()) | 34 | if (id >= registers.NumIds()) |
| @@ -53,6 +57,8 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 53 | case PICA_REG_INDEX(trigger_draw): | 57 | case PICA_REG_INDEX(trigger_draw): |
| 54 | case PICA_REG_INDEX(trigger_draw_indexed): | 58 | case PICA_REG_INDEX(trigger_draw_indexed): |
| 55 | { | 59 | { |
| 60 | Common::Profiling::ScopeTimer scope_timer(category_drawing); | ||
| 61 | |||
| 56 | DebugUtils::DumpTevStageConfig(registers.GetTevStages()); | 62 | DebugUtils::DumpTevStageConfig(registers.GetTevStages()); |
| 57 | 63 | ||
| 58 | if (g_debug_context) | 64 | if (g_debug_context) |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 272695174..db7538ddd 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -4,7 +4,10 @@ | |||
| 4 | 4 | ||
| 5 | #include "core/hw/gpu.h" | 5 | #include "core/hw/gpu.h" |
| 6 | #include "core/mem_map.h" | 6 | #include "core/mem_map.h" |
| 7 | |||
| 7 | #include "common/emu_window.h" | 8 | #include "common/emu_window.h" |
| 9 | #include "common/profiler_reporting.h" | ||
| 10 | |||
| 8 | #include "video_core/video_core.h" | 11 | #include "video_core/video_core.h" |
| 9 | #include "video_core/renderer_opengl/renderer_opengl.h" | 12 | #include "video_core/renderer_opengl/renderer_opengl.h" |
| 10 | #include "video_core/renderer_opengl/gl_shader_util.h" | 13 | #include "video_core/renderer_opengl/gl_shader_util.h" |
| @@ -75,9 +78,18 @@ void RendererOpenGL::SwapBuffers() { | |||
| 75 | 78 | ||
| 76 | DrawScreens(); | 79 | DrawScreens(); |
| 77 | 80 | ||
| 81 | auto& profiler = Common::Profiling::GetProfilingManager(); | ||
| 82 | profiler.FinishFrame(); | ||
| 83 | { | ||
| 84 | auto aggregator = Common::Profiling::GetTimingResultsAggregator(); | ||
| 85 | aggregator->AddFrame(profiler.GetPreviousFrameResults()); | ||
| 86 | } | ||
| 87 | |||
| 78 | // Swap buffers | 88 | // Swap buffers |
| 79 | render_window->PollEvents(); | 89 | render_window->PollEvents(); |
| 80 | render_window->SwapBuffers(); | 90 | render_window->SwapBuffers(); |
| 91 | |||
| 92 | profiler.BeginFrame(); | ||
| 81 | } | 93 | } |
| 82 | 94 | ||
| 83 | /** | 95 | /** |