Struct vulkano::descriptor::descriptor_set::UnsafeDescriptorPool[][src]

pub struct UnsafeDescriptorPool { /* fields omitted */ }

Pool from which descriptor sets are allocated from.

A pool has a maximum number of descriptor sets and a maximum number of descriptors (one value per descriptor type) it can allocate.

Implementations

impl UnsafeDescriptorPool[src]

pub fn new(
    device: Arc<Device>,
    count: &DescriptorsCount,
    max_sets: u32,
    free_descriptor_set_bit: bool
) -> Result<UnsafeDescriptorPool, OomError>
[src]

Initializes a new pool.

Initializes a pool whose capacity is given by count and max_sets. At most count descriptors or max_sets descriptor sets can be allocated at once with this pool.

If free_descriptor_set_bit is true, then individual descriptor sets can be free’d from the pool. Otherwise you must reset or destroy the whole pool at once.

Panic

  • Panics if all the descriptors count are 0.
  • Panics if max_sets is 0.

pub unsafe fn alloc<'l, I>(
    &mut self,
    layouts: I
) -> Result<UnsafeDescriptorPoolAllocIter, DescriptorPoolAllocError> where
    I: IntoIterator<Item = &'l UnsafeDescriptorSetLayout>, 
[src]

Allocates descriptor sets from the pool, one for each layout. Returns an iterator to the allocated sets, or an error.

The FragmentedPool errors often can’t be prevented. If the function returns this error, you should just create a new pool.

Panic

  • Panics if one of the layouts wasn’t created with the same device as the pool.

Safety

See also the new function.

  • The total descriptors of the layouts must fit in the pool.
  • The total number of descriptor sets allocated from the pool must not overflow the pool.
  • You must ensure that the allocated descriptor sets are no longer in use when the pool is destroyed, as destroying the pool is equivalent to freeing all the sets.

pub unsafe fn free<I>(&mut self, descriptor_sets: I) -> Result<(), OomError> where
    I: IntoIterator<Item = UnsafeDescriptorSet>, 
[src]

Frees some descriptor sets.

Note that it is not mandatory to free sets. Destroying or resetting the pool destroys all the descriptor sets.

Safety

  • The pool must have been created with free_descriptor_set_bit set to true.
  • The descriptor sets must have been allocated from the pool.
  • The descriptor sets must not be free’d twice.
  • The descriptor sets must not be in use by the GPU.

pub unsafe fn reset(&mut self) -> Result<(), OomError>[src]

Resets the pool.

This destroys all descriptor sets and empties the pool.

Trait Implementations

impl Debug for UnsafeDescriptorPool[src]

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl DeviceOwned for UnsafeDescriptorPool[src]

fn device(&self) -> &Arc<Device>[src]

Returns the device that owns Self.

impl Drop for UnsafeDescriptorPool[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> Content for T[src]

pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>[src]

Builds a pointer to this type from a raw pointer.

pub fn is_size_suitable(usize) -> bool[src]

Returns true if the size is suitable to store a type like this.

pub fn indiv_size() -> usize[src]

Returns the size of an individual element.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.