[Mesa-dev] [PATCH 04/16] anv: handle out of memory situations in anv_batch_emit_dwords()

Iago Toral Quiroga itoral at igalia.com
Tue Mar 7 07:15:49 UTC 2017


---
 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 4cbfb4d..162ef2e 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -197,8 +197,11 @@ anv_reloc_list_append(struct anv_reloc_list *list,
 void *
 anv_batch_emit_dwords(struct anv_batch *batch, int num_dwords)
 {
-   if (batch->next + num_dwords * 4 > batch->end)
-      batch->extend_cb(batch, batch->user_data);
+   if (batch->next + num_dwords * 4 > batch->end) {
+      VkResult result = batch->extend_cb(batch, batch->user_data);
+      if (result != VK_SUCCESS)
+         return NULL;
+   }
 
    void *p = batch->next;
 
-- 
2.7.4



More information about the mesa-dev mailing list