pub struct FixedSizeDescriptorSetsPool<L> { /* private fields */ }
Expand description

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. The first parameter of the new function can be a graphics pipeline, a compute pipeline, or anything that represents a pipeline layout.

use vulkano::descriptor::descriptor_set::FixedSizeDescriptorSetsPool;
// use vulkano::pipeline::GraphicsPipelineAbstract;
// let graphics_pipeline: Arc<GraphicsPipelineAbstract> = ...;

let pool = FixedSizeDescriptorSetsPool::new(graphics_pipeline.clone(), 0);

You would then typically store the pool in a struct for later. Its type is FixedSizeDescriptorSetsPool<T> where T is the type of what was passed to new(). In the example above, it would be FixedSizeDescriptorSetsPool<Arc<GraphicsPipelineAbstract>>.

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

Initializes a new pool. The pool is configured to allocate sets that corresponds to the parameters passed to this function.

Starts the process of building a new descriptor set.

The set will corresponds to the set layout that was passed to new.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Builds a pointer to this type from a raw pointer.
Returns true if the size is suitable to store a type like this.
Returns the size of an individual element.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.