redo custom error for Compositor::draw()

This commit is contained in:
Billy Messenger 2021-07-22 13:23:36 -05:00
parent a7d2834a6d
commit e5010b8ab8
4 changed files with 62 additions and 55 deletions

View file

@ -391,16 +391,16 @@ async fn run_instance<A, E, C>(
// Maybe we can use `ControlFlow::WaitUntil` for this.
}
Err(error) => match error {
window::CompositorDrawError::SwapchainOutdated(_) => {
// This is an unrecoverable error.
window::SwapChainError::OutOfMemory => {
panic!("{}", error);
}
_ => {
debug.render_finished();
// Swapchain is outdated. Try rendering again next frame.
// Try rendering again next frame.
window.request_redraw();
}
window::CompositorDrawError::FatalSwapchainError(e) => {
// Fatal swapchain error. Rendering cannot continue.
panic!("{}", e);
}
},
}
}