anv: Return better errors from AllocateDescriptorSets
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 21 Jan 2017 15:40:22 +0000 (07:40 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 24 Jan 2017 20:27:48 +0000 (12:27 -0800)
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_descriptor_set.c

index a5e65afc489f66f8befea4effcc02b3624b407e3..a4b7638a6180634ac2afc1fbb0f43b8181e0dfe5 100644 (file)
@@ -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;