Skip to content

Commit

Permalink
Fix Apple runtime crashes on Macs with non-Apple-Silicon GPUs
Browse files Browse the repository at this point in the history
This removes some legacy code that prevented the correct factory from being initialized when used on Macs with non-Apple-Silicon GPUs. Additionally, it removes explicitly setting the storage mode, which was causing Metal API validation to fail on non-Apple-Silicon GPU Macs.

## Storage Mode

Explicitly setting the storage mode to shared has been removed. This has no impact on iOS. For macOS, this defaults to managed, which should be appropriately handled by the C++ runtime, per Chris.

Per the docs for `MTLTextureDescriptor.storageMode`:

> In iOS and tvOS, the default value is MTLStorageMode.shared. In macOS, the default value is MTLStorageMode.managed.

## Testing

These changes were tested on an i9 Intel Mac against a file that was reproducibly causing crashes. Post-changes, the file no longer crashes.

Diffs=
56d95d200 Fix Apple runtime crashes on Macs with non-Apple-Silicon GPUs (#8301)
  • Loading branch information
dskuza committed Oct 8, 2024
1 parent de796be commit 8e2ddd0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ab13be54df9e69b44581d0e3fd8c6069e34d7528
56d95d2006868350ebb0c080447d07647d1a5855
2 changes: 1 addition & 1 deletion submodules/rive-cpp

0 comments on commit 8e2ddd0

Please sign in to comment.