diff options
author | Rohan Garg <rohan.garg@intel.com> | 2024-08-19 12:28:35 +0200 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2024-08-21 11:07:02 +0200 |
commit | 2afcbcce6d8fde333bb4d5f92e82f57deecaa644 (patch) | |
tree | fb63006a88c86895edcc18ef4f7c6d508364f84a /src/intel | |
parent | 75deeb5f49ee6e1e86b91ab381a07b27195efff9 (diff) |
anv: dispatch indirect draws with a count buffer through the XI hardware on ARL+
ARL+ can dispatch indirect draws through the hardware.
Backport-to: 24.2
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30690>
(cherry picked from commit f69c74b6d5c40f077fa467fb6cfabc09372e531c)
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/genX_cmd_draw.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/intel/vulkan/genX_cmd_draw.c b/src/intel/vulkan/genX_cmd_draw.c index fbf71f3266e..f70b667fdbc 100644 --- a/src/intel/vulkan/genX_cmd_draw.c +++ b/src/intel/vulkan/genX_cmd_draw.c @@ -1731,8 +1731,10 @@ static inline const uint32_t xi_argument_format_for_vk_cmd(enum vk_cmd_type cmd) #if GFX_VERx10 >= 125 switch (cmd) { case VK_CMD_DRAW_INDIRECT: + case VK_CMD_DRAW_INDIRECT_COUNT: return XI_DRAW; case VK_CMD_DRAW_INDEXED_INDIRECT: + case VK_CMD_DRAW_INDEXED_INDIRECT_COUNT: return XI_DRAWINDEXED; default: unreachable("unhandled cmd type"); @@ -1750,8 +1752,10 @@ stride_aligned_for_vk_cmd(uint32_t stride, enum vk_cmd_type cmd) switch (cmd) { case VK_CMD_DRAW_INDIRECT: + case VK_CMD_DRAW_INDIRECT_COUNT: return stride == sizeof(VkDrawIndirectCommand); case VK_CMD_DRAW_INDEXED_INDIRECT: + case VK_CMD_DRAW_INDEXED_INDIRECT_COUNT: return stride == sizeof(VkDrawIndexedIndirectCommand); default: unreachable("unhandled cmd type"); @@ -2102,7 +2106,15 @@ void genX(CmdDrawIndirectCount)( anv_address_add(count_buffer->address, countBufferOffset); stride = MAX2(stride, sizeof(VkDrawIndirectCommand)); - if (anv_use_generated_draws(cmd_buffer, maxDrawCount)) { + if (execute_indirect_draw_supported(cmd_buffer)) { + genX(cmd_buffer_emit_execute_indirect_draws)( + cmd_buffer, + indirect_data_address, + stride, + count_address, + maxDrawCount, + VK_CMD_DRAW_INDIRECT_COUNT); + } else if (anv_use_generated_draws(cmd_buffer, maxDrawCount)) { genX(cmd_buffer_emit_indirect_generated_draws)( cmd_buffer, indirect_data_address, @@ -2150,7 +2162,15 @@ void genX(CmdDrawIndexedIndirectCount)( anv_address_add(count_buffer->address, countBufferOffset); stride = MAX2(stride, sizeof(VkDrawIndexedIndirectCommand)); - if (anv_use_generated_draws(cmd_buffer, maxDrawCount)) { + if (execute_indirect_draw_supported(cmd_buffer)) { + genX(cmd_buffer_emit_execute_indirect_draws)( + cmd_buffer, + indirect_data_address, + stride, + count_address, + maxDrawCount, + VK_CMD_DRAW_INDEXED_INDIRECT_COUNT); + } else if (anv_use_generated_draws(cmd_buffer, maxDrawCount)) { genX(cmd_buffer_emit_indirect_generated_draws)( cmd_buffer, indirect_data_address, |