diff options
author | Brian Ho <[email protected]> | 2020-02-27 18:48:43 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-03 02:25:25 +0000 |
commit | 69628ababbd79a5865c2c5bd01b4a963eb7800f9 (patch) | |
tree | fc305352c785fd217cf0b3c0cc92408be5865389 /src | |
parent | 5715a61fa96e8986da82ef263e06db4ef90fb106 (diff) |
turnip: Execute main cs for secondary command buffers
Previously, we only added the secondary command buffer's draw and
draw epilogue command streams to the primary command buffer on
vkCmdExecuteCommands. However, we also need to merge the primary cs
for non-draw operations like vkCmdCopyBuffer and vkCmdBeginQuery.
Fixes dEQP-VK.memory.pipeline_barrier.host_write_transfer_src.*
and various other tests in dEQP-VK.api.command_buffers.*.
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3988>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3988>
Diffstat (limited to 'src')
-rw-r--r-- | src/freedreno/vulkan/tu_cmd_buffer.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index 9b4ee7637a6..8727c3376fe 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -2400,17 +2400,32 @@ tu_CmdExecuteCommands(VkCommandBuffer commandBuffer, break; } - result = tu_cs_add_entries(&cmd->draw_cs, &secondary->draw_cs); - if (result != VK_SUCCESS) { - cmd->record_result = result; - break; - } + if (secondary->usage_flags & + VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT) { + assert(tu_cs_is_empty(&secondary->cs)); - result = tu_cs_add_entries(&cmd->draw_epilogue_cs, - &secondary->draw_epilogue_cs); - if (result != VK_SUCCESS) { - cmd->record_result = result; - break; + result = tu_cs_add_entries(&cmd->draw_cs, &secondary->draw_cs); + if (result != VK_SUCCESS) { + cmd->record_result = result; + break; + } + + result = tu_cs_add_entries(&cmd->draw_epilogue_cs, + &secondary->draw_epilogue_cs); + if (result != VK_SUCCESS) { + cmd->record_result = result; + break; + } + } else { + assert(tu_cs_is_empty(&secondary->draw_cs)); + assert(tu_cs_is_empty(&secondary->draw_epilogue_cs)); + + for (uint32_t j = 0; j < secondary->cs.bo_count; j++) { + tu_bo_list_add(&cmd->bo_list, secondary->cs.bos[j], + MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_DUMP); + } + + tu_cs_emit_call(&cmd->cs, &secondary->cs); } } cmd->state.dirty = ~0u; /* TODO: set dirty only what needs to be */ |