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

Iago Toral Quiroga itoral at igalia.com
Fri Mar 10 12:38:20 UTC 2017


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);
+      if (result != VK_SUCCESS)
+         return;
+   }
 
    assert(batch->next + size <= batch->end);
 
-- 
2.7.4



More information about the mesa-dev mailing list