c->inputs[attr * 4 + 1] = qir_FRAG_Y(c);
c->inputs[attr * 4 + 2] =
qir_FMUL(c,
- qir_FRAG_Z(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);
}
qir_TLB_DISCARD_SETUP(c, c->discard);
if (c->fs_key->depth_enabled) {
- qir_emit(c, qir_inst(QOP_TLB_PASSTHROUGH_Z_WRITE, c->undef,
- c->undef, c->undef));
+ qir_TLB_Z_WRITE(c, qir_FRAG_Z(c));
}
bool color_written = false;
[QOP_VPM_WRITE] = { "vpm_write", 0, 1, true },
[QOP_VPM_READ] = { "vpm_read", 0, 1, true },
[QOP_TLB_DISCARD_SETUP] = { "discard", 0, 1, true },
- [QOP_TLB_PASSTHROUGH_Z_WRITE] = { "tlb_passthrough_z", 0, 0, true },
+ [QOP_TLB_Z_WRITE] = { "tlb_z", 0, 1, true },
[QOP_TLB_COLOR_WRITE] = { "tlb_color", 0, 1, true },
[QOP_TLB_COLOR_READ] = { "tlb_color_read", 1, 0, true },
[QOP_VARY_ADD_C] = { "vary_add_c", 1, 1 },
QOP_VPM_WRITE,
QOP_VPM_READ,
QOP_TLB_DISCARD_SETUP,
- QOP_TLB_PASSTHROUGH_Z_WRITE,
+ QOP_TLB_Z_WRITE,
QOP_TLB_COLOR_WRITE,
QOP_TLB_COLOR_READ,
QOP_VARY_ADD_C,
QIR_ALU0(FRAG_RCP_W)
QIR_ALU0(TEX_RESULT)
QIR_ALU0(TLB_COLOR_READ)
+QIR_NODST_1(TLB_Z_WRITE)
QIR_NODST_1(TLB_DISCARD_SETUP)
static inline struct qreg
if (qinst->src[i].file == QFILE_TEMP)
reg_uses_remaining[qinst->src[i].index]++;
}
- if (qinst->op == QOP_TLB_PASSTHROUGH_Z_WRITE ||
- qinst->op == QOP_FRAG_Z)
+ if (qinst->op == QOP_FRAG_Z)
reg_in_use[3 + 32 + QPU_R_FRAG_PAYLOAD_ZW] = true;
}
if (reg.mux != QPU_MUX_R4)
continue;
break;
+ case QOP_FRAG_Z:
+ if (reg.mux != QPU_MUX_B ||
+ reg.addr != QPU_R_FRAG_PAYLOAD_ZW) {
+ continue;
+ }
+ break;
default:
if (reg.mux == QPU_MUX_R4)
continue;
break;
case QOP_FRAG_Z:
- queue(c, qpu_a_ITOF(dst,
- qpu_rb(QPU_R_FRAG_PAYLOAD_ZW)));
+ /* QOP_FRAG_Z doesn't emit instructions, just
+ * allocates the register to the Z payload.
+ */
break;
case QOP_FRAG_RCP_W:
*last_inst(c) |= QPU_SF;
break;
- case QOP_TLB_PASSTHROUGH_Z_WRITE:
- queue(c, qpu_a_MOV(qpu_ra(QPU_W_TLB_Z),
- qpu_rb(QPU_R_FRAG_PAYLOAD_ZW)));
+ case QOP_TLB_Z_WRITE:
+ queue(c, qpu_a_MOV(qpu_ra(QPU_W_TLB_Z), src[0]));
if (discard) {
set_last_cond_add(c, QPU_COND_ZS);
}