pub struct DescriptorPool { /* private fields */ }
Expand description

RAII Vulkan DescriptorPool.

Implementations§

source§

impl DescriptorPool

source

pub unsafe fn new( render_device: Arc<RenderDevice>, create_info: &DescriptorPoolCreateInfo ) -> Result<Self, GraphicsError>

Create a new Vulkan descriptor pool.

Safety

Unsafe because:

  • command pools must be destroyed before the Vulkan device is dropped.
source

pub unsafe fn new_with_sizes( render_device: Arc<RenderDevice>, max_sets: u32, pool_sizes: &[DescriptorPoolSize] ) -> Result<Self, GraphicsError>

Create a new Vulkan descriptor pool using the max_sets and pool_sizes.

Safety

Unsafe because:

  • command pools must be destroyed before the Vulkan device is dropped.
source

pub fn set_debug_name(&self, name: impl Into<String>)

Set the name which shows up in Vulkan debug logs for this resource.

source

pub fn descriptor_set(&self, index: usize) -> DescriptorSet

Get the n’th descriptor set owned by this pool.

Note: The descriptor pool destroys all allocated sets when it is dropped. The caller must ensure that no descriptor sets are kept around after the pool is dropped.

source

pub fn allocate_descriptor_sets( &mut self, layouts: &[&DescriptorSetLayout] ) -> Result<usize, GraphicsError>

Allocate descriptor sets from this pool.

Returns

Returns the index of the first newly allocated descriptor set.

source

pub fn raw(&self) -> DescriptorPool

Get the raw Vulkan command pool handle.

Trait Implementations§

source§

impl Debug for DescriptorPool

source§

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

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

impl Drop for DescriptorPool

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> Pointable for T

source§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.