From: Eric Anholt Date: Tue, 31 Jul 2012 19:46:25 +0000 (-0700) Subject: mesa: Unbind uniform buffer bindings on glDeleteBuffers(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bfa046b5f2e50a0297ecb7e325395367362c4c39;p=mesa.git mesa: Unbind uniform buffer bindings on glDeleteBuffers(). Fixes piglit GL_ARB_uniform_buffer_object/deletebuffers. Reviewed-by: Kenneth Graunke --- 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 ); }