add custom error for Compositor::draw()
This commit is contained in:
parent
191288771f
commit
a7d2834a6d
5 changed files with 69 additions and 30 deletions
|
|
@ -220,11 +220,13 @@ pub fn main() {
|
|||
local_pool.run_until_stalled();
|
||||
}
|
||||
Err(error) => match error {
|
||||
wgpu::SwapChainError::Outdated => {
|
||||
wgpu::SwapChainError::OutOfMemory => {
|
||||
panic!("Swapchain error: {}. Rendering cannot continue.", error)
|
||||
}
|
||||
_ => {
|
||||
// Try rendering again next frame.
|
||||
window.request_redraw();
|
||||
}
|
||||
_ => panic!("Swapchain error: {:?}", error),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue