summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-05-09 16:09:13 +1000
committerDave Airlie <[email protected]>2016-05-10 06:06:09 +1000
commitbbc6a275901b69ea2804f374cc03c2c2448d8e55 (patch)
tree0f1d044015020c3b420540b4510203ecd05b1d54 /src/mesa/main/api_validate.c
parenteafe3905d93efbe5a5f0267d23608cc71c1f96fe (diff)
mesa: don't use genned but unnamed xfb objects.
If we try to draw or query an XFB object that hasn't been bound, we shouldn't return any information. This fixes a couple if cases in: GL33-CTS.transform_feedback.api_errors_test The ObjectLabel test is inspired by another test. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r--src/mesa/main/api_validate.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 9d29f8d6249..a714c0a2146 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -665,6 +665,15 @@ _mesa_validate_DrawTransformFeedback(struct gl_context *ctx,
return GL_FALSE;
}
+ /* From the GL 4.5 specification, page 429:
+ * "An INVALID_VALUE error is generated if id is not the name of a
+ * transform feedback object."
+ */
+ if (!obj->EverBound) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDrawTransformFeedback*(name)");
+ return GL_FALSE;
+ }
+
if (stream >= ctx->Const.MaxVertexStreams) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glDrawTransformFeedbackStream*(index>=MaxVertexStream)");