fixing collect wrap-around

This commit is contained in:
Marcos Slomp 2024-02-09 14:13:59 -08:00
parent a9538799da
commit ad2c2efacd

View File

@ -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<uint32_t>(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);