[Mesa-dev] [PATCH 1/4] mesa: Disallow TransformFeedbackVaryings when active.

Kenneth Graunke kenneth at whitecape.org
Fri Sep 6 16:40:13 PDT 2013


Fixes a subcase of Piglit's new ARB_transform_feedback2 api-errors test.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/main/transformfeedback.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c
index 3f8a7f4..eca0e5f 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -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;
-- 
1.8.3.4



More information about the mesa-dev mailing list