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

pub struct Fence<D = Arc<Device>> where D: SafeDeref<Target=Device> {
    // some 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]

fn raw(device: &D) -> Result<Fence<D>, OomError> where D: Clone

See the docs of new().

fn new(device: &D) -> Arc<Fence<D>> where D: Clone

Builds a new fence.

Panic

  • Panicks if the device or host ran out of memory.

fn signaled_raw(device: &D) -> Result<Fence<D>, OomError> where D: Clone

See the docs of signaled().

fn signaled(device: &D) -> Arc<Fence<D>> where D: Clone

Builds a new fence already in the "signaled" state.

Panic

  • Panicks if the device or host ran out of memory.

fn ready(&self) -> Result<boolOomError>

Returns true if the fence is signaled.

fn wait(&self, timeout: Duration) -> Result<()FenceWaitError>

Waits until the fence is signaled, or at least until the number of nanoseconds of the timeout has elapsed.

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

fn multi_wait<'a, I>(iter: I, timeout: Duration) -> Result<()FenceWaitError> where I: IntoIterator<Item=&'a Fence<D>>, D: 'a

Waits for multiple fences at once.

Panic

Panicks if not all fences belong to the same device.

fn reset(&self)

Resets the fence.

fn multi_reset<'a, I>(iter: I) where I: IntoIterator<Item=&'a Fence<D>>, D: 'a

Resets multiple fences at once.

Panic

Panicks if not all fences belong to the same device.

Trait Implementations

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

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

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

type Object = Fence

The type of the object.

fn internal_object(&self) -> Fence

Returns a reference to the object.

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

fn drop(&mut self)

A method called when the value goes out of scope. Read more