mesa: Unbind uniform buffer bindings on glDeleteBuffers().

Fixes piglit GL_ARB_uniform_buffer_object/deletebuffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Eric Anholt 2012-07-31 12:46:25 -07:00
parent 1eb3c06ae8
commit bfa046b5f2

View file

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