Mesa (main): radv: fix vk_object_base_init/finish for the internal pipeline cache

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 1 07:45:48 UTC 2021


Module: Mesa
Branch: main
Commit: 1b3f0ccb387d94d495b982a81a3f0d7043592a54
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1b3f0ccb387d94d495b982a81a3f0d7043592a54

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Wed Sep 29 09:28:50 2021 +0200

radv: fix vk_object_base_init/finish for the internal pipeline cache

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13102>

---

 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);
 }
 



More information about the mesa-commit mailing list