From 1b3f0ccb387d94d495b982a81a3f0d7043592a54 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 29 Sep 2021 09:28:50 +0200 Subject: [PATCH] radv: fix vk_object_base_init/finish for the internal pipeline cache Signed-off-by: Samuel Pitoiset Reviewed-by: Jason Ekstrand Part-of: --- src/amd/vulkan/radv_pipeline_cache.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline_cache.c b/src/amd/vulkan/radv_pipeline_cache.c index 84c591a49cb..c31ab4819d6 100644 --- a/src/amd/vulkan/radv_pipeline_cache.c +++ b/src/amd/vulkan/radv_pipeline_cache.c @@ -63,6 +63,8 @@ radv_pipeline_cache_unlock(struct radv_pipeline_cache *cache) void radv_pipeline_cache_init(struct radv_pipeline_cache *cache, struct radv_device *device) { + vk_object_base_init(&device->vk, &cache->base, VK_OBJECT_TYPE_PIPELINE_CACHE); + cache->device = device; mtx_init(&cache->mutex, mtx_plain); cache->flags = 0; @@ -96,6 +98,8 @@ radv_pipeline_cache_finish(struct radv_pipeline_cache *cache) } mtx_destroy(&cache->mutex); free(cache->hash_table); + + vk_object_base_finish(&cache->base); } static uint32_t @@ -547,8 +551,6 @@ radv_CreatePipelineCache(VkDevice _device, const VkPipelineCacheCreateInfo *pCre if (cache == NULL) return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY); - vk_object_base_init(&device->vk, &cache->base, VK_OBJECT_TYPE_PIPELINE_CACHE); - if (pAllocator) cache->alloc = *pAllocator; else @@ -575,9 +577,8 @@ radv_DestroyPipelineCache(VkDevice _device, VkPipelineCache _cache, if (!cache) return; - radv_pipeline_cache_finish(cache); - vk_object_base_finish(&cache->base); + radv_pipeline_cache_finish(cache); vk_free2(&device->vk.alloc, pAllocator, cache); }