summaryrefslogtreecommitdiff
path: root/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-05-06 12:27:38 -0600
committerBrian Paul <brianp@vmware.com>2009-05-06 12:38:35 -0600
commit88af3f8783452dcf50a9e2e82076f52b2044f643 (patch)
treeb88e104acf51254e7c37665682dc1e63e459b452 /src/mesa/main/api_validate.c
parenta13df193c23f9202ade6f16643e3ef529cff772b (diff)
mesa: new comments, minor reformatting
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r--src/mesa/main/api_validate.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 1986cbecbb..dfe754dee5 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -44,10 +44,8 @@ max_buffer_index(GLcontext *ctx, GLuint count, GLenum type,
if (elementBuf->Name) {
/* elements are in a user-defined buffer object. need to map it */
- map = ctx->Driver.MapBuffer(ctx,
- GL_ELEMENT_ARRAY_BUFFER_ARB,
- GL_READ_ONLY,
- elementBuf);
+ map = ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER,
+ GL_READ_ONLY, elementBuf);
/* Actual address is the sum of pointers */
indices = (const GLvoid *) ADD_POINTERS(map, (const GLubyte *) indices);
}
@@ -70,14 +68,16 @@ max_buffer_index(GLcontext *ctx, GLuint count, GLenum type,
}
if (map) {
- ctx->Driver.UnmapBuffer(ctx,
- GL_ELEMENT_ARRAY_BUFFER_ARB,
- elementBuf);
+ ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, elementBuf);
}
return max;
}
+
+/**
+ * Check if OK to render by examining framebuffer status and vertex arrays.
+ */
static GLboolean
check_valid_to_render(GLcontext *ctx, char *function)
{
@@ -105,6 +105,12 @@ check_valid_to_render(GLcontext *ctx, char *function)
return GL_TRUE;
}
+
+/**
+ * Error checking for glDrawElements(). Includes parameter checking
+ * and VBO bounds checking.
+ * \return GL_TRUE if OK to render, GL_FALSE if error found
+ */
GLboolean
_mesa_validate_DrawElements(GLcontext *ctx,
GLenum mode, GLsizei count, GLenum type,
@@ -184,6 +190,12 @@ _mesa_validate_DrawElements(GLcontext *ctx,
return GL_TRUE;
}
+
+/**
+ * Error checking for glDrawRangeElements(). Includes parameter checking
+ * and VBO bounds checking.
+ * \return GL_TRUE if OK to render, GL_FALSE if error found
+ */
GLboolean
_mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
GLuint start, GLuint end,
@@ -265,6 +277,7 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
/**
* Called from the tnl module to error check the function parameters and
* verify that we really can draw something.
+ * \return GL_TRUE if OK to render, GL_FALSE if error found
*/
GLboolean
_mesa_validate_DrawArrays(GLcontext *ctx,