summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-07-02 19:17:11 -0600
committerBrian Paul <[email protected]>2008-07-02 19:17:11 -0600
commitb3e1f9bd521ab25fc1cb313902cd77c6c274a918 (patch)
tree2d9140e60cfdad72960d9d15e0495bef2b1d89e2 /src
parent1726b7d1d336465dca10a5bd0a8a02fcf5f2e455 (diff)
mesa: fix vertex array validation test for attribute 0 (vert pos)
We don't actually need vertex array[0] enabled when using a vertex program/shader.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/api_validate.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 74b0912bef6..5a199939760 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -108,10 +108,10 @@ _mesa_validate_DrawElements(GLcontext *ctx,
if (ctx->NewState)
_mesa_update_state(ctx);
- /* Always need vertex positions */
- if (!ctx->Array.ArrayObj->Vertex.Enabled
- && !(ctx->VertexProgram._Enabled
- && ctx->Array.ArrayObj->VertexAttrib[0].Enabled))
+ /* Always need vertex positions, unless a vertex program is in use */
+ if (!ctx->VertexProgram._Current &&
+ !ctx->Array.ArrayObj->Vertex.Enabled &&
+ !ctx->Array.ArrayObj->VertexAttrib[0].Enabled)
return GL_FALSE;
/* Vertex buffer object tests */
@@ -190,10 +190,10 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
if (ctx->NewState)
_mesa_update_state(ctx);
- /* Always need vertex positions */
- if (!ctx->Array.ArrayObj->Vertex.Enabled
- && !(ctx->VertexProgram._Enabled
- && ctx->Array.ArrayObj->VertexAttrib[0].Enabled))
+ /* Always need vertex positions, unless a vertex program is in use */
+ if (!ctx->VertexProgram._Current &&
+ !ctx->Array.ArrayObj->Vertex.Enabled &&
+ !ctx->Array.ArrayObj->VertexAttrib[0].Enabled)
return GL_FALSE;
/* Vertex buffer object tests */
@@ -261,9 +261,10 @@ _mesa_validate_DrawArrays(GLcontext *ctx,
if (ctx->NewState)
_mesa_update_state(ctx);
- /* Always need vertex positions */
- if (!ctx->Array.ArrayObj->Vertex.Enabled
- && !ctx->Array.ArrayObj->VertexAttrib[0].Enabled)
+ /* Always need vertex positions, unless a vertex program is in use */
+ if (!ctx->VertexProgram._Current &&
+ !ctx->Array.ArrayObj->Vertex.Enabled &&
+ !ctx->Array.ArrayObj->VertexAttrib[0].Enabled)
return GL_FALSE;
if (ctx->Const.CheckArrayBounds) {