Struct vulkano::sync::Fence [] [src]

pub struct Fence<D = Arc<Device>> where
    D: SafeDeref<Target = Device>, 
{ /* fields omitted */ }

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

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

Methods

impl<D> Fence<D> where
    D: SafeDeref<Target = Device>, 
[src]

[src]

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.

[src]

Builds a new fence.

[src]

Builds a new fence in signaled state.

[src]

Returns true if the fence is signaled.

[src]

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.

[src]

Waits for multiple fences at once.

Panic

Panics if not all fences belong to the same device.

[src]

Resets the fence.

[src]

Resets multiple fences at once.

Panic

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

Trait Implementations

impl<D: Debug> Debug for Fence<D> where
    D: SafeDeref<Target = Device>, 
[src]

[src]

Formats the value using the given formatter.

impl DeviceOwned for Fence
[src]

[src]

Returns the device that owns Self.

impl<D> VulkanObject for Fence<D> where
    D: SafeDeref<Target = Device>, 
[src]

The type of the object.

TYPE: DebugReportObjectTypeEXT = vk::DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT

The DebugReportObjectTypeEXT of the internal Vulkan handle.

[src]

Returns a reference to the object.

impl<D> Drop for Fence<D> where
    D: SafeDeref<Target = Device>, 
[src]

[src]

Executes the destructor for this type. Read more