mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-16 04:38:30 +02:00
anv: fix nested command buffer relocations
When executing 3 command buffers : vkCmdExecuteCommands(CB_B, CB_C); vkCmdExecuteCommands(CB_A, CB_B); vkQueueSubmit(CB_A); We're not transfering correctly the relocations of CB_C from CB_B to CB_A. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: mesa-stable Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35160>
This commit is contained in:
parent
ff4e1b9ed9
commit
e64889635c
1 changed files with 21 additions and 15 deletions
|
|
@ -1123,19 +1123,15 @@ anv_cmd_buffer_end_batch_buffer(struct anv_cmd_buffer *cmd_buffer)
|
|||
cmd_buffer->total_batch_size += batch_bo->length;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
anv_cmd_buffer_add_seen_bbos(struct anv_cmd_buffer *cmd_buffer,
|
||||
struct list_head *list)
|
||||
static void
|
||||
anv_cmd_buffer_add_seen_bbos(struct anv_cmd_buffer *primary,
|
||||
struct anv_cmd_buffer *secondary)
|
||||
{
|
||||
list_for_each_entry(struct anv_batch_bo, bbo, list, link) {
|
||||
struct anv_batch_bo **bbo_ptr = u_vector_add(&cmd_buffer->seen_bbos);
|
||||
if (bbo_ptr == NULL)
|
||||
return vk_error(cmd_buffer, VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||
|
||||
*bbo_ptr = bbo;
|
||||
struct anv_batch_bo **bbo;
|
||||
u_vector_foreach(bbo, &secondary->seen_bbos) {
|
||||
struct anv_batch_bo **bbo_ptr = u_vector_add(&primary->seen_bbos);
|
||||
*bbo_ptr = *bbo;
|
||||
}
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1164,7 +1160,7 @@ anv_cmd_buffer_add_secondary(struct anv_cmd_buffer *primary,
|
|||
*/
|
||||
anv_batch_bo_link(primary, last_bbo, this_bbo, offset);
|
||||
|
||||
anv_cmd_buffer_add_seen_bbos(primary, &secondary->batch_bos);
|
||||
anv_cmd_buffer_add_seen_bbos(primary, secondary);
|
||||
break;
|
||||
}
|
||||
case ANV_CMD_BUFFER_EXEC_MODE_COPY_AND_CHAIN: {
|
||||
|
|
@ -1172,10 +1168,20 @@ anv_cmd_buffer_add_secondary(struct anv_cmd_buffer *primary,
|
|||
VkResult result = anv_batch_bo_list_clone(&secondary->batch_bos,
|
||||
secondary,
|
||||
©_list);
|
||||
if (result != VK_SUCCESS)
|
||||
if (result != VK_SUCCESS) {
|
||||
anv_batch_set_error(&primary->batch, result);
|
||||
return; /* FIXME */
|
||||
}
|
||||
|
||||
anv_cmd_buffer_add_seen_bbos(primary, ©_list);
|
||||
list_for_each_entry(struct anv_batch_bo, bbo, ©_list, link) {
|
||||
struct anv_batch_bo **bbo_ptr = u_vector_add(&primary->seen_bbos);
|
||||
if (bbo_ptr == NULL) {
|
||||
anv_batch_set_error(&primary->batch,
|
||||
VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||
return;
|
||||
}
|
||||
*bbo_ptr = bbo;
|
||||
}
|
||||
|
||||
struct anv_batch_bo *first_bbo =
|
||||
list_first_entry(©_list, struct anv_batch_bo, link);
|
||||
|
|
@ -1200,7 +1206,7 @@ anv_cmd_buffer_add_secondary(struct anv_cmd_buffer *primary,
|
|||
(struct anv_address) { .bo = first_bbo->bo },
|
||||
secondary->return_addr);
|
||||
|
||||
anv_cmd_buffer_add_seen_bbos(primary, &secondary->batch_bos);
|
||||
anv_cmd_buffer_add_seen_bbos(primary, secondary);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue