Last active
September 7, 2020 13:49
-
-
Save koutoftimer/694c828b20562dc5489a89dd9e44674f to your computer and use it in GitHub Desktop.
Test available backends for wgpu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[dependencies] | |
wgpu = "0.6.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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