From a7d616da69d631cc088c01b761a8b1b8b36c6b13 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 6 Sep 2013 12:38:12 -0700 Subject: [PATCH] mesa: Disallow TransformFeedbackVaryings when active. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes a subcase of Piglit's new ARB_transform_feedback2 api-errors test. Signed-off-by: Kenneth Graunke Reviewed-by: Marek Olšák --- 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 3f8a7f48dad..eca0e5f55c9 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; -- 2.30.2