diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-03-16 11:06:06 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-03-18 22:59:33 +0300 |
commit | e5c2bfb341020e65021a63d30be754eff7d69087 (patch) | |
tree | 4225811c9285c44352853c66de7d83190f788680 /source/blender/draw/intern/draw_manager_data.c | |
parent | d7df0dcccb50bbbc1e14cbe49bb128fa108b8a3e (diff) |
DRW: Add support for compute indirect command.
This just expose the GPU API through DRW.
Diffstat (limited to 'source/blender/draw/intern/draw_manager_data.c')
-rw-r--r-- | source/blender/draw/intern/draw_manager_data.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index be45cee8759..a069a4e756c 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -820,6 +820,12 @@ static void drw_command_compute_ref(DRWShadingGroup *shgroup, int groups_ref[3]) cmd->groups_ref = groups_ref; } +static void drw_command_compute_indirect(DRWShadingGroup *shgroup, GPUStorageBuf *indirect_buf) +{ + DRWCommandComputeIndirect *cmd = drw_command_create(shgroup, DRW_CMD_COMPUTE_INDIRECT); + cmd->indirect_buf = indirect_buf; +} + static void drw_command_barrier(DRWShadingGroup *shgroup, eGPUBarrier type) { DRWCommandBarrier *cmd = drw_command_create(shgroup, DRW_CMD_BARRIER); @@ -958,6 +964,12 @@ void DRW_shgroup_call_compute_ref(DRWShadingGroup *shgroup, int groups_ref[3]) drw_command_compute_ref(shgroup, groups_ref); } +void DRW_shgroup_call_compute_indirect(DRWShadingGroup *shgroup, GPUStorageBuf *indirect_buf) +{ + BLI_assert(GPU_compute_shader_support()); + + drw_command_compute_indirect(shgroup, indirect_buf); +} void DRW_shgroup_barrier(DRWShadingGroup *shgroup, eGPUBarrier type) { BLI_assert(GPU_compute_shader_support()); |