Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class ARBIndirectParameters

extends Object
Class Inheritance
Imports
java.nio.*, org.lwjgl.system.*

Native bindings to the ARB_indirect_parameters extension.

OpenGL 4.3 (with the introduction of the ARB_multi_draw_indirect extension) enhanced the ability of OpenGL to allow a large sets of parameters for indirect draws (introduced with OpenGL 4.0) into a buffer object and dispatch the entire list with one API call. This allows, for example, a shader (such as a compute shader via shader storage buffers, or a geometry shader via transform feedback) to produce lists of draw commands that can then be consumed by OpenGL without a server-client round trip. However, when a variable and potentially unknown number of draws are produced by such a shader, it becomes difficult to know how many draws are in the output array(s). Applications must resort to techniques such as transform feedback primitive queries, or mapping buffers containing the content of atomic counters, which can cause stalls or bubbles in the OpenGL pipeline.

This extension introduces the concept of the "parameter buffer", which is a target allowing buffers to store parameters for certain drawing commands. Also in this extension, new variants of MultiDrawArraysIndirect and MultiDrawElementsIndirect are introduced that source some of their parameters from this buffer. Further commands could potentially be introduced that source other parameters from a buffer.

Requires OpenGL 4.2.

Field Summary

Modifier and TypeField and Description
public static final int
GL_PARAMETER_BUFFER_ARB

Accepted by the target parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData.

public static final int
GL_PARAMETER_BUFFER_BINDING_ARB

Accepted by the value parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static void
glMultiDrawArraysIndirectCountARB(int mode, ByteBuffer
an array of structures containing the draw parameters
indirect
,
long
the offset into the parameter buffer object
drawcount
,
int
the maximum number of draws
maxdrawcount
,
int
the distance in basic machine units between elements of the draw parameter array
stride
)

Behaves similarly to MultiDrawArraysIndirect, except that drawcount defines an offset (in bytes) into the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single sizei typed value is stored, which contains the draw count.

public static void
glMultiDrawArraysIndirectCountARB(int mode, long
an array of structures containing the draw parameters
indirect
,
long
the offset into the parameter buffer object
drawcount
,
int
the maximum number of draws
maxdrawcount
,
int
the distance in basic machine units between elements of the draw parameter array
stride
)

Behaves similarly to MultiDrawArraysIndirect, except that drawcount defines an offset (in bytes) into the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single sizei typed value is stored, which contains the draw count.

public static void
glMultiDrawArraysIndirectCountARB(int mode, IntBuffer
an array of structures containing the draw parameters
indirect
,
long
the offset into the parameter buffer object
drawcount
,
int
the maximum number of draws
maxdrawcount
,
int
the distance in basic machine units between elements of the draw parameter array
stride
)

Behaves similarly to MultiDrawArraysIndirect, except that drawcount defines an offset (in bytes) into the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single sizei typed value is stored, which contains the draw count.

public static void
glMultiDrawArraysIndirectCountARB(int mode, int[] indirect, long drawcount, int maxdrawcount, int stride)

Array version of: MultiDrawArraysIndirectCountARB

public static void
glMultiDrawElementsIndirectCountARB(int mode, int
the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
type
,
ByteBuffer
a structure containing an array of draw parameters
indirect
,
long
the offset into the parameter buffer object
drawcount
,
int
the maximum number of draws
maxdrawcount
,
int
the distance in basic machine units between elements of the draw parameter array
stride
)

Behaves similarly to MultiDrawElementsIndirect, except that drawcount defines an offset (in bytes) into the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single sizei typed value is stored, which contains the draw count.

public static void
glMultiDrawElementsIndirectCountARB(int mode, int
the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
type
,
long
a structure containing an array of draw parameters
indirect
,
long
the offset into the parameter buffer object
drawcount
,
int
the maximum number of draws
maxdrawcount
,
int
the distance in basic machine units between elements of the draw parameter array
stride
)

