2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
27 #include "api_validate.h"
28 #include "bufferobj.h"
34 #include "transformfeedback.h"
39 * \return number of bytes in array [count] of type.
42 index_bytes(GLenum type
, GLsizei count
)
44 if (type
== GL_UNSIGNED_INT
) {
45 return count
* sizeof(GLuint
);
47 else if (type
== GL_UNSIGNED_BYTE
) {
48 return count
* sizeof(GLubyte
);
51 ASSERT(type
== GL_UNSIGNED_SHORT
);
52 return count
* sizeof(GLushort
);
58 * Check if OK to draw arrays/elements.
61 check_valid_to_render(struct gl_context
*ctx
, const char *function
)
63 if (!_mesa_valid_to_render(ctx
, function
)) {
69 /* For ES2, we can draw if we have a vertex program/shader). */
70 if (!ctx
->VertexProgram
._Current
)
75 /* For OpenGL ES, only draw if we have vertex positions
77 if (!ctx
->Array
.VAO
->VertexAttrib
[VERT_ATTRIB_POS
].Enabled
)
82 /* Section 10.4 (Drawing Commands Using Vertex Arrays) of the OpenGL 4.5
83 * Core Profile spec says:
85 * "An INVALID_OPERATION error is generated if no vertex array
86 * object is bound (see section 10.3.1)."
88 if (ctx
->Array
.VAO
== ctx
->Array
.DefaultVAO
) {
89 _mesa_error(ctx
, GL_INVALID_OPERATION
, "%s(no VAO bound)", function
);
93 case API_OPENGL_COMPAT
: {
94 const struct gl_shader_program
*const vsProg
=
95 ctx
->_Shader
->CurrentProgram
[MESA_SHADER_VERTEX
];
96 const bool haveVertexShader
= (vsProg
&& vsProg
->LinkStatus
);
97 const bool haveVertexProgram
= ctx
->VertexProgram
._Enabled
;
99 if (haveVertexShader
|| haveVertexProgram
) {
100 /* Draw regardless of whether or not we have any vertex arrays.
101 * (Ex: could draw a point using a constant vertex pos)
105 /* Draw if we have vertex positions (GL_VERTEX_ARRAY or generic
108 return (ctx
->Array
.VAO
->VertexAttrib
[VERT_ATTRIB_POS
].Enabled
||
109 ctx
->Array
.VAO
->VertexAttrib
[VERT_ATTRIB_GENERIC0
].Enabled
);
115 unreachable("Invalid API value in check_valid_to_render()");
123 * Is 'mode' a valid value for glBegin(), glDrawArrays(), glDrawElements(),
124 * etc? The set of legal values depends on whether geometry shaders/programs
126 * Note: This may be called during display list compilation.
129 _mesa_is_valid_prim_mode(struct gl_context
*ctx
, GLenum mode
)
137 case GL_TRIANGLE_STRIP
:
138 case GL_TRIANGLE_FAN
:
143 return (ctx
->API
== API_OPENGL_COMPAT
);
144 case GL_LINES_ADJACENCY
:
145 case GL_LINE_STRIP_ADJACENCY
:
146 case GL_TRIANGLES_ADJACENCY
:
147 case GL_TRIANGLE_STRIP_ADJACENCY
:
148 return _mesa_has_geometry_shaders(ctx
);
156 * Is 'mode' a valid value for glBegin(), glDrawArrays(), glDrawElements(),
157 * etc? Also, do additional checking related to transformation feedback.
158 * Note: this function cannot be called during glNewList(GL_COMPILE) because
159 * this code depends on current transform feedback state.
162 _mesa_valid_prim_mode(struct gl_context
*ctx
, GLenum mode
, const char *name
)
164 bool valid_enum
= _mesa_is_valid_prim_mode(ctx
, mode
);
167 _mesa_error(ctx
, GL_INVALID_ENUM
, "%s(mode=%x)", name
, mode
);
171 /* From the ARB_geometry_shader4 spec:
173 * The error INVALID_OPERATION is generated if Begin, or any command that
174 * implicitly calls Begin, is called when a geometry shader is active and:
176 * * the input primitive type of the current geometry shader is
177 * POINTS and <mode> is not POINTS,
179 * * the input primitive type of the current geometry shader is
180 * LINES and <mode> is not LINES, LINE_STRIP, or LINE_LOOP,
182 * * the input primitive type of the current geometry shader is
183 * TRIANGLES and <mode> is not TRIANGLES, TRIANGLE_STRIP or
186 * * the input primitive type of the current geometry shader is
187 * LINES_ADJACENCY_ARB and <mode> is not LINES_ADJACENCY_ARB or
188 * LINE_STRIP_ADJACENCY_ARB, or
190 * * the input primitive type of the current geometry shader is
191 * TRIANGLES_ADJACENCY_ARB and <mode> is not
192 * TRIANGLES_ADJACENCY_ARB or TRIANGLE_STRIP_ADJACENCY_ARB.
195 if (ctx
->_Shader
->CurrentProgram
[MESA_SHADER_GEOMETRY
]) {
196 const GLenum geom_mode
=
197 ctx
->_Shader
->CurrentProgram
[MESA_SHADER_GEOMETRY
]->Geom
.InputType
;
200 valid_enum
= (geom_mode
== GL_POINTS
);
205 valid_enum
= (geom_mode
== GL_LINES
);
208 case GL_TRIANGLE_STRIP
:
209 case GL_TRIANGLE_FAN
:
210 valid_enum
= (geom_mode
== GL_TRIANGLES
);
217 case GL_LINES_ADJACENCY
:
218 case GL_LINE_STRIP_ADJACENCY
:
219 valid_enum
= (geom_mode
== GL_LINES_ADJACENCY
);
221 case GL_TRIANGLES_ADJACENCY
:
222 case GL_TRIANGLE_STRIP_ADJACENCY
:
223 valid_enum
= (geom_mode
== GL_TRIANGLES_ADJACENCY
);
230 _mesa_error(ctx
, GL_INVALID_OPERATION
,
231 "%s(mode=%s vs geometry shader input %s)",
233 _mesa_lookup_prim_by_nr(mode
),
234 _mesa_lookup_prim_by_nr(geom_mode
));
239 /* From the GL_EXT_transform_feedback spec:
241 * "The error INVALID_OPERATION is generated if Begin, or any command
242 * that performs an explicit Begin, is called when:
244 * * a geometry shader is not active and <mode> does not match the
245 * allowed begin modes for the current transform feedback state as
246 * given by table X.1.
248 * * a geometry shader is active and the output primitive type of the
249 * geometry shader does not match the allowed begin modes for the
250 * current transform feedback state as given by table X.1.
253 if (_mesa_is_xfb_active_and_unpaused(ctx
)) {
254 GLboolean pass
= GL_TRUE
;
256 if(ctx
->_Shader
->CurrentProgram
[MESA_SHADER_GEOMETRY
]) {
257 switch (ctx
->_Shader
->CurrentProgram
[MESA_SHADER_GEOMETRY
]->Geom
.OutputType
) {
259 pass
= ctx
->TransformFeedback
.Mode
== GL_POINTS
;
262 pass
= ctx
->TransformFeedback
.Mode
== GL_LINES
;
264 case GL_TRIANGLE_STRIP
:
265 pass
= ctx
->TransformFeedback
.Mode
== GL_TRIANGLES
;
274 pass
= ctx
->TransformFeedback
.Mode
== GL_POINTS
;
279 pass
= ctx
->TransformFeedback
.Mode
== GL_LINES
;
282 pass
= ctx
->TransformFeedback
.Mode
== GL_TRIANGLES
;
287 _mesa_error(ctx
, GL_INVALID_OPERATION
,
288 "%s(mode=%s vs transform feedback %s)",
290 _mesa_lookup_prim_by_nr(mode
),
291 _mesa_lookup_prim_by_nr(ctx
->TransformFeedback
.Mode
));
300 * Verify that the element type is valid.
302 * Generates \c GL_INVALID_ENUM and returns \c false if it is not.
305 valid_elements_type(struct gl_context
*ctx
, GLenum type
, const char *name
)
308 case GL_UNSIGNED_BYTE
:
309 case GL_UNSIGNED_SHORT
:
310 case GL_UNSIGNED_INT
:
314 _mesa_error(ctx
, GL_INVALID_ENUM
, "%s(type = %s)", name
,
315 _mesa_lookup_enum_by_nr(type
));
321 validate_DrawElements_common(struct gl_context
*ctx
,
322 GLenum mode
, GLsizei count
, GLenum type
,
323 const GLvoid
*indices
,
326 /* From the GLES3 specification, section 2.14.2 (Transform Feedback
327 * Primitive Capture):
329 * The error INVALID_OPERATION is also generated by DrawElements,
330 * DrawElementsInstanced, and DrawRangeElements while transform feedback
331 * is active and not paused, regardless of mode.
333 if (_mesa_is_gles3(ctx
) && _mesa_is_xfb_active_and_unpaused(ctx
)) {
334 _mesa_error(ctx
, GL_INVALID_OPERATION
,
335 "%s(transform feedback active)", caller
);
340 _mesa_error(ctx
, GL_INVALID_VALUE
, "%s(count)", caller
);
344 if (!_mesa_valid_prim_mode(ctx
, mode
, caller
)) {
348 if (!valid_elements_type(ctx
, type
, caller
))
351 if (!check_valid_to_render(ctx
, caller
))
354 /* Vertex buffer object tests */
355 if (_mesa_is_bufferobj(ctx
->Array
.VAO
->IndexBufferObj
)) {
356 /* use indices in the buffer object */
357 /* make sure count doesn't go outside buffer bounds */
358 if (index_bytes(type
, count
) > ctx
->Array
.VAO
->IndexBufferObj
->Size
) {
359 _mesa_warning(ctx
, "%s index out of buffer bounds", caller
);
364 /* not using a VBO */
376 * Error checking for glDrawElements(). Includes parameter checking
377 * and VBO bounds checking.
378 * \return GL_TRUE if OK to render, GL_FALSE if error found
381 _mesa_validate_DrawElements(struct gl_context
*ctx
,
382 GLenum mode
, GLsizei count
, GLenum type
,
383 const GLvoid
*indices
)
385 FLUSH_CURRENT(ctx
, 0);
387 return validate_DrawElements_common(ctx
, mode
, count
, type
, indices
,
393 * Error checking for glMultiDrawElements(). Includes parameter checking
394 * and VBO bounds checking.
395 * \return GL_TRUE if OK to render, GL_FALSE if error found
398 _mesa_validate_MultiDrawElements(struct gl_context
*ctx
,
399 GLenum mode
, const GLsizei
*count
,
400 GLenum type
, const GLvoid
* const *indices
,
405 FLUSH_CURRENT(ctx
, 0);
407 for (i
= 0; i
< primcount
; i
++) {
409 _mesa_error(ctx
, GL_INVALID_VALUE
,
410 "glMultiDrawElements(count)" );
415 if (!_mesa_valid_prim_mode(ctx
, mode
, "glMultiDrawElements")) {
419 if (!valid_elements_type(ctx
, type
, "glMultiDrawElements"))
422 if (!check_valid_to_render(ctx
, "glMultiDrawElements"))
425 /* Vertex buffer object tests */
426 if (_mesa_is_bufferobj(ctx
->Array
.VAO
->IndexBufferObj
)) {
427 /* use indices in the buffer object */
428 /* make sure count doesn't go outside buffer bounds */
429 for (i
= 0; i
< primcount
; i
++) {
430 if (index_bytes(type
, count
[i
]) >
431 ctx
->Array
.VAO
->IndexBufferObj
->Size
) {
433 "glMultiDrawElements index out of buffer bounds");
439 /* not using a VBO */
440 for (i
= 0; i
< primcount
; i
++) {
451 * Error checking for glDrawRangeElements(). Includes parameter checking
452 * and VBO bounds checking.
453 * \return GL_TRUE if OK to render, GL_FALSE if error found
456 _mesa_validate_DrawRangeElements(struct gl_context
*ctx
, GLenum mode
,
457 GLuint start
, GLuint end
,
458 GLsizei count
, GLenum type
,
459 const GLvoid
*indices
)
461 FLUSH_CURRENT(ctx
, 0);
464 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDrawRangeElements(end<start)");
468 return validate_DrawElements_common(ctx
, mode
, count
, type
, indices
,
469 "glDrawRangeElements");
474 * Called from the tnl module to error check the function parameters and
475 * verify that we really can draw something.
476 * \return GL_TRUE if OK to render, GL_FALSE if error found
479 _mesa_validate_DrawArrays(struct gl_context
*ctx
, GLenum mode
, GLsizei count
)
481 struct gl_transform_feedback_object
*xfb_obj
482 = ctx
->TransformFeedback
.CurrentObject
;
483 FLUSH_CURRENT(ctx
, 0);
486 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDrawArrays(count)" );
490 if (!_mesa_valid_prim_mode(ctx
, mode
, "glDrawArrays")) {
494 if (!check_valid_to_render(ctx
, "glDrawArrays"))
497 /* From the GLES3 specification, section 2.14.2 (Transform Feedback
498 * Primitive Capture):
500 * The error INVALID_OPERATION is generated by DrawArrays and
501 * DrawArraysInstanced if recording the vertices of a primitive to the
502 * buffer objects being used for transform feedback purposes would result
503 * in either exceeding the limits of any buffer object’s size, or in
504 * exceeding the end position offset + size − 1, as set by
507 * This is in contrast to the behaviour of desktop GL, where the extra
508 * primitives are silently dropped from the transform feedback buffer.
510 if (_mesa_is_gles3(ctx
) && _mesa_is_xfb_active_and_unpaused(ctx
)) {
511 size_t prim_count
= vbo_count_tessellated_primitives(mode
, count
, 1);
512 if (xfb_obj
->GlesRemainingPrims
< prim_count
) {
513 _mesa_error(ctx
, GL_INVALID_OPERATION
,
514 "glDrawArrays(exceeds transform feedback size)");
517 xfb_obj
->GlesRemainingPrims
-= prim_count
;
528 _mesa_validate_DrawArraysInstanced(struct gl_context
*ctx
, GLenum mode
, GLint first
,
529 GLsizei count
, GLsizei numInstances
)
531 struct gl_transform_feedback_object
*xfb_obj
532 = ctx
->TransformFeedback
.CurrentObject
;
533 FLUSH_CURRENT(ctx
, 0);
536 _mesa_error(ctx
, GL_INVALID_VALUE
,
537 "glDrawArraysInstanced(count=%d)", count
);
542 _mesa_error(ctx
, GL_INVALID_VALUE
,
543 "glDrawArraysInstanced(start=%d)", first
);
547 if (!_mesa_valid_prim_mode(ctx
, mode
, "glDrawArraysInstanced")) {
551 if (numInstances
<= 0) {
552 if (numInstances
< 0)
553 _mesa_error(ctx
, GL_INVALID_VALUE
,
554 "glDrawArraysInstanced(numInstances=%d)", numInstances
);
558 if (!check_valid_to_render(ctx
, "glDrawArraysInstanced(invalid to render)"))
561 /* From the GLES3 specification, section 2.14.2 (Transform Feedback
562 * Primitive Capture):
564 * The error INVALID_OPERATION is generated by DrawArrays and
565 * DrawArraysInstanced if recording the vertices of a primitive to the
566 * buffer objects being used for transform feedback purposes would result
567 * in either exceeding the limits of any buffer object’s size, or in
568 * exceeding the end position offset + size − 1, as set by
571 * This is in contrast to the behaviour of desktop GL, where the extra
572 * primitives are silently dropped from the transform feedback buffer.
574 if (_mesa_is_gles3(ctx
) && _mesa_is_xfb_active_and_unpaused(ctx
)) {
576 = vbo_count_tessellated_primitives(mode
, count
, numInstances
);
577 if (xfb_obj
->GlesRemainingPrims
< prim_count
) {
578 _mesa_error(ctx
, GL_INVALID_OPERATION
,
579 "glDrawArraysInstanced(exceeds transform feedback size)");
582 xfb_obj
->GlesRemainingPrims
-= prim_count
;
593 _mesa_validate_DrawElementsInstanced(struct gl_context
*ctx
,
594 GLenum mode
, GLsizei count
, GLenum type
,
595 const GLvoid
*indices
, GLsizei numInstances
)
597 FLUSH_CURRENT(ctx
, 0);
599 if (numInstances
< 0) {
600 _mesa_error(ctx
, GL_INVALID_VALUE
,
601 "glDrawElementsInstanced(numInstances=%d)", numInstances
);
605 return validate_DrawElements_common(ctx
, mode
, count
, type
, indices
,
606 "glDrawElementsInstanced")
607 && (numInstances
> 0);
612 _mesa_validate_DrawTransformFeedback(struct gl_context
*ctx
,
614 struct gl_transform_feedback_object
*obj
,
616 GLsizei numInstances
)
618 FLUSH_CURRENT(ctx
, 0);
620 if (!_mesa_valid_prim_mode(ctx
, mode
, "glDrawTransformFeedback*(mode)")) {
625 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDrawTransformFeedback*(name)");
629 if (stream
>= ctx
->Const
.MaxVertexStreams
) {
630 _mesa_error(ctx
, GL_INVALID_VALUE
,
631 "glDrawTransformFeedbackStream*(index>=MaxVertexStream)");
635 if (!obj
->EndedAnytime
) {
636 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glDrawTransformFeedback*");
640 if (numInstances
<= 0) {
641 if (numInstances
< 0)
642 _mesa_error(ctx
, GL_INVALID_VALUE
,
643 "glDrawTransformFeedback*Instanced(numInstances=%d)",
648 if (!check_valid_to_render(ctx
, "glDrawTransformFeedback*")) {
656 valid_draw_indirect(struct gl_context
*ctx
,
657 GLenum mode
, const GLvoid
*indirect
,
658 GLsizei size
, const char *name
)
660 const GLsizeiptr end
= (GLsizeiptr
)indirect
+ size
;
662 if (!_mesa_valid_prim_mode(ctx
, mode
, name
))
666 /* From the ARB_draw_indirect specification:
667 * "An INVALID_OPERATION error is generated [...] if <indirect> is no
670 if ((GLsizeiptr
)indirect
& (sizeof(GLuint
) - 1)) {
671 _mesa_error(ctx
, GL_INVALID_OPERATION
,
672 "%s(indirect is not aligned)", name
);
676 if (!_mesa_is_bufferobj(ctx
->DrawIndirectBuffer
)) {
677 _mesa_error(ctx
, GL_INVALID_OPERATION
,
678 "%s: no buffer bound to DRAW_INDIRECT_BUFFER", name
);
682 if (_mesa_check_disallowed_mapping(ctx
->DrawIndirectBuffer
)) {
683 _mesa_error(ctx
, GL_INVALID_OPERATION
,
684 "%s(DRAW_INDIRECT_BUFFER is mapped)", name
);
688 /* From the ARB_draw_indirect specification:
689 * "An INVALID_OPERATION error is generated if the commands source data
690 * beyond the end of the buffer object [...]"
692 if (ctx
->DrawIndirectBuffer
->Size
< end
) {
693 _mesa_error(ctx
, GL_INVALID_OPERATION
,
694 "%s(DRAW_INDIRECT_BUFFER too small)", name
);
698 if (!check_valid_to_render(ctx
, name
))
704 static inline GLboolean
705 valid_draw_indirect_elements(struct gl_context
*ctx
,
706 GLenum mode
, GLenum type
, const GLvoid
*indirect
,
707 GLsizeiptr size
, const char *name
)
709 if (!valid_elements_type(ctx
, type
, name
))
713 * Unlike regular DrawElementsInstancedBaseVertex commands, the indices
714 * may not come from a client array and must come from an index buffer.
715 * If no element array buffer is bound, an INVALID_OPERATION error is
718 if (!_mesa_is_bufferobj(ctx
->Array
.VAO
->IndexBufferObj
)) {
719 _mesa_error(ctx
, GL_INVALID_OPERATION
,
720 "%s(no buffer bound to GL_ELEMENT_ARRAY_BUFFER)", name
);
724 return valid_draw_indirect(ctx
, mode
, indirect
, size
, name
);
727 static inline GLboolean
728 valid_draw_indirect_multi(struct gl_context
*ctx
,
729 GLsizei primcount
, GLsizei stride
,
733 /* From the ARB_multi_draw_indirect specification:
734 * "INVALID_VALUE is generated by MultiDrawArraysIndirect or
735 * MultiDrawElementsIndirect if <primcount> is negative."
737 * "<primcount> must be positive, otherwise an INVALID_VALUE error will
741 _mesa_error(ctx
, GL_INVALID_VALUE
, "%s(primcount < 0)", name
);
746 /* From the ARB_multi_draw_indirect specification:
747 * "<stride> must be a multiple of four, otherwise an INVALID_VALUE
748 * error is generated."
751 _mesa_error(ctx
, GL_INVALID_VALUE
, "%s(stride %% 4)", name
);
759 _mesa_validate_DrawArraysIndirect(struct gl_context
*ctx
,
761 const GLvoid
*indirect
)
763 const unsigned drawArraysNumParams
= 4;
765 FLUSH_CURRENT(ctx
, 0);
767 return valid_draw_indirect(ctx
, mode
,
768 indirect
, drawArraysNumParams
* sizeof(GLuint
),
769 "glDrawArraysIndirect");
773 _mesa_validate_DrawElementsIndirect(struct gl_context
*ctx
,
774 GLenum mode
, GLenum type
,
775 const GLvoid
*indirect
)
777 const unsigned drawElementsNumParams
= 5;
779 FLUSH_CURRENT(ctx
, 0);
781 return valid_draw_indirect_elements(ctx
, mode
, type
,
782 indirect
, drawElementsNumParams
* sizeof(GLuint
),
783 "glDrawElementsIndirect");
787 _mesa_validate_MultiDrawArraysIndirect(struct gl_context
*ctx
,
789 const GLvoid
*indirect
,
790 GLsizei primcount
, GLsizei stride
)
793 const unsigned drawArraysNumParams
= 4;
795 FLUSH_CURRENT(ctx
, 0);
797 /* caller has converted stride==0 to drawArraysNumParams * sizeof(GLuint) */
800 if (!valid_draw_indirect_multi(ctx
, primcount
, stride
,
801 "glMultiDrawArraysIndirect"))
804 /* number of bytes of the indirect buffer which will be read */
806 ? (primcount
- 1) * stride
+ drawArraysNumParams
* sizeof(GLuint
)
809 if (!valid_draw_indirect(ctx
, mode
, indirect
, size
,
810 "glMultiDrawArraysIndirect"))
817 _mesa_validate_MultiDrawElementsIndirect(struct gl_context
*ctx
,
818 GLenum mode
, GLenum type
,
819 const GLvoid
*indirect
,
820 GLsizei primcount
, GLsizei stride
)
823 const unsigned drawElementsNumParams
= 5;
825 FLUSH_CURRENT(ctx
, 0);
827 /* caller has converted stride==0 to drawElementsNumParams * sizeof(GLuint) */
830 if (!valid_draw_indirect_multi(ctx
, primcount
, stride
,
831 "glMultiDrawElementsIndirect"))
834 /* number of bytes of the indirect buffer which will be read */
836 ? (primcount
- 1) * stride
+ drawElementsNumParams
* sizeof(GLuint
)
839 if (!valid_draw_indirect_elements(ctx
, mode
, type
,
841 "glMultiDrawElementsIndirect"))