diff options
author | Brian Paul <[email protected]> | 2009-05-22 07:51:35 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-05-22 07:51:35 -0600 |
commit | a545f1ab6d50e044c6e0b2d952af28e6d9059f80 (patch) | |
tree | e11e9e1444a9641a71c34529b998474ba33307df /src/mesa/shader/arbprogram.c | |
parent | 42ae2a8648923b6fa11e29ad0f6ff7555534e390 (diff) |
mesa: added some assertions
Diffstat (limited to 'src/mesa/shader/arbprogram.c')
-rw-r--r-- | src/mesa/shader/arbprogram.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 21c5cfbf99c..39136efadac 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -254,6 +254,8 @@ _mesa_EnableVertexAttribArrayARB(GLuint index) return; } + ASSERT(index < Elements(ctx->Array.ArrayObj->VertexAttrib)); + FLUSH_VERTICES(ctx, _NEW_ARRAY); ctx->Array.ArrayObj->VertexAttrib[index].Enabled = GL_TRUE; ctx->Array.ArrayObj->_Enabled |= _NEW_ARRAY_ATTRIB(index); @@ -273,6 +275,8 @@ _mesa_DisableVertexAttribArrayARB(GLuint index) return; } + ASSERT(index < Elements(ctx->Array.ArrayObj->VertexAttrib)); + FLUSH_VERTICES(ctx, _NEW_ARRAY); ctx->Array.ArrayObj->VertexAttrib[index].Enabled = GL_FALSE; ctx->Array.ArrayObj->_Enabled &= ~_NEW_ARRAY_ATTRIB(index); @@ -315,6 +319,8 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params) return; } + ASSERT(index < Elements(ctx->Array.ArrayObj->VertexAttrib)); + array = &ctx->Array.ArrayObj->VertexAttrib[index]; switch (pname) { @@ -387,6 +393,8 @@ _mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer) return; } + ASSERT(index < Elements(ctx->Array.ArrayObj->VertexAttrib)); + *pointer = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[index].Ptr; } |