summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2023-05-28 23:45:47 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2023-06-08 03:44:42 +0200
commit907507886d755fa56099713c4b8f05bb640a8b7d (patch)
treea6ef3a8dfa9ba4aab797ab4985e078aba4b89fd2 /src/core
parenttime: Use compile time division for TimeSpanType conversion (diff)
downloadyuzu-907507886d755fa56099713c4b8f05bb640a8b7d.tar
yuzu-907507886d755fa56099713c4b8f05bb640a8b7d.tar.gz
yuzu-907507886d755fa56099713c4b8f05bb640a8b7d.tar.bz2
yuzu-907507886d755fa56099713c4b8f05bb640a8b7d.tar.lz
yuzu-907507886d755fa56099713c4b8f05bb640a8b7d.tar.xz
yuzu-907507886d755fa56099713c4b8f05bb640a8b7d.tar.zst
yuzu-907507886d755fa56099713c4b8f05bb640a8b7d.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core_timing.cpp7
-rw-r--r--src/core/core_timing.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index 9a1d5a69a..e57bca70a 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -197,6 +197,13 @@ u64 CoreTiming::GetClockTicks() const {
return ticks;
}
+u64 CoreTiming::GetGPUTicks() const {
+ if (is_multicore) [[likely]] {
+ return clock->GetGPUTick();
+ }
+ return Common::WallClock::CNTPCTToGPUTick(ticks);
+}
+
std::optional<s64> CoreTiming::Advance() {
std::scoped_lock lock{advance_lock, basic_lock};
global_timer = GetGlobalTimeNs().count();
diff --git a/src/core/core_timing.h b/src/core/core_timing.h
index fdacdd94a..1873852c4 100644
--- a/src/core/core_timing.h
+++ b/src/core/core_timing.h
@@ -119,6 +119,9 @@ public:
/// Returns the current CNTPCT tick value.
u64 GetClockTicks() const;
+ /// Returns the current GPU tick value.
+ u64 GetGPUTicks() const;
+
/// Returns current time in microseconds.
std::chrono::microseconds GetGlobalTimeUs() const;