mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-27 01:05:03 +00:00
Properly handle error when waiting on the Fence
This commit is contained in:
parent
7d63a7c641
commit
fcaa29a2a2
@ -35,6 +35,7 @@ use pipeline::input_assembly::Index;
|
||||
use pipeline::vertex::Definition as VertexDefinition;
|
||||
use pipeline::vertex::Source as VertexSource;
|
||||
use sync::Fence;
|
||||
use sync::FenceWaitError;
|
||||
use sync::Semaphore;
|
||||
|
||||
use device::Device;
|
||||
@ -1060,7 +1061,12 @@ impl Submission {
|
||||
impl Drop for Submission {
|
||||
#[inline]
|
||||
fn drop(&mut self) {
|
||||
self.fence.wait(5 * 1000 * 1000 * 1000 /* 5 seconds */).unwrap();
|
||||
match self.fence.wait(5 * 1000 * 1000 * 1000 /* 5 seconds */) {
|
||||
Ok(_) => (),
|
||||
Err(FenceWaitError::DeviceLostError) => (),
|
||||
Err(FenceWaitError::Timeout) => panic!(), // The driver has some sort of problem.
|
||||
Err(FenceWaitError::OomError) => panic!(), // What else to do here?
|
||||
}
|
||||
|
||||
// TODO: return `signalled_semaphores` to the semaphore pools
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user