[Mesa-dev] [PATCH 5/6] anv: Return better errors from AllocateDescriptorSets

Jason Ekstrand jason at jlekstrand.net
Mon Jan 23 22:31:43 UTC 2017


v2: I need to learn to compile-test my patches

---
 src/intel/vulkan/anv_descriptor_set.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c
index a5e65af..a4b7638 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -432,8 +432,13 @@ anv_descriptor_set_create(struct anv_device *device,
       }
    }
 
-   if (set == NULL)
-      return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
+   if (set == NULL) {
+      if (pool->free_list != EMPTY) {
+         return vk_error(VK_ERROR_FRAGMENTED_POOL);
+      } else {
+         return vk_error(VK_ERROR_OUT_OF_POOL_MEMORY_KHR);
+      }
+   }
 
    set->size = size;
    set->layout = layout;
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list