mesa: forbid UseProgram to be called inside Begin/End
authorMarek Olšák <maraeo@gmail.com>
Sun, 29 May 2011 16:58:45 +0000 (18:58 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 30 May 2011 14:26:02 +0000 (16:26 +0200)
The spec doesn't state it should be an error, but. We have this piglit test
useprogram-inside-begin that passes with this commit. No idea what's correct.

NOTE: This is a candidate for the 7.10 branch.

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

index 03155b7ac04c32cfbcd5af895d1ab5ad4d4a6888..1e237a95da1fa3d30e039a8bdabd30a4ead9fc3d 100644 (file)
@@ -1593,6 +1593,8 @@ _mesa_UseProgramObjectARB(GLhandleARB program)
    struct gl_transform_feedback_object *obj =
       ctx->TransformFeedback.CurrentObject;
 
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
+
    if (obj->Active) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
                   "glUseProgram(transform feedback active)");