summaryrefslogtreecommitdiffstats
path: root/wgpu/src/settings.rs
diff options
context:
space:
mode:
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,
+ }
+ }
}