Fix FenceSignalFuture::cleanup_finished

This commit is contained in:
Pierre Krieger 2017-05-21 18:43:56 +02:00
parent 4de0f2e114
commit f1dac0b9c8

View File

@ -99,12 +99,25 @@ impl<F> FenceSignalFuture<F> where F: GpuFuture {
let mut state = self.state.lock().unwrap();
match *state {
FenceSignalFutureState::Flushed(_, ref fence) => {
FenceSignalFutureState::Flushed(ref mut prev, ref fence) => {
match fence.wait(Some(Duration::from_secs(0))) {
Ok(()) => (),
Err(_) => return,
Ok(()) => unsafe {
prev.signal_finished()
},
Err(_) => {
prev.cleanup_finished();
return
},
}
},
FenceSignalFutureState::Pending(ref mut prev, _) => {
prev.cleanup_finished();
return;
},
FenceSignalFutureState::PartiallyFlushed(ref mut prev, _) => {
prev.cleanup_finished();
return;
},
_ => return,
};