mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
expect on profiler creation error
This commit is contained in:
parent
3192ed037f
commit
1e40fa55c2
@ -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}"),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user