From 006e346a94231e86e571272d3e22ce00f787c5bd Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Thu, 16 Apr 2026 03:04:16 +0200 Subject: [PATCH] Don't fail metal `create_fence` if no shared event could be created (#9415) Co-authored-by: Connor Fitzgerald --- CHANGELOG.md | 4 ++++ wgpu-hal/src/metal/device.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e608e698e..5e00e208b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -150,6 +150,10 @@ By @teoxoy in [#9351](https://github.com/gfx-rs/wgpu/pull/9351). - Fixed use of a texture view without `TextureUsage::TEXTURE_BINDING` as a read-only depth attachment. By @andyleiserson in [#9346](https://github.com/gfx-rs/wgpu/pull/9346). - Fixed a `debug_assert` during stride validation for indirect multi draw. By @kristoff3r in [#9332](https://github.com/gfx-rs/wgpu/pull/9332) +#### Metal + +- Fix crash on fence creation when running in a MacOS Seatbelt sandbox. By @wumpf in [#9415](https://github.com/gfx-rs/wgpu/pull/9415) + ### Dependency Updates #### WebGPU diff --git a/wgpu-hal/src/metal/device.rs b/wgpu-hal/src/metal/device.rs index 6a66826e8..061af6374 100644 --- a/wgpu-hal/src/metal/device.rs +++ b/wgpu-hal/src/metal/device.rs @@ -1858,7 +1858,7 @@ impl crate::Device for super::Device { self.counters.fences.add(1); // https://developer.apple.com/documentation/metal/mtlsharedevent let shared_event = if available!(macos = 10.14, ios = 12.0, tvos = 12.0, visionos = 1.0) { - Some(self.shared.device.newSharedEvent().unwrap()) + self.shared.device.newSharedEvent() // This should be supported on said devices, but some sandbox environments may still restrict it, making it return `None`. } else { None };