diff options
author | Sagar Ghuge <sagar.ghuge@intel.com> | 2024-04-08 19:11:34 -0700 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2024-04-21 22:21:51 +0200 |
commit | 8b496ec0ab3313e3417e299256e8c28bfa747a3f (patch) | |
tree | eba4f2e4b9308e2bd1a7ba9399ab6b17079ebd35 | |
parent | 2a82433d7b90562a105d74bcc6d5d340f84b4cfe (diff) |
anv: Use appropriate argument format for indirect draw
If index is specified we can use the DRAWINDEXED otherwise we can simply
use DRAW argument format.
v2: (Rohan & Lionel)
- Fix the aligned_stride check
Fixes: 6d4f43f0d6 ("anv: Emit EXECUTE_INDIRECT_DRAW when available")
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28658>
(cherry picked from commit 0aa632b519b0ad774520e6f83869f2a7bb9fabed)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json index a06a59b1f33..f957168cf29 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3834,7 +3834,7 @@ "description": "anv: Use appropriate argument format for indirect draw", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "6d4f43f0d6f58edb5bf236ddf1ce6f798afa851b", "notes": null diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 5026adbaf62..c96e32a4477 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -5265,7 +5265,8 @@ emit_indirect_draws(struct anv_cmd_buffer *cmd_buffer, UNUSED const struct intel_device_info *devinfo = cmd_buffer->device->info; UNUSED const bool aligned_stride = (indirect_data_stride == 0 || - indirect_data_stride == sizeof(VkDrawIndirectCommand)); + (!indexed && indirect_data_stride == sizeof(VkDrawIndirectCommand)) || + (indexed && indirect_data_stride == sizeof(VkDrawIndexedIndirectCommand))); UNUSED const bool execute_indirect_supported = execute_indirect_draw_supported(cmd_buffer); @@ -5314,7 +5315,7 @@ emit_indirect_draws(struct anv_cmd_buffer *cmd_buffer, #if GFX_VERx10 >= 125 genX(emit_breakpoint)(&cmd_buffer->batch, cmd_buffer->device, true); anv_batch_emit(&cmd_buffer->batch, GENX(EXECUTE_INDIRECT_DRAW), ind) { - ind.ArgumentFormat = DRAW; + ind.ArgumentFormat = indexed ? DRAWINDEXED : DRAW; ind.TBIMREnabled = cmd_buffer->state.gfx.dyn_state.use_tbimr; ind.PredicateEnable = cmd_buffer->state.conditional_render_enabled; |