From: Iago Toral Quiroga Date: Fri, 3 Mar 2017 10:17:03 +0000 (+0100) Subject: anv: handle allocation failure in anv_batch_emit_batch() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9e69409fcf16d8af58e2ba732e3cd78240a65317;p=mesa.git anv: handle allocation failure in anv_batch_emit_batch() v2: - Call the error handler (Topi) Fixes: dEQP-VK.api.out_of_host_memory.cmd_execute_commands Reviewed-by: Topi Pohjolainen --- diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 3f6039e816b..40fc2f4f899 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -222,8 +222,13 @@ 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); + if (result != VK_SUCCESS) { + anv_batch_set_error(batch, result); + return; + } + } assert(batch->next + size <= batch->end);