Skip to content

Commit

Permalink
Allow waiting on SwapchainAcquireFuture (#2080)
Browse files Browse the repository at this point in the history
  • Loading branch information
phire authored Nov 6, 2022
1 parent 0a15cf3 commit f2158e4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions vulkano/src/swapchain/swapchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,18 @@ impl SwapchainAcquireFuture {
pub fn swapchain(&self) -> &Arc<Swapchain> {
&self.swapchain
}

/// Blocks the current thread until the swapchain image has been acquired, or timeout
///
/// If timeout is `None`, will potentially block forever
///
/// You still need to join with this future for present to work
pub fn wait(&self, timeout: Option<Duration>) -> Result<(), FenceError> {
match &self.fence {
Some(fence) => fence.wait(timeout),
None => Ok(()),
}
}
}

unsafe impl GpuFuture for SwapchainAcquireFuture {
Expand Down

0 comments on commit f2158e4

Please sign in to comment.