pub unsafe trait DescriptorSetAllocator: DeviceOwned {
    type Alloc: DescriptorSetAlloc;

    // Required method
    fn allocate(
        &self,
        layout: &Arc<DescriptorSetLayout>,
        variable_descriptor_count: u32
    ) -> Result<Self::Alloc, Validated<VulkanError>>;
}
Expand description

Types that manage the memory of descriptor sets.

Safety

A Vulkan descriptor pool must be externally synchronized as if it owned the descriptor sets that were allocated from it. This includes allocating from the pool, freeing from the pool and resetting the pool or individual descriptor sets. The implementation of DescriptorSetAllocator is expected to manage this.

The destructor of the DescriptorSetAlloc is expected to free the descriptor set, reset the descriptor set, or add it to a pool so that it gets reused. If the implementation frees or resets the descriptor set, it must not forget that this operation must be externally synchronized.

Required Associated Types§

source

type Alloc: DescriptorSetAlloc

Object that represented an allocated descriptor set.

The destructor of this object should free the descriptor set.

Required Methods§

source

fn allocate( &self, layout: &Arc<DescriptorSetLayout>, variable_descriptor_count: u32 ) -> Result<Self::Alloc, Validated<VulkanError>>

Allocates a descriptor set.

Implementations on Foreign Types§

source§

impl<T: DescriptorSetAllocator> DescriptorSetAllocator for Arc<T>

§

type Alloc = <T as DescriptorSetAllocator>::Alloc

source§

fn allocate( &self, layout: &Arc<DescriptorSetLayout>, variable_descriptor_count: u32 ) -> Result<Self::Alloc, Validated<VulkanError>>

Implementors§