Skip to content

Commit

Permalink
TextureFormatFeatureFlags.supported_sample_counts
Browse files Browse the repository at this point in the history
  • Loading branch information
DevJac committed Oct 26, 2023
1 parent dd67d0c commit e0e1056
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2097,6 +2097,16 @@ impl TextureFormatFeatureFlags {
_ => false,
}
}

/// A `Vec` of supported sample counts.
pub fn supported_sample_counts(&self) -> Vec<u32> {
let all_possible_sample_counts: Vec<u32> = vec![1, 2, 4, 8, 16];
all_possible_sample_counts
.iter()
.filter(|sc| self.sample_count_supported(**sc))
.cloned()
.collect()
}
}

impl_bitflags!(TextureFormatFeatureFlags);
Expand Down

0 comments on commit e0e1056

Please sign in to comment.