Class ARBIndirectParameters
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
FieldsModifier and TypeFieldDescriptionstatic final intAccepted by thetargetparameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData.static final intAccepted by thevalueparameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidglMultiDrawArraysIndirectCountARB(int mode, int[] indirect, long drawcount, int maxdrawcount, int stride) Array version of:MultiDrawArraysIndirectCountARBstatic voidglMultiDrawArraysIndirectCountARB(int mode, long indirect, long drawcount, int maxdrawcount, int stride) Behaves similarly toMultiDrawArraysIndirect, except thatdrawcountdefines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARBbinding point at which a singlesizeityped value is stored, which contains the draw count.static voidglMultiDrawArraysIndirectCountARB(int mode, ByteBuffer indirect, long drawcount, int maxdrawcount, int stride) Behaves similarly toMultiDrawArraysIndirect, except thatdrawcountdefines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARBbinding point at which a singlesizeityped value is stored, which contains the draw count.static voidglMultiDrawArraysIndirectCountARB(int mode, IntBuffer indirect, long drawcount, int maxdrawcount, int stride) Behaves similarly toMultiDrawArraysIndirect, except thatdrawcountdefines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARBbinding point at which a singlesizeityped value is stored, which contains the draw count.static voidglMultiDrawElementsIndirectCountARB(int mode, int type, int[] indirect, long drawcount, int maxdrawcount, int stride) Array version of:MultiDrawElementsIndirectCountARBstatic voidglMultiDrawElementsIndirectCountARB(int mode, int type, long indirect, long drawcount, int maxdrawcount, int stride) Behaves similarly toMultiDrawElementsIndirect, except thatdrawcountdefines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARBbinding point at which a singlesizeityped value is stored, which contains the draw count.static voidglMultiDrawElementsIndirectCountARB(int mode, int type, ByteBuffer indirect, long drawcount, int maxdrawcount, int stride) Behaves similarly toMultiDrawElementsIndirect, except thatdrawcountdefines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARBbinding point at which a singlesizeityped value is stored, which contains the draw count.static voidglMultiDrawElementsIndirectCountARB(int mode, int type, IntBuffer indirect, long drawcount, int maxdrawcount, int stride) Behaves similarly toMultiDrawElementsIndirect, except thatdrawcountdefines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARBbinding point at which a singlesizeityped value is stored, which contains the draw count.static voidnglMultiDrawArraysIndirectCountARB(int mode, long indirect, long drawcount, int maxdrawcount, int stride) Unsafe version of:MultiDrawArraysIndirectCountARBstatic voidnglMultiDrawElementsIndirectCountARB(int mode, int type, long indirect, long drawcount, int maxdrawcount, int stride) Unsafe version of:MultiDrawElementsIndirectCountARB
-
Field Details
-
GL_PARAMETER_BUFFER_ARB
public static final int GL_PARAMETER_BUFFER_ARBAccepted by thetargetparameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData.- See Also:
-
GL_PARAMETER_BUFFER_BINDING_ARB
public static final int GL_PARAMETER_BUFFER_BINDING_ARBAccepted by thevalueparameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev.- See Also:
-
-
Method Details
-
nglMultiDrawArraysIndirectCountARB
public static void nglMultiDrawArraysIndirectCountARB(int mode, long indirect, long drawcount, int maxdrawcount, int stride) Unsafe version of:MultiDrawArraysIndirectCountARB -
glMultiDrawArraysIndirectCountARB
public static void glMultiDrawArraysIndirectCountARB(int mode, ByteBuffer indirect, long drawcount, int maxdrawcount, int stride) Behaves similarly toMultiDrawArraysIndirect, except thatdrawcountdefines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARBbinding point at which a singlesizeityped value is stored, which contains the draw count.maxdrawcountspecifies the maximum number of draws that are expected to be stored in the buffer. If the value stored atdrawcountinto the buffer is greater thanmaxdrawcount, an implementation stop processing draws aftermaxdrawcountparameter sets.drawcountmust be a multiple of four.- Parameters:
mode- what kind of primitives to render. One of:POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLESLINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADSQUAD_STRIPindirect- 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
-
glMultiDrawArraysIndirectCountARB
public static void glMultiDrawArraysIndirectCountARB(int mode, long indirect, long drawcount, int maxdrawcount, int stride) Behaves similarly toMultiDrawArraysIndirect, except thatdrawcountdefines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARBbinding point at which a singlesizeityped value is stored, which contains the draw count.maxdrawcountspecifies the maximum number of draws that are expected to be stored in the buffer. If the value stored atdrawcountinto the buffer is greater thanmaxdrawcount, an implementation stop processing draws aftermaxdrawcountparameter sets.drawcountmust be a multiple of four.- Parameters:
mode- what kind of primitives to render. One of:POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLESLINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADSQUAD_STRIPindirect- 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
-
glMultiDrawArraysIndirectCountARB
public static void glMultiDrawArraysIndirectCountARB(int mode, IntBuffer indirect, long drawcount, int maxdrawcount, int stride) Behaves similarly toMultiDrawArraysIndirect, except thatdrawcountdefines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARBbinding point at which a singlesizeityped value is stored, which contains the draw count.maxdrawcountspecifies the maximum number of draws that are expected to be stored in the buffer. If the value stored atdrawcountinto the buffer is greater thanmaxdrawcount, an implementation stop processing draws aftermaxdrawcountparameter sets.drawcountmust be a multiple of four.- Parameters:
mode- what kind of primitives to render. One of:POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLESLINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADSQUAD_STRIPindirect- 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
-
nglMultiDrawElementsIndirectCountARB
public static void nglMultiDrawElementsIndirectCountARB(int mode, int type, long indirect, long drawcount, int maxdrawcount, int stride) Unsafe version of:MultiDrawElementsIndirectCountARB -
glMultiDrawElementsIndirectCountARB
public static void glMultiDrawElementsIndirectCountARB(int mode, int type, ByteBuffer indirect, long drawcount, int maxdrawcount, int stride) Behaves similarly toMultiDrawElementsIndirect, except thatdrawcountdefines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARBbinding point at which a singlesizeityped value is stored, which contains the draw count.maxdrawcountspecifies the maximum number of draws that are expected to be stored in the buffer. If the value stored atdrawcountinto the buffer is greater thanmaxdrawcount, an implementation stop processing draws aftermaxdrawcountparameter sets.drawcountmust be a multiple of four.- Parameters:
mode- what kind of primitives to render. One of:POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLESLINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADSQUAD_STRIPtype- the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INTindirect- 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
-
glMultiDrawElementsIndirectCountARB
public static void glMultiDrawElementsIndirectCountARB(int mode, int type, long indirect, long drawcount, int maxdrawcount, int stride) Behaves similarly toMultiDrawElementsIndirect, except thatdrawcountdefines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARBbinding point at which a singlesizeityped value is stored, which contains the draw count.maxdrawcountspecifies the maximum number of draws that are expected to be stored in the buffer. If the value stored atdrawcountinto the buffer is greater thanmaxdrawcount, an implementation stop processing draws aftermaxdrawcountparameter sets.drawcountmust be a multiple of four.- Parameters:
mode- what kind of primitives to render. One of:POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLESLINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADSQUAD_STRIPtype- the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INTindirect- 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
-
glMultiDrawElementsIndirectCountARB
public static void glMultiDrawElementsIndirectCountARB(int mode, int type, IntBuffer indirect, long drawcount, int maxdrawcount, int stride) Behaves similarly toMultiDrawElementsIndirect, except thatdrawcountdefines an offset (in bytes) into the buffer object bound to thePARAMETER_BUFFER_ARBbinding point at which a singlesizeityped value is stored, which contains the draw count.maxdrawcountspecifies the maximum number of draws that are expected to be stored in the buffer. If the value stored atdrawcountinto the buffer is greater thanmaxdrawcount, an implementation stop processing draws aftermaxdrawcountparameter sets.drawcountmust be a multiple of four.- Parameters:
mode- what kind of primitives to render. One of:POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLESLINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADSQUAD_STRIPtype- the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INTindirect- 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
-