diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-07-10 07:59:40 +0200 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-07-10 07:59:40 +0200 |
commit | 240650f6a6336df8d3eb11b410cdcd332d8ad562 (patch) | |
tree | 16ae249e6160a22f88bd2238d43b23079c4afb44 /src/core/hle/service/nvflinger | |
parent | Merge pull request #8531 from FernandoS27/core-timing-fix-reg (diff) | |
download | yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar.gz yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar.bz2 yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar.lz yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar.xz yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar.zst yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 2b2985a2d..600b19b3f 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -67,21 +67,20 @@ NVFlinger::NVFlinger(Core::System& system_, HosBinderDriverServer& hos_binder_dr // Schedule the screen composition events composition_event = Core::Timing::CreateEvent( - "ScreenComposition", [this](std::uintptr_t, std::chrono::nanoseconds ns_late) { + "ScreenComposition", + [this](std::uintptr_t, s64 time, + std::chrono::nanoseconds ns_late) -> std::optional<std::chrono::nanoseconds> { const auto lock_guard = Lock(); Compose(); - const auto ticks = std::chrono::nanoseconds{GetNextTicks()}; - const auto ticks_delta = ticks - ns_late; - const auto future_ns = std::max(std::chrono::nanoseconds::zero(), ticks_delta); - - this->system.CoreTiming().ScheduleEvent(future_ns, composition_event); + return std::chrono::nanoseconds(GetNextTicks()) - ns_late; }); if (system.IsMulticore()) { vsync_thread = std::jthread([this](std::stop_token token) { SplitVSync(token); }); } else { - system.CoreTiming().ScheduleEvent(frame_ns, composition_event); + system.CoreTiming().ScheduleLoopingEvent(std::chrono::nanoseconds(0), frame_ns, + composition_event); } } |