diff options
author | bunnei <bunneidev@gmail.com> | 2018-01-17 01:23:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-17 01:23:43 -0500 |
commit | 9ae55884d2ccdb15e9eef7dabb4a76cb90b697c2 (patch) | |
tree | 499549b1713ce88df4b9285bcba065cc79144acc /src/core | |
parent | dc905463dcbe12a7d472a97b38d17597ee59450e (diff) | |
parent | a66eb7351ba8073015602ba9739bda5ad143d3ee (diff) |
Merge pull request #60 from jroweboy/game-frame
UI: Fix frame rate perf stats
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp | 3 | ||||
-rw-r--r-- | src/core/perf_stats.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp index c42a65b366..b65d79f117 100644 --- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp +++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp @@ -4,6 +4,7 @@ #include "common/assert.h" #include "common/logging/log.h" +#include "core/core.h" #include "core/hle/service/nvdrv/devices/nvdisp_disp0.h" #include "core/hle/service/nvdrv/devices/nvmap.h" #include "video_core/renderer_base.h" @@ -28,6 +29,8 @@ void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, u32 format, u32 width, u3 using PixelFormat = RendererBase::FramebufferInfo::PixelFormat; const RendererBase::FramebufferInfo framebuffer_info{ addr, offset, width, height, stride, static_cast<PixelFormat>(format)}; + + Core::System::GetInstance().perf_stats.EndGameFrame(); VideoCore::g_renderer->SwapBuffers(framebuffer_info); } diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index 26752699e3..ad3b56fcc8 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp @@ -69,7 +69,7 @@ PerfStats::Results PerfStats::GetAndResetStats(u64 current_system_time_us) { double PerfStats::GetLastFrameTimeScale() { std::lock_guard<std::mutex> lock(object_mutex); - constexpr double FRAME_LENGTH = 1.0 / 60; // GPU::SCREEN_REFRESH_RATE; + constexpr double FRAME_LENGTH = 1.0 / 60; return duration_cast<DoubleSecs>(previous_frame_length).count() / FRAME_LENGTH; } |