pub struct PipelineDescriptorSetLayoutCreateInfo {
pub flags: PipelineLayoutCreateFlags,
pub set_layouts: Vec<DescriptorSetLayoutCreateInfo>,
pub push_constant_ranges: Vec<PushConstantRange>,
}
Expand description
Parameters to create a new PipelineLayout
as well as its accompanying DescriptorSetLayout
objects.
Fields§
§flags: PipelineLayoutCreateFlags
§set_layouts: Vec<DescriptorSetLayoutCreateInfo>
§push_constant_ranges: Vec<PushConstantRange>
Implementations§
source§impl PipelineDescriptorSetLayoutCreateInfo
impl PipelineDescriptorSetLayoutCreateInfo
sourcepub fn from_stages<'a>(
stages: impl IntoIterator<Item = &'a PipelineShaderStageCreateInfo>
) -> Self
pub fn from_stages<'a>( stages: impl IntoIterator<Item = &'a PipelineShaderStageCreateInfo> ) -> Self
Creates a new PipelineDescriptorSetLayoutCreateInfo
from the union of the requirements of
each shader stage in stages
.
This is intended for quick prototyping or for single use layouts that do not have any bindings in common with other shaders. For the general case, it is strongly recommended to create pipeline layouts manually:
- When multiple pipelines share the same layout object, it is faster than if they have different objects, even if the objects both contain identical bindings. It is also faster (though a little bit less), if multiple pipeline layout objects share common descriptor set objects.
- Pipeline layouts only need to be a superset of what the shaders use, they don’t have to match exactly. Creating a manual pipeline layout therefore allows you to specify layouts that are applicable for many shaders, as long as each one uses a subset. This allows further sharing.
- Creating a manual pipeline layout makes your code more robust against changes in the shader, in particular regarding whether a particular binding in the shader is used or not (see also the limitations below).
Limitations:
Only bindings that are statically used are included in the descriptor binding requirements, and therefore are included in the descriptor set layout. If the use of a binding depends on input variables to the shader (buffers, images, push constants etc.) then the shader reflection is unable to know that the binding is in use, and it will not be included in the pipeline layout.
Note that this corresponds to the shader_*_array_dynamic_indexing
device features.
sourcepub fn into_pipeline_layout_create_info(
self,
device: Arc<Device>
) -> Result<PipelineLayoutCreateInfo, IntoPipelineLayoutCreateInfoError>
pub fn into_pipeline_layout_create_info( self, device: Arc<Device> ) -> Result<PipelineLayoutCreateInfo, IntoPipelineLayoutCreateInfoError>
Converts the PipelineDescriptorSetLayoutCreateInfo
into a PipelineLayoutCreateInfo
by
creating the descriptor set layout objects.
Trait Implementations§
source§impl Clone for PipelineDescriptorSetLayoutCreateInfo
impl Clone for PipelineDescriptorSetLayoutCreateInfo
source§fn clone(&self) -> PipelineDescriptorSetLayoutCreateInfo
fn clone(&self) -> PipelineDescriptorSetLayoutCreateInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more