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 <jason@jlekstrand.net>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8373>
This commit is contained in:
Eric Anholt 2021-01-06 16:08:43 -08:00 committed by Marge Bot
parent 111e4be698
commit 670944ba04
1 changed files with 1 additions and 1 deletions

View File

@ -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);