+
+ /* Create the mapping from the FS inputs we produce to the VS outputs
+ * they source from.
+ */
+ uint32_t max_source_attr = 0;
+ for (; attr < VARYING_SLOT_MAX; attr++) {
+ enum glsl_interp_qualifier interp_qualifier =
+ brw->fragment_program->InterpQualifier[attr];
+ bool is_gl_Color = attr == VARYING_SLOT_COL0 || attr == VARYING_SLOT_COL1;
+
+ if (!(brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(attr)))
+ continue;
+
+ if (ctx->Point.PointSprite &&
+ attr >= VARYING_SLOT_TEX0 && attr <= VARYING_SLOT_TEX7 &&
+ ctx->Point.CoordReplace[attr - VARYING_SLOT_TEX0]) {
+ dw10 |= (1 << input_index);
+ }
+
+ if (attr == VARYING_SLOT_PNTC)
+ dw10 |= (1 << input_index);
+
+ /* flat shading */
+ if (interp_qualifier == INTERP_QUALIFIER_FLAT ||
+ (shade_model_flat && is_gl_Color &&
+ interp_qualifier == INTERP_QUALIFIER_NONE))
+ dw11 |= (1 << input_index);
+
+ /* The hardware can only do the overrides on 16 overrides at a
+ * time, and the other up to 16 have to be lined up so that the
+ * input index = the output index. We'll need to do some
+ * tweaking to make sure that's the case.
+ */
+ assert(input_index < 16 || attr == input_index);
+
+ /* CACHE_NEW_VS_PROG | _NEW_LIGHT | _NEW_PROGRAM */
+ attr_overrides[input_index++] =
+ get_attr_override(&brw->vs.prog_data->vue_map,
+ urb_entry_read_offset, attr,
+ ctx->VertexProgram._TwoSideEnabled,
+ &max_source_attr);