pub struct FenceSignalFuture<F>where
    F: GpuFuture,
{ /* private fields */ }
Expand description

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.

This can also be done through Rust’s Async system by simply .awaiting this object. Note though that (due to the Vulkan API fence design) this will spin to check the fence, rather than blocking in the driver. Therefore if you have a long-running task, blocking may be less CPU intense (depending on the driver’s implementation).

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

Returns true if the fence is signaled by the GPU.

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

Returns the device that owns Self.
Executes the destructor for this type. Read more
The type of value produced on completion.
Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
If possible, checks whether the submission has finished. If so, gives up ownership of the resources used by these submissions. Read more
Builds a submission that, if submitted, makes sure that the event represented by this GpuFuture will happen, and possibly contains extra elements (eg. a semaphore wait or an event wait) that makes the dependency with subsequent operations work. Read more
Flushes the future and submits to the GPU the actions that will permit this future to occur. Read more
Sets the future to its “complete” state, meaning that it can safely be destroyed. Read more
Returns true if elements submitted after this future can be submitted to a different queue than the other returned by queue(). Read more
Returns the queue that triggers the event. Returns None if unknown or irrelevant. Read more
Checks whether submitting something after this future grants access (exclusive or shared, depending on the parameter) to the given buffer on the given queue. Read more
Checks whether submitting something after this future grants access (exclusive or shared, depending on the parameter) to the given image on the given queue. Read more
Checks whether accessing a swapchain image is permitted. Read more
Joins this future with another one, representing the moment when both events have happened.
Executes a command buffer after this future. Read more
Executes a command buffer after this future, on the same queue as the future. Read more
Signals a semaphore after this future. Returns another future that represents the signal. Read more
Signals a semaphore after this future and flushes it. Returns another future that represents the moment when the semaphore is signalled. Read more
Signals a fence after this future. Returns another future that represents the signal. Read more
Signals a fence after this future. Returns another future that represents the signal. Read more
Presents a swapchain image after this future. Read more
Turn the current future into a Box<dyn GpuFuture>. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The output that the future will produce on completion.
Which kind of future are we turning this into?
Creates a future from a value. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.