Class VkDescriptorUpdateTemplateEntry

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer
    Direct Known Subclasses:
    VkDescriptorUpdateTemplateEntryKHR

    public class VkDescriptorUpdateTemplateEntry
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Describes a single descriptor update of the descriptor update template.
    Valid Usage
    • dstBinding must be a valid binding in the descriptor set layout implicitly specified when using a descriptor update template to update descriptors.
    • dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding implicitly specified when using a descriptor update template to update descriptors, and all applicable consecutive bindings, as described by consecutive binding updates
    • If descriptor type is DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, dstArrayElement must be an integer multiple of 4
    • If descriptor type is DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, descriptorCount must be an integer multiple of 4
    Valid Usage (Implicit)
    • descriptorType must be a valid VkDescriptorType value
    See Also

    VkDescriptorUpdateTemplateCreateInfo

    Member documentation

    • dstBinding – the descriptor binding to update when using this descriptor update template.
    • dstArrayElement – the starting element in the array belonging to dstBinding. If the descriptor binding identified by srcBinding has a descriptor type of DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then dstArrayElement specifies the starting byte offset to update.
    • descriptorCount – the number of descriptors to update. If descriptorCount is greater than the number of remaining array elements in the destination binding, those affect consecutive bindings in a manner similar to VkWriteDescriptorSet above. If the descriptor binding identified by dstBinding has a descriptor type of DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then descriptorCount specifies the number of bytes to update and the remaining array elements in the destination binding refer to the remaining number of bytes in it.
    • descriptorType – a VkDescriptorType specifying the type of the descriptor.
    • offset – the offset in bytes of the first binding in the raw data structure.
    • stride – the stride in bytes between two consecutive array elements of the descriptor update informations in the raw data structure. The actual pointer ptr for each array element j of update entry i is computed using the following formula:
      
           const char *ptr = (const char *)pData + pDescriptorUpdateEntries[i].offset + j * pDescriptorUpdateEntries[i].stride

      The stride is useful in case the bindings are stored in structs along with other data. If descriptorType is DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then the value of stride is ignored and the stride is assumed to be 1, i.e. the descriptor update information for them is always specified as a contiguous range.

    Layout

    
     struct VkDescriptorUpdateTemplateEntry {
         uint32_t dstBinding;
         uint32_t dstArrayElement;
         uint32_t descriptorCount;
         VkDescriptorType descriptorType;
         size_t offset;
         size_t stride;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • DSTBINDING, DSTARRAYELEMENT, DESCRIPTORCOUNT, DESCRIPTORTYPE, OFFSET, STRIDE

        The struct member offsets.
    • Constructor Detail

      • VkDescriptorUpdateTemplateEntry

        public VkDescriptorUpdateTemplateEntry​(java.nio.ByteBuffer container)
        Creates a VkDescriptorUpdateTemplateEntry 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
      • dstBinding

        public int dstBinding()
        Returns the value of the dstBinding field.
      • dstArrayElement

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

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

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

        public long offset()
        Returns the value of the offset field.
      • stride

        public long stride()
        Returns the value of the stride field.
      • set

        public VkDescriptorUpdateTemplateEntry set​(int dstBinding,
                                                   int dstArrayElement,
                                                   int descriptorCount,
                                                   int descriptorType,
                                                   long offset,
                                                   long stride)
        Initializes this struct with the specified values.
      • malloc

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

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

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

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

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

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

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

        public static int ndstBinding​(long struct)
        Unsafe version of dstBinding().
      • ndstArrayElement

        public static int ndstArrayElement​(long struct)
        Unsafe version of dstArrayElement().
      • ndescriptorCount

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

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

        public static long noffset​(long struct)
        Unsafe version of offset().
      • nstride

        public static long nstride​(long struct)
        Unsafe version of stride().
      • ndstBinding

        public static void ndstBinding​(long struct,
                                       int value)
        Unsafe version of dstBinding.
      • ndstArrayElement

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

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

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

        public static void noffset​(long struct,
                                   long value)
        Unsafe version of offset.
      • nstride

        public static void nstride​(long struct,
                                   long value)
        Unsafe version of stride.