expect on profiler creation error

This commit is contained in:
Isse 2024-01-27 23:05:06 +01:00 committed by Marcel Märtens
parent 3192ed037f
commit 1e40fa55c2
2 changed files with 2 additions and 8 deletions

View File

@ -8,7 +8,6 @@ pub enum RenderError {
CouldNotFindAdapter,
ErrorInitializingCompiler,
ShaderError(String, shaderc::Error),
ProfilerCreationError(wgpu_profiler::CreationError),
}
use std::fmt;
@ -31,7 +30,6 @@ impl fmt::Debug for RenderError {
f,
"\"{shader_name}\" shader failed to compile due to the following error: {err}",
),
RenderError::ProfilerCreationError(err) => write!(f, "Profiler creation error: {err}"),
}
}
}

View File

@ -558,7 +558,7 @@ impl Renderer {
enable_debug_groups: other_modes.profiler_enabled,
max_num_pending_frames: 4,
})
.map_err(RenderError::ProfilerCreationError)?;
.expect("Error creating profiler");
#[cfg(feature = "egui-ui")]
let egui_renderpass = egui_wgpu_backend::RenderPass::new(&device, format, 1);
@ -674,11 +674,7 @@ impl Renderer {
enable_debug_groups: self.other_modes.profiler_enabled,
max_num_pending_frames: 4,
})
.map_err(|err| {
RenderError::ProfilerCreationError(
wgpu_profiler::CreationError::InvalidSettings(err),
)
})?;
.expect("Error creating profiler");
// Recreate render target
self.on_resize(self.resolution);