diff options
author | Tomeu Vizoso <[email protected]> | 2019-05-07 17:28:36 +0200 |
---|---|---|
committer | Tomeu Vizoso <[email protected]> | 2019-05-10 07:37:57 +0200 |
commit | 554975bafa4ec17e19d90725c66feeb4e1f49d9e (patch) | |
tree | 6a327060bd62528d3ca016ba2d75bd3e3f7c240d /src | |
parent | 67b9c196d0a403d7252448f262627eaeff49a958 (diff) |
panfrost: Fix two uninitialized accesses in compiler
Valgrind was complaining of those.
NIR_PASS only sets progress to TRUE if there was progress.
nir_const_load_to_arr() only sets as many constants as components has
the instruction.
This was causing some dEQP tests to flip-flop, such as:
dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_src_color_constant_color
Signed-off-by: Tomeu Vizoso <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Fixes: 14531d676b11 ("nir: make nir_const_value scalar")
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/midgard_compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c index eaf473840ca..25316cab053 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c +++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c @@ -1020,7 +1020,7 @@ emit_load_const(compiler_context *ctx, nir_load_const_instr *instr) { nir_ssa_def def = instr->def; - float *v = ralloc_array(NULL, float, 4); + float *v = rzalloc_array(NULL, float, 4); nir_const_load_to_arr(v, instr, f32); _mesa_hash_table_u64_insert(ctx->ssa_constants, def.index + 1, v); } |