lavapipe: fix descriptor set layout freeing.

Have to store the used allocator otherwise ends up being free wrong.

Fix for
dEQP-VK.api.object_management.alloc_callback_fail.descriptor_set_layout*

Fixes: f94a5f30e0 ("lavapipe: add reference counting to descriptor set layout")

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9247>
This commit is contained in:
Dave Airlie 2021-02-24 17:02:51 +10:00
parent b9133e48a6
commit 1121ea8192
2 changed files with 3 additions and 1 deletions

View File

@ -59,6 +59,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateDescriptorSetLayout(
struct lvp_sampler **samplers =
(struct lvp_sampler **)&set_layout->binding[max_binding + 1];
set_layout->alloc = pAllocator;
set_layout->binding_count = max_binding + 1;
set_layout->shader_stages = 0;
set_layout->size = 0;
@ -163,7 +164,7 @@ lvp_descriptor_set_layout_destroy(struct lvp_device *device,
{
assert(layout->ref_cnt == 0);
vk_object_base_finish(&layout->base);
vk_free(&device->vk.alloc, layout);
vk_free2(&device->vk.alloc, layout->alloc, layout);
}
VKAPI_ATTR void VKAPI_CALL lvp_DestroyDescriptorSetLayout(

View File

@ -419,6 +419,7 @@ struct lvp_descriptor_set_binding_layout {
struct lvp_descriptor_set_layout {
struct vk_object_base base;
const VkAllocationCallbacks *alloc;
/* Descriptor set layouts can be destroyed at almost any time */
uint32_t ref_cnt;