Replace default wgpu error handler with one that includes the error in the panic message

This commit is contained in:
Imbris 2021-04-25 22:03:59 -04:00
parent 7f9ba17dee
commit 972a6f3605

View File

@ -210,6 +210,16 @@ impl Renderer {
),
)?;
// Set error handler for wgpu errors
// This is better for use than their default because it includes the error in
// the panic message
device.on_uncaptured_error(|error| {
panic!(
"wgpu error (handling all wgpu errors as fatal): {:?}",
error
)
});
let profiler_features_enabled = device
.features()
.contains(wgpu_profiler::GpuProfiler::REQUIRED_WGPU_FEATURES);