From bbc6a275901b69ea2804f374cc03c2c2448d8e55 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 9 May 2016 16:09:13 +1000 Subject: 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 Reviewed-by: Kenneth Graunke Signed-off-by: Dave Airlie --- src/mesa/main/objectlabel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa/main/objectlabel.c') diff --git a/src/mesa/main/objectlabel.c b/src/mesa/main/objectlabel.c index 5070b008792..974abbcc6f5 100644 --- a/src/mesa/main/objectlabel.c +++ b/src/mesa/main/objectlabel.c @@ -176,9 +176,13 @@ get_label_pointer(struct gl_context *ctx, GLenum identifier, GLuint name, break; case GL_TRANSFORM_FEEDBACK: { + /* From the GL 4.5 specification, page 536: + * "An INVALID_VALUE error is generated if name is not the name of a + * valid object of the type specified by identifier." + */ struct gl_transform_feedback_object *tfo = _mesa_lookup_transform_feedback_object(ctx, name); - if (tfo) + if (tfo && tfo->EverBound) labelPtr = &tfo->Label; } break; -- cgit v1.2.3