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, CouldNotFindAdapter,
ErrorInitializingCompiler, ErrorInitializingCompiler,
ShaderError(String, shaderc::Error), ShaderError(String, shaderc::Error),
ProfilerCreationError(wgpu_profiler::CreationError),
} }
use std::fmt; use std::fmt;
@ -31,7 +30,6 @@ impl fmt::Debug for RenderError {
f, f,
"\"{shader_name}\" shader failed to compile due to the following error: {err}", "\"{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, enable_debug_groups: other_modes.profiler_enabled,
max_num_pending_frames: 4, max_num_pending_frames: 4,
}) })
.map_err(RenderError::ProfilerCreationError)?; .expect("Error creating profiler");
#[cfg(feature = "egui-ui")] #[cfg(feature = "egui-ui")]
let egui_renderpass = egui_wgpu_backend::RenderPass::new(&device, format, 1); 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, enable_debug_groups: self.other_modes.profiler_enabled,
max_num_pending_frames: 4, max_num_pending_frames: 4,
}) })
.map_err(|err| { .expect("Error creating profiler");
RenderError::ProfilerCreationError(
wgpu_profiler::CreationError::InvalidSettings(err),
)
})?;
// Recreate render target // Recreate render target
self.on_resize(self.resolution); self.on_resize(self.resolution);