From 508b724dd7aed2bfce9d0b584e98a4479e7a03d7 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Mon, 18 Mar 2019 11:00:43 -0400 Subject: [PATCH] Helpful error message on empty backend --- wgpu-native/src/instance.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wgpu-native/src/instance.rs b/wgpu-native/src/instance.rs index c479881278..fcbe5e6b94 100644 --- a/wgpu-native/src/instance.rs +++ b/wgpu-native/src/instance.rs @@ -149,7 +149,9 @@ pub fn instance_get_adapter(instance_id: InstanceId, desc: &AdapterDescriptor) - PowerPreference::LowPower => low.or(high), PowerPreference::HighPerformance | PowerPreference::Default => high.or(low), }; - some.or(other).unwrap() + some + .or(other) + .expect("No adapters found. Please enable the feature for one of the graphics backends: vulkan, metal, dx12, dx11") } #[cfg(feature = "local")]