I need to get the non-reciprocal version of W for interpolation, anyway.
qir_FMUL(c,
qir_ITOF(c, qir_FRAG_Z(c)),
qir_uniform_f(c, 1.0 / 0xffffff));
- c->inputs[attr * 4 + 3] = qir_FRAG_RCP_W(c);
+ c->inputs[attr * 4 + 3] = qir_RCP(c, qir_FRAG_W(c));
}
static struct qreg
[QOP_FRAG_X] = { "frag_x", 1, 0 },
[QOP_FRAG_Y] = { "frag_y", 1, 0 },
[QOP_FRAG_Z] = { "frag_z", 1, 0 },
- [QOP_FRAG_RCP_W] = { "frag_rcp_w", 1, 0 },
+ [QOP_FRAG_W] = { "frag_w", 1, 0 },
[QOP_TEX_S] = { "tex_s", 0, 2 },
[QOP_TEX_T] = { "tex_t", 0, 2 },
QOP_FRAG_X,
QOP_FRAG_Y,
QOP_FRAG_Z,
- QOP_FRAG_RCP_W,
+ QOP_FRAG_W,
/** Texture x coordinate parameter write */
QOP_TEX_S,
QIR_ALU0(FRAG_X)
QIR_ALU0(FRAG_Y)
QIR_ALU0(FRAG_Z)
-QIR_ALU0(FRAG_RCP_W)
+QIR_ALU0(FRAG_W)
QIR_ALU0(TEX_RESULT)
QIR_ALU0(TLB_COLOR_READ)
QIR_NODST_1(TLB_Z_WRITE)
break;
case QOP_FRAG_Z:
- /* QOP_FRAG_Z doesn't emit instructions, just
- * allocates the register to the Z payload.
+ case QOP_FRAG_W:
+ /* QOP_FRAG_Z/W don't emit instructions, just allocate
+ * the register to the Z/W payload.
*/
break;
- case QOP_FRAG_RCP_W:
- queue(c, qpu_a_MOV(qpu_rb(QPU_W_SFU_RECIP),
- qpu_ra(QPU_R_FRAG_PAYLOAD_ZW)));
-
- queue(c, qpu_a_MOV(dst, qpu_r4()));
- break;
-
case QOP_TLB_DISCARD_SETUP:
discard = true;
queue(c, qpu_a_MOV(src[0], src[0]));
}
if (qinst->op == QOP_FRAG_Z)
reg_in_use[3 + 32 + QPU_R_FRAG_PAYLOAD_ZW] = true;
+ if (qinst->op == QOP_FRAG_W)
+ reg_in_use[3 + QPU_R_FRAG_PAYLOAD_ZW] = true;
}
foreach(node, &c->instructions) {
continue;
}
break;
+ case QOP_FRAG_W:
+ if (reg.mux != QPU_MUX_A ||
+ reg.addr != QPU_R_FRAG_PAYLOAD_ZW) {
+ continue;
+ }
+ break;
default:
if (reg.mux == QPU_MUX_R4)
continue;