Class VkDescriptorSetLayoutBinding

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VkDescriptorSetLayoutBinding>
org.lwjgl.vulkan.VkDescriptorSetLayoutBinding
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class VkDescriptorSetLayoutBinding extends org.lwjgl.system.Struct<VkDescriptorSetLayoutBinding> 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

Layout


 struct VkDescriptorSetLayoutBinding {
     uint32_t binding();
     VkDescriptorType descriptorType();
     uint32_t descriptorCount();
     VkShaderStageFlags stageFlags();
     VkSampler const * pImmutableSamplers();
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • BINDING

      public static final int BINDING
      The struct member offsets.
    • DESCRIPTORTYPE

      public static final int DESCRIPTORTYPE
      The struct member offsets.
    • DESCRIPTORCOUNT

      public static final int DESCRIPTORCOUNT
      The struct member offsets.
    • STAGEFLAGS

      public static final int STAGEFLAGS
      The struct member offsets.
    • PIMMUTABLESAMPLERS

      public static final int PIMMUTABLESAMPLERS
      The struct member offsets.
  • Constructor Details

    • VkDescriptorSetLayoutBinding

      public VkDescriptorSetLayoutBinding(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 Details

    • sizeof

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

      public int binding()
      the binding number of this entry and corresponds to a resource of the same binding number in the shader stages.
    • descriptorType

      public int descriptorType()
      a VkDescriptorType specifying which type of resource descriptors are used for this binding.
    • descriptorCount

      public int 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 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

      public int 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

      public @Nullable LongBuffer 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 a pointer to an array of sampler handles that will be copied into the set layout and used for the corresponding binding. Only the sampler handles are copied; the sampler objects must not be destroyed before the final use of the set layout and any descriptor pools and sets created using it. 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.
    • binding

      public VkDescriptorSetLayoutBinding binding(int value)
      Sets the specified value to the binding() field.
    • descriptorType

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

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

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

      public VkDescriptorSetLayoutBinding pImmutableSamplers(@Nullable 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 LongBuffer pImmutableSamplers)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • 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.
    • createSafe

      public static @Nullable VkDescriptorSetLayoutBinding createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static VkDescriptorSetLayoutBinding.Buffer malloc(int capacity)
      Returns a new VkDescriptorSetLayoutBinding.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static VkDescriptorSetLayoutBinding.Buffer calloc(int capacity)
      Returns a new VkDescriptorSetLayoutBinding.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkDescriptorSetLayoutBinding.Buffer create(int capacity)
      Returns a new VkDescriptorSetLayoutBinding.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkDescriptorSetLayoutBinding.Buffer create(long address, int capacity)
      Create a VkDescriptorSetLayoutBinding.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable VkDescriptorSetLayoutBinding.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • mallocStack

      @Deprecated public static VkDescriptorSetLayoutBinding mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static VkDescriptorSetLayoutBinding callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkDescriptorSetLayoutBinding mallocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static VkDescriptorSetLayoutBinding callocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkDescriptorSetLayoutBinding.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static VkDescriptorSetLayoutBinding.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkDescriptorSetLayoutBinding.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static VkDescriptorSetLayoutBinding.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

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

      public static VkDescriptorSetLayoutBinding calloc(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
    • malloc

      public static VkDescriptorSetLayoutBinding.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkDescriptorSetLayoutBinding.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static VkDescriptorSetLayoutBinding.Buffer calloc(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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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

      public static @Nullable 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 LongBuffer value)
      Unsafe version of pImmutableSamplers.