Class VkPushConstantsInfoKHR

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

public class VkPushConstantsInfoKHR extends org.lwjgl.system.Struct<VkPushConstantsInfoKHR> implements org.lwjgl.system.NativeResource
Structure specifying a push constant update operation.
Valid Usage
  • For each byte in the range specified by offset and size and for each shader stage in stageFlags, there must be a push constant range in layout that includes that byte and that stage
  • For each byte in the range specified by offset and size and for each push constant range that overlaps that byte, stageFlags must include all stages in that push constant range’s VkPushConstantRange::stageFlags
  • offset must be a multiple of 4
  • size must be a multiple of 4
  • offset must be less than VkPhysicalDeviceLimits::maxPushConstantsSize
  • size must be less than or equal to VkPhysicalDeviceLimits::maxPushConstantsSize minus offset
Valid Usage (Implicit)
  • sType must be STRUCTURE_TYPE_PUSH_CONSTANTS_INFO_KHR
  • pNext must be NULL or a pointer to a valid instance of VkPipelineLayoutCreateInfo
  • The sType value of each struct in the pNext chain must be unique
  • If layout is not NULL_HANDLE, layout must be a valid VkPipelineLayout handle
  • stageFlags must be a valid combination of VkShaderStageFlagBits values
  • stageFlags must not be 0
  • pValues must be a valid pointer to an array of size bytes
  • size must be greater than 0
See Also

CmdPushConstants2KHR

Layout


 struct VkPushConstantsInfoKHR {
     VkStructureType sType();
     void const * pNext();
     VkPipelineLayout layout();
     VkShaderStageFlags stageFlags();
     uint32_t offset();
     uint32_t size();
     void const * pValues();
 }
  • Field Details

    • SIZEOF

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

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

      public static final int STYPE
      The struct member offsets.
    • PNEXT

      public static final int PNEXT
      The struct member offsets.
    • LAYOUT

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

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

      public static final int OFFSET
      The struct member offsets.
    • SIZE

      public static final int SIZE
      The struct member offsets.
    • PVALUES

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

    • VkPushConstantsInfoKHR

      public VkPushConstantsInfoKHR(ByteBuffer container)
      Creates a VkPushConstantsInfoKHR 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<VkPushConstantsInfoKHR>
    • sType

      public int sType()
      a VkStructureType value identifying this structure.
    • pNext

      public long pNext()
      NULL or a pointer to a structure extending this structure.
    • layout

      public long layout()
      the pipeline layout used to program the push constant updates. If the dynamicPipelineLayout feature is enabled, layout can be NULL_HANDLE and the layout must be specified by chaining VkPipelineLayoutCreateInfo structure off the pNext
    • stageFlags

      public int stageFlags()
      a bitmask of VkShaderStageFlagBits specifying the shader stages that will use the push constants in the updated range.
    • offset

      public int offset()
      the start offset of the push constant range to update, in units of bytes.
    • size

      public int size()
      the size of the push constant range to update, in units of bytes.
    • pValues

      public ByteBuffer pValues()
      a pointer to an array of size bytes containing the new push constant values.
    • sType

      public VkPushConstantsInfoKHR sType(int value)
      Sets the specified value to the sType() field.
    • sType$Default

      public VkPushConstantsInfoKHR sType$Default()
      Sets the STRUCTURE_TYPE_PUSH_CONSTANTS_INFO_KHR value to the sType() field.
    • pNext

      public VkPushConstantsInfoKHR pNext(long value)
      Sets the specified value to the pNext() field.
    • pNext

      Prepends the specified VkPipelineLayoutCreateInfo value to the pNext chain.
    • layout

      public VkPushConstantsInfoKHR layout(long value)
      Sets the specified value to the layout() field.
    • stageFlags

      public VkPushConstantsInfoKHR stageFlags(int value)
      Sets the specified value to the stageFlags() field.
    • offset

      public VkPushConstantsInfoKHR offset(int value)
      Sets the specified value to the offset() field.
    • pValues

      public VkPushConstantsInfoKHR pValues(ByteBuffer value)
      Sets the address of the specified ByteBuffer to the pValues() field.
    • set

      public VkPushConstantsInfoKHR set(int sType, long pNext, long layout, int stageFlags, int offset, ByteBuffer pValues)
      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 VkPushConstantsInfoKHR malloc()
      Returns a new VkPushConstantsInfoKHR instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

      public static VkPushConstantsInfoKHR create(long address)
      Returns a new VkPushConstantsInfoKHR instance for the specified memory address.
    • createSafe

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

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

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

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

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

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

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

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

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

      public static VkPushConstantsInfoKHR.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkPushConstantsInfoKHR.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
    • nsType

      public static int nsType(long struct)
      Unsafe version of sType().
    • npNext

      public static long npNext(long struct)
      Unsafe version of pNext().
    • nlayout

      public static long nlayout(long struct)
      Unsafe version of layout().
    • nstageFlags

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

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

      public static int nsize(long struct)
      Unsafe version of size().
    • npValues

      public static ByteBuffer npValues(long struct)
      Unsafe version of pValues.
    • nsType

      public static void nsType(long struct, int value)
      Unsafe version of sType.
    • npNext

      public static void npNext(long struct, long value)
      Unsafe version of pNext.
    • nlayout

      public static void nlayout(long struct, long value)
      Unsafe version of layout.
    • nstageFlags

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

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

      public static void nsize(long struct, int value)
      Sets the specified value to the size field of the specified struct.
    • npValues

      public static void npValues(long struct, ByteBuffer value)
      Unsafe version of pValues.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate