Class VkDescriptorSetLayoutBinding

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class VkDescriptorSetLayoutBinding
    extends Struct
    implements NativeResource
    Structure specifying a descriptor set layout binding.

    The above layout definition allows the descriptor bindings to be specified sparsely such that not all binding numbers between 0 and the maximum binding number need to be specified in the pBindings array. Bindings that are not specified have a descriptorCount and stageFlags of zero, and the value of descriptorType is undefined. However, all binding numbers between 0 and the maximum binding number in the VkDescriptorSetLayoutCreateInfo::pBindings array may consume memory in the descriptor set layout even if not all descriptor bindings are used, though it should not consume additional memory from the descriptor pool.


    The maximum binding number specified should be as compact as possible to avoid wasted memory.

    Valid Usage
    Valid Usage (Implicit)
    • descriptorType must be a valid VkDescriptorType value
    See Also


    Member documentation

    • binding – the binding number of this entry and corresponds to a resource of the same binding number in the shader stages.
    • descriptorType – a VkDescriptorType specifying which type of resource descriptors are used for this binding.
    • descriptorCount – the number of descriptors contained in the binding, accessed in a shader as an array , except if descriptorType is DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT in which case descriptorCount is the size in bytes of the inline uniform block . If descriptorCount is zero this binding entry is reserved and the resource must not be accessed from any stage via this binding within any pipeline using the set layout.
    • stageFlags – member is a bitmask of VkShaderStageFlagBits specifying which pipeline shader stages can access a resource for this binding. SHADER_STAGE_ALL is a shorthand specifying that all defined shader stages, including any additional stages defined by extensions, can access the resource.

      If a shader stage is not included in stageFlags, then a resource must not be accessed from that stage via this binding within any pipeline using the set layout. Other than input attachments which are limited to the fragment shader, there are no limitations on what combinations of stages can use a descriptor binding, and in particular a binding can be used by both graphics stages and the compute stage.

    • pImmutableSamplers – affects initialization of samplers. If descriptorType specifies a DESCRIPTOR_TYPE_SAMPLER or DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER type descriptor, then pImmutableSamplers can be used to initialize a set of immutable samplers. Immutable samplers are permanently bound into the set layout and must not be changed; updating a DESCRIPTOR_TYPE_SAMPLER descriptor with immutable samplers is not allowed and updates to a DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER descriptor with immutable samplers does not modify the samplers (the image views are updated, but the sampler updates are ignored). If pImmutableSamplers is not NULL, then it is considered to be a pointer to an array of sampler handles that will be consumed by the set layout and used for the corresponding binding. If pImmutableSamplers is NULL, then the sampler slots are dynamic and sampler handles must be bound into descriptor sets using this layout. If descriptorType is not one of these descriptor types, then pImmutableSamplers is ignored.


     struct VkDescriptorSetLayoutBinding {
         uint32_t binding;
         VkDescriptorType descriptorType;
         uint32_t descriptorCount;
         VkShaderStageFlags stageFlags;
         VkSampler const * pImmutableSamplers;
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.

        The struct member offsets.
    • Constructor Detail

      • VkDescriptorSetLayoutBinding

        public VkDescriptorSetLayoutBinding​(java.nio.ByteBuffer container)
        Creates a VkDescriptorSetLayoutBinding instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.