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 Oct 18, 2024
1 parent 4425338 commit 6e9afff
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 @@ -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
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 @@ -442,7 +442,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 6e9afff

Please sign in to comment.