From 670944ba0462d83066fa66f4129ab59a30a85ad2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 6 Jan 2021 16:08:43 -0800 Subject: [PATCH] nir/lower_locals_to_regs: Use the imul_imm helper instead of forcing it. Cleaned up a bit of addressing math in the shader I just had to debug. Reviewed-by: Jason Ekstrand Reviewed-by: Gert Wollny Part-of: --- src/compiler/nir/nir_lower_locals_to_regs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_lower_locals_to_regs.c b/src/compiler/nir/nir_lower_locals_to_regs.c index 36a59678199..02f23a6f979 100644 --- a/src/compiler/nir/nir_lower_locals_to_regs.c +++ b/src/compiler/nir/nir_lower_locals_to_regs.c @@ -169,7 +169,7 @@ get_deref_reg_src(nir_deref_instr *deref, struct locals_to_regs_state *state) nir_ssa_def *index = nir_i2i(b, nir_ssa_for_src(b, d->arr.index, 1), 32); src.reg.indirect->ssa = nir_iadd(b, src.reg.indirect->ssa, - nir_imul(b, index, nir_imm_int(b, inner_array_size))); + nir_imul_imm(b, index, inner_array_size)); } inner_array_size *= glsl_get_length(nir_deref_instr_parent(d)->type);