Class 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 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 Detail

      • GL_PARAMETER_BUFFER_ARB

        Accepted by the target parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData.
    • 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 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 - what kind of primitives to render. One of:
        POINTSLINE_STRIPLINE_LOOPLINESPOLYGONTRIANGLE_STRIPTRIANGLE_FAN
        TRIANGLESQUAD_STRIPQUADSLINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCY
        PATCHES
        indirect - an array of structures containing the draw parameters
        drawcount - the offset into the parameter buffer object
        maxdrawcount - the maximum number of draws
        stride - 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 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 - what kind of primitives to render. One of:
        POINTSLINE_STRIPLINE_LOOPLINESPOLYGONTRIANGLE_STRIPTRIANGLE_FAN
        TRIANGLESQUAD_STRIPQUADSLINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCY
        PATCHES
        type - the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
        UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
        indirect - a structure containing an array of draw parameters
        drawcount - the offset into the parameter buffer object
        maxdrawcount - the maximum number of draws
        stride - 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)
      • glMultiDrawElementsIndirectCountARB

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