Package org.lwjgl.vulkan
Class VkDrawIndirectCommand
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkDrawIndirectCommand
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VkDrawIndirectCommand extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure specifying a draw indirect command.Description
The members of
VkDrawIndirectCommand
have the same meaning as the similarly named parameters ofCmdDraw
.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
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; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkDrawIndirectCommand.Buffer
An array ofVkDrawIndirectCommand
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
FIRSTINSTANCE
FIRSTVERTEX
INSTANCECOUNTThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
VERTEXCOUNT
The struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkDrawIndirectCommand(java.nio.ByteBuffer container)
Creates aVkDrawIndirectCommand
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkDrawIndirectCommand
calloc()
Returns a newVkDrawIndirectCommand
instance allocated withmemCalloc
.static VkDrawIndirectCommand.Buffer
calloc(int capacity)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated withmemCalloc
.static VkDrawIndirectCommand
callocStack()
Returns a newVkDrawIndirectCommand
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkDrawIndirectCommand.Buffer
callocStack(int capacity)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkDrawIndirectCommand.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkDrawIndirectCommand
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkDrawIndirectCommand
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkDrawIndirectCommand
create()
Returns a newVkDrawIndirectCommand
instance allocated withBufferUtils
.static VkDrawIndirectCommand.Buffer
create(int capacity)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated withBufferUtils
.static VkDrawIndirectCommand
create(long address)
Returns a newVkDrawIndirectCommand
instance for the specified memory address.static VkDrawIndirectCommand.Buffer
create(long address, int capacity)
Create aVkDrawIndirectCommand.Buffer
instance at the specified memory.static VkDrawIndirectCommand
createSafe(long address)
static VkDrawIndirectCommand.Buffer
createSafe(long address, int capacity)
int
firstInstance()
Returns the value of thefirstInstance
field.VkDrawIndirectCommand
firstInstance(int value)
Sets the specified value to thefirstInstance
field.int
firstVertex()
Returns the value of thefirstVertex
field.VkDrawIndirectCommand
firstVertex(int value)
Sets the specified value to thefirstVertex
field.int
instanceCount()
Returns the value of theinstanceCount
field.VkDrawIndirectCommand
instanceCount(int value)
Sets the specified value to theinstanceCount
field.static VkDrawIndirectCommand
malloc()
Returns a newVkDrawIndirectCommand
instance allocated withmemAlloc
.static VkDrawIndirectCommand.Buffer
malloc(int capacity)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated withmemAlloc
.static VkDrawIndirectCommand
mallocStack()
Returns a newVkDrawIndirectCommand
instance allocated on the thread-localMemoryStack
.static VkDrawIndirectCommand.Buffer
mallocStack(int capacity)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated on the thread-localMemoryStack
.static VkDrawIndirectCommand.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated on the specifiedMemoryStack
.static VkDrawIndirectCommand
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkDrawIndirectCommand
instance allocated on the specifiedMemoryStack
.static int
nfirstInstance(long struct)
Unsafe version offirstInstance()
.static void
nfirstInstance(long struct, int value)
Unsafe version offirstInstance
.static int
nfirstVertex(long struct)
Unsafe version offirstVertex()
.static void
nfirstVertex(long struct, int value)
Unsafe version offirstVertex
.static int
ninstanceCount(long struct)
Unsafe version ofinstanceCount()
.static void
ninstanceCount(long struct, int value)
Unsafe version ofinstanceCount
.static int
nvertexCount(long struct)
Unsafe version ofvertexCount()
.static void
nvertexCount(long struct, int value)
Unsafe version ofvertexCount
.VkDrawIndirectCommand
set(int vertexCount, int instanceCount, int firstVertex, int firstInstance)
Initializes this struct with the specified values.VkDrawIndirectCommand
set(VkDrawIndirectCommand src)
Copies the specified struct data to this struct.int
sizeof()
int
vertexCount()
Returns the value of thevertexCount
field.VkDrawIndirectCommand
vertexCount(int value)
Sets the specified value to thevertexCount
field.
-
-
-
Constructor Detail
-
VkDrawIndirectCommand
public VkDrawIndirectCommand(java.nio.ByteBuffer container)
Creates aVkDrawIndirectCommand
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
vertexCount
public int vertexCount()
Returns the value of thevertexCount
field.
-
instanceCount
public int instanceCount()
Returns the value of theinstanceCount
field.
-
firstVertex
public int firstVertex()
Returns the value of thefirstVertex
field.
-
firstInstance
public int firstInstance()
Returns the value of thefirstInstance
field.
-
vertexCount
public VkDrawIndirectCommand vertexCount(int value)
Sets the specified value to thevertexCount
field.
-
instanceCount
public VkDrawIndirectCommand instanceCount(int value)
Sets the specified value to theinstanceCount
field.
-
firstVertex
public VkDrawIndirectCommand firstVertex(int value)
Sets the specified value to thefirstVertex
field.
-
firstInstance
public VkDrawIndirectCommand firstInstance(int value)
Sets the specified value to thefirstInstance
field.
-
set
public VkDrawIndirectCommand set(int vertexCount, int instanceCount, int firstVertex, int firstInstance)
Initializes this struct with the specified values.
-
set
public VkDrawIndirectCommand set(VkDrawIndirectCommand src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkDrawIndirectCommand malloc()
Returns a newVkDrawIndirectCommand
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkDrawIndirectCommand calloc()
Returns a newVkDrawIndirectCommand
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkDrawIndirectCommand create()
Returns a newVkDrawIndirectCommand
instance allocated withBufferUtils
.
-
create
public static VkDrawIndirectCommand create(long address)
Returns a newVkDrawIndirectCommand
instance for the specified memory address.
-
createSafe
@Nullable public static VkDrawIndirectCommand createSafe(long address)
-
malloc
public static VkDrawIndirectCommand.Buffer malloc(int capacity)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkDrawIndirectCommand.Buffer calloc(int capacity)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkDrawIndirectCommand.Buffer create(int capacity)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkDrawIndirectCommand.Buffer create(long address, int capacity)
Create aVkDrawIndirectCommand.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkDrawIndirectCommand.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkDrawIndirectCommand mallocStack()
Returns a newVkDrawIndirectCommand
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkDrawIndirectCommand callocStack()
Returns a newVkDrawIndirectCommand
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkDrawIndirectCommand mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkDrawIndirectCommand
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkDrawIndirectCommand callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkDrawIndirectCommand
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkDrawIndirectCommand.Buffer mallocStack(int capacity)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkDrawIndirectCommand.Buffer callocStack(int capacity)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkDrawIndirectCommand.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkDrawIndirectCommand.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkDrawIndirectCommand.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nvertexCount
public static int nvertexCount(long struct)
Unsafe version ofvertexCount()
.
-
ninstanceCount
public static int ninstanceCount(long struct)
Unsafe version ofinstanceCount()
.
-
nfirstVertex
public static int nfirstVertex(long struct)
Unsafe version offirstVertex()
.
-
nfirstInstance
public static int nfirstInstance(long struct)
Unsafe version offirstInstance()
.
-
nvertexCount
public static void nvertexCount(long struct, int value)
Unsafe version ofvertexCount
.
-
ninstanceCount
public static void ninstanceCount(long struct, int value)
Unsafe version ofinstanceCount
.
-
nfirstVertex
public static void nfirstVertex(long struct, int value)
Unsafe version offirstVertex
.
-
nfirstInstance
public static void nfirstInstance(long struct, int value)
Unsafe version offirstInstance
.
-
-