Skip to content

Commit 36fccf1

Browse files
committed
WGPU-cli-2 - Add support for using the WGPU_BACKEND environment variable.
1 parent d027386 commit 36fccf1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • experimentation/wgpu-cli-2/src

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ 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::all(),
127+
backends: wgpu::Backends::from_env()
128+
.ok_or("Failed to parse WGPU_BACKENDS env var")?,
128129
..Default::default()
129130
});
130131

0 commit comments

Comments
 (0)