vk: Handle allocation failure in anv_pipeline_init()
authorKristian Høgsberg Kristensen <krh@owl.jf.intel.com>
Mon, 4 Jan 2016 06:42:01 +0000 (22:42 -0800)
committerKristian Høgsberg Kristensen <krh@owl.jf.intel.com>
Mon, 4 Jan 2016 18:06:50 +0000 (10:06 -0800)
Fixes dEQP-VK.api.object_management.alloc_callback_fail.* failures.

src/vulkan/anv_pipeline.c

index 12430f824adec29b6a7021b264638f7f0d56983b..ad47f9661e4792445bd8ab573bb752c10eb320ee 100644 (file)
@@ -950,6 +950,8 @@ anv_pipeline_init(struct anv_pipeline *pipeline, struct anv_device *device,
                   const struct anv_graphics_pipeline_create_info *extra,
                   const VkAllocationCallbacks *alloc)
 {
+   VkResult result;
+
    anv_validate {
       anv_pipeline_validate_create_info(pCreateInfo);
    }
@@ -960,8 +962,9 @@ anv_pipeline_init(struct anv_pipeline *pipeline, struct anv_device *device,
    pipeline->device = device;
    pipeline->layout = anv_pipeline_layout_from_handle(pCreateInfo->layout);
 
-   anv_reloc_list_init(&pipeline->batch_relocs, alloc);
-   /* TODO: Handle allocation fail */
+   result = anv_reloc_list_init(&pipeline->batch_relocs, alloc);
+   if (result != VK_SUCCESS)
+      return result;
 
    pipeline->batch.alloc = alloc;
    pipeline->batch.next = pipeline->batch.start = pipeline->batch_data;