summaryrefslogtreecommitdiffstats
path: root/wgpu/src/settings.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-15 10:08:27 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-15 10:08:27 +0100
commitdadae122533ae0916bebd04d6efab3de145263d4 (patch)
treed0fda3d65fe0e842e97547ba4b18c398ce45ab25 /wgpu/src/settings.rs
parent4969bfdb66cf2b33033cb642423bc326e288e15b (diff)
downloadiced-dadae122533ae0916bebd04d6efab3de145263d4.tar.gz
iced-dadae122533ae0916bebd04d6efab3de145263d4.tar.bz2
iced-dadae122533ae0916bebd04d6efab3de145263d4.zip
Implement MSAA for `triangle` pipeline in `iced_wgpu`
Diffstat (limited to 'wgpu/src/settings.rs')
-rw-r--r--wgpu/src/settings.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/wgpu/src/settings.rs b/wgpu/src/settings.rs
index dbe81830..c8a0cadf 100644
--- a/wgpu/src/settings.rs
+++ b/wgpu/src/settings.rs
@@ -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,
+ }
+ }
}