[Mesa-dev] [PATCH] anv: remove early out from cmd_buffer_setup_attachments

Lionel Landwerlin lionel.g.landwerlin at intel.com
Fri Jul 14 17:06:34 UTC 2017


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: <mesa-stable at lists.freedesktop.org>
> ---
>   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. */




More information about the mesa-dev mailing list