summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-07-02 19:18:10 -0600
committerBrian Paul <[email protected]>2008-07-02 19:18:10 -0600
commit1ca23061478868d61b9b2e6a30367e8e1de4a456 (patch)
tree38c5222e4d05c865ed27f49802ef6a668a4fd2b9 /src/mesa/main/api_validate.c
parent98b7174ad6f6a74361e58136bdd235a092b07a40 (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. cherry-picked from master
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r--src/mesa/main/api_validate.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 9144b4bc663..2eb96ae3f4e 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -59,9 +59,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 */
@@ -177,9 +178,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 */
@@ -247,8 +249,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) {