if (flags & ~valid_flags)
return false;
+ /* Allow an immediate src1 for flat.b, since it's ignored */
+ if (instr->opc == OPC_FLAT_B &&
+ n == 1 && flags == IR3_REG_IMMED)
+ return true;
+
if (flags & (IR3_REG_CONST | IR3_REG_IMMED | IR3_REG_SHARED)) {
unsigned m = n ^ 1;
/* cannot deal w/ const or shared in both srcs:
instr = ir3_BARY_F(block, inloc, 0, coord, 0);
} else if (ctx->compiler->flat_bypass) {
if (ctx->compiler->gen >= 6) {
- struct ir3_instruction *ij[2];
-
- for (int i = 0; i < 2; i++) {
- ij[i] = create_immed(block, fui(0.0));
- }
-
- instr = ir3_FLAT_B(block, inloc, 0, ir3_create_collect(block, ij, 2), 0);
- instr->srcs[1]->wrmask = 0x3;
+ instr = ir3_FLAT_B(block, inloc, 0, inloc, 0);
} else {
instr = ir3_LDLV(block, inloc, 0, create_immed(block, 1), 0);
instr->cat6.type = TYPE_U32;