summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-09-21 14:07:35 -0600
committerBrian Paul <brianp@vmware.com>2009-09-21 14:25:39 -0600
commit44d260329efaea2bc844afa42fb1b4f882ab74fd (patch)
tree68f07a47c145b126d70b688f6c975c3fab4e502c
parentff5535c5219047fc56f89c55ee44899d218dc234 (diff)
mesa: make max_buffer_index() a non-static function
-rw-r--r--src/mesa/main/api_validate.c16
-rw-r--r--src/mesa/main/api_validate.h6
2 files changed, 14 insertions, 8 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 2df4f17389..507e21fe81 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -54,10 +54,10 @@ index_bytes(GLenum type, GLsizei count)
/**
* 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;
@@ -179,8 +179,8 @@ _mesa_validate_DrawElements(GLcontext *ctx,
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 "
@@ -251,8 +251,8 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
}
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;
diff --git a/src/mesa/main/api_validate.h b/src/mesa/main/api_validate.h
index 10f0c34e66..ff82a2966c 100644
--- a/src/mesa/main/api_validate.h
+++ b/src/mesa/main/api_validate.h
@@ -30,6 +30,12 @@
#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);