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.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/wgpu/src/settings.rs b/wgpu/src/settings.rs
index abc404dc..9a7eed34 100644
--- a/wgpu/src/settings.rs
+++ b/wgpu/src/settings.rs
@@ -29,7 +29,15 @@ pub struct Settings {
/// By default, it will be set to 20.
pub default_text_size: u16,
+ /// If enabled, spread text workload in multiple threads when multiple cores
+ /// are available.
+ ///
+ /// By default, it is disabled.
+ pub text_multithreading: bool,
+
/// The antialiasing strategy that will be used for triangle primitives.
+ ///
+ /// By default, it is `None`.
pub antialiasing: Option<Antialiasing>,
}
@@ -47,6 +55,7 @@ impl Settings {
/// - `dx11`
/// - `gl`
/// - `webgpu`
+ /// - `primary`
pub fn from_env() -> Self {
Settings {
internal_backend: backend_from_env()
@@ -64,6 +73,7 @@ impl Default for Settings {
internal_backend: wgpu::BackendBit::PRIMARY,
default_font: None,
default_text_size: 20,
+ text_multithreading: false,
antialiasing: None,
}
}
@@ -78,6 +88,7 @@ fn backend_from_env() -> Option<wgpu::BackendBit> {
"dx11" => wgpu::BackendBit::DX11,
"gl" => wgpu::BackendBit::GL,
"webgpu" => wgpu::BackendBit::BROWSER_WEBGPU,
+ "primary" => wgpu::BackendBit::PRIMARY,
other => panic!("Unknown backend: {}", other),
}
})