diff --git a/public/tracy/TracyMetal.hmm b/public/tracy/TracyMetal.hmm index f529eeed..e95cedb7 100644 --- a/public/tracy/TracyMetal.hmm +++ b/public/tracy/TracyMetal.hmm @@ -208,6 +208,11 @@ public: return true; } + if (RingIndex(begin) + count > RingSize()) + { + count = RingSize() - RingIndex(begin); + } + if (count >= MaxQueries) { fprintf(stdout, "TracyMetal: Collect: FULL [%llu, %llu] (%d)\n", begin, latestCheckpoint, count); @@ -292,6 +297,11 @@ private: return static_cast(count); } + tracy_force_inline uint32_t RingSize() const + { + return MaxQueries; + } + tracy_force_inline unsigned int NextQueryId(int n=1) { auto id = m_queryCounter.fetch_add(n);