summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/bufferobj.c
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2015-09-17 10:10:07 -0700
committerJordan Justen <[email protected]>2015-09-24 19:15:13 -0700
commit12cf91db0236291ebaff71f602d929064b1ec096 (patch)
treeef0386376c08b46ce7d1d4b4280ff2be60f13fac /src/mesa/main/bufferobj.c
parent4a1ba7e6bd3ddcab4647a1382d14165a08c0d3b0 (diff)
mesa/cs: Support GL_DISPATCH_INDIRECT_BUFFER
v2: * Use _mesa_has_compute_shaders (Ilia) Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/mesa/main/bufferobj.c')
-rw-r--r--src/mesa/main/bufferobj.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index f87cea97557..20963bda8f2 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -93,6 +93,11 @@ get_buffer_target(struct gl_context *ctx, GLenum target)
return &ctx->DrawIndirectBuffer;
}
break;
+ case GL_DISPATCH_INDIRECT_BUFFER:
+ if (_mesa_has_compute_shaders(ctx)) {
+ return &ctx->DispatchIndirectBuffer;
+ }
+ break;
case GL_TRANSFORM_FEEDBACK_BUFFER:
if (ctx->Extensions.EXT_transform_feedback) {
return &ctx->TransformFeedback.CurrentBuffer;
@@ -844,6 +849,9 @@ _mesa_init_buffer_objects( struct gl_context *ctx )
_mesa_reference_buffer_object(ctx, &ctx->DrawIndirectBuffer,
ctx->Shared->NullBufferObj);
+ _mesa_reference_buffer_object(ctx, &ctx->DispatchIndirectBuffer,
+ ctx->Shared->NullBufferObj);
+
for (i = 0; i < MAX_COMBINED_UNIFORM_BUFFERS; i++) {
_mesa_reference_buffer_object(ctx,
&ctx->UniformBufferBindings[i].BufferObject,
@@ -888,6 +896,8 @@ _mesa_free_buffer_objects( struct gl_context *ctx )
_mesa_reference_buffer_object(ctx, &ctx->DrawIndirectBuffer, NULL);
+ _mesa_reference_buffer_object(ctx, &ctx->DispatchIndirectBuffer, NULL);
+
for (i = 0; i < MAX_COMBINED_UNIFORM_BUFFERS; i++) {
_mesa_reference_buffer_object(ctx,
&ctx->UniformBufferBindings[i].BufferObject,
@@ -1233,6 +1243,11 @@ _mesa_DeleteBuffers(GLsizei n, const GLuint *ids)
_mesa_BindBuffer( GL_DRAW_INDIRECT_BUFFER, 0 );
}
+ /* unbind ARB_compute_shader binding point */
+ if (ctx->DispatchIndirectBuffer == bufObj) {
+ _mesa_BindBuffer(GL_DISPATCH_INDIRECT_BUFFER, 0);
+ }
+
/* unbind ARB_copy_buffer binding points */
if (ctx->CopyReadBuffer == bufObj) {
_mesa_BindBuffer( GL_COPY_READ_BUFFER, 0 );