collect = ir3_instr_create(ctx->block, -1, OPC_META_FI);
ir3_reg_create(collect, 0, 0);
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 4; i++) {
if (tinf.src_wrmask & (1 << i))
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA),
coord, src_swiz(coord, i));
else if (tinf.src_wrmask & ~((1 << i) - 1))
ir3_reg_create(collect, 0, 0);
+ }
/* Attach derivatives onto the end of the fan-in. Derivatives start after
* the 4th argument, so make sure that fi is padded up to 4 first.
ctx->max_bary = MAX2(ctx->max_bary, inloc->iim_val);
}
- for (i = 1; i < n->regs_count; i++) {
+ /* NOTE: consider dst register too.. it could happen that
+ * texture sample instruction (for example) writes some
+ * components which are unused. A subsequent instruction
+ * that writes the same register can race w/ the sam instr
+ * resulting in undefined results:
+ */
+ for (i = 0; i < n->regs_count; i++) {
reg = n->regs[i];
if (reg_gpr(reg)) {