Implement MSAA for triangle pipeline in iced_wgpu

This commit is contained in:
Héctor Ramón Jiménez 2020-02-15 10:08:27 +01:00
parent 4969bfdb66
commit dadae12253
15 changed files with 539 additions and 73 deletions

View file

@ -7,4 +7,26 @@ pub struct Settings {
///
/// If `None` is provided, a default system font will be chosen.
pub default_font: Option<&'static [u8]>,
/// The antialiasing strategy that will be used for triangle primitives.
pub antialiasing: Option<MSAA>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum MSAA {
X2,
X4,
X8,
X16,
}
impl MSAA {
pub(crate) fn sample_count(&self) -> u32 {
match self {
MSAA::X2 => 2,
MSAA::X4 => 4,
MSAA::X8 => 8,
MSAA::X16 => 16,
}
}
}