Skip to content

Commit 4ada51d

Browse files
committed
Enable Metal ICB path on Apple Watch (S4+/Apple5)
The prepass rework dropped watchOS from the ICB gating along with the splice-era OS-version gates, but watchOS support was genuine hardware capability, not a splice workaround. Restore it. Validated end-to-end on Apple Watch SE 2 (S8 SiP, watchOS 11.6): the GPU reports "Apple S4 GPU", supports the Apple5 family, and an indirect command buffer GPU-generated by the multi-draw generation kernel renders correctly via executeCommandsInBuffer: (readback + visual). objc2-metal exposes no MTLFeatureSet::watchOS_* values, so the feature-set table can't cover watchOS, and watchOS classifies as OsType::Ios here with no watchos key in family_check; the watch is therefore detected purely by GPU family, folded into icb_family_support behind available!(watchos = 11.0) (false on every other platform). watchOS 11 is the floor for the same reason iOS/iPadOS/tvOS 17.x are excluded: earlier drivers mishandle the render-ICB path.
1 parent 7b2115d commit 4ada51d

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

wgpu-hal/src/metal/adapter.rs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,16 @@ impl super::CapabilitiesQuery {
727727
// needs iOS/tvOS 13, and `useResource:usage:` only participates in
728728
// hazard tracking from macOS 10.15 / iOS 13 — which the deferred
729729
// generation relies on to order the ICB write against its execution.
730-
let icb_api_check = available!(macos = 10.15, ios = 13.0, tvos = 13.0, visionos = 1.0);
731-
let icb_family_support = family_check
730+
// watchOS is gated at 11.0 for the same reason iOS/iPadOS/tvOS 17.x are
731+
// excluded: those driver generations mishandle the render-ICB path.
732+
let icb_api_check = available!(
733+
macos = 10.15,
734+
ios = 13.0,
735+
tvos = 13.0,
736+
visionos = 1.0,
737+
watchos = 11.0
738+
);
739+
let icb_family_support = (family_check
732740
&& if os_type == super::OsType::Macos {
733741
device.supportsFamily(MTLGPUFamily::Mac2)
734742
|| device.supportsFamily(MTLGPUFamily::Metal3)
@@ -737,7 +745,15 @@ impl super::CapabilitiesQuery {
737745
|| device.supportsFamily(MTLGPUFamily::Metal3)
738746
|| (os_type == super::OsType::Tvos
739747
&& device.supportsFamily(MTLGPUFamily::Apple3))
740-
};
748+
})
749+
// objc2-metal exposes no `MTLFeatureSet::watchOS_*` values, so the
750+
// feature-set table can't cover watchOS and `family_check` carries
751+
// no `watchos` key; detect the Apple Watch (which classifies as
752+
// `OsType::Ios` here) purely by GPU family. The S4+ watch GPU
753+
// reports Apple5 and supports ICBs — validated on Apple Watch SE 2
754+
// (S8, watchOS 11). `available!(watchos = 11.0)` is `false` on every
755+
// other platform, so this branch is inert off watchOS.
756+
|| (available!(watchos = 11.0) && device.supportsFamily(MTLGPUFamily::Apple5));
741757
let indirect_command_buffers_rendering = !is_virtual
742758
&& icb_api_check
743759
&& (Self::supports_any(device, INDIRECT_COMMAND_BUFFERS_RENDERING_SUPPORT)

0 commit comments

Comments
 (0)