return reg->num & 0x3;
}
+#define INVALID_REG regid(63, 0)
+#define VALIDREG(r) ((r) != INVALID_REG)
+#define CONDREG(r, val) COND(VALIDREG(r), (val))
+
static inline bool is_flow(struct ir3_instruction *instr)
{
return (opc_cat(instr->opc) == 0);
*/
for (unsigned i = 0; i < so->inputs_count; i++)
- so->inputs[i].regid = regid(63, 0);
+ so->inputs[i].regid = INVALID_REG;
for (unsigned i = 0; i < so->outputs_count; i++)
- so->outputs[i].regid = regid(63, 0);
+ so->outputs[i].regid = INVALID_REG;
struct ir3_instruction *out;
foreach_output(out, ir) {
assert(in->opc == OPC_META_INPUT);
unsigned inidx = in->input.inidx;
- so->inputs[inidx].regid = in->regs[0]->num;
- so->inputs[inidx].half = !!(in->regs[0]->flags & IR3_REG_HALF);
+ if (pre_assign_inputs) {
+ if (VALIDREG(so->nonbinning->inputs[inidx].regid)) {
+ compile_assert(ctx, in->regs[0]->num ==
+ so->nonbinning->inputs[inidx].regid);
+ compile_assert(ctx, !!(in->regs[0]->flags & IR3_REG_HALF) ==
+ so->nonbinning->inputs[inidx].half);
+ }
+ so->inputs[inidx].regid = so->nonbinning->inputs[inidx].regid;
+ so->inputs[inidx].half = so->nonbinning->inputs[inidx].half;
+ } else {
+ so->inputs[inidx].regid = in->regs[0]->num;
+ so->inputs[inidx].half = !!(in->regs[0]->flags & IR3_REG_HALF);
+ }
}
if (ctx->astc_srgb)
OUT_RING(ring, state->fs->image_mapping.num_ibo);
}
-#define VALIDREG(r) ((r) != regid(63,0))
-#define CONDREG(r, val) COND(VALIDREG(r), (val))
-
static inline uint32_t
next_regid(uint32_t reg, uint32_t increment)
{