mesa: fix GL error checking in TransformFeedbackVaryings
authorMarek Olšák <maraeo@gmail.com>
Mon, 24 Oct 2011 00:21:48 +0000 (02:21 +0200)
committerMarek Olšák <maraeo@gmail.com>
Thu, 27 Oct 2011 09:26:19 +0000 (11:26 +0200)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/transformfeedback.c

index 47efad121091385562d17948bfcf295330197002..86fff889122537815d240f6019d6ca16397f34a0 100644 (file)
@@ -603,7 +603,9 @@ _mesa_TransformFeedbackVaryings(GLuint program, GLsizei count,
       return;
    }
 
-   if (count < 0 || count > ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+   if (count < 0 ||
+       (bufferMode == GL_SEPARATE_ATTRIBS &&
+        count > ctx->Const.MaxTransformFeedbackSeparateAttribs)) {
       _mesa_error(ctx, GL_INVALID_VALUE,
                   "glTransformFeedbackVaryings(count=%d)", count);
       return;