mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-22 06:45:23 +00:00
Better error detection in fence waiting
This commit is contained in:
parent
5941198d90
commit
408fd30e5c
@ -151,11 +151,17 @@ impl Fence {
|
||||
/// timeout has elapsed.
|
||||
///
|
||||
/// Returns `Ok` if the fence is now signaled. Returns `Err` if the timeout was reached instead.
|
||||
pub fn wait(&self, timeout_ns: u64) -> Result<(), ()> {
|
||||
pub fn wait(&self, timeout_ns: u64) -> Result<(), OomError> { // FIXME: wrong error
|
||||
unsafe {
|
||||
let vk = self.device.pointers();
|
||||
vk.WaitForFences(self.device.internal_object(), 1, &self.fence, vk::TRUE, timeout_ns);
|
||||
Ok(()) // FIXME:
|
||||
let r = try!(check_errors(vk.WaitForFences(self.device.internal_object(), 1,
|
||||
&self.fence, vk::TRUE, timeout_ns)));
|
||||
|
||||
match r {
|
||||
Success::Success => Ok(()),
|
||||
Success::Timeout => panic!(), // FIXME:
|
||||
_ => unreachable!()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user