From 46d203c0abfedf58054de684a3e8ca9878ca434c Mon Sep 17 00:00:00 2001 From: Sagar Ghuge Date: Thu, 18 May 2023 15:04:07 -0700 Subject: [PATCH] anv: Add secondary companion RCS cmd buffer to primary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add secondary buffer's companion RCS command buffer to primary buffer's companion RCS command buffer for execution if secondary RCS is valid. v2: (Lionel) - Fix the primary companion RCS check - Set batch error Signed-off-by: Sagar Ghuge Reviewed-by: Lionel Landwerlin Reviewed-by: José Roberto de Souza Part-of: --- src/intel/vulkan/genX_cmd_buffer.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 407b08db714..12000e605f5 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -3685,6 +3685,21 @@ genX(CmdExecuteCommands)( anv_cmd_buffer_add_secondary(primary, secondary); + /* Add secondary buffer's RCS command buffer to primary buffer's RCS + * command buffer for execution if secondary RCS is valid. + */ + if (secondary->companion_rcs_cmd_buffer != NULL) { + if (primary->companion_rcs_cmd_buffer == NULL) { + VkResult result = anv_create_companion_rcs_command_buffer(primary); + if (result != VK_SUCCESS) { + anv_batch_set_error(&primary->batch, result); + return; + } + } + anv_cmd_buffer_add_secondary(primary->companion_rcs_cmd_buffer, + secondary->companion_rcs_cmd_buffer); + } + assert(secondary->perf_query_pool == NULL || primary->perf_query_pool == NULL || secondary->perf_query_pool == primary->perf_query_pool); if (secondary->perf_query_pool)