aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2012-06-03 22:34:32 -0700
committerIan Romanick <[email protected]>2012-07-06 09:51:26 -0700
commita8fed44e9e29ac3998fd6642bfc73804d14f169a (patch)
tree2f9e2061df98254d8a439ae1a251b9c2a6adbfd5 /src
parent0f7dffae6936eb18fbc9fe32a1ff45d9c78557bf (diff)
mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.
According to the GL 3.1 spec, section 2.9 ("Buffer Objects"): "If a buffer object is deleted while it is bound, all bindings to that object in the current context (i.e. in the thread that called DeleteBuffers) are reset to zero." The code already checked for a number of cases, but neglected these newer binding points. +21 oglconforms. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> (cherry picked from commit cb8ed93dd0faf958493d35a4729c4a00a201af8d)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/bufferobj.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 32da289c68a..75b021f06f4 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -791,6 +791,19 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
_mesa_BindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 );
}
+ /* unbind ARB_copy_buffer binding points */
+ if (ctx->CopyReadBuffer == bufObj) {
+ _mesa_BindBufferARB( GL_COPY_READ_BUFFER, 0 );
+ }
+ if (ctx->CopyWriteBuffer == bufObj) {
+ _mesa_BindBufferARB( GL_COPY_WRITE_BUFFER, 0 );
+ }
+
+ /* unbind transform feedback binding point */
+ if (ctx->TransformFeedback.CurrentBuffer == bufObj) {
+ _mesa_BindBufferARB( GL_TRANSFORM_FEEDBACK_BUFFER, 0 );
+ }
+
/* unbind any pixel pack/unpack pointers bound to this buffer */
if (ctx->Pack.BufferObj == bufObj) {
_mesa_BindBufferARB( GL_PIXEL_PACK_BUFFER_EXT, 0 );