Struct vulkano::descriptor::descriptor_set::FixedSizeDescriptorSetsPool [−][src]
pub struct FixedSizeDescriptorSetsPool { /* fields omitted */ }
Pool of descriptor sets of a specific capacity and that are automatically reclaimed.
You are encouraged to use this type when you need a different descriptor set at each frame, or regularly during the execution.
Example
At initialization, create a FixedSizeDescriptorSetsPool
.
use vulkano::descriptor::descriptor_set::FixedSizeDescriptorSetsPool; use vulkano::descriptor::pipeline_layout::PipelineLayoutAbstract; // use vulkano::pipeline::GraphicsPipelineAbstract; // let graphics_pipeline: Arc<GraphicsPipelineAbstract> = ...; let layout = graphics_pipeline.descriptor_set_layout(0).unwrap(); let pool = FixedSizeDescriptorSetsPool::new(layout.clone());
You would then typically store the pool in a struct for later. Then whenever you need a
descriptor set, call pool.next()
to start the process of building it.
let descriptor_set = pool.next() //.add_buffer(...) //.add_sampled_image(...) .build().unwrap();
Note that next()
requires exclusive (mut
) access to the pool. You can use a Mutex
around
the pool if you can’t provide this.
Implementations
impl FixedSizeDescriptorSetsPool
[src]
impl FixedSizeDescriptorSetsPool
[src]pub fn new(
layout: Arc<UnsafeDescriptorSetLayout>
) -> FixedSizeDescriptorSetsPool
[src]
pub fn new(
layout: Arc<UnsafeDescriptorSetLayout>
) -> FixedSizeDescriptorSetsPool
[src]Initializes a new pool. The pool is configured to allocate sets that corresponds to the parameters passed to this function.
pub fn next(&mut self) -> FixedSizeDescriptorSetBuilder<'_, ()>
[src]
pub fn next(&mut self) -> FixedSizeDescriptorSetBuilder<'_, ()>
[src]Starts the process of building a new descriptor set.
The set will corresponds to the set layout that was passed to new
.
Trait Implementations
impl Clone for FixedSizeDescriptorSetsPool
[src]
impl Clone for FixedSizeDescriptorSetsPool
[src]fn clone(&self) -> FixedSizeDescriptorSetsPool
[src]
fn clone(&self) -> FixedSizeDescriptorSetsPool
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for FixedSizeDescriptorSetsPool
impl Send for FixedSizeDescriptorSetsPool
impl Sync for FixedSizeDescriptorSetsPool
impl Unpin for FixedSizeDescriptorSetsPool
impl UnwindSafe for FixedSizeDescriptorSetsPool
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Content for T
[src]
impl<T> Content for T
[src]pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut 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]
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]
pub fn indiv_size() -> usize
[src]Returns the size of an individual element.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more