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.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/wgpu/src/settings.rs b/wgpu/src/settings.rs
index 5e2603ee..b3c3cf6a 100644
--- a/wgpu/src/settings.rs
+++ b/wgpu/src/settings.rs
@@ -52,6 +52,18 @@ impl From<graphics::Settings> for Settings {
}
}
+/// Obtains a [`wgpu::PresentMode`] from the current environment
+/// configuration, if set.
+///
+/// The value returned by this function can be changed by setting
+/// the `ICED_PRESENT_MODE` env variable. The possible values are:
+///
+/// - `vsync` → [`wgpu::PresentMode::AutoVsync`]
+/// - `no_vsync` → [`wgpu::PresentMode::AutoNoVsync`]
+/// - `immediate` → [`wgpu::PresentMode::Immediate`]
+/// - `fifo` → [`wgpu::PresentMode::Fifo`]
+/// - `fifo_relaxed` → [`wgpu::PresentMode::FifoRelaxed`]
+/// - `mailbox` → [`wgpu::PresentMode::Mailbox`]
pub fn present_mode_from_env() -> Option<wgpu::PresentMode> {
let present_mode = std::env::var("ICED_PRESENT_MODE").ok()?;