[Mesa-dev] [PATCH v2 07/24] anv: handle allocation failure in anv_batch_emit_batch()

Pohjolainen, Topi topi.pohjolainen at gmail.com
Mon Mar 13 10:07:28 UTC 2017


On Fri, Mar 10, 2017 at 01:38:20PM +0100, Iago Toral Quiroga wrote:
> Fixes:
> dEQP-VK.api.out_of_host_memory.cmd_execute_commands
> ---
>  src/intel/vulkan/anv_batch_chain.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
> index 3f6039e..1236001 100644
> --- a/src/intel/vulkan/anv_batch_chain.c
> +++ b/src/intel/vulkan/anv_batch_chain.c
> @@ -222,8 +222,11 @@ anv_batch_emit_batch(struct anv_batch *batch, struct anv_batch *other)
>     size = other->next - other->start;
>     assert(size % 4 == 0);
>  
> -   if (batch->next + size > batch->end)
> -      batch->extend_cb(batch, batch->user_data);
> +   if (batch->next + size > batch->end) {
> +      VkResult result = batch->extend_cb(batch, batch->user_data);

This made think should we set the status also in anv_batch here?
Implementations for extend_cb(), anv_cmd_buffer_chain_batch() and
anv_cmd_buffer_grow_batch(), only deal with the underlying buffer, right?

> +      if (result != VK_SUCCESS)
> +         return;
> +   }
>  
>     assert(batch->next + size <= batch->end);
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list