gfx_hal::pso

Trait DescriptorPool

Source
pub trait DescriptorPool<B: Backend>:
    Send
    + Sync
    + Debug {
    // Required methods
    unsafe fn free<I>(&mut self, descriptor_sets: I)
       where I: Iterator<Item = B::DescriptorSet>;
    unsafe fn reset(&mut self);

    // Provided methods
    unsafe fn allocate_one(
        &mut self,
        layout: &B::DescriptorSetLayout,
    ) -> Result<B::DescriptorSet, AllocationError> { ... }
    unsafe fn allocate<'a, I, E>(
        &mut self,
        layouts: I,
        list: &mut E,
    ) -> Result<(), AllocationError>
       where I: Iterator<Item = &'a B::DescriptorSetLayout>,
             E: Extend<B::DescriptorSet> { ... }
}
Expand description

A descriptor pool is a collection of memory from which descriptor sets are allocated.

Required Methods§

Source

unsafe fn free<I>(&mut self, descriptor_sets: I)
where I: Iterator<Item = B::DescriptorSet>,

Free the given descriptor sets provided as an iterator.

Source

unsafe fn reset(&mut self)

Resets a descriptor pool, releasing all resources from all the descriptor sets allocated from it and freeing the descriptor sets. Invalidates all descriptor sets allocated from the pool; trying to use one after the pool has been reset is undefined behavior.

Provided Methods§

Source

unsafe fn allocate_one( &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.

Source

unsafe fn allocate<'a, I, E>( &mut self, layouts: I, list: &mut E, ) -> Result<(), AllocationError>
where I: Iterator<Item = &'a B::DescriptorSetLayout>, E: Extend<B::DescriptorSet>,

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§