mirror of
https://github.com/lisk77/comet.git
synced 2025-12-12 09:08:49 +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
|
|
@ -18,6 +18,7 @@ pollster = "0.3"
|
||||||
winit_input_helper = "0.16.0"
|
winit_input_helper = "0.16.0"
|
||||||
crossbeam-channel = "0.5.14"
|
crossbeam-channel = "0.5.14"
|
||||||
chrono = "0.4.40"
|
chrono = "0.4.40"
|
||||||
|
wgpu = "22.0"
|
||||||
|
|
||||||
[dependencies.image]
|
[dependencies.image]
|
||||||
version = "0.24"
|
version = "0.24"
|
||||||
|
|
|
||||||
|
|
@ -387,7 +387,19 @@ impl App {
|
||||||
window.request_redraw();
|
window.request_redraw();
|
||||||
match renderer.render() {
|
match renderer.render() {
|
||||||
Ok(_) => {}
|
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