1 /**************************************************************************
3 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * Copyright 2009 VMware, Inc.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sub license, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial portions
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
23 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 **************************************************************************/
29 #include "main/glheader.h"
30 #include "main/context.h"
31 #include "main/state.h"
32 #include "main/api_validate.h"
33 #include "main/api_noop.h"
34 #include "main/varray.h"
35 #include "main/bufferobj.h"
36 #include "glapi/dispatch.h"
38 #include "vbo_context.h"
42 * Compute min and max elements for glDraw[Range]Elements() calls.
45 vbo_get_minmax_index(GLcontext
*ctx
,
46 const struct _mesa_prim
*prim
,
47 const struct _mesa_index_buffer
*ib
,
48 GLuint
*min_index
, GLuint
*max_index
)
51 GLsizei count
= prim
->count
;
54 if (_mesa_is_bufferobj(ib
->obj
)) {
55 const GLvoid
*map
= ctx
->Driver
.MapBuffer(ctx
,
56 GL_ELEMENT_ARRAY_BUFFER_ARB
,
59 indices
= ADD_POINTERS(map
, ib
->ptr
);
65 case GL_UNSIGNED_INT
: {
66 const GLuint
*ui_indices
= (const GLuint
*)indices
;
67 GLuint max_ui
= ui_indices
[count
-1];
68 GLuint min_ui
= ui_indices
[0];
69 for (i
= 0; i
< count
; i
++) {
70 if (ui_indices
[i
] > max_ui
) max_ui
= ui_indices
[i
];
71 if (ui_indices
[i
] < min_ui
) min_ui
= ui_indices
[i
];
77 case GL_UNSIGNED_SHORT
: {
78 const GLushort
*us_indices
= (const GLushort
*)indices
;
79 GLuint max_us
= us_indices
[count
-1];
80 GLuint min_us
= us_indices
[0];
81 for (i
= 0; i
< count
; i
++) {
82 if (us_indices
[i
] > max_us
) max_us
= us_indices
[i
];
83 if (us_indices
[i
] < min_us
) min_us
= us_indices
[i
];
89 case GL_UNSIGNED_BYTE
: {
90 const GLubyte
*ub_indices
= (const GLubyte
*)indices
;
91 GLuint max_ub
= ub_indices
[count
-1];
92 GLuint min_ub
= ub_indices
[0];
93 for (i
= 0; i
< count
; i
++) {
94 if (ub_indices
[i
] > max_ub
) max_ub
= ub_indices
[i
];
95 if (ub_indices
[i
] < min_ub
) min_ub
= ub_indices
[i
];
106 if (_mesa_is_bufferobj(ib
->obj
)) {
107 ctx
->Driver
.UnmapBuffer(ctx
,
108 GL_ELEMENT_ARRAY_BUFFER_ARB
,
115 * Check that element 'j' of the array has reasonable data.
119 check_array_data(GLcontext
*ctx
, struct gl_client_array
*array
,
120 GLuint attrib
, GLuint j
)
122 if (array
->Enabled
) {
123 const void *data
= array
->Ptr
;
124 if (_mesa_is_bufferobj(array
->BufferObj
)) {
125 if (!array
->BufferObj
->Pointer
) {
126 /* need to map now */
127 array
->BufferObj
->Pointer
= ctx
->Driver
.MapBuffer(ctx
,
132 data
= ADD_POINTERS(data
, array
->BufferObj
->Pointer
);
134 switch (array
->Type
) {
137 GLfloat
*f
= (GLfloat
*) ((GLubyte
*) data
+ array
->StrideB
* j
);
139 for (k
= 0; k
< array
->Size
; k
++) {
140 if (IS_INF_OR_NAN(f
[k
]) ||
141 f
[k
] >= 1.0e20
|| f
[k
] <= -1.0e10
) {
142 _mesa_printf("Bad array data:\n");
143 _mesa_printf(" Element[%u].%u = %f\n", j
, k
, f
[k
]);
144 _mesa_printf(" Array %u at %p\n", attrib
, (void* ) array
);
145 _mesa_printf(" Type 0x%x, Size %d, Stride %d\n",
146 array
->Type
, array
->Size
, array
->Stride
);
147 _mesa_printf(" Address/offset %p in Buffer Object %u\n",
148 array
->Ptr
, array
->BufferObj
->Name
);
149 f
[k
] = 1.0; /* XXX replace the bad value! */
151 //assert(!IS_INF_OR_NAN(f[k]));
163 * Unmap the buffer object referenced by given array, if mapped.
166 unmap_array_buffer(GLcontext
*ctx
, struct gl_client_array
*array
)
168 if (array
->Enabled
&&
169 _mesa_is_bufferobj(array
->BufferObj
) &&
170 _mesa_bufferobj_mapped(array
->BufferObj
)) {
171 ctx
->Driver
.UnmapBuffer(ctx
,
179 * Examine the array's data for NaNs, etc.
182 check_draw_elements_data(GLcontext
*ctx
, GLsizei count
, GLenum elemType
,
183 const void *elements
)
185 struct gl_array_object
*arrayObj
= ctx
->Array
.ArrayObj
;
189 if (_mesa_is_bufferobj(ctx
->Array
.ElementArrayBufferObj
)) {
190 elemMap
= ctx
->Driver
.MapBuffer(ctx
,
191 GL_ELEMENT_ARRAY_BUFFER_ARB
,
193 ctx
->Array
.ElementArrayBufferObj
);
194 elements
= ADD_POINTERS(elements
, elemMap
);
197 for (i
= 0; i
< count
; i
++) {
202 case GL_UNSIGNED_BYTE
:
203 j
= ((const GLubyte
*) elements
)[i
];
205 case GL_UNSIGNED_SHORT
:
206 j
= ((const GLushort
*) elements
)[i
];
208 case GL_UNSIGNED_INT
:
209 j
= ((const GLuint
*) elements
)[i
];
215 /* check element j of each enabled array */
216 check_array_data(ctx
, &arrayObj
->Vertex
, VERT_ATTRIB_POS
, j
);
217 check_array_data(ctx
, &arrayObj
->Normal
, VERT_ATTRIB_NORMAL
, j
);
218 check_array_data(ctx
, &arrayObj
->Color
, VERT_ATTRIB_COLOR0
, j
);
219 check_array_data(ctx
, &arrayObj
->SecondaryColor
, VERT_ATTRIB_COLOR1
, j
);
220 for (k
= 0; k
< Elements(arrayObj
->TexCoord
); k
++) {
221 check_array_data(ctx
, &arrayObj
->TexCoord
[k
], VERT_ATTRIB_TEX0
+ k
, j
);
223 for (k
= 0; k
< Elements(arrayObj
->VertexAttrib
); k
++) {
224 check_array_data(ctx
, &arrayObj
->VertexAttrib
[k
], VERT_ATTRIB_GENERIC0
+ k
, j
);
228 if (_mesa_is_bufferobj(ctx
->Array
.ElementArrayBufferObj
)) {
229 ctx
->Driver
.UnmapBuffer(ctx
,
230 GL_ELEMENT_ARRAY_BUFFER_ARB
,
231 ctx
->Array
.ElementArrayBufferObj
);
234 unmap_array_buffer(ctx
, &arrayObj
->Vertex
);
235 unmap_array_buffer(ctx
, &arrayObj
->Normal
);
236 unmap_array_buffer(ctx
, &arrayObj
->Color
);
237 for (k
= 0; k
< Elements(arrayObj
->TexCoord
); k
++) {
238 unmap_array_buffer(ctx
, &arrayObj
->TexCoord
[k
]);
240 for (k
= 0; k
< Elements(arrayObj
->VertexAttrib
); k
++) {
241 unmap_array_buffer(ctx
, &arrayObj
->VertexAttrib
[k
]);
247 * Check array data, looking for NaNs, etc.
250 check_draw_arrays_data(GLcontext
*ctx
, GLint start
, GLsizei count
)
257 * Print info/data for glDrawArrays().
260 print_draw_arrays(GLcontext
*ctx
, struct vbo_exec_context
*exec
,
261 GLenum mode
, GLint start
, GLsizei count
)
265 _mesa_printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
268 for (i
= 0; i
< 32; i
++) {
269 GLuint bufName
= exec
->array
.inputs
[i
]->BufferObj
->Name
;
270 GLint stride
= exec
->array
.inputs
[i
]->Stride
;
271 _mesa_printf("attr %2d: size %d stride %d enabled %d "
272 "ptr %p Bufobj %u\n",
274 exec
->array
.inputs
[i
]->Size
,
276 /*exec->array.inputs[i]->Enabled,*/
277 exec
->array
.legacy_array
[i
]->Enabled
,
278 exec
->array
.inputs
[i
]->Ptr
,
282 struct gl_buffer_object
*buf
= _mesa_lookup_bufferobj(ctx
, bufName
);
283 GLubyte
*p
= ctx
->Driver
.MapBuffer(ctx
, GL_ARRAY_BUFFER_ARB
,
284 GL_READ_ONLY_ARB
, buf
);
285 int offset
= (int) (GLintptr
) exec
->array
.inputs
[i
]->Ptr
;
286 float *f
= (float *) (p
+ offset
);
289 int n
= (count
* stride
) / 4;
292 _mesa_printf(" Data at offset %d:\n", offset
);
293 for (i
= 0; i
< n
; i
++) {
294 _mesa_printf(" float[%d] = 0x%08x %f\n", i
, k
[i
], f
[i
]);
296 ctx
->Driver
.UnmapBuffer(ctx
, GL_ARRAY_BUFFER_ARB
, buf
);
303 * Just translate the arrayobj into a sane layout.
306 bind_array_obj(GLcontext
*ctx
)
308 struct vbo_context
*vbo
= vbo_context(ctx
);
309 struct vbo_exec_context
*exec
= &vbo
->exec
;
310 struct gl_array_object
*arrayObj
= ctx
->Array
.ArrayObj
;
313 /* TODO: Fix the ArrayObj struct to keep legacy arrays in an array
314 * rather than as individual named arrays. Then this function can
317 exec
->array
.legacy_array
[VERT_ATTRIB_POS
] = &arrayObj
->Vertex
;
318 exec
->array
.legacy_array
[VERT_ATTRIB_WEIGHT
] = &arrayObj
->Weight
;
319 exec
->array
.legacy_array
[VERT_ATTRIB_NORMAL
] = &arrayObj
->Normal
;
320 exec
->array
.legacy_array
[VERT_ATTRIB_COLOR0
] = &arrayObj
->Color
;
321 exec
->array
.legacy_array
[VERT_ATTRIB_COLOR1
] = &arrayObj
->SecondaryColor
;
322 exec
->array
.legacy_array
[VERT_ATTRIB_FOG
] = &arrayObj
->FogCoord
;
323 exec
->array
.legacy_array
[VERT_ATTRIB_COLOR_INDEX
] = &arrayObj
->Index
;
324 if (arrayObj
->PointSize
.Enabled
) {
325 /* this aliases COLOR_INDEX */
326 exec
->array
.legacy_array
[VERT_ATTRIB_POINT_SIZE
] = &arrayObj
->PointSize
;
328 exec
->array
.legacy_array
[VERT_ATTRIB_EDGEFLAG
] = &arrayObj
->EdgeFlag
;
330 for (i
= 0; i
< Elements(arrayObj
->TexCoord
); i
++)
331 exec
->array
.legacy_array
[VERT_ATTRIB_TEX0
+ i
] = &arrayObj
->TexCoord
[i
];
333 for (i
= 0; i
< Elements(arrayObj
->VertexAttrib
); i
++) {
334 assert(i
< Elements(exec
->array
.generic_array
));
335 exec
->array
.generic_array
[i
] = &arrayObj
->VertexAttrib
[i
];
338 exec
->array
.array_obj
= arrayObj
->Name
;
343 recalculate_input_bindings(GLcontext
*ctx
)
345 struct vbo_context
*vbo
= vbo_context(ctx
);
346 struct vbo_exec_context
*exec
= &vbo
->exec
;
347 const struct gl_client_array
**inputs
= &exec
->array
.inputs
[0];
348 GLbitfield const_inputs
= 0x0;
351 exec
->array
.program_mode
= get_program_mode(ctx
);
352 exec
->array
.enabled_flags
= ctx
->Array
.ArrayObj
->_Enabled
;
354 switch (exec
->array
.program_mode
) {
356 /* When no vertex program is active (or the vertex program is generated
357 * from fixed-function state). We put the material values into the
358 * generic slots. This is the only situation where material values
359 * are available as per-vertex attributes.
361 for (i
= 0; i
<= VERT_ATTRIB_TEX7
; i
++) {
362 if (exec
->array
.legacy_array
[i
]->Enabled
)
363 inputs
[i
] = exec
->array
.legacy_array
[i
];
365 inputs
[i
] = &vbo
->legacy_currval
[i
];
366 const_inputs
|= 1 << i
;
370 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
371 inputs
[VERT_ATTRIB_GENERIC0
+ i
] = &vbo
->mat_currval
[i
];
372 const_inputs
|= 1 << (VERT_ATTRIB_GENERIC0
+ i
);
375 /* Could use just about anything, just to fill in the empty
378 for (i
= MAT_ATTRIB_MAX
; i
< VERT_ATTRIB_MAX
- VERT_ATTRIB_GENERIC0
; i
++) {
379 inputs
[VERT_ATTRIB_GENERIC0
+ i
] = &vbo
->generic_currval
[i
];
380 const_inputs
|= 1 << (VERT_ATTRIB_GENERIC0
+ i
);
385 /* NV_vertex_program - attribute arrays alias and override
386 * conventional, legacy arrays. No materials, and the generic
389 for (i
= 0; i
<= VERT_ATTRIB_TEX7
; i
++) {
390 if (exec
->array
.generic_array
[i
]->Enabled
)
391 inputs
[i
] = exec
->array
.generic_array
[i
];
392 else if (exec
->array
.legacy_array
[i
]->Enabled
)
393 inputs
[i
] = exec
->array
.legacy_array
[i
];
395 inputs
[i
] = &vbo
->legacy_currval
[i
];
396 const_inputs
|= 1 << i
;
400 /* Could use just about anything, just to fill in the empty
403 for (i
= VERT_ATTRIB_GENERIC0
; i
< VERT_ATTRIB_MAX
; i
++) {
404 inputs
[i
] = &vbo
->generic_currval
[i
- VERT_ATTRIB_GENERIC0
];
405 const_inputs
|= 1 << i
;
410 /* GL_ARB_vertex_program or GLSL vertex shader - Only the generic[0]
411 * attribute array aliases and overrides the legacy position array.
413 * Otherwise, legacy attributes available in the legacy slots,
414 * generic attributes in the generic slots and materials are not
415 * available as per-vertex attributes.
417 if (exec
->array
.generic_array
[0]->Enabled
)
418 inputs
[0] = exec
->array
.generic_array
[0];
419 else if (exec
->array
.legacy_array
[0]->Enabled
)
420 inputs
[0] = exec
->array
.legacy_array
[0];
422 inputs
[0] = &vbo
->legacy_currval
[0];
423 const_inputs
|= 1 << 0;
426 for (i
= 1; i
<= VERT_ATTRIB_TEX7
; i
++) {
427 if (exec
->array
.legacy_array
[i
]->Enabled
)
428 inputs
[i
] = exec
->array
.legacy_array
[i
];
430 inputs
[i
] = &vbo
->legacy_currval
[i
];
431 const_inputs
|= 1 << i
;
435 for (i
= 0; i
< MAX_VERTEX_GENERIC_ATTRIBS
; i
++) {
436 if (exec
->array
.generic_array
[i
]->Enabled
)
437 inputs
[VERT_ATTRIB_GENERIC0
+ i
] = exec
->array
.generic_array
[i
];
439 inputs
[VERT_ATTRIB_GENERIC0
+ i
] = &vbo
->generic_currval
[i
];
440 const_inputs
|= 1 << (VERT_ATTRIB_GENERIC0
+ i
);
447 _mesa_set_varying_vp_inputs( ctx
, ~const_inputs
);
452 bind_arrays(GLcontext
*ctx
)
455 if (ctx
->Array
.ArrayObj
.Name
!= exec
->array
.array_obj
) {
457 recalculate_input_bindings(ctx
);
459 else if (exec
->array
.program_mode
!= get_program_mode(ctx
) ||
460 exec
->array
.enabled_flags
!= ctx
->Array
.ArrayObj
->_Enabled
) {
462 recalculate_input_bindings(ctx
);
466 recalculate_input_bindings(ctx
);
472 /***********************************************************************
476 static void GLAPIENTRY
477 vbo_exec_DrawArrays(GLenum mode
, GLint start
, GLsizei count
)
479 GET_CURRENT_CONTEXT(ctx
);
480 struct vbo_context
*vbo
= vbo_context(ctx
);
481 struct vbo_exec_context
*exec
= &vbo
->exec
;
482 struct _mesa_prim prim
[1];
484 if (!_mesa_validate_DrawArrays( ctx
, mode
, start
, count
))
487 FLUSH_CURRENT( ctx
, 0 );
490 _mesa_update_state( ctx
);
492 if (!vbo_validate_shaders(ctx
)) {
493 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glDrawArrays(bad shader)");
498 check_draw_arrays_data(ctx
, start
, count
);
500 (void) check_draw_arrays_data
;
505 /* Again... because we may have changed the bitmask of per-vertex varying
506 * attributes. If we regenerate the fixed-function vertex program now
507 * we may be able to prune down the number of vertex attributes which we
508 * need in the shader.
511 _mesa_update_state( ctx
);
518 prim
[0].start
= start
;
519 prim
[0].count
= count
;
522 vbo
->draw_prims( ctx
, exec
->array
.inputs
, prim
, 1, NULL
,
523 GL_TRUE
, start
, start
+ count
- 1 );
526 print_draw_arrays(ctx
, exec
, mode
, start
, count
);
528 (void) print_draw_arrays
;
534 * Map GL_ELEMENT_ARRAY_BUFFER and print contents.
537 dump_element_buffer(GLcontext
*ctx
, GLenum type
)
539 const GLvoid
*map
= ctx
->Driver
.MapBuffer(ctx
,
540 GL_ELEMENT_ARRAY_BUFFER_ARB
,
542 ctx
->Array
.ElementArrayBufferObj
);
544 case GL_UNSIGNED_BYTE
:
546 const GLubyte
*us
= (const GLubyte
*) map
;
548 for (i
= 0; i
< ctx
->Array
.ElementArrayBufferObj
->Size
; i
++) {
549 _mesa_printf("%02x ", us
[i
]);
556 case GL_UNSIGNED_SHORT
:
558 const GLushort
*us
= (const GLushort
*) map
;
560 for (i
= 0; i
< ctx
->Array
.ElementArrayBufferObj
->Size
/ 2; i
++) {
561 _mesa_printf("%04x ", us
[i
]);
568 case GL_UNSIGNED_INT
:
570 const GLuint
*us
= (const GLuint
*) map
;
572 for (i
= 0; i
< ctx
->Array
.ElementArrayBufferObj
->Size
/ 4; i
++) {
573 _mesa_printf("%08x ", us
[i
]);
584 ctx
->Driver
.UnmapBuffer(ctx
,
585 GL_ELEMENT_ARRAY_BUFFER_ARB
,
586 ctx
->Array
.ElementArrayBufferObj
);
589 /* Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements */
591 vbo_validated_drawrangeelements(GLcontext
*ctx
, GLenum mode
,
592 GLboolean index_bounds_valid
,
593 GLuint start
, GLuint end
,
594 GLsizei count
, GLenum type
,
595 const GLvoid
*indices
)
597 struct vbo_context
*vbo
= vbo_context(ctx
);
598 struct vbo_exec_context
*exec
= &vbo
->exec
;
599 struct _mesa_index_buffer ib
;
600 struct _mesa_prim prim
[1];
602 FLUSH_CURRENT( ctx
, 0 );
605 _mesa_update_state( ctx
);
607 if (!vbo_validate_shaders(ctx
)) {
608 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glDrawRangeElements(bad shader)");
613 _mesa_update_state( ctx
);
619 ib
.obj
= ctx
->Array
.ElementArrayBufferObj
;
628 prim
[0].count
= count
;
631 /* Need to give special consideration to rendering a range of
632 * indices starting somewhere above zero. Typically the
633 * application is issuing multiple DrawRangeElements() to draw
634 * successive primitives layed out linearly in the vertex arrays.
635 * Unless the vertex arrays are all in a VBO (or locked as with
636 * CVA), the OpenGL semantics imply that we need to re-read or
637 * re-upload the vertex data on each draw call.
639 * In the case of hardware tnl, we want to avoid starting the
640 * upload at zero, as it will mean every draw call uploads an
641 * increasing amount of not-used vertex data. Worse - in the
642 * software tnl module, all those vertices might be transformed and
643 * lit but never rendered.
645 * If we just upload or transform the vertices in start..end,
646 * however, the indices will be incorrect.
648 * At this level, we don't know exactly what the requirements of
649 * the backend are going to be, though it will likely boil down to
652 * 1) Do nothing, everything is in a VBO and is processed once
655 * 2) Adjust the indices and vertex arrays so that start becomes
658 * Rather than doing anything here, I'll provide a helper function
659 * for the latter case elsewhere.
662 vbo
->draw_prims( ctx
, exec
->array
.inputs
, prim
, 1, &ib
,
663 index_bounds_valid
, start
, end
);
666 static void GLAPIENTRY
667 vbo_exec_DrawRangeElements(GLenum mode
,
668 GLuint start
, GLuint end
,
669 GLsizei count
, GLenum type
, const GLvoid
*indices
)
671 GET_CURRENT_CONTEXT(ctx
);
673 if (!_mesa_validate_DrawRangeElements( ctx
, mode
, start
, end
, count
,
677 if (end
>= ctx
->Array
.ArrayObj
->_MaxElement
) {
678 /* the max element is out of bounds of one or more enabled arrays */
679 _mesa_warning(ctx
, "glDraw[Range]Elements(start %u, end %u, count %d, "
680 "type 0x%x, indices=%p)\n"
681 "\tindex=%u is out of bounds (max=%u) "
682 "Element Buffer %u (size %d)",
683 start
, end
, count
, type
, indices
, end
,
684 ctx
->Array
.ArrayObj
->_MaxElement
- 1,
685 ctx
->Array
.ElementArrayBufferObj
->Name
,
686 ctx
->Array
.ElementArrayBufferObj
->Size
);
689 dump_element_buffer(ctx
, type
);
692 _mesa_print_arrays(ctx
);
696 _mesa_printf("glDraw[Range]Elements"
697 "(start %u, end %u, type 0x%x, count %d) ElemBuf %u\n",
698 start
, end
, type
, count
,
699 ctx
->Array
.ElementArrayBufferObj
->Name
);
703 check_draw_elements_data(ctx
, count
, type
, indices
);
705 (void) check_draw_elements_data
;
708 vbo_validated_drawrangeelements(ctx
, mode
, GL_TRUE
, start
, end
,
709 count
, type
, indices
);
713 static void GLAPIENTRY
714 vbo_exec_DrawElements(GLenum mode
, GLsizei count
, GLenum type
,
715 const GLvoid
*indices
)
717 GET_CURRENT_CONTEXT(ctx
);
719 if (!_mesa_validate_DrawElements( ctx
, mode
, count
, type
, indices
))
722 vbo_validated_drawrangeelements(ctx
, mode
, GL_FALSE
, ~0, ~0,
723 count
, type
, indices
);
727 /***********************************************************************
732 vbo_exec_array_init( struct vbo_exec_context
*exec
)
735 exec
->vtxfmt
.DrawArrays
= vbo_exec_DrawArrays
;
736 exec
->vtxfmt
.DrawElements
= vbo_exec_DrawElements
;
737 exec
->vtxfmt
.DrawRangeElements
= vbo_exec_DrawRangeElements
;
739 exec
->vtxfmt
.DrawArrays
= _mesa_noop_DrawArrays
;
740 exec
->vtxfmt
.DrawElements
= _mesa_noop_DrawElements
;
741 exec
->vtxfmt
.DrawRangeElements
= _mesa_noop_DrawRangeElements
;
747 vbo_exec_array_destroy( struct vbo_exec_context
*exec
)
753 /* This API entrypoint is not ordinarily used */
755 _mesa_DrawArrays(GLenum mode
, GLint first
, GLsizei count
)
757 vbo_exec_DrawArrays(mode
, first
, count
);
761 /* This API entrypoint is not ordinarily used */
763 _mesa_DrawElements(GLenum mode
, GLsizei count
, GLenum type
,
764 const GLvoid
*indices
)
766 vbo_exec_DrawElements(mode
, count
, type
, indices
);
770 /* This API entrypoint is not ordinarily used */
772 _mesa_DrawRangeElements(GLenum mode
, GLuint start
, GLuint end
, GLsizei count
,
773 GLenum type
, const GLvoid
*indices
)
775 vbo_exec_DrawRangeElements(mode
, start
, end
, count
, type
, indices
);