panfrost: Use memctx for sysvals

8.74KB leaked over 52 calls from:
    0xffffbb5b9fc3
      in ??
    _mesa_hash_table_init
      at ../src/util/hash_table.c:163
      in /home/alyssa/rockchip_dri.so
    _mesa_hash_table_create
      at ../src/util/hash_table.c:186
    _mesa_hash_table_u64_create
      at ../src/util/hash_table.c:701
      in /home/alyssa/rockchip_dri.so
    panfrost_nir_assign_sysvals
      at ../src/panfrost/util/pan_sysval.c:130
      in /home/alyssa/rockchip_dri.so
    midgard_compile_shader_nir
      at ../src/panfrost/midgard/midgard_compile.c:2905
      in /home/alyssa/rockchip_dri.so

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: mesa-stable
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
This commit is contained in:
Alyssa Rosenzweig 2020-08-18 08:31:42 -04:00 committed by Tomeu Vizoso
parent 8dd38e5a3e
commit 680fb05f99
4 changed files with 5 additions and 5 deletions

View file

@ -1342,7 +1342,7 @@ bifrost_compile_shader_nir(nir_shader *nir, panfrost_program *program, unsigned
nir_print_shader(nir, stdout);
}
panfrost_nir_assign_sysvals(&ctx->sysvals, nir);
panfrost_nir_assign_sysvals(&ctx->sysvals, ctx, nir);
program->sysval_count = ctx->sysvals.sysval_count;
memcpy(program->sysvals, ctx->sysvals.sysvals, sizeof(ctx->sysvals.sysvals[0]) * ctx->sysvals.sysval_count);
ctx->blend_types = program->blend_types;

View file

@ -2897,7 +2897,7 @@ midgard_compile_shader_nir(nir_shader *nir, panfrost_program *program, bool is_b
/* Assign sysvals and counts, now that we're sure
* (post-optimisation) */
panfrost_nir_assign_sysvals(&ctx->sysvals, nir);
panfrost_nir_assign_sysvals(&ctx->sysvals, ctx, nir);
program->sysval_count = ctx->sysvals.sysval_count;
memcpy(program->sysvals, ctx->sysvals.sysvals, sizeof(ctx->sysvals.sysvals[0]) * ctx->sysvals.sysval_count);

View file

@ -76,7 +76,7 @@ struct panfrost_sysvals {
};
void
panfrost_nir_assign_sysvals(struct panfrost_sysvals *ctx, nir_shader *shader);
panfrost_nir_assign_sysvals(struct panfrost_sysvals *ctx, void *memctx, nir_shader *shader);
int
panfrost_sysval_for_instr(nir_instr *instr, nir_dest *dest);

View file

@ -124,10 +124,10 @@ panfrost_nir_assign_sysval_body(struct panfrost_sysvals *ctx, nir_instr *instr)
}
void
panfrost_nir_assign_sysvals(struct panfrost_sysvals *ctx, nir_shader *shader)
panfrost_nir_assign_sysvals(struct panfrost_sysvals *ctx, void *memctx, nir_shader *shader)
{
ctx->sysval_count = 0;
ctx->sysval_to_id = _mesa_hash_table_u64_create(NULL);
ctx->sysval_to_id = _mesa_hash_table_u64_create(memctx);
nir_foreach_function(function, shader) {
if (!function->impl) continue;