Class VkPushConstantRange

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

    public class VkPushConstantRange
    extends Struct
    implements 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

    VkPipelineLayoutCreateInfo

    Member documentation

    • 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.
    • offsetoffset 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 – see offset

    Layout

    
     struct VkPushConstantRange {
         VkShaderStageFlags stageFlags;
         uint32_t offset;
         uint32_t size;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

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

        The struct member offsets.
    • Constructor Detail

      • VkPushConstantRange

        public VkPushConstantRange​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • stageFlags

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

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

        public int size()
        Returns the value of the size field.
      • 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.
      • 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​(long address)
        Returns a new VkPushConstantRange instance for the specified memory address.
      • createSafe

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

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

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

        public static VkPushConstantRange callocStack​(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
      • 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.