Compare commits

...

1 Commits

Author SHA1 Message Date
Benjamin Doherty
15424c85b5 Metal: use atomic for buffer tracking 2025-09-19 13:41:37 -07:00
2 changed files with 2 additions and 2 deletions

View File

@@ -153,7 +153,7 @@ private:
Type mType = Type::NONE; Type mType = Type::NONE;
static PlatformMetal* platform; static PlatformMetal* platform;
static std::array<uint64_t, TypeCount> aliveBuffers; static std::array<std::atomic<uint64_t>, TypeCount> aliveBuffers;
}; };
class MetalBuffer { class MetalBuffer {

View File

@@ -24,7 +24,7 @@
namespace filament { namespace filament {
namespace backend { namespace backend {
std::array<uint64_t, TrackedMetalBuffer::TypeCount> TrackedMetalBuffer::aliveBuffers = { 0 }; std::array<std::atomic<uint64_t>, TrackedMetalBuffer::TypeCount> TrackedMetalBuffer::aliveBuffers = { 0 };
PlatformMetal* TrackedMetalBuffer::platform = nullptr; PlatformMetal* TrackedMetalBuffer::platform = nullptr;
PlatformMetal* ScopedAllocationTimer::platform = nullptr; PlatformMetal* ScopedAllocationTimer::platform = nullptr;