Struct gpu_descriptor::DescriptorAllocator [−][src]
pub struct DescriptorAllocator<P, S> { /* fields omitted */ }Expand description
Descriptor allocator. Can be used to allocate descriptor sets for any layout.
Implementations
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>,
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>,
Allocate descriptor set with specified layout.
Safety
- Same
deviceinstance must be passed to all method calls of oneDescriptorAllocatorinstance. flagsmust match flags that were used to create the layout.layout_descriptor_countmust 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>>,
pub unsafe fn free<L, D, I>(&mut self, device: &D, sets: I) where
D: DescriptorDevice<L, P, S>,
I: IntoIterator<Item = DescriptorSet<S>>,
Free descriptor sets.
Safety
- Same
deviceinstance must be passed to all method calls of oneDescriptorAllocatorinstance. - 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.
Perform cleanup to allow resources reuse.
Safety
- Same
deviceinstance must be passed to all method calls of oneDescriptorAllocatorinstance.