Class ARBIndirectParameters
- java.lang.Object
-
- org.lwjgl.opengl.ARBIndirectParameters
-
public class ARBIndirectParameters extends java.lang.Object
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
andMultiDrawElementsIndirect
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
Fields Modifier and Type Field and Description static int
GL_PARAMETER_BUFFER_ARB
Accepted by thetarget
parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData.static int
GL_PARAMETER_BUFFER_BINDING_ARB
Accepted by thevalue
parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static void
glMultiDrawArraysIndirectCountARB(int mode, java.nio.ByteBuffer indirect, long drawcount, int maxdrawcount, int stride)
Behaves similarly toMultiDrawArraysIndirect
, except thatdrawcount
defines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARB
binding point at which a singlesizei
typed value is stored, which contains the draw count.static void
glMultiDrawArraysIndirectCountARB(int mode, int[] indirect, long drawcount, int maxdrawcount, int stride)
Array version of:MultiDrawArraysIndirectCountARB
static void
glMultiDrawArraysIndirectCountARB(int mode, java.nio.IntBuffer indirect, long drawcount, int maxdrawcount, int stride)
Behaves similarly toMultiDrawArraysIndirect
, except thatdrawcount
defines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARB
binding point at which a singlesizei
typed value is stored, which contains the draw count.static void
glMultiDrawArraysIndirectCountARB(int mode, long indirect, long drawcount, int maxdrawcount, int stride)
Behaves similarly toMultiDrawArraysIndirect
, except thatdrawcount
defines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARB
binding point at which a singlesizei
typed value is stored, which contains the draw count.static void
glMultiDrawElementsIndirectCountARB(int mode, int type, java.nio.ByteBuffer indirect, long drawcount, int maxdrawcount, int stride)
Behaves similarly toMultiDrawElementsIndirect
, except thatdrawcount
defines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARB
binding point at which a singlesizei
typed value is stored, which contains the draw count.static void
glMultiDrawElementsIndirectCountARB(int mode, int type, int[] indirect, long drawcount, int maxdrawcount, int stride)
Array version of:MultiDrawElementsIndirectCountARB
static void
glMultiDrawElementsIndirectCountARB(int mode, int type, java.nio.IntBuffer indirect, long drawcount, int maxdrawcount, int stride)
Behaves similarly toMultiDrawElementsIndirect
, except thatdrawcount
defines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARB
binding point at which a singlesizei
typed value is stored, which contains the draw count.static void
glMultiDrawElementsIndirectCountARB(int mode, int type, long indirect, long drawcount, int maxdrawcount, int stride)
Behaves similarly toMultiDrawElementsIndirect
, except thatdrawcount
defines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARB
binding point at which a singlesizei
typed value is stored, which contains the draw count.
-
-
-
Field Detail
-
GL_PARAMETER_BUFFER_ARB
Accepted by thetarget
parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData.
-
GL_PARAMETER_BUFFER_BINDING_ARB
Accepted by thevalue
parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev.
-
-
Method Detail
-
glMultiDrawArraysIndirectCountARB
public static void glMultiDrawArraysIndirectCountARB(int mode, java.nio.ByteBuffer indirect, long drawcount, int maxdrawcount, int stride) public static void glMultiDrawArraysIndirectCountARB(int mode, long indirect, long drawcount, int maxdrawcount, int stride) public static void glMultiDrawArraysIndirectCountARB(int mode, java.nio.IntBuffer indirect, long drawcount, int maxdrawcount, int stride)
Behaves similarly toMultiDrawArraysIndirect
, except thatdrawcount
defines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARB
binding point at which a singlesizei
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 atdrawcount
into the buffer is greater thanmaxdrawcount
, an implementation stop processing draws aftermaxdrawcount
parameter sets.drawcount
must be a multiple of four.- Parameters:
mode
- what kind of primitives to render. One of:POINTS
LINE_STRIP
LINE_LOOP
LINES
POLYGON
TRIANGLE_STRIP
TRIANGLE_FAN
TRIANGLES
QUAD_STRIP
QUADS
LINES_ADJACENCY
LINE_STRIP_ADJACENCY
TRIANGLES_ADJACENCY
TRIANGLE_STRIP_ADJACENCY
PATCHES
indirect
- an array of structures containing the draw parametersdrawcount
- the offset into the parameter buffer objectmaxdrawcount
- the maximum number of drawsstride
- the distance in basic machine units between elements of the draw parameter array
-
glMultiDrawElementsIndirectCountARB
public static void glMultiDrawElementsIndirectCountARB(int mode, int type, java.nio.ByteBuffer indirect, long drawcount, int maxdrawcount, int stride) public static void glMultiDrawElementsIndirectCountARB(int mode, int type, long indirect, long drawcount, int maxdrawcount, int stride) public static void glMultiDrawElementsIndirectCountARB(int mode, int type, java.nio.IntBuffer indirect, long drawcount, int maxdrawcount, int stride)
Behaves similarly toMultiDrawElementsIndirect
, except thatdrawcount
defines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARB
binding point at which a singlesizei
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 atdrawcount
into the buffer is greater thanmaxdrawcount
, an implementation stop processing draws aftermaxdrawcount
parameter sets.drawcount
must be a multiple of four.- Parameters:
mode
- what kind of primitives to render. One of:POINTS
LINE_STRIP
LINE_LOOP
LINES
POLYGON
TRIANGLE_STRIP
TRIANGLE_FAN
TRIANGLES
QUAD_STRIP
QUADS
LINES_ADJACENCY
LINE_STRIP_ADJACENCY
TRIANGLES_ADJACENCY
TRIANGLE_STRIP_ADJACENCY
PATCHES
type
- the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:UNSIGNED_BYTE
UNSIGNED_SHORT
UNSIGNED_INT
indirect
- a structure containing an array of draw parametersdrawcount
- the offset into the parameter buffer objectmaxdrawcount
- the maximum number of drawsstride
- the distance in basic machine units between elements of the draw parameter array
-
glMultiDrawArraysIndirectCountARB
public static void glMultiDrawArraysIndirectCountARB(int mode, int[] indirect, long drawcount, int maxdrawcount, int stride)
Array version of:MultiDrawArraysIndirectCountARB
-
glMultiDrawElementsIndirectCountARB
public static void glMultiDrawElementsIndirectCountARB(int mode, int type, int[] indirect, long drawcount, int maxdrawcount, int stride)
Array version of:MultiDrawElementsIndirectCountARB
-
-