Behaves similarly to MultiDrawElementsIndirect, except that drawcount defines an offset (in bytes) into the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single sizei typed value is stored, which contains the draw count.

public static void
glMultiDrawElementsIndirectCountARB(int mode, int
the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
type
,
IntBuffer
a structure containing an array of draw parameters
indirect
,
long
the offset into the parameter buffer object
drawcount
,
int
the maximum number of draws
maxdrawcount
,
int
the distance in basic machine units between elements of the draw parameter array
stride
)

Behaves similarly to MultiDrawElementsIndirect, except that drawcount defines an offset (in bytes) into the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single sizei typed value is stored, which contains the draw count.

public static void
glMultiDrawElementsIndirectCountARB(int mode, int type, int[] indirect, long drawcount, int maxdrawcount, int stride)

Array version of: MultiDrawElementsIndirectCountARB

public static native void
nglMultiDrawArraysIndirectCountARB(int mode, long indirect, long drawcount, int maxdrawcount, int stride)

Unsafe version of: MultiDrawArraysIndirectCountARB

public static native void
nglMultiDrawElementsIndirectCountARB(int mode, int type, long indirect, long drawcount, int maxdrawcount, int stride)

Unsafe version of: MultiDrawElementsIndirectCountARB

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

GL_PARAMETER_BUFFER_ARBback to summary
public static final int GL_PARAMETER_BUFFER_ARB

Accepted by the target parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData.

GL_PARAMETER_BUFFER_BINDING_ARBback to summary
public static final int GL_PARAMETER_BUFFER_BINDING_ARB

Accepted by the value parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev.

Constructor Detail

ARBIndirectParametersback to summary
protected ARBIndirectParameters()

Method Detail

glMultiDrawArraysIndirectCountARBback to summary
public static void glMultiDrawArraysIndirectCountARB(int mode, ByteBuffer indirect, long drawcount, int maxdrawcount, int stride)

Behaves similarly to MultiDrawArraysIndirect, except that drawcount defines an offset (in bytes) into the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single sizei typed value is stored, which contains the draw count. maxdrawcount specifies the maximum number of draws that are expected to be stored in the buffer. If the value stored at drawcount into the buffer is greater than maxdrawcount, an implementation stop processing draws after maxdrawcount parameter sets. drawcount must be a multiple of four.

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
indirect:ByteBuffer

an array of structures containing the draw parameters

drawcount:long

the offset into the parameter buffer object

maxdrawcount:int

the maximum number of draws

stride:int

the distance in basic machine units between elements of the draw parameter array

glMultiDrawArraysIndirectCountARBback to summary
public static void glMultiDrawArraysIndirectCountARB(int mode, long indirect, long drawcount, int maxdrawcount, int stride)

Behaves similarly to MultiDrawArraysIndirect, except that drawcount defines an offset (in bytes) into the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single sizei typed value is stored, which contains the draw count. maxdrawcount specifies the maximum number of draws that are expected to be stored in the buffer. If the value stored at drawcount into the buffer is greater than maxdrawcount, an implementation stop processing draws after maxdrawcount parameter sets. drawcount must be a multiple of four.

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
indirect:long

an array of structures containing the draw parameters

drawcount:long

the offset into the parameter buffer object

maxdrawcount:int

the maximum number of draws

stride:int

the distance in basic machine units between elements of the draw parameter array

glMultiDrawArraysIndirectCountARBback to summary
public static void glMultiDrawArraysIndirectCountARB(int mode, IntBuffer indirect, long drawcount, int maxdrawcount, int stride)

Behaves similarly to MultiDrawArraysIndirect, except that drawcount defines an offset (in bytes) into the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single sizei typed value is stored, which contains the draw count. maxdrawcount specifies the maximum number of draws that are expected to be stored in the buffer. If the value stored at drawcount into the buffer is greater than maxdrawcount, an implementation stop processing draws after maxdrawcount parameter sets. drawcount must be a multiple of four.

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
indirect:IntBuffer

