anv: destroy descriptor sets when pool gets reset
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Mon, 11 Mar 2019 17:33:54 +0000 (18:33 +0100)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 12 Mar 2019 01:40:31 +0000 (20:40 -0500)
As stated in Vulkan spec:
   "Resetting a descriptor pool recycles all of the resources from all
    of the descriptor sets allocated from the descriptor pool back to
    the descriptor pool, and the descriptor sets are implicitly freed."

This fixes dEQP-VK.api.descriptor_pool.*

Fixes: 14f6275c92f1 "anv/descriptor_set: add reference counting for..."
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Tested-by: Clayton Craft <clayton.a.craft@intel.com>
src/intel/vulkan/anv_descriptor_set.c

index f293cf469ee4b1969b0dc5827fa3f67ab6043b60..f34a44aefd7e8cf00607969b35813b9277b970c9 100644 (file)
@@ -636,6 +636,12 @@ VkResult anv_ResetDescriptorPool(
    }
 
    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);
+   }
+
    anv_state_stream_init(&pool->surface_state_stream,
                          &device->surface_state_pool, 4096);
    pool->surface_state_free_list = NULL;