nvk: Unref shaders on pipeline free

Fixes: d6a1e29ccd ("nvk: pipeline shader cache")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27130>
This commit is contained in:
Faith Ekstrand 2024-01-17 12:06:22 -06:00 committed by Marge Bot
parent 4b0448d8f8
commit be0f04f5bd

View file

@ -32,6 +32,11 @@ nvk_pipeline_free(struct nvk_device *dev,
struct nvk_pipeline *pipeline,
const VkAllocationCallbacks *pAllocator)
{
for (uint32_t s = 0; s < ARRAY_SIZE(pipeline->shaders); s++) {
if (pipeline->shaders[s] != NULL)
vk_pipeline_cache_object_unref(&dev->vk, &pipeline->shaders[s]->base);
}
vk_object_free(&dev->vk, pAllocator, pipeline);
}