anv: Add secondary companion RCS cmd buffer to primary

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 <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
This commit is contained in:
Sagar Ghuge 2023-05-18 15:04:07 -07:00 committed by Marge Bot
parent 4d79c2d280
commit 46d203c0ab

View file

@ -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)