diff options
Diffstat (limited to 'source/blender/gpu/opengl/gl_backend.hh')
-rw-r--r-- | source/blender/gpu/opengl/gl_backend.hh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_backend.hh b/source/blender/gpu/opengl/gl_backend.hh index d7edd162f33..e72726d9c7b 100644 --- a/source/blender/gpu/opengl/gl_backend.hh +++ b/source/blender/gpu/opengl/gl_backend.hh @@ -123,6 +123,19 @@ class GLBackend : public GPUBackend { GLCompute::dispatch(groups_x_len, groups_y_len, groups_z_len); } + void compute_dispatch_indirect(StorageBuf *indirect_buf) override + { + GLContext::get()->state_manager_active_get()->apply_state(); + + dynamic_cast<GLStorageBuf *>(indirect_buf)->bind_as(GL_DISPATCH_INDIRECT_BUFFER); + /* This barrier needs to be here as it only work on the currently bound indirect buffer. */ + glMemoryBarrier(GL_DRAW_INDIRECT_BUFFER); + + glDispatchComputeIndirect((GLintptr)0); + /* Unbind. */ + glBindBuffer(GL_DRAW_INDIRECT_BUFFER, 0); + } + private: static void platform_init(); static void platform_exit(); |