From 220a01d525cc49380e97b87695f454f5e76ce69a Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 31 Jul 2015 08:52:28 -0700 Subject: [PATCH] vk/batch_chain: Compute secondary exec mode after finishing the bo Figuring out whether or not to do a copy requires knowing the length of the final batch_bo. This gets set by anv_batch_bo_finish so we have to do it afterwards. Not sure how this was even working before. --- src/vulkan/anv_batch_chain.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/vulkan/anv_batch_chain.c b/src/vulkan/anv_batch_chain.c index 2f09248acee..04528bb06b6 100644 --- a/src/vulkan/anv_batch_chain.c +++ b/src/vulkan/anv_batch_chain.c @@ -636,7 +636,13 @@ anv_cmd_buffer_end_batch_buffer(struct anv_cmd_buffer *cmd_buffer) anv_batch_emit(&cmd_buffer->batch, GEN8_MI_NOOP); cmd_buffer->exec_mode = ANV_CMD_BUFFER_EXEC_MODE_PRIMARY; - } else { + } + + anv_batch_bo_finish(batch_bo, &cmd_buffer->batch); + + surface_bbo->length = cmd_buffer->surface_next; + + if (cmd_buffer->level == VK_CMD_BUFFER_LEVEL_SECONDARY) { /* If this is a secondary command buffer, we need to determine the * mode in which it will be executed with vkExecuteCommands. We * determine this statically here so that this stays in sync with the @@ -666,10 +672,6 @@ anv_cmd_buffer_end_batch_buffer(struct anv_cmd_buffer *cmd_buffer) cmd_buffer->exec_mode = ANV_CMD_BUFFER_EXEC_MODE_COPY_AND_CHAIN; } } - - anv_batch_bo_finish(batch_bo, &cmd_buffer->batch); - - surface_bbo->length = cmd_buffer->surface_next; } static inline VkResult -- 2.30.2