[Mesa-dev] [PATCH 09/16] anv: handle out of memory scenarios in anv_batch_emit_batch()

Iago Toral Quiroga itoral at igalia.com
Tue Mar 7 07:15:54 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 162ef2e..d0a1b03 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -227,8 +227,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