[Mesa-dev] [PATCH 14/22] mesa: Unbind uniform buffer bindings on glDeleteBuffers().
Eric Anholt
eric at anholt.net
Tue Jul 31 15:01:43 PDT 2012
Fixes piglit GL_ARB_uniform_buffer_object/deletebuffers.
---
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 ad28f8a..5fdf52e 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 );
}
--
1.7.10.4
More information about the mesa-dev
mailing list