anv/descriptor_set: Destroy sets before pool finalization
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 24 Apr 2019 02:46:32 +0000 (21:46 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 24 Apr 2019 05:40:27 +0000 (05:40 +0000)
Fixes: 105002bd2d "anv: destroy descriptor sets when pool gets..."
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_descriptor_set.c

index a1dd8a3527f3dd8a6b7580843b64a5482a10be0c..882c42f231e6955dc7408903e00661fe677c9d37 100644 (file)
@@ -745,6 +745,11 @@ void anv_DestroyDescriptorPool(
    if (!pool)
       return;
 
+   list_for_each_entry_safe(struct anv_descriptor_set, set,
+                            &pool->desc_sets, pool_link) {
+      anv_descriptor_set_destroy(device, pool, set);
+   }
+
    if (pool->bo.size) {
       anv_gem_munmap(pool->bo.map, pool->bo.size);
       anv_vma_free(device, &pool->bo);
@@ -752,11 +757,6 @@ void anv_DestroyDescriptorPool(
    }
    anv_state_stream_finish(&pool->surface_state_stream);
 
-   list_for_each_entry_safe(struct anv_descriptor_set, set,
-                            &pool->desc_sets, pool_link) {
-      anv_descriptor_set_destroy(device, pool, set);
-   }
-
    util_vma_heap_finish(&pool->bo_heap);
 
    vk_free2(&device->alloc, pAllocator, pool);