summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/bufferobj.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-06-18 11:17:04 -0700
committerEric Anholt <[email protected]>2012-06-21 10:57:54 -0700
commitc5c696e7fbce2e0b598ed5d4b1d73f086a664a57 (patch)
treebeb5a4e1d0b83f1442599d77f27e0299597e494a /src/mesa/main/bufferobj.c
parent5426b1ade9c97497bdf5ecd7c44701a6d5ef04dc (diff)
mesa: Add support for the GL_UNIFORM_BUFFER general binding point.
Fixes piglit ARB_uniform_buffer_object/buffer-targets. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/bufferobj.c')
-rw-r--r--src/mesa/main/bufferobj.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 332af3d36d7..b646baa41a1 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -92,6 +92,11 @@ get_buffer_target(struct gl_context *ctx, GLenum target)
return &ctx->Texture.BufferObject;
}
break;
+ case GL_UNIFORM_BUFFER:
+ if (ctx->Extensions.ARB_uniform_buffer_object) {
+ return &ctx->UniformBuffer;
+ }
+ break;
default:
return NULL;
}
@@ -840,6 +845,10 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
}
}
+ if (ctx->UniformBuffer == bufObj) {
+ _mesa_BindBufferARB( GL_UNIFORM_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 );