diff --git a/filament/backend/CMakeLists.txt b/filament/backend/CMakeLists.txt index 29a580924bb..3878723f434 100644 --- a/filament/backend/CMakeLists.txt +++ b/filament/backend/CMakeLists.txt @@ -540,6 +540,8 @@ if (APPLE AND NOT IOS) add_executable(metal_utils_test test/MetalTest.mm) +target_compile_options(metal_utils_test PRIVATE "-fobjc-arc") + target_link_libraries(metal_utils_test PRIVATE backend getopt diff --git a/filament/backend/src/metal/MetalState.h b/filament/backend/src/metal/MetalState.h index c861cd8cfc9..92d5a3319c2 100644 --- a/filament/backend/src/metal/MetalState.h +++ b/filament/backend/src/metal/MetalState.h @@ -442,7 +442,7 @@ class MetalBufferBindings { private: static_assert(N <= 8); - std::array<__unsafe_unretained id, N> mBuffers = { nil }; + std::array<__weak id, N> mBuffers = { nil }; std::array mOffsets = { 0 }; utils::bitset8 mDirtyBuffers; utils::bitset8 mDirtyOffsets;