From 799360dfb81952f0bd2657fad4d20b24c19e46a8 Mon Sep 17 00:00:00 2001 From: Marcos Slomp Date: Thu, 16 May 2024 22:24:35 -0700 Subject: [PATCH] Collect pending timestamps during shutdown --- public/tracy/TracyMetal.hmm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/tracy/TracyMetal.hmm b/public/tracy/TracyMetal.hmm index b2956f28..bd0293a9 100644 --- a/public/tracy/TracyMetal.hmm +++ b/public/tracy/TracyMetal.hmm @@ -144,6 +144,12 @@ public: ~MetalCtx() { ZoneScopedNC("~TracyMetalCtx", tracy::Color::Red4); + ZoneValue(m_previousCheckpoint.load()); + ZoneValue(m_queryCounter.load()); + // collect the last remnants of Metal GPU activity... + // TODO: add a timeout to this loop? + while (m_previousCheckpoint.load() != m_queryCounter.load()) + Collect(); } static MetalCtx* Create(id device)