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:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user