Struct gpu_descriptor::DescriptorAllocator[][src]

pub struct DescriptorAllocator<P, S> { /* fields omitted */ }

Descriptor allocator. Can be used to allocate descriptor sets for any layout.

Implementations

impl<P, S> DescriptorAllocator<P, S>[src]

pub fn new(max_update_after_bind_descriptors_in_all_pools: u32) -> Self[src]

Create new allocator instance.

pub unsafe fn allocate<L, D>(
    &mut self,
    device: &D,
    layout: &L,
    flags: DescriptorSetLayoutCreateFlags,
    layout_descriptor_count: &DescriptorTotalCount,
    count: u32
) -> Result<Vec<DescriptorSet<S>>, AllocationError> where
    S: Debug,
    L: Debug,
    D: DescriptorDevice<L, P, S>, 
[src]

Allocate descriptor set with specified layout.

Safety

  • Same device instance must be passed to all method calls of one DescriptorAllocator instance.
  • flags must match flags that were used to create the layout.
  • layout_descriptor_count must match descriptor numbers in the layout.

pub unsafe fn free<L, D, I>(&mut self, device: &D, sets: I) where
    D: DescriptorDevice<L, P, S>,
    I: IntoIterator<Item = DescriptorSet<S>>, 
[src]

Free descriptor sets.

Safety

  • Same device instance must be passed to all method calls of one DescriptorAllocator instance.
  • None of descriptor sets can be referenced in any pending command buffers.
  • All command buffers where at least one of descriptor sets referenced move to invalid state.

pub unsafe fn cleanup<L>(&mut self, device: &impl DescriptorDevice<L, P, S>)[src]

Perform cleanup to allow resources reuse.

Safety

  • Same device instance must be passed to all method calls of one DescriptorAllocator instance.

Trait Implementations

impl<P: Debug, S: Debug> Debug for DescriptorAllocator<P, S>[src]

impl<P, S> Drop for DescriptorAllocator<P, S>[src]

Auto Trait Implementations

impl<P, S> RefUnwindSafe for DescriptorAllocator<P, S> where
    P: RefUnwindSafe,
    S: RefUnwindSafe

impl<P, S> Send for DescriptorAllocator<P, S> where
    P: Send,
    S: Send

impl<P, S> Sync for DescriptorAllocator<P, S> where
    P: Sync,
    S: Sync

impl<P, S> Unpin for DescriptorAllocator<P, S> where
    P: Unpin,
    S: Unpin

impl<P, S> UnwindSafe for DescriptorAllocator<P, S> where
    P: UnwindSafe,
    S: UnwindSafe

Blanket Implementations

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

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

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

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.