diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-07-30 14:30:59 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-08-02 22:53:17 +0300 |
commit | 9a52f1f72035ffdd40ef56e938dcb540086b3463 (patch) | |
tree | a06dbeba65275b2b2b9f2b4e08dd529e0a89752f /source/blender/draw/intern/draw_shader_shared.h | |
parent | 710609a2e0d7ef63711940f746392b30dd8bbc7b (diff) |
DRW: Add DRW_shgroup_call_procedural_triangles_indirect
Just like the name suggest, this adds a way to draw a series of proceduraly
positioned triangles using and indirect buffer.
Diffstat (limited to 'source/blender/draw/intern/draw_shader_shared.h')
-rw-r--r-- | source/blender/draw/intern/draw_shader_shared.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_shader_shared.h b/source/blender/draw/intern/draw_shader_shared.h index 266db22a84f..fbcc78e52f9 100644 --- a/source/blender/draw/intern/draw_shader_shared.h +++ b/source/blender/draw/intern/draw_shader_shared.h @@ -11,6 +11,9 @@ typedef struct ObjectMatrices ObjectMatrices; typedef struct ObjectInfos ObjectInfos; typedef struct VolumeInfos VolumeInfos; typedef struct CurvesInfos CurvesInfos; +typedef struct DrawCommand DrawCommand; +typedef struct DrawCommandIndexed DrawCommandIndexed; +typedef struct DispatchCommand DispatchCommand; #endif #define DRW_SHADER_SHARED_H @@ -98,3 +101,33 @@ BLI_STATIC_ASSERT_ALIGN(CurvesInfos, 16) #define OrcoTexCoFactors (drw_infos[resource_id].drw_OrcoTexCoFactors) #define ObjectInfo (drw_infos[resource_id].drw_Infos) #define ObjectColor (drw_infos[resource_id].drw_ObjectColor) + +/* Indirect commands structures. */ + +struct DrawCommand { + uint v_count; + uint i_count; + uint v_first; + uint i_first; +}; +BLI_STATIC_ASSERT_ALIGN(DrawCommand, 16) + +struct DrawCommandIndexed { + uint v_count; + uint i_count; + uint v_first; + uint base_index; + uint i_first; + uint _pad0; + uint _pad1; + uint _pad2; +}; +BLI_STATIC_ASSERT_ALIGN(DrawCommandIndexed, 16) + +struct DispatchCommand { + uint num_groups_x; + uint num_groups_y; + uint num_groups_z; + uint _pad0; +}; +BLI_STATIC_ASSERT_ALIGN(DispatchCommand, 16) |