Struct vulkano::descriptor_set::layout::DescriptorSetLayout
source · pub struct DescriptorSetLayout { /* private fields */ }
Expand description
Describes to the Vulkan implementation the layout of all descriptors within a descriptor set.
Implementations§
source§impl DescriptorSetLayout
impl DescriptorSetLayout
sourcepub fn new(
device: Arc<Device>,
create_info: DescriptorSetLayoutCreateInfo
) -> Result<Arc<DescriptorSetLayout>, Validated<VulkanError>>
pub fn new( device: Arc<Device>, create_info: DescriptorSetLayoutCreateInfo ) -> Result<Arc<DescriptorSetLayout>, Validated<VulkanError>>
Creates a new DescriptorSetLayout
.
sourcepub unsafe fn from_handle(
device: Arc<Device>,
handle: DescriptorSetLayout,
create_info: DescriptorSetLayoutCreateInfo
) -> Arc<DescriptorSetLayout>
pub unsafe fn from_handle( device: Arc<Device>, handle: DescriptorSetLayout, create_info: DescriptorSetLayoutCreateInfo ) -> Arc<DescriptorSetLayout>
Creates a new DescriptorSetLayout
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 flags(&self) -> DescriptorSetLayoutCreateFlags
pub fn flags(&self) -> DescriptorSetLayoutCreateFlags
Returns the flags that the descriptor set layout was created with.
sourcepub fn bindings(&self) -> &BTreeMap<u32, DescriptorSetLayoutBinding>
pub fn bindings(&self) -> &BTreeMap<u32, DescriptorSetLayoutBinding>
Returns the bindings of the descriptor set layout.
sourcepub fn descriptor_counts(&self) -> &HashMap<DescriptorType, u32>
pub fn descriptor_counts(&self) -> &HashMap<DescriptorType, u32>
Returns the number of descriptors of each type.
The map is guaranteed to not contain any elements with a count of 0
.
sourcepub fn variable_descriptor_count(&self) -> u32
pub fn variable_descriptor_count(&self) -> u32
If the highest-numbered binding has a variable count, returns its descriptor_count
.
Otherwise returns 0
.
sourcepub fn is_compatible_with(&self, other: &DescriptorSetLayout) -> bool
pub fn is_compatible_with(&self, other: &DescriptorSetLayout) -> bool
Returns whether self
is compatible with other
.
“Compatible” in this sense is defined by the Vulkan specification under the section “Pipeline layout compatibility”: either the two are the same descriptor set layout object, or they must be identically defined to the Vulkan API.