gpu_descriptor

Struct DescriptorAllocator

Source
pub struct DescriptorAllocator<P, S> { /* private fields */ }
Expand description

Descriptor allocator. Can be used to allocate descriptor sets for any layout.

Implementations§

Source§

impl<P, S> DescriptorAllocator<P, S>

Source

pub fn new(max_update_after_bind_descriptors_in_all_pools: u32) -> Self

Create new allocator instance.

Source

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 device instance must be passed to all method calls of one DescriptorAllocator instance.
  • flags must match flags that were used to create the layout.
  • layout_descriptor_count must match descriptor numbers in the layout.
Source

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 device instance must be passed to all method calls of one DescriptorAllocator instance.
  • 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.
Source

pub unsafe fn cleanup<L>(&mut self, device: &impl DescriptorDevice<L, P, S>)

Perform cleanup to allow resources reuse.

§Safety
  • Same device instance must be passed to all method calls of one DescriptorAllocator instance.

Trait Implementations§

Source§

impl<P: Debug, S: Debug> Debug for DescriptorAllocator<P, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P, S> Drop for DescriptorAllocator<P, S>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<P, S> Freeze for DescriptorAllocator<P, S>

§

impl<P, S> RefUnwindSafe for DescriptorAllocator<P, S>

§

impl<P, S> Send for DescriptorAllocator<P, S>
where S: Send, P: Send,

§

impl<P, S> Sync for DescriptorAllocator<P, S>
where S: Sync, P: Sync,

§

impl<P, S> Unpin for DescriptorAllocator<P, S>
where S: Unpin, P: Unpin,

§

impl<P, S> UnwindSafe for DescriptorAllocator<P, S>
where S: UnwindSafe, P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.