mesa: Disable certain error checks when transform feedback is paused
authorPaul Berry <stereotype441@gmail.com>
Wed, 21 Dec 2011 19:03:11 +0000 (11:03 -0800)
committerPaul Berry <stereotype441@gmail.com>
Fri, 23 Dec 2011 17:43:18 +0000 (09:43 -0800)
When transform feedback is paused, it is legal to change programs or
to perform drawing operations using a drawing mode that doesn't match
the transform feedback mode.

Reviewed-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/shaderapi.c
src/mesa/main/transformfeedback.c

index c4d01abc7056b067e418b289510da4df08dba380..b71b44b705dbf134a79e904370fa9630096e97ae 100644 (file)
@@ -1436,7 +1436,7 @@ _mesa_UseProgramObjectARB(GLhandleARB program)
 
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
-   if (obj->Active) {
+   if (obj->Active && !obj->Paused) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
                   "glUseProgram(transform feedback active)");
       return;
@@ -1638,7 +1638,8 @@ _mesa_UseShaderProgramEXT(GLenum type, GLuint program)
       return;
    }
 
-   if (ctx->TransformFeedback.CurrentObject->Active) {
+   if (ctx->TransformFeedback.CurrentObject->Active &&
+       !ctx->TransformFeedback.CurrentObject->Paused) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
                   "glUseShaderProgramEXT(transform feedback is active)");
       return;
index fea711aa6e06422085dbf61e98316155e3a3868e..be0d0ff19a4f5cc5685dc44533e3570b2e326940 100644 (file)
@@ -98,7 +98,8 @@ reference_transform_feedback_object(struct gl_transform_feedback_object **ptr,
 GLboolean
 _mesa_validate_primitive_mode(struct gl_context *ctx, GLenum mode)
 {
-   if (ctx->TransformFeedback.CurrentObject->Active) {
+   if (ctx->TransformFeedback.CurrentObject->Active &&
+       !ctx->TransformFeedback.CurrentObject->Paused) {
       switch (mode) {
       case GL_POINTS:
          return ctx->TransformFeedback.Mode == GL_POINTS;