pan/midg: Fix 2 memory leaks

The ssa_constants hash table and its elements are leaked. Pass the
context to the allocator to avoid that.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10408>
This commit is contained in:
Boris Brezillon
2021-04-22 16:14:41 +02:00
parent 74c467d988
commit 51a4bca3c3
+2 -2
View File
@@ -435,7 +435,7 @@ emit_load_const(compiler_context *ctx, nir_load_const_instr *instr)
{
nir_ssa_def def = instr->def;
midgard_constants *consts = rzalloc(NULL, midgard_constants);
midgard_constants *consts = rzalloc(ctx, midgard_constants);
assert(instr->def.num_components * instr->def.bit_size <= sizeof(*consts) * 8);
@@ -3040,7 +3040,7 @@ midgard_compile_shader_nir(nir_shader *nir,
/* Initialize at a global (not block) level hash tables */
ctx->ssa_constants = _mesa_hash_table_u64_create(NULL);
ctx->ssa_constants = _mesa_hash_table_u64_create(ctx);
/* Lower gl_Position pre-optimisation, but after lowering vars to ssa
* (so we don't accidentally duplicate the epilogue since mesa/st has