foreach_block (block, &ir->block_list) {
foreach_instr (instr, &block->instr_list) {
if (instr->opc == OPC_META_INPUT) {
- /* special case, if pre-fs texture fetch used, we cannot
- * eliminate the barycentric i/j input
- */
- if (so->num_sampler_prefetch &&
- instr->input.sysval == SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL)
- continue;
-
/* Without GS header geometry shader is never invoked. */
if (instr->input.sysval == SYSTEM_VALUE_GS_HEADER_IR3)
continue;
ij_regid[i] = ir3_find_sysval_regid(fs, SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL + i);
if (fs->num_sampler_prefetch > 0) {
- assert(VALIDREG(ij_regid[IJ_PERSP_PIXEL]));
- /* also, it seems like ij_pix is *required* to be r0.x */
- assert(ij_regid[IJ_PERSP_PIXEL] == regid(0, 0));
+ /* It seems like ij_pix is *required* to be r0.x */
+ assert(!VALIDREG(ij_regid[IJ_PERSP_PIXEL]) ||
+ ij_regid[IJ_PERSP_PIXEL] == regid(0, 0));
}
tu_cs_emit_pkt4(cs, REG_A6XX_SP_FS_PREFETCH_CNTL, 1 + fs->num_sampler_prefetch);
ij_regid[i] =
ir3_find_sysval_regid(fs, SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL + i);
- /* If we have pre-dispatch texture fetches, then ij_pix should not
- * be DCE'd, even if not actually used in the shader itself:
- */
if (fs->num_sampler_prefetch > 0) {
- assert(VALIDREG(ij_regid[IJ_PERSP_PIXEL]));
- /* also, it seems like ij_pix is *required* to be r0.x */
- assert(ij_regid[IJ_PERSP_PIXEL] == regid(0, 0));
+ /* It seems like ij_pix is *required* to be r0.x */
+ assert(!VALIDREG(ij_regid[IJ_PERSP_PIXEL]) ||
+ ij_regid[IJ_PERSP_PIXEL] == regid(0, 0));
}
/* we can't write gl_SampleMask for !msaa.. if b0 is zero then we