mesa: Unbind GL_TEXTURE_BUFFER on DeleteBuffers.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 10 Jun 2012 04:44:58 +0000 (21:44 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 11 Jun 2012 20:30:32 +0000 (13:30 -0700)
Fixes oglconform's tbo/basic.buffer.delete test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/bufferobj.c

index 846260d80fe763187a8234fbd210f6ffcea6fa84..332af3d36d77c78d7e36ef3593bf371165ac93fc 100644 (file)
@@ -848,6 +848,10 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
             _mesa_BindBufferARB( GL_PIXEL_UNPACK_BUFFER_EXT, 0 );
          }
 
+         if (ctx->Texture.BufferObject == bufObj) {
+            _mesa_BindBufferARB( GL_TEXTURE_BUFFER, 0 );
+         }
+
          /* The ID is immediately freed for re-use */
          _mesa_HashRemove(ctx->Shared->BufferObjects, ids[i]);
          /* Make sure we do not run into the classic ABA problem on bind.