pub trait DescriptorDevice<L, P, S> {
// Required methods
unsafe fn create_descriptor_pool(
&self,
descriptor_count: &DescriptorTotalCount,
max_sets: u32,
flags: DescriptorPoolCreateFlags,
) -> Result<P, CreatePoolError>;
unsafe fn destroy_descriptor_pool(&self, pool: P);
unsafe fn alloc_descriptor_sets<'a>(
&self,
pool: &mut P,
layouts: impl ExactSizeIterator<Item = &'a L>,
sets: &mut impl Extend<S>,
) -> Result<(), DeviceAllocationError>
where L: 'a;
unsafe fn dealloc_descriptor_sets(
&self,
pool: &mut P,
sets: impl Iterator<Item = S>,
);
}
Expand description
Abstract device that can create pools of type P
and allocate sets S
with layout L
.
Required Methods§
Sourceunsafe fn create_descriptor_pool(
&self,
descriptor_count: &DescriptorTotalCount,
max_sets: u32,
flags: DescriptorPoolCreateFlags,
) -> Result<P, CreatePoolError>
unsafe fn create_descriptor_pool( &self, descriptor_count: &DescriptorTotalCount, max_sets: u32, flags: DescriptorPoolCreateFlags, ) -> Result<P, CreatePoolError>
Creates a new descriptor pool.
§Safety
Actually safe.
TODO: Remove unsafe
with next breaking change.
Sourceunsafe fn destroy_descriptor_pool(&self, pool: P)
unsafe fn destroy_descriptor_pool(&self, pool: P)
Destroys descriptor pool.
§Safety
Pool must be created from this device. All descriptor sets allocated from this pool become invalid.
Sourceunsafe fn alloc_descriptor_sets<'a>(
&self,
pool: &mut P,
layouts: impl ExactSizeIterator<Item = &'a L>,
sets: &mut impl Extend<S>,
) -> Result<(), DeviceAllocationError>where
L: 'a,
unsafe fn alloc_descriptor_sets<'a>(
&self,
pool: &mut P,
layouts: impl ExactSizeIterator<Item = &'a L>,
sets: &mut impl Extend<S>,
) -> Result<(), DeviceAllocationError>where
L: 'a,
Sourceunsafe fn dealloc_descriptor_sets(
&self,
pool: &mut P,
sets: impl Iterator<Item = S>,
)
unsafe fn dealloc_descriptor_sets( &self, pool: &mut P, sets: impl Iterator<Item = S>, )
Deallocates descriptor sets.
§Safety
Sets must be allocated from specified pool and not deallocated before.
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.