[][src]Struct vulkano::sync::FenceSignalFuture

#[must_use =
  "Dropping this object will immediately block the thread until the GPU has finished \
              processing the submission"]pub struct FenceSignalFuture<F> where
    F: GpuFuture
{ /* fields omitted */ }

Represents a fence being signaled after a previous event.

Contrary to most other future types, it is possible to block the current thread until the event happens. This is done by calling the wait() function.

Also note that the GpuFuture trait is implemented on Arc<FenceSignalFuture<_>>. This means that you can put this future in an Arc and keep a copy of it somewhere in order to know when the execution reached that point.

use std::sync::Arc;
use vulkano::sync::GpuFuture;

// Assuming you have a chain of operations, like this:
// let future = ...
//      .then_execute(foo)
//      .then_execute(bar)

// You can signal a fence at this point of the chain, and put the future in an `Arc`.
let fence_signal = Arc::new(future.then_signal_fence());

// And then continue the chain:
// fence_signal.clone()
//      .then_execute(baz)
//      .then_execute(qux)

// Later you can wait until you reach the point of `fence_signal`:
fence_signal.wait(None).unwrap();

Implementations

impl<F> FenceSignalFuture<F> where
    F: GpuFuture
[src]

pub fn wait(&self, timeout: Option<Duration>) -> Result<(), FlushError>[src]

Blocks the current thread until the fence is signaled by the GPU. Performs a flush if necessary.

If timeout is None, then the wait is infinite. Otherwise the thread will unblock after the specified timeout has elapsed and an error will be returned.

If the wait is successful, this function also cleans any resource locked by previous submissions.

Trait Implementations

impl<F> DeviceOwned for FenceSignalFuture<F> where
    F: GpuFuture
[src]

impl<F> Drop for FenceSignalFuture<F> where
    F: GpuFuture
[src]

impl<F> GpuFuture for FenceSignalFuture<F> where
    F: GpuFuture
[src]

Auto Trait Implementations

impl<F> RefUnwindSafe for FenceSignalFuture<F>

impl<F> Send for FenceSignalFuture<F> where
    F: Send

impl<F> Sync for FenceSignalFuture<F> where
    F: Send

impl<F> Unpin for FenceSignalFuture<F> where
    F: Unpin

impl<F> UnwindSafe for FenceSignalFuture<F>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Content for T[src]

impl<T> DeviceOwned for T where
    T: Deref,
    <T as Deref>::Target: DeviceOwned
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.