zink: stop leaking programs

gfx and compute programs both end up with an extra ref from creation,
so they both need to lose a ref during creation after they get their
shader refs

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9470>
This commit is contained in:
Mike Blumenkrantz 2020-11-04 20:50:08 -05:00 committed by Marge Bot
parent 46b356ca2d
commit edcad555f8

View file

@ -559,6 +559,7 @@ zink_create_gfx_program(struct zink_context *ctx,
zink_gfx_program_reference(screen, NULL, prog);
}
}
p_atomic_dec(&prog->base.reference.count);
if (!zink_descriptor_program_init(ctx, stages, (struct zink_program*)prog))
goto fail;
@ -653,7 +654,6 @@ zink_create_compute_program(struct zink_context *ctx, struct zink_shader *shader
equals_compute_pipeline_state);
_mesa_set_add(shader->programs, comp);
zink_compute_program_reference(screen, NULL, comp);
comp->shader = shader;
struct zink_shader *stages[ZINK_SHADER_COUNT] = {};