summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/api_validate.c9
-rw-r--r--src/mesa/main/context.c4
2 files changed, 4 insertions, 9 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index e71e5a6ce86..013048bbc16 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -190,9 +190,6 @@ _mesa_validate_DrawElements(GLcontext *ctx,
return GL_FALSE;
}
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
if (!check_valid_to_render(ctx, "glDrawElements"))
return GL_FALSE;
@@ -254,9 +251,6 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
return GL_FALSE;
}
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
if (!check_valid_to_render(ctx, "glDrawRangeElements"))
return GL_FALSE;
@@ -304,9 +298,6 @@ _mesa_validate_DrawArrays(GLcontext *ctx,
return GL_FALSE;
}
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
if (!check_valid_to_render(ctx, "glDrawArrays"))
return GL_FALSE;
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index a570506d57b..eb6bc8e4369 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1578,6 +1578,10 @@ _mesa_set_mvp_with_dp4( GLcontext *ctx,
GLboolean
_mesa_valid_to_render(GLcontext *ctx, const char *where)
{
+ /* This depends on having up to date derived state (shaders) */
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
if (ctx->Shader.CurrentProgram) {
/* using shaders */
if (!ctx->Shader.CurrentProgram->LinkStatus) {