Skip to content

Commit 7f77477

Browse files
committed
WGPU-cli-2 - Use default backend if no environment variable is set.
1 parent 36fccf1 commit 7f77477

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • experimentation/wgpu-cli-2/src

experimentation/wgpu-cli-2/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ impl RenderState {
124124
async fn new(width: u32, height: u32) -> Result<Self, Box<dyn std::error::Error>> {
125125
// Create instance
126126
let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
127-
backends: wgpu::Backends::from_env()
128-
.ok_or("Failed to parse WGPU_BACKENDS env var")?,
127+
backends: wgpu::Backends::from_env().unwrap_or_default(),
129128
..Default::default()
130129
});
131130

0 commit comments

Comments
 (0)