diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index 82989598ef..542e751a02 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -2097,6 +2097,16 @@ impl TextureFormatFeatureFlags { _ => false, } } + + /// A `Vec` of supported sample counts. + pub fn supported_sample_counts(&self) -> Vec { + let all_possible_sample_counts: Vec = vec![1, 2, 4, 8, 16]; + all_possible_sample_counts + .iter() + .filter(|sc| self.sample_count_supported(**sc)) + .cloned() + .collect() + } } impl_bitflags!(TextureFormatFeatureFlags);