Class VkDrawIndirectCommand

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

    public class VkDrawIndirectCommand
    extends Struct
    implements NativeResource
    Structure specifying a draw indirect command.
    Description

    The members of VkDrawIndirectCommand have the same meaning as the similarly named parameters of CmdDraw.

    Valid Usage
    • For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description
    • If the drawIndirectFirstInstance feature is not enabled, firstInstance must be 0
    See Also

    CmdDrawIndirect

    Member documentation

    • vertexCount – the number of vertices to draw.
    • instanceCount – the number of instances to draw.
    • firstVertex – the index of the first vertex to draw.
    • firstInstance – the instance ID of the first instance to draw.

    Layout

    
     struct VkDrawIndirectCommand {
         uint32_t vertexCount;
         uint32_t instanceCount;
         uint32_t firstVertex;
         uint32_t firstInstance;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • VERTEXCOUNT, INSTANCECOUNT, FIRSTVERTEX, FIRSTINSTANCE

        The struct member offsets.
    • Constructor Detail

      • VkDrawIndirectCommand

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

        public int vertexCount()
        Returns the value of the vertexCount field.
      • instanceCount

        public int instanceCount()
        Returns the value of the instanceCount field.
      • firstVertex

        public int firstVertex()
        Returns the value of the firstVertex field.
      • firstInstance

        public int firstInstance()
        Returns the value of the firstInstance field.
      • vertexCount

        public VkDrawIndirectCommand vertexCount​(int value)
        Sets the specified value to the vertexCount field.
      • instanceCount

        public VkDrawIndirectCommand instanceCount​(int value)
        Sets the specified value to the instanceCount field.
      • firstVertex

        public VkDrawIndirectCommand firstVertex​(int value)
        Sets the specified value to the firstVertex field.
      • firstInstance

        public VkDrawIndirectCommand firstInstance​(int value)
        Sets the specified value to the firstInstance field.
      • set

        public VkDrawIndirectCommand set​(int vertexCount,
                                         int instanceCount,
                                         int firstVertex,
                                         int firstInstance)
        Initializes this struct with the specified values.
      • malloc

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

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

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

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

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

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

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

        public static int nvertexCount​(long struct)
        Unsafe version of vertexCount().
      • ninstanceCount

        public static int ninstanceCount​(long struct)
        Unsafe version of instanceCount().
      • nfirstVertex

        public static int nfirstVertex​(long struct)
        Unsafe version of firstVertex().
      • nfirstInstance

        public static int nfirstInstance​(long struct)
        Unsafe version of firstInstance().
      • nvertexCount

        public static void nvertexCount​(long struct,
                                        int value)
        Unsafe version of vertexCount.
      • ninstanceCount

        public static void ninstanceCount​(long struct,
                                          int value)
        Unsafe version of instanceCount.
      • nfirstVertex

        public static void nfirstVertex​(long struct,
                                        int value)
        Unsafe version of firstVertex.
      • nfirstInstance

        public static void nfirstInstance​(long struct,
                                          int value)
        Unsafe version of firstInstance.