From 0941ef3dd57e692ee1a897ed83bd887d0cebdc63 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Sun, 6 Mar 2016 12:36:19 -0500 Subject: [PATCH] mesa: flip current tf object back to default if current is being deleted In the rather unusual case of Bind + Delete, we need to make sure that we unbind the current tf object. Fixes dEQP-GLES3.functional.lifetime.delete_bound.transform_feedback Signed-off-by: Ilia Mirkin Reviewed-by: Matt Turner --- src/mesa/main/transformfeedback.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 976b2686a60..f73a89f6c0f 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -1136,6 +1136,11 @@ _mesa_DeleteTransformFeedbacks(GLsizei n, const GLuint *names) } _mesa_HashRemove(ctx->TransformFeedback.Objects, names[i]); /* unref, but object may not be deleted until later */ + if (obj == ctx->TransformFeedback.CurrentObject) { + reference_transform_feedback_object( + &ctx->TransformFeedback.CurrentObject, + ctx->TransformFeedback.DefaultObject); + } reference_transform_feedback_object(&obj, NULL); } } -- 2.30.2