Struct vulkano::descriptor::descriptor_set::PersistentDescriptorSet
source · pub struct PersistentDescriptorSet<L, R, P = StdDescriptorPoolAlloc> { /* private fields */ }
Expand description
An immutable descriptor set that is expected to be long-lived.
Creating a persistent descriptor set allocates from a pool, and can’t be modified once created. You are therefore encouraged to create them at initialization and not the during performance-critical paths.
Note: You can control of the pool that is used to create the descriptor set, if you wish so. By creating a implementation of the
DescriptorPool
trait that doesn’t perform any actual allocation, you can skip this allocation and make it acceptable to use a persistent descriptor set in performance-critical paths..
The template parameter of the PersistentDescriptorSet
is complex, and you shouldn’t try to
express it explicitly. If you want to store your descriptor set in a struct or in a Vec
for
example, you are encouraged to turn the PersistentDescriptorSet
into a Box<DescriptorSet>
or a Arc<DescriptorSet>
.
Example
Implementations
sourceimpl<L> PersistentDescriptorSet<L, ()>
impl<L> PersistentDescriptorSet<L, ()>
sourcepub fn start(layout: L, set_id: usize) -> PersistentDescriptorSetBuilder<L, ()>where
L: PipelineLayoutAbstract,
pub fn start(layout: L, set_id: usize) -> PersistentDescriptorSetBuilder<L, ()>where
L: PipelineLayoutAbstract,
Starts the process of building a PersistentDescriptorSet
. Returns a builder.
Panic
- Panics if the set id is out of range.
Trait Implementations
sourceimpl<L, R, P> DescriptorSet for PersistentDescriptorSet<L, R, P>where
L: PipelineLayoutAbstract,
P: DescriptorPoolAlloc,
R: PersistentDescriptorSetResources,
impl<L, R, P> DescriptorSet for PersistentDescriptorSet<L, R, P>where
L: PipelineLayoutAbstract,
P: DescriptorPoolAlloc,
R: PersistentDescriptorSetResources,
sourcefn inner(&self) -> &UnsafeDescriptorSet
fn inner(&self) -> &UnsafeDescriptorSet
UnsafeDescriptorSet
.sourcefn num_buffers(&self) -> usize
fn num_buffers(&self) -> usize
sourcefn buffer(&self, index: usize) -> Option<(&dyn BufferAccess, u32)>
fn buffer(&self, index: usize) -> Option<(&dyn BufferAccess, u32)>
index
th buffer of this descriptor set, or None
if out of range. Also
returns the index of the descriptor that uses this buffer. Read moresourcefn num_images(&self) -> usize
fn num_images(&self) -> usize
sourceimpl<L, R, P> DescriptorSetDesc for PersistentDescriptorSet<L, R, P>where
L: PipelineLayoutAbstract,
impl<L, R, P> DescriptorSetDesc for PersistentDescriptorSet<L, R, P>where
L: PipelineLayoutAbstract,
sourcefn num_bindings(&self) -> usize
fn num_bindings(&self) -> usize
sourcefn descriptor(&self, binding: usize) -> Option<DescriptorDesc>
fn descriptor(&self, binding: usize) -> Option<DescriptorDesc>
None
if out of range.