Class ARBIndirectParameters
- java.lang.Object
-
- org.lwjgl.opengl.ARBIndirectParameters
-
public class ARBIndirectParameters extends java.lang.ObjectNative bindings to the ARB_indirect_parameters extension.OpenGL 4.3 (with the introduction of the
ARB_multi_draw_indirectextension) 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
MultiDrawArraysIndirectandMultiDrawElementsIndirectare 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 intGL_PARAMETER_BUFFER_ARBAccepted by thetargetparameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData.static intGL_PARAMETER_BUFFER_BINDING_ARBAccepted by thevalueparameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidglMultiDrawArraysIndirectCountARB(int mode, java.nio.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, int[] indirect, long drawcount, int maxdrawcount, int stride)Array version of:MultiDrawArraysIndirectCountARBstatic voidglMultiDrawArraysIndirectCountARB(int mode, java.nio.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 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 voidglMultiDrawElementsIndirectCountARB(int mode, int type, java.nio.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, int[] indirect, long drawcount, int maxdrawcount, int stride)Array version of:MultiDrawElementsIndirectCountARBstatic voidglMultiDrawElementsIndirectCountARB(int mode, int type, java.nio.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 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.
-
-
-
Field Detail
-
GL_PARAMETER_BUFFER_ARB
Accepted by thetargetparameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData.
-
GL_PARAMETER_BUFFER_BINDING_ARB
Accepted by thevalueparameter 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 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_LOOPLINESPOLYGONTRIANGLE_STRIPTRIANGLE_FANTRIANGLESQUAD_STRIPQUADSLINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESindirect- 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 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_LOOPLINESPOLYGONTRIANGLE_STRIPTRIANGLE_FANTRIANGLESQUAD_STRIPQUADSLINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHEStype- 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
-
-