Class VkPushConstantRange

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

public class VkPushConstantRange extends org.lwjgl.system.Struct<VkPushConstantRange> implements org.lwjgl.system.NativeResource
Structure specifying a push constant range.
Valid Usage
  • offset must be less than VkPhysicalDeviceLimits::maxPushConstantsSize
  • offset must be a multiple of 4
  • size must be greater than 0
  • size must be a multiple of 4
  • size must be less than or equal to VkPhysicalDeviceLimits::maxPushConstantsSize minus offset
Valid Usage (Implicit)
  • stageFlags must be a valid combination of VkShaderStageFlagBits values
  • stageFlags must not be 0
See Also

VkIndirectCommandsPushConstantTokenEXT, VkIndirectExecutionSetShaderInfoEXT, VkPipelineLayoutCreateInfo, VkShaderCreateInfoEXT

Layout


 struct VkPushConstantRange {
     VkShaderStageFlags stageFlags();
     uint32_t offset();
     uint32_t size();
 }
  • Field Details

    • SIZEOF

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

      public static final int ALIGNOF
      The struct alignment in bytes.
    • 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.
  • Constructor Details

    • VkPushConstantRange

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

      public int stageFlags()
      a set of stage flags describing the shader stages that will access a range of push constants. If a particular stage is not included in the range, then accessing members of that range of push constants from the corresponding shader stage will return undefined values.
    • offset

      public int offset()
      offset and size are the start offset and size, respectively, consumed by the range. Both offset and size are in units of bytes and must be a multiple of 4. The layout of the push constant variables is specified in the shader.
    • size

      public int size()
      see offset
    • stageFlags

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

      public VkPushConstantRange offset(int value)
      Sets the specified value to the offset() field.
    • size

      public VkPushConstantRange size(int value)
      Sets the specified value to the size() field.
    • set

      public VkPushConstantRange set(int stageFlags, int offset, int size)
      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 VkPushConstantRange malloc()
      Returns a new VkPushConstantRange instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      @Deprecated public static VkPushConstantRange.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 VkPushConstantRange.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 VkPushConstantRange malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkPushConstantRange instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

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

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

      public static VkPushConstantRange.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkPushConstantRange.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
    • 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().
    • 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)
      Unsafe version of size.