From 375e73d85948b43aa509e25f0a210ebd10238b6f Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 18 Dec 2011 02:43:31 +0100 Subject: mesa: implement glGet queries and error handling for ARB_transform_feedback3 Acked-by: Ian Romanick --- src/mesa/main/transformfeedback.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/mesa/main/transformfeedback.c') diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 6f822120105..7679b4b0853 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -603,6 +603,38 @@ _mesa_TransformFeedbackVaryings(GLuint program, GLsizei count, return; } + if (ctx->Extensions.ARB_transform_feedback3) { + if (bufferMode == GL_INTERLEAVED_ATTRIBS) { + unsigned buffers = 1; + + for (i = 0; i < count; i++) { + if (strcmp(varyings[i], "gl_NextBuffer") == 0) + buffers++; + } + + if (buffers > ctx->Const.MaxTransformFeedbackBuffers) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTransformFeedbackVaryings(too many gl_NextBuffer " + "occurences)"); + return; + } + } else { + for (i = 0; i < count; i++) { + if (strcmp(varyings[i], "gl_NextBuffer") == 0 || + strcmp(varyings[i], "gl_SkipComponents1") == 0 || + strcmp(varyings[i], "gl_SkipComponents2") == 0 || + strcmp(varyings[i], "gl_SkipComponents3") == 0 || + strcmp(varyings[i], "gl_SkipComponents4") == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTransformFeedbackVaryings(SEPARATE_ATTRIBS," + "varying=%s)", + varyings[i]); + return; + } + } + } + } + /* free existing varyings, if any */ for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) { free(shProg->TransformFeedback.VaryingNames[i]); -- cgit v1.2.3