From e0e105611db4cf797b99afca7fbf6623e5732dfb Mon Sep 17 00:00:00 2001 From: DevJac Date: Wed, 25 Oct 2023 08:55:41 -0600 Subject: [PATCH] TextureFormatFeatureFlags.supported_sample_counts --- wgpu-types/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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);