Skip to content

Instantly share code, notes, and snippets.

@koutoftimer
Last active September 7, 2020 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koutoftimer/694c828b20562dc5489a89dd9e44674f to your computer and use it in GitHub Desktop.
Save koutoftimer/694c828b20562dc5489a89dd9e44674f to your computer and use it in GitHub Desktop.
Test available backends for wgpu
[dependencies]
wgpu = "0.6.0"
use wgpu;
fn main() {
for &bit in [
wgpu::BackendBit::DX11,
wgpu::BackendBit::DX12,
wgpu::BackendBit::GL,
wgpu::BackendBit::VULKAN,
wgpu::BackendBit::METAL,
wgpu::BackendBit::PRIMARY,
wgpu::BackendBit::SECONDARY,
wgpu::BackendBit::BROWSER_WEBGPU,
].iter() {
let instance = wgpu::Instance::new(bit);
let av = instance.enumerate_adapters(bit);
println!("backend: {:?}, detectes {} adapters", bit, av.count());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment