Merge pull request #876 from Cupnfish/master

Add a primary backend that can be set
This commit is contained in:
Héctor Ramón 2021-05-17 19:54:28 +07:00 committed by GitHub
commit 0ce6a2db21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,6 +47,7 @@ impl Settings {
/// - `dx11` /// - `dx11`
/// - `gl` /// - `gl`
/// - `webgpu` /// - `webgpu`
/// - `primary`
pub fn from_env() -> Self { pub fn from_env() -> Self {
Settings { Settings {
internal_backend: backend_from_env() internal_backend: backend_from_env()
@ -78,6 +79,7 @@ fn backend_from_env() -> Option<wgpu::BackendBit> {
"dx11" => wgpu::BackendBit::DX11, "dx11" => wgpu::BackendBit::DX11,
"gl" => wgpu::BackendBit::GL, "gl" => wgpu::BackendBit::GL,
"webgpu" => wgpu::BackendBit::BROWSER_WEBGPU, "webgpu" => wgpu::BackendBit::BROWSER_WEBGPU,
"primary" => wgpu::BackendBit::PRIMARY,
other => panic!("Unknown backend: {}", other), other => panic!("Unknown backend: {}", other),
} }
}) })