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:
f94a5f30e0ebd ("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>
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;
{
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(
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;