mesa: Disallow TransformFeedbackVaryings when active.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 6 Sep 2013 19:38:12 +0000 (12:38 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 12 Sep 2013 17:18:59 +0000 (10:18 -0700)
Fixes a subcase of Piglit's new ARB_transform_feedback2 api-errors test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/transformfeedback.c

index 3f8a7f48daddba67a0ce384e8a74280a88fd2b81..eca0e5f55c95dd9173fee9cac96fe3ac644b6e0c 100644 (file)
@@ -611,6 +611,16 @@ _mesa_TransformFeedbackVaryings(GLuint program, GLsizei count,
    GLint i;
    GET_CURRENT_CONTEXT(ctx);
 
+   /* From the ARB_transform_feedback2 specification:
+    * "The error INVALID_OPERATION is generated by TransformFeedbackVaryings
+    *  if the current transform feedback object is active, even if paused."
+    */
+   if (ctx->TransformFeedback.CurrentObject->Active) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+               "glTransformFeedbackVaryings(current object is active)");
+      return;
+   }
+
    switch (bufferMode) {
    case GL_INTERLEAVED_ATTRIBS:
       break;