Do MTL feature check for Depth Clamping (#1933)

* Do MTL feature check for Depth Clamping

(cherry picked from commit ae6e83c3b2e695918ffcd8bbf7ce3a1b32e2b36e)

# Conflicts:
#	wgpu-hal/src/metal/adapter.rs

* make feature support check conform

* clean code

* avoid same featureset checks multiple times

* cargo fmt'ed
This commit is contained in:
Geert Bleyen authored and Dzmitry Malyshau committed 2021-09-12 17:42:46 -04:00
1 parent 85bb70915b
commit 1c3b5663ba
2 files changed
+6 -1

No files matched your search

+5 -1
View File
@@ -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,12 +860,13 @@ 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
| F::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES;
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
+1
View File
@@ -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)]