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