summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/transformfeedback.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-12-18 02:43:31 +0100
committerMarek Olšák <[email protected]>2012-07-12 13:05:58 +0200
commit375e73d85948b43aa509e25f0a210ebd10238b6f (patch)
treec9296d6e5ba7fb2b937ebd0000f5e22ec7610c2e /src/mesa/main/transformfeedback.c
parent21cb5ed20d1d7984b7695395327ed0ba0b0d16e2 (diff)
mesa: implement glGet queries and error handling for ARB_transform_feedback3
Acked-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/transformfeedback.c')
-rw-r--r--src/mesa/main/transformfeedback.c32
1 files changed, 32 insertions, 0 deletions
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]);