Class VkSpecializationMapEntry

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

    public class VkSpecializationMapEntry
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure specifying a specialization map entry.
    Description

    If a constantID value is not a specialization constant ID used in the shader, that map entry does not affect the behavior of the pipeline.

    Valid Usage
    • For a constantID specialization constant declared in a shader, size must match the byte size of the constantID. If the specialization constant is of type boolean, size must be the byte size of VkBool32
    See Also

    VkSpecializationInfo

    Member documentation

    • constantID – the ID of the specialization constant in SPIR-V.
    • offset – the byte offset of the specialization constant value within the supplied data buffer.
    • size – the byte size of the specialization constant value within the supplied data buffer.

    Layout

    
     struct VkSpecializationMapEntry {
         uint32_t constantID;
         uint32_t offset;
         size_t size;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • CONSTANTID, OFFSET, SIZE

        The struct member offsets.
    • Constructor Detail

      • VkSpecializationMapEntry

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

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

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

        public long size()
        Returns the value of the size field.
      • constantID

        public VkSpecializationMapEntry constantID​(int value)
        Sets the specified value to the constantID field.
      • set

        public VkSpecializationMapEntry set​(int constantID,
                                            int offset,
                                            long size)
        Initializes this struct with the specified values.
      • malloc

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

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

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

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

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

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

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

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

        public static VkSpecializationMapEntry.Buffer callocStack​(int capacity,
                                                                  org.lwjgl.system.MemoryStack stack)
        Returns a new VkSpecializationMapEntry.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
      • nconstantID

        public static int nconstantID​(long struct)
        Unsafe version of constantID().
      • noffset

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

        public static long nsize​(long struct)
        Unsafe version of size().
      • nconstantID

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

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

        public static void nsize​(long struct,
                                 long value)
        Unsafe version of size.