diff --git a/wgpu-hal/src/metal/adapter.rs b/wgpu-hal/src/metal/adapter.rs index 2a66889205..62a9a6b147 100644 --- a/wgpu-hal/src/metal/adapter.rs +++ b/wgpu-hal/src/metal/adapter.rs @@ -850,6 +850,9 @@ impl super::PrivateCapabilities { } else { Self::version_at_least(major, minor, 11, 0) }, + //Depth clipping is supported on all macOS GPU families and iOS family 4 and later + supports_depth_clamping: device.supports_feature_set(MTLFeatureSet::iOS_GPUFamily4_v1) + || os_is_mac, } } @@ -857,7 +860,6 @@ impl super::PrivateCapabilities { use wgt::Features as F; let mut features = F::empty() - | F::DEPTH_CLAMPING | F::TEXTURE_COMPRESSION_BC | F::MAPPABLE_PRIMARY_BUFFERS | F::VERTEX_WRITABLE_STORAGE @@ -865,6 +867,8 @@ impl super::PrivateCapabilities { | F::POLYGON_MODE_LINE | F::CLEAR_COMMANDS; + features.set(F::DEPTH_CLAMPING, self.supports_depth_clamping); + features.set( F::TEXTURE_BINDING_ARRAY | F::SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING diff --git a/wgpu-hal/src/metal/mod.rs b/wgpu-hal/src/metal/mod.rs index e51806a3d0..ed8deb9bb5 100644 --- a/wgpu-hal/src/metal/mod.rs +++ b/wgpu-hal/src/metal/mod.rs @@ -222,6 +222,7 @@ struct PrivateCapabilities { supports_arrays_of_textures: bool, supports_arrays_of_textures_write: bool, supports_mutability: bool, + supports_depth_clamping: bool, } #[derive(Clone, Debug)]