summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-04-02 19:27:08 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:36:07 +0200
commitbfb5244cf8c600e6444d8590c8850ec31779bc6c (patch)
tree6fec4aae569ef4ced64d1a1e52058975d2b9ca9b
parentSingleCore: Correct ticks reset to be on preemption. (diff)
downloadyuzu-bfb5244cf8c600e6444d8590c8850ec31779bc6c.tar
yuzu-bfb5244cf8c600e6444d8590c8850ec31779bc6c.tar.gz
yuzu-bfb5244cf8c600e6444d8590c8850ec31779bc6c.tar.bz2
yuzu-bfb5244cf8c600e6444d8590c8850ec31779bc6c.tar.lz
yuzu-bfb5244cf8c600e6444d8590c8850ec31779bc6c.tar.xz
yuzu-bfb5244cf8c600e6444d8590c8850ec31779bc6c.tar.zst
yuzu-bfb5244cf8c600e6444d8590c8850ec31779bc6c.zip
-rw-r--r--src/core/core_timing.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index 12e9e60a4..b02119494 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -136,8 +136,11 @@ void CoreTiming::AddTicks(u64 ticks) {
void CoreTiming::Idle() {
if (!event_queue.empty()) {
- u64 next_event_time = event_queue.front().time;
- ticks = nsToCycles(std::chrono::nanoseconds(next_event_time)) + 10U;
+ const u64 next_event_time = event_queue.front().time;
+ const u64 next_ticks = nsToCycles(std::chrono::nanoseconds(next_event_time)) + 10U;
+ if (next_ticks > ticks) {
+ ticks = next_ticks;
+ }
return;
}
ticks += 1000U;