getDescriptorSetLayoutSizeEXT :: MonadIO io=> Devicedeviceis the logical device that gets the size.-> DescriptorSetLayoutlayoutis the descriptor set layout being queried.-> io ("layoutSizeInBytes"
::: DeviceSize)
vkGetDescriptorSetLayoutSizeEXT - Get the size of a descriptor set layout in memory
Description
The size of a descriptor set layout will be at least as large as the sum total of the size of all descriptors in the layout, and may be larger. This size represents the amount of memory that will be required to store all of the descriptors for this layout in memory, when placed according to the layout’s offsets as obtained by getDescriptorSetLayoutBindingOffsetEXT.
If any binding in layout is
DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT,
the returned size includes space for the maximum descriptorCount
descriptors as declared for that binding. To compute the required size
of a descriptor set with a
DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT:
size = offset + descriptorSize × variableDescriptorCount
where offset is obtained by getDescriptorSetLayoutBindingOffsetEXT and
descriptorSize is the size of the relevant descriptor as obtained from
PhysicalDeviceDescriptorBufferPropertiesEXT, and
variableDescriptorCount is the equivalent of
DescriptorSetVariableDescriptorCountAllocateInfo::pDescriptorCounts.
For
DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK,
variableDescriptorCount is the size in bytes for the inline uniform
block, and descriptorSize is 1.
If
PhysicalDeviceDescriptorBufferPropertiesEXT::combinedImageSamplerDescriptorSingleArray
is FALSE and the variable descriptor
type is
DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
variableDescriptorCount is always considered to be the upper bound.
Valid Usage
The descriptorBuffer feature must be enabled
layoutmust have been created with the DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT flag setlayoutmust have not been created with the DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT flag setlayoutmust have not been created with the DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT flag set
Valid Usage (Implicit)
devicemust be a valid Device handle
layoutmust be a valid DescriptorSetLayout handlepLayoutSizeInBytesmust be a valid pointer to a DeviceSize valuelayoutmust have been created, allocated, or retrieved fromdevice
See Also
VK_EXT_descriptor_buffer, DescriptorSetLayout, Device, DeviceSize