summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-03-05 12:32:32 -0700
committerBrian Paul <brianp@vmware.com>2010-03-05 13:28:18 -0700
commite9968ebfa40b4740601c1596950ebd3f168664b0 (patch)
treec002323872239d060db7512bc250927100a39424
parentf846a008e9e63f01bc673e31efd0d6b22e4eb0b9 (diff)
mesa: minor reformatting, new comments
-rw-r--r--src/mesa/main/api_validate.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index e9359dbe5f..4fb7b5ad61 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -123,6 +123,12 @@ check_valid_to_render(GLcontext *ctx, const char *function)
return GL_TRUE;
}
+
+/**
+ * Do bounds checking on array element indexes. Check that the vertices
+ * pointed to by the indices don't lie outside buffer object bounds.
+ * \return GL_TRUE if OK, GL_FALSE if any indexed vertex goes is out of bounds
+ */
static GLboolean
check_index_bounds(GLcontext *ctx, GLsizei count, GLenum type,
const GLvoid *indices, GLint basevertex)
@@ -150,14 +156,15 @@ check_index_bounds(GLcontext *ctx, GLsizei count, GLenum type,
if ((int)(min + basevertex) < 0 ||
max + basevertex > ctx->Array.ArrayObj->_MaxElement) {
/* the max element is out of bounds of one or more enabled arrays */
- _mesa_warning(ctx, "glDrawElements() index=%u is "
- "out of bounds (max=%u)", max, ctx->Array.ArrayObj->_MaxElement);
+ _mesa_warning(ctx, "glDrawElements() index=%u is out of bounds (max=%u)",
+ max, ctx->Array.ArrayObj->_MaxElement);
return GL_FALSE;
}
return GL_TRUE;
}
+
/**
* Error checking for glDrawElements(). Includes parameter checking
* and VBO bounds checking.