Struct vulkano::pipeline::layout::PipelineLayout
source · pub struct PipelineLayout { /* private fields */ }
Expand description
Describes the layout of descriptor sets and push constants that are made available to shaders.
Implementations§
source§impl PipelineLayout
impl PipelineLayout
sourcepub fn new(
device: Arc<Device>,
create_info: PipelineLayoutCreateInfo
) -> Result<Arc<PipelineLayout>, PipelineLayoutCreationError>
pub fn new(
device: Arc<Device>,
create_info: PipelineLayoutCreateInfo
) -> Result<Arc<PipelineLayout>, PipelineLayoutCreationError>
Creates a new PipelineLayout
.
Panics
- Panics if an element of
create_info.push_constant_ranges
has an emptystages
value. - Panics if an element of
create_info.push_constant_ranges
has anoffset
orsize
that’s not divisible by 4. - Panics if an element of
create_info.push_constant_ranges
has ansize
of zero.
sourcepub unsafe fn from_handle(
device: Arc<Device>,
handle: PipelineLayout,
create_info: PipelineLayoutCreateInfo
) -> Arc<PipelineLayout>
pub unsafe fn from_handle(
device: Arc<Device>,
handle: PipelineLayout,
create_info: PipelineLayoutCreateInfo
) -> Arc<PipelineLayout>
Creates a new PipelineLayout
from a raw object handle.
Safety
handle
must be a valid Vulkan object handle created fromdevice
.create_info
must match the info used to create the object.
sourcepub fn set_layouts(&self) -> &[Arc<DescriptorSetLayout>]
pub fn set_layouts(&self) -> &[Arc<DescriptorSetLayout>]
Returns the descriptor set layouts this pipeline layout was created from.
sourcepub fn push_constant_ranges(&self) -> &[PushConstantRange]
pub fn push_constant_ranges(&self) -> &[PushConstantRange]
Returns a slice containing the push constant ranges this pipeline layout was created from.
The ranges are guaranteed to be sorted deterministically by offset, size, then stages. This means that two slices containing the same elements will always have the same order.
sourcepub fn is_compatible_with(&self, other: &PipelineLayout, num_sets: u32) -> bool
pub fn is_compatible_with(&self, other: &PipelineLayout, num_sets: u32) -> bool
Returns whether self
is compatible with other
for the given number of sets.
sourcepub fn ensure_compatible_with_shader<'a>(
&self,
descriptor_requirements: impl IntoIterator<Item = ((u32, u32), &'a DescriptorRequirements)>,
push_constant_range: Option<&PushConstantRange>
) -> Result<(), PipelineLayoutSupersetError>
pub fn ensure_compatible_with_shader<'a>(
&self,
descriptor_requirements: impl IntoIterator<Item = ((u32, u32), &'a DescriptorRequirements)>,
push_constant_range: Option<&PushConstantRange>
) -> Result<(), PipelineLayoutSupersetError>
Makes sure that self
is a superset of the provided descriptor set layouts and push
constant ranges. Returns an Err
if this is not the case.