diff --git a/.pick_status.json b/.pick_status.json index 0899f0395ba..62c83dc031d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -484,7 +484,7 @@ "description": "anv: destroy sets when destroying pool", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index 801111ce520..c65d506502b 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -1387,6 +1387,10 @@ VkResult anv_CreateDescriptorPool( return VK_SUCCESS; } +static void anv_descriptor_set_destroy(struct anv_device *device, + struct anv_descriptor_pool *pool, + struct anv_descriptor_set *set); + void anv_DestroyDescriptorPool( VkDevice _device, VkDescriptorPool _pool, @@ -1400,9 +1404,16 @@ void anv_DestroyDescriptorPool( ANV_RMV(resource_destroy, device, pool); + /* From the Vulkan spec, vkDestroyDescriptorPool: + * + * "When a pool is destroyed, all descriptor sets allocated from the + * pool are implicitly freed and become invalid. Descriptor sets + * allocated from a given pool do not need to be freed before destroying + * that descriptor pool." + */ list_for_each_entry_safe(struct anv_descriptor_set, set, &pool->desc_sets, pool_link) { - vk_descriptor_set_layout_unref(&device->vk, &set->layout->vk); + anv_descriptor_set_destroy(device, pool, set); } util_vma_heap_finish(&pool->host_heap);