Introduce ICED_PRESENT_MODE env var to pick a wgpu::PresentMode
This commit is contained in:
parent
db07b9ba9e
commit
8a0701a0d9
2 changed files with 29 additions and 10 deletions
|
|
@ -51,3 +51,17 @@ impl From<graphics::Settings> for Settings {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn present_mode_from_env() -> Option<wgpu::PresentMode> {
|
||||
let present_mode = std::env::var("ICED_PRESENT_MODE").ok()?;
|
||||
|
||||
match present_mode.to_lowercase().as_str() {
|
||||
"vsync" => Some(wgpu::PresentMode::AutoVsync),
|
||||
"no_vsync" => Some(wgpu::PresentMode::AutoNoVsync),
|
||||
"immediate" => Some(wgpu::PresentMode::Immediate),
|
||||
"fifo" => Some(wgpu::PresentMode::Fifo),
|
||||
"fifo_relaxed" => Some(wgpu::PresentMode::FifoRelaxed),
|
||||
"mailbox" => Some(wgpu::PresentMode::Mailbox),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue