From bfa046b5f2e50a0297ecb7e325395367362c4c39 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 31 Jul 2012 12:46:25 -0700 Subject: [PATCH] mesa: Unbind uniform buffer bindings on glDeleteBuffers(). Fixes piglit GL_ARB_uniform_buffer_object/deletebuffers. Reviewed-by: Kenneth Graunke --- src/mesa/main/bufferobj.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 0e3216009b0..22d7927bbcb 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -886,6 +886,13 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) } } + /* unbind UBO binding points */ + for (j = 0; j < ctx->Const.MaxUniformBufferBindings; j++) { + if (ctx->UniformBufferBindings[j].BufferObject == bufObj) { + _mesa_BindBufferBase( GL_UNIFORM_BUFFER, j, 0 ); + } + } + if (ctx->UniformBuffer == bufObj) { _mesa_BindBufferARB( GL_UNIFORM_BUFFER, 0 ); } -- 2.30.2