zink: fix compute shader leaks

Compute program owns the nir and zink shaders now and must free them
too when destroyed.

Fixes: 4cb4bb555e ("zink: create compute programs from compute shaders directly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
This commit is contained in:
SoroushIMG
2023-02-12 00:36:29 +00:00
committed by Marge Bot
parent 742c77078c
commit 6af3a12e70
+7 -2
View File
@@ -1457,8 +1457,13 @@ zink_destroy_compute_program(struct zink_screen *screen,
{
deinit_program(screen, &comp->base);
if (comp->shader)
_mesa_set_remove_key(comp->shader->programs, comp);
assert(comp->shader);
assert(!comp->shader->spirv);
_mesa_set_destroy(comp->shader->programs, NULL);
ralloc_free(comp->shader->nir);
ralloc_free(comp->shader);
destroy_shader_cache(screen, &comp->shader_cache[0]);
destroy_shader_cache(screen, &comp->shader_cache[1]);