Class VkDescriptorSetLayoutBinding

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

    public class VkDescriptorSetLayoutBinding
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure specifying a descriptor set layout binding.
    Description

    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.

    Note

    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

    VkDescriptorSetLayoutCreateInfo

    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.

    Layout

    
     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.
      • BINDING, DESCRIPTORTYPE, DESCRIPTORCOUNT, STAGEFLAGS, PIMMUTABLESAMPLERS

        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.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • binding

        public int binding()
        Returns the value of the binding field.
      • descriptorType

        public int descriptorType()
        Returns the value of the descriptorType field.
      • descriptorCount

        public int descriptorCount()
        Returns the value of the descriptorCount field.
      • stageFlags

        public int stageFlags()
        Returns the value of the stageFlags field.
      • pImmutableSamplers

        @Nullable
        public java.nio.LongBuffer pImmutableSamplers()
        Returns a LongBuffer view of the data pointed to by the pImmutableSamplers field.
      • descriptorCount

        public VkDescriptorSetLayoutBinding descriptorCount​(int value)
        Sets the specified value to the descriptorCount field.
      • pImmutableSamplers

        public VkDescriptorSetLayoutBinding pImmutableSamplers​(@Nullable
                                                               java.nio.LongBuffer value)
        Sets the address of the specified LongBuffer to the pImmutableSamplers field.
      • set

        public VkDescriptorSetLayoutBinding set​(int binding,
                                                int descriptorType,
                                                int descriptorCount,
                                                int stageFlags,
                                                @Nullable
                                                java.nio.LongBuffer pImmutableSamplers)
        Initializes this struct with the specified values.
      • malloc

        public static VkDescriptorSetLayoutBinding malloc()
        Returns a new VkDescriptorSetLayoutBinding instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static VkDescriptorSetLayoutBinding calloc()
        Returns a new VkDescriptorSetLayoutBinding instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static VkDescriptorSetLayoutBinding create()
        Returns a new VkDescriptorSetLayoutBinding instance allocated with BufferUtils.
      • create

        public static VkDescriptorSetLayoutBinding create​(long address)
        Returns a new VkDescriptorSetLayoutBinding instance for the specified memory address.
      • mallocStack

        public static VkDescriptorSetLayoutBinding mallocStack()
        Returns a new VkDescriptorSetLayoutBinding instance allocated on the thread-local MemoryStack.
      • callocStack

        public static VkDescriptorSetLayoutBinding callocStack()
        Returns a new VkDescriptorSetLayoutBinding instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static VkDescriptorSetLayoutBinding mallocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new VkDescriptorSetLayoutBinding instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static VkDescriptorSetLayoutBinding callocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new VkDescriptorSetLayoutBinding instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static VkDescriptorSetLayoutBinding.Buffer callocStack​(int capacity,
                                                                      org.lwjgl.system.MemoryStack stack)
        Returns a new VkDescriptorSetLayoutBinding.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nbinding

        public static int nbinding​(long struct)
        Unsafe version of binding().
      • ndescriptorType

        public static int ndescriptorType​(long struct)
        Unsafe version of descriptorType().
      • ndescriptorCount

        public static int ndescriptorCount​(long struct)
        Unsafe version of descriptorCount().
      • nstageFlags

        public static int nstageFlags​(long struct)
        Unsafe version of stageFlags().
      • npImmutableSamplers

        @Nullable
        public static java.nio.LongBuffer npImmutableSamplers​(long struct)
        Unsafe version of pImmutableSamplers.
      • nbinding

        public static void nbinding​(long struct,
                                    int value)
        Unsafe version of binding.
      • ndescriptorType

        public static void ndescriptorType​(long struct,
                                           int value)
        Unsafe version of descriptorType.
      • ndescriptorCount

        public static void ndescriptorCount​(long struct,
                                            int value)
        Sets the specified value to the descriptorCount field of the specified struct.
      • nstageFlags

        public static void nstageFlags​(long struct,
                                       int value)
        Unsafe version of stageFlags.
      • npImmutableSamplers

        public static void npImmutableSamplers​(long struct,
                                               @Nullable
                                               java.nio.LongBuffer value)
        Unsafe version of pImmutableSamplers.