radv: rework shaders ref counting

Introduce helpers like for descriptor set layouts. This will also
help graphics pipeline libraries.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17628>
This commit is contained in:
Samuel Pitoiset
2022-07-19 14:26:20 +02:00
committed by Marge Bot
parent 6f4b6b4d11
commit a2b8a92c72
4 changed files with 26 additions and 11 deletions

View File

@@ -217,10 +217,10 @@ radv_pipeline_destroy(struct radv_device *device, struct radv_pipeline *pipeline
for (unsigned i = 0; i < MESA_VULKAN_SHADER_STAGES; ++i)
if (pipeline->shaders[i])
radv_shader_destroy(device, pipeline->shaders[i]);
radv_shader_unref(device, pipeline->shaders[i]);
if (pipeline->gs_copy_shader)
radv_shader_destroy(device, pipeline->gs_copy_shader);
radv_shader_unref(device, pipeline->gs_copy_shader);
if (pipeline->cs.buf)
free(pipeline->cs.buf);