an array of structures containing the draw parameters

drawcount:long

the offset into the parameter buffer object

maxdrawcount:int

the maximum number of draws

stride:int

the distance in basic machine units between elements of the draw parameter array

glMultiDrawArraysIndirectCountARBback to summary
public static void glMultiDrawArraysIndirectCountARB(int mode, int[] indirect, long drawcount, int maxdrawcount, int stride)

Array version of: MultiDrawArraysIndirectCountARB

glMultiDrawElementsIndirectCountARBback to summary
public static void glMultiDrawElementsIndirectCountARB(int mode, int type, ByteBuffer indirect, long drawcount, int maxdrawcount, int stride)

Behaves similarly to MultiDrawElementsIndirect, except that drawcount defines an offset (in bytes) into the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single sizei typed value is stored, which contains the draw count. maxdrawcount specifies the maximum number of draws that are expected to be stored in the buffer. If the value stored at drawcount into the buffer is greater than maxdrawcount, an implementation stop processing draws after maxdrawcount parameter sets. drawcount must be a multiple of four.

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
type:int

the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:

UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
indirect:ByteBuffer

a structure containing an array of draw parameters

drawcount:long

the offset into the parameter buffer object

maxdrawcount:int

the maximum number of draws

stride:int

the distance in basic machine units between elements of the draw parameter array

glMultiDrawElementsIndirectCountARBback to summary
public static void glMultiDrawElementsIndirectCountARB(int mode, int type, long indirect, long drawcount, int maxdrawcount, int stride)

Behaves similarly to MultiDrawElementsIndirect, except that drawcount defines an offset (in bytes) into the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single sizei typed value is stored, which contains the draw count. maxdrawcount specifies the maximum number of draws that are expected to be stored in the buffer. If the value stored at drawcount into the buffer is greater than maxdrawcount, an implementation stop processing draws after maxdrawcount parameter sets. drawcount must be a multiple of four.

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
type:int

the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:

UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
indirect:long

a structure containing an array of draw parameters

drawcount:long

the offset into the parameter buffer object

maxdrawcount:int

the maximum number of draws

stride:int

the distance in basic machine units between elements of the draw parameter array

glMultiDrawElementsIndirectCountARBback to summary
public static void glMultiDrawElementsIndirectCountARB(int mode, int type, IntBuffer indirect, long drawcount, int maxdrawcount, int stride)

Behaves similarly to MultiDrawElementsIndirect, except that drawcount defines an offset (in bytes) into the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single sizei typed value is stored, which contains the draw count. maxdrawcount specifies the maximum number of draws that are expected to be stored in the buffer. If the value stored at drawcount into the buffer is greater than maxdrawcount, an implementation stop processing draws after maxdrawcount parameter sets. drawcount must be a multiple of four.

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
type:int

the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:

UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
indirect:IntBuffer

a structure containing an array of draw parameters

drawcount:long

the offset into the parameter buffer object

maxdrawcount:int

the maximum number of draws

stride:int

the distance in basic machine units between elements of the draw parameter array

glMultiDrawElementsIndirectCountARBback to summary
public static void glMultiDrawElementsIndirectCountARB(int mode, int type, int[] indirect, long drawcount, int maxdrawcount, int stride)

Array version of: MultiDrawElementsIndirectCountARB

nglMultiDrawArraysIndirectCountARBback to summary
public static native void nglMultiDrawArraysIndirectCountARB(int mode, long indirect, long drawcount, int maxdrawcount, int stride)

Unsafe version of: MultiDrawArraysIndirectCountARB

nglMultiDrawElementsIndirectCountARBback to summary
public static native void nglMultiDrawElementsIndirectCountARB(int mode, int type, long indirect, long drawcount, int maxdrawcount, int stride)

Unsafe version of: MultiDrawElementsIndirectCountARB