[][src]Struct nannou::vk::sync::Fence

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 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.

Methods

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

pub fn from_pool(device: D) -> Result<Fence<D>, OomError>[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.

pub fn alloc(device: D) -> Result<Fence<D>, OomError>[src]

Builds a new fence.

pub fn alloc_signaled(device: D) -> Result<Fence<D>, OomError>[src]

Builds a new fence in signaled state.

pub fn ready(&self) -> Result<bool, OomError>[src]

Returns true if the fence is signaled.

pub fn wait(&self, timeout: Option<Duration>) -> Result<(), FenceWaitError>[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.

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

Waits for multiple fences at once.

Panic

Panics if not all fences belong to the same device.

pub fn reset(&mut self) -> Result<(), OomError>[src]

Resets the fence.

pub fn multi_reset<'a, I>(iter: I) -> Result<(), OomError> where
    D: 'a,
    I: IntoIterator<Item = &'a mut Fence<D>>, 
[src]

Resets multiple fences at once.

Panic

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

Trait Implementations

impl DeviceOwned for Fence<Arc<Device>>[src]

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

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

type Object = u64

The type of the object.

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

Auto Trait Implementations

impl<D> Send for Fence<D> where
    D: Send

impl<D> Sync for Fence<D> where
    D: Sync

Blanket Implementations

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.

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

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

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

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

impl<T> Content for T[src]

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

impl<T> Erased for T

impl<S> FromSample<S> for S[src]

impl<T, U> ToSample<U> for T where
    U: FromSample<T>, 
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.