logo
pub struct Fence<D = Arc<Device>> where
    D: SafeDeref<Target = Device>, 
{ /* private fields */ }
Expand description

A fence is used to know when a command buffer submission has finished its execution.

When a command buffer accesses a resource, you have to ensure that the CPU doesn’t access the same resource simultaneously (except for concurrent reads). Therefore in order to know when the CPU can access a resource again, a fence has to be used.

Implementations

Takes a fence from the vulkano-provided fence pool. If the pool is empty, a new fence will be allocated. Upon drop, the fence is put back into the pool.

For most applications, using the fence pool should be preferred, in order to avoid creating new fences every frame.

Builds a new fence.

Builds a new fence in signaled state.

Returns true if the fence is signaled.

Waits until the fence is signaled, or at least until the timeout duration has elapsed.

Returns Ok if the fence is now signaled. Returns Err if the timeout was reached instead.

If you pass a duration of 0, then the function will return without blocking.

Waits for multiple fences at once.

Panic

Panics if not all fences belong to the same device.

Resets the fence.

Resets multiple fences at once.

Panic
  • Panics if not all fences belong to the same device.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the device that owns Self.

Executes the destructor for this type. Read more

The type of the object.

Returns a reference to the object.

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

Builds a pointer to this type from a raw pointer.

Returns true if the size is suitable to store a type like this.

Returns the size of an individual element.

Performs the conversion.

Performs the conversion.

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.