Trait gfx_hal::pso::DescriptorPool
source · pub trait DescriptorPool<B: Backend>: Send + Sync + Debug {
unsafe fn free_sets<I>(&mut self, descriptor_sets: I)
where
I: IntoIterator<Item = B::DescriptorSet>;
unsafe fn reset(&mut self);
unsafe fn allocate_set(
&mut self,
layout: &B::DescriptorSetLayout
) -> Result<B::DescriptorSet, AllocationError> { ... }
unsafe fn allocate_sets<I>(
&mut self,
layouts: I,
sets: &mut Vec<B::DescriptorSet>
) -> Result<(), AllocationError>
where
I: IntoIterator,
I::Item: Borrow<B::DescriptorSetLayout>,
{ ... }
}
Expand description
A descriptor pool is a collection of memory from which descriptor sets are allocated.
Required Methods
sourceunsafe fn free_sets<I>(&mut self, descriptor_sets: I)where
I: IntoIterator<Item = B::DescriptorSet>,
unsafe fn free_sets<I>(&mut self, descriptor_sets: I)where
I: IntoIterator<Item = B::DescriptorSet>,
Free the given descriptor sets provided as an iterator.
Provided Methods
sourceunsafe fn allocate_set(
&mut self,
layout: &B::DescriptorSetLayout
) -> Result<B::DescriptorSet, AllocationError>
unsafe fn allocate_set(
&mut self,
layout: &B::DescriptorSetLayout
) -> Result<B::DescriptorSet, AllocationError>
Allocate a descriptor set from the pool.
The descriptor set will be allocated from the pool according to the corresponding set layout. However,
specific descriptors must still be written to the set before use using a DescriptorSetWrite
or
DescriptorSetCopy
.
Descriptors will become invalid once the pool is reset. Usage of invalidated descriptor sets results in undefined behavior.
sourceunsafe fn allocate_sets<I>(
&mut self,
layouts: I,
sets: &mut Vec<B::DescriptorSet>
) -> Result<(), AllocationError>where
I: IntoIterator,
I::Item: Borrow<B::DescriptorSetLayout>,
unsafe fn allocate_sets<I>(
&mut self,
layouts: I,
sets: &mut Vec<B::DescriptorSet>
) -> Result<(), AllocationError>where
I: IntoIterator,
I::Item: Borrow<B::DescriptorSetLayout>,
Allocate one or multiple descriptor sets from the pool.
The descriptor set will be allocated from the pool according to the corresponding set layout. However,
specific descriptors must still be written to the set before use using a DescriptorSetWrite
or
DescriptorSetCopy
.
Each descriptor set will be allocated from the pool according to the corresponding set layout. Descriptors will become invalid once the pool is reset. Usage of invalidated descriptor sets results in undefined behavior.