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

Iago Toral itoral at igalia.com
Mon Mar 13 14:11:26 UTC 2017


On Mon, 2017-03-13 at 12:07 +0200, Pohjolainen, Topi wrote:
> 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?

Yes, we should set the error here like we do for anv_batch_emit_dwords
in the next patch. Thanks for catching this!

Iago

> > 
> > +      if (result != VK_SUCCESS)
> > +         return;
> > +   }
> >  
> >     assert(batch->next + size <= batch->end);
> >  


More information about the mesa-dev mailing list