Skip to content

Commit

Permalink
Fix potential crash when a descriptor set is destroyed but not unbound (
Browse files Browse the repository at this point in the history
  • Loading branch information
bejado authored and poweifeng committed Oct 21, 2024
1 parent 1d0c23a commit e4b1f04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions filament/backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,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
Expand Down
2 changes: 1 addition & 1 deletion filament/backend/src/metal/MetalState.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class MetalBufferBindings {

private:
static_assert(N <= 8);
std::array<__unsafe_unretained id<MTLBuffer>, N> mBuffers = { nil };
std::array<__weak id<MTLBuffer>, N> mBuffers = { nil };
std::array<NSUInteger, N> mOffsets = { 0 };
utils::bitset8 mDirtyBuffers;
utils::bitset8 mDirtyOffsets;
Expand Down

0 comments on commit e4b1f04

Please sign in to comment.