/**
* Find the max index in the given element/index buffer
*/
-static GLuint
-max_buffer_index(GLcontext *ctx, GLuint count, GLenum type,
- const void *indices,
- struct gl_buffer_object *elementBuf)
+GLuint
+_mesa_max_buffer_index(GLcontext *ctx, GLuint count, GLenum type,
+ const void *indices,
+ struct gl_buffer_object *elementBuf)
{
const GLubyte *map = NULL;
GLuint max = 0;
if (ctx->Const.CheckArrayBounds) {
/* find max array index */
- GLuint max = max_buffer_index(ctx, count, type, indices,
- ctx->Array.ElementArrayBufferObj);
+ GLuint max = _mesa_max_buffer_index(ctx, count, type, indices,
+ ctx->Array.ElementArrayBufferObj);
if (max >= ctx->Array.ArrayObj->_MaxElement) {
/* the max element is out of bounds of one or more enabled arrays */
_mesa_warning(ctx, "glDrawElements() index=%u is "
}
if (ctx->Const.CheckArrayBounds) {
- GLuint max = max_buffer_index(ctx, count, type, indices,
- ctx->Array.ElementArrayBufferObj);
+ GLuint max = _mesa_max_buffer_index(ctx, count, type, indices,
+ ctx->Array.ElementArrayBufferObj);
if (max >= ctx->Array.ArrayObj->_MaxElement) {
/* the max element is out of bounds of one or more enabled arrays */
return GL_FALSE;
#include "mtypes.h"
+
+extern GLuint
+_mesa_max_buffer_index(GLcontext *ctx, GLuint count, GLenum type,
+ const void *indices,
+ struct gl_buffer_object *elementBuf);
+
extern GLboolean
_mesa_validate_DrawArrays(GLcontext *ctx,
GLenum mode, GLint start, GLsizei count);