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 <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Ilia Mirkin 2016-03-06 12:36:19 -05:00
parent f6827e20d1
commit 0941ef3dd5
1 changed files with 5 additions and 0 deletions

View File

@ -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);
}
}