Previously the loop for assigning registers was bailing out early if
the register had a null source. I think the intention is that in this
case it isn’t necessary to assign a register. However it was also
missing out the part to fix up the types. This can happen if the
instruction is copy propagated to be a move from a constant half-float
input register. In that case it still needs to fix up the types.
Fixes assert in
dEQP-GLES3.functional.shaders.invariance.highp.subexpression_precision_mediump
when lowering the precision of the variables.
Signed-off-by: Rob Clark <robdclark@chromium.org>
foreach_src_n(reg, n, instr) {
struct ir3_instruction *src = reg->instr;
/* Note: reg->instr could be null for IR3_REG_ARRAY */
- if (!(src || (reg->flags & IR3_REG_ARRAY)))
- continue;
- reg_assign(ctx, instr->regs[n+1], src);
+ if (src || (reg->flags & IR3_REG_ARRAY))
+ reg_assign(ctx, instr->regs[n+1], src);
if (instr->regs[n+1]->flags & IR3_REG_HALF)
fixup_half_instr_src(instr);
}