mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End
authorMarek Olšák <maraeo@gmail.com>
Tue, 31 May 2011 12:59:44 +0000 (14:59 +0200)
committerMarek Olšák <maraeo@gmail.com>
Wed, 1 Jun 2011 14:03:26 +0000 (16:03 +0200)
I couldn't find this being required by the spec.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/shaderapi.c
src/mesa/main/uniforms.c

index 1e237a95da1fa3d30e039a8bdabd30a4ead9fc3d..cbfbac802969be9e2c2c44a4718a9ccbb22848eb 100644 (file)
@@ -1790,6 +1790,8 @@ _mesa_UseShaderProgramEXT(GLenum type, GLuint program)
    GET_CURRENT_CONTEXT(ctx);
    struct gl_shader_program *shProg = NULL;
 
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
+
    if (!validate_shader_target(ctx, type)) {
       _mesa_error(ctx, GL_INVALID_ENUM, "glUseShaderProgramEXT(type)");
       return;
index 12fe7b5e2269a2b0eaf271a43a37e0c7ae2f6dd2..715ac760ab781745e477a3cd58526bee44c9ad29 100644 (file)
@@ -855,6 +855,8 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
    struct gl_uniform *uniform;
    GLint elems, offset;
 
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
+
    if (!shProg || !shProg->LinkStatus) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(program not linked)");
       return;
@@ -1028,6 +1030,8 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
    struct gl_uniform *uniform;
    GLint offset;
 
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
+
    if (!shProg || !shProg->LinkStatus) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
          "glUniformMatrix(program not linked)");