summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authormobserveur <mobserveur@gmail.com>2024-06-06 13:16:15 +0200
committermobserveur <mobserveur@gmail.com>2024-06-06 13:16:15 +0200
commit899b0b006d1e7fed7369b0c7cdbdb42b7365b93a (patch)
tree0d6b75c5b6bcc42523b188b7e874f618c91ef204 /indra
parent1da579b44e49ad6bb347c00ea8c6288a0eecbf55 (diff)
fasttimer.h fixed clock for Apple Gpu
This fixes the precision clock used in fasttimer.h
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/llfasttimer.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index 607509ea2d..cf5e43d805 100644
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -127,8 +127,22 @@ public:
#endif
+#if (LL_DARWIN && defined(__arm64__))
-#if (LL_LINUX || LL_DARWIN) && !(defined(__i386__) || defined(__amd64__))
+ static U32 getCPUClockCount64()
+ {
+ U64 t = clock_gettime_nsec_np(CLOCK_UPTIME_RAW);
+ return t/1000;
+ }
+
+ static U64 getCPUClockCount32()
+ {
+ return (U32) (getCPUClockCount64() >> 8);
+ }
+
+#endif
+
+#if (LL_LINUX && !(defined(__i386__) || defined(__amd64__)))
//
// Linux implementation of CPU clock - non-x86.
// This is accurate but SLOW! Only use out of desperation.