summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-09-06 14:51:26 -0700
committerKenneth Graunke <[email protected]>2013-09-12 10:19:09 -0700
commit9cc74c93f8983f978e7315e021eb59dfaca6404b (patch)
tree2dfdb23d60826ae12d982b7d68d747e5d5c14ae9 /src/mesa
parentc732f68cf4aca06bac03e6a70c49047057c0c357 (diff)
mesa: Reject ResumeTransformFeedback if the wrong program is bound.
This is actually a pretty important error condition: otherwise, you could set up transform feedback with one program, and resume it with a program that generates a completely different set of outputs. Fixes a subcase of Piglit's new ARB_transform_feedback2 api-errors test. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/transformfeedback.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c
index c2c14a1d339..191e88c8033 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -943,6 +943,17 @@ _mesa_ResumeTransformFeedback(void)
return;
}
+ /* From the ARB_transform_feedback2 specification:
+ * "The error INVALID_OPERATION is generated by ResumeTransformFeedback if
+ * the program object being used by the current transform feedback object
+ * is not active."
+ */
+ if (obj->shader_program != ctx->Shader.CurrentVertexProgram) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glResumeTransformFeedback(wrong vertex program bound)");
+ return;
+ }
+
FLUSH_VERTICES(ctx, 0);
ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedback;