instr->cat6.type = TYPE_U32;
instr->cat6.iim_val = 1;
} else {
- instr = ir3_BARY_F(block, inloc, 0, ctx->frag_vcoord, 0);
+ instr = ir3_BARY_F(block, inloc, 0, ctx->ij_pixel, 0);
instr->regs[2]->wrmask = 0x3;
}
break;
case nir_intrinsic_load_barycentric_centroid:
case nir_intrinsic_load_barycentric_pixel:
- ir3_split_dest(b, dst, ctx->frag_vcoord, 0, 2);
+ /* NOTE: we still pre-create ij_pixel just to keep things working with
+ * nir producers that create "old style" frag shader inputs (ie. just
+ * load_input, vs load_barycentric_* + load_interpolated_input)
+ */
+ ir3_split_dest(b, dst, ctx->ij_pixel, 0, 2);
break;
case nir_intrinsic_load_interpolated_input:
idx = nir_intrinsic_base(intr);
/* for fragment shader, the vcoord input register is used as the
* base for bary.f varying fetch instrs:
+ *
+ * TODO defer creating ctx->ij_pixel and corresponding sysvals
+ * until emit_intrinsic when we know they are actually needed.
+ * For now, we defer creating ctx->ij_centroid, etc, since we
+ * only need ij_pixel for "old style" varying inputs (ie.
+ * tgsi_to_nir)
*/
struct ir3_instruction *vcoord = NULL;
if (ctx->so->type == MESA_SHADER_FRAGMENT) {
vcoord = create_input_compmask(ctx, 0, 0x3);
ir3_split_dest(ctx->block, xy, vcoord, 0, 2);
- ctx->frag_vcoord = ir3_create_collect(ctx, xy, 2);
+ ctx->ij_pixel = ir3_create_collect(ctx, xy, 2);
}
/* Setup inputs: */
nir_function_impl *impl;
/* For fragment shaders, varyings are not actual shader inputs,
- * instead the hw passes a varying-coord which is used with
+ * instead the hw passes a ij coord which is used with
* bary.f.
*
* But NIR doesn't know that, it still declares varyings as
* inputs. So we do all the input tracking normally and fix
* things up after compile_instructions()
- *
- * NOTE that frag_vcoord is the hardware position (possibly it
- * is actually an index or tag or some such.. it is *not*
- * values that can be directly used for gl_FragCoord..)
*/
- struct ir3_instruction *frag_vcoord;
+ struct ir3_instruction *ij_pixel;
/* for fragment shaders, for gl_FrontFacing and gl_FragCoord: */
struct ir3_instruction *frag_face, *frag_coord;
dump_output(out, so, VARYING_SLOT_PSIZ, "psize");
break;
case MESA_SHADER_FRAGMENT:
- dump_reg(out, "pos (bary)",
+ dump_reg(out, "pos (ij_pixel)",
ir3_find_sysval_regid(so, SYSTEM_VALUE_BARYCENTRIC_PIXEL));
dump_output(out, so, FRAG_RESULT_DEPTH, "posz");
if (so->color0_mrt) {