Struct demo_vk::graphics::vulkan::DescriptorBumpAllocator
source · pub struct DescriptorBumpAllocator { /* private fields */ }Expand description
A grow-only descriptor pool that can be reset.
Internally, there can actually be many DescriptorPools. When a pool is out of space for allocations, then a new pool will be created, and so on…
Implementations§
source§impl DescriptorBumpAllocator
impl DescriptorBumpAllocator
sourcepub fn new<I>(
ctx: Arc<VulkanContext>,
max_sets_per_pool: u32,
pool_ratios: I,
) -> Result<Self>where
I: IntoIterator<Item = PoolRatio>,
pub fn new<I>(
ctx: Arc<VulkanContext>,
max_sets_per_pool: u32,
pool_ratios: I,
) -> Result<Self>where
I: IntoIterator<Item = PoolRatio>,
Creates a new bump allocator instance.
§Params
max_sets_per_pool- controls the size of each DescriptorPool. Larger values mean fewer calls to vkCreateDescriptorPool, but may be wasteful in memory usage.pool_ratios- controls the relative ratios of how many descriptor types can be allocated from each pool. This doesn’t need to be perfect (when in doubt, overestimate), but inaccuraces can result in wasted pools.
sourcepub fn allocate_descriptor_set(
&mut self,
descriptor_set_layout: &DescriptorSetLayout,
) -> Result<DescriptorSet>
pub fn allocate_descriptor_set( &mut self, descriptor_set_layout: &DescriptorSetLayout, ) -> Result<DescriptorSet>
Allocates a new descriptor set with the provided layout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DescriptorBumpAllocator
impl !RefUnwindSafe for DescriptorBumpAllocator
impl Send for DescriptorBumpAllocator
impl Sync for DescriptorBumpAllocator
impl Unpin for DescriptorBumpAllocator
impl !UnwindSafe for DescriptorBumpAllocator
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.