Re: [Mesa-dev] [PATCH] anv: remove early out from cmd_buffer_setup_attachments
On Fri, 2017-07-14 at 18:06 +0100, Lionel Landwerlin wrote: > Hi James, > > I think this patch from Jason might fix the same problem : > https://patchwork.freedesktop.org/patch/166280/ Yes it does. I'll drop my patch if and when Jason's is pushed to master. Thanks, James. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] anv: remove early out from cmd_buffer_setup_attachments
Hi James, I think this patch from Jason might fix the same problem : https://patchwork.freedesktop.org/patch/166280/ Series : https://patchwork.freedesktop.org/series/27142/ Cheers, - Lionel On 14/07/17 17:58, James Legg wrote: Even when there are no attachments, set up cmd_buffer->state->render_pass_states, so that secondary command buffers with the VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT usage flag enabled can be used in VkCmdExecuteCommands with valid allocation sizes. CC: --- src/intel/vulkan/genX_cmd_buffer.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 53c58ca..7f733d8 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -431,17 +431,16 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer, if (pass->attachment_count == 0) { state->attachments = NULL; - return VK_SUCCESS; - } - - state->attachments = vk_alloc(&cmd_buffer->pool->alloc, - pass->attachment_count * - sizeof(state->attachments[0]), - 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); - if (state->attachments == NULL) { - /* Propagate VK_ERROR_OUT_OF_HOST_MEMORY to vkEndCommandBuffer */ - return anv_batch_set_error(&cmd_buffer->batch, - VK_ERROR_OUT_OF_HOST_MEMORY); + } else { + state->attachments = vk_alloc(&cmd_buffer->pool->alloc, +pass->attachment_count * + sizeof(state->attachments[0]), +8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + if (state->attachments == NULL) { + /* Propagate VK_ERROR_OUT_OF_HOST_MEMORY to vkEndCommandBuffer */ + return anv_batch_set_error(&cmd_buffer->batch, +VK_ERROR_OUT_OF_HOST_MEMORY); + } } /* Reserve one for the NULL state. */ ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] anv: remove early out from cmd_buffer_setup_attachments
Even when there are no attachments, set up cmd_buffer->state->render_pass_states, so that secondary command buffers with the VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT usage flag enabled can be used in VkCmdExecuteCommands with valid allocation sizes. CC: --- src/intel/vulkan/genX_cmd_buffer.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 53c58ca..7f733d8 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -431,17 +431,16 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer, if (pass->attachment_count == 0) { state->attachments = NULL; - return VK_SUCCESS; - } - - state->attachments = vk_alloc(&cmd_buffer->pool->alloc, - pass->attachment_count * - sizeof(state->attachments[0]), - 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); - if (state->attachments == NULL) { - /* Propagate VK_ERROR_OUT_OF_HOST_MEMORY to vkEndCommandBuffer */ - return anv_batch_set_error(&cmd_buffer->batch, - VK_ERROR_OUT_OF_HOST_MEMORY); + } else { + state->attachments = vk_alloc(&cmd_buffer->pool->alloc, +pass->attachment_count * + sizeof(state->attachments[0]), +8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + if (state->attachments == NULL) { + /* Propagate VK_ERROR_OUT_OF_HOST_MEMORY to vkEndCommandBuffer */ + return anv_batch_set_error(&cmd_buffer->batch, +VK_ERROR_OUT_OF_HOST_MEMORY); + } } /* Reserve one for the NULL state. */ -- 2.9.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev