mirror of
https://github.com/lisk77/comet.git
synced 2025-12-12 17:18:50 +00:00
fix(app): surface errors are handled properly now
This commit is contained in:
parent
e589544a31
commit
bf7f0bebe9
2 changed files with 14 additions and 1 deletions
|
|
@ -387,7 +387,19 @@ impl App {
|
|||
window.request_redraw();
|
||||
match renderer.render() {
|
||||
Ok(_) => {}
|
||||
Err(e) => error!("Error rendering: {}", e),
|
||||
Err(
|
||||
wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated,
|
||||
) => {
|
||||
let size = renderer.size();
|
||||
renderer.resize(size);
|
||||
}
|
||||
Err(wgpu::SurfaceError::OutOfMemory) => {
|
||||
error!("Out of memory!");
|
||||
elwt.exit();
|
||||
}
|
||||
Err(wgpu::SurfaceError::Timeout) => {
|
||||
warn!("Surface timeout - skipping frame");
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue