wgpu: Update to 0.10
This commit is contained in:
parent
663c3685da
commit
18753b77fc
14 changed files with 100 additions and 89 deletions
|
|
@ -12,7 +12,7 @@ pub struct Settings {
|
|||
pub present_mode: wgpu::PresentMode,
|
||||
|
||||
/// The internal graphics backend to use.
|
||||
pub internal_backend: wgpu::BackendBit,
|
||||
pub internal_backend: wgpu::Backends,
|
||||
|
||||
/// The bytes of the font that will be used by default.
|
||||
///
|
||||
|
|
@ -54,7 +54,7 @@ impl Settings {
|
|||
pub fn from_env() -> Self {
|
||||
Settings {
|
||||
internal_backend: backend_from_env()
|
||||
.unwrap_or(wgpu::BackendBit::PRIMARY),
|
||||
.unwrap_or(wgpu::Backends::all()),
|
||||
..Self::default()
|
||||
}
|
||||
}
|
||||
|
|
@ -64,7 +64,7 @@ impl Default for Settings {
|
|||
fn default() -> Settings {
|
||||
Settings {
|
||||
present_mode: wgpu::PresentMode::Mailbox,
|
||||
internal_backend: wgpu::BackendBit::PRIMARY,
|
||||
internal_backend: wgpu::Backends::all(),
|
||||
default_font: None,
|
||||
default_text_size: 20,
|
||||
text_multithreading: false,
|
||||
|
|
@ -73,16 +73,16 @@ impl Default for Settings {
|
|||
}
|
||||
}
|
||||
|
||||
fn backend_from_env() -> Option<wgpu::BackendBit> {
|
||||
fn backend_from_env() -> Option<wgpu::Backends> {
|
||||
std::env::var("WGPU_BACKEND").ok().map(|backend| {
|
||||
match backend.to_lowercase().as_str() {
|
||||
"vulkan" => wgpu::BackendBit::VULKAN,
|
||||
"metal" => wgpu::BackendBit::METAL,
|
||||
"dx12" => wgpu::BackendBit::DX12,
|
||||
"dx11" => wgpu::BackendBit::DX11,
|
||||
"gl" => wgpu::BackendBit::GL,
|
||||
"webgpu" => wgpu::BackendBit::BROWSER_WEBGPU,
|
||||
"primary" => wgpu::BackendBit::PRIMARY,
|
||||
"vulkan" => wgpu::Backends::VULKAN,
|
||||
"metal" => wgpu::Backends::METAL,
|
||||
"dx12" => wgpu::Backends::DX12,
|
||||
"dx11" => wgpu::Backends::DX11,
|
||||
"gl" => wgpu::Backends::GL,
|
||||
"webgpu" => wgpu::Backends::BROWSER_WEBGPU,
|
||||
"primary" => wgpu::Backends::PRIMARY,
|
||||
other => panic!("Unknown backend: {}", other),
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue