summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-07-31 12:46:25 -0700
committerEric Anholt <[email protected]>2012-08-07 13:54:51 -0700
commitbfa046b5f2e50a0297ecb7e325395367362c4c39 (patch)
treee74a734698034abf5b7012aaeda43ad92b2b40a3 /src
parent1eb3c06ae82cc962c5d867238acd089f833c2337 (diff)
mesa: Unbind uniform buffer bindings on glDeleteBuffers().
Fixes piglit GL_ARB_uniform_buffer_object/deletebuffers. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/bufferobj.c7
1 files changed, 7 insertions, 0 deletions
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 );
}