(1 << GEN6_SF_TRIFAN_PROVOKE_SHIFT);
}
- /* flat shading */
- if (ctx->Light.ShadeModel == GL_FLAT) {
- dw17 |= ((brw->fragment_program->Base.InputsRead & (FRAG_BIT_COL0 | FRAG_BIT_COL1)) >>
- ((brw->fragment_program->Base.InputsRead & FRAG_BIT_WPOS) ? 0 : 1));
- }
-
/* Create the mapping from the FS inputs we produce to the VS outputs
* they source from.
*/
if (attr == FRAG_ATTRIB_PNTC)
dw16 |= (1 << input_index);
+ /* flat shading */
+ if (ctx->Light.ShadeModel == GL_FLAT) {
+ /*
+ * Setup the Constant Interpolation Enable bit mask for each
+ * corresponding attribute(currently, we only care two attrs:
+ * FRAG_BIT_COL0 and FRAG_BIT_COL1).
+ *
+ * FIXME: should we care other attributes?
+ */
+ if (attr == FRAG_ATTRIB_COL0 || attr == FRAG_ATTRIB_COL1)
+ dw17 |= (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
dw1 |= GEN6_SF_POINT_SPRITE_LOWERLEFT;
dw10 = 0;
-
- /* _NEW_LIGHT (flat shading) */
dw11 = 0;
- if (ctx->Light.ShadeModel == GL_FLAT) {
- dw11 |= ((brw->fragment_program->Base.InputsRead & (FRAG_BIT_COL0 | FRAG_BIT_COL1)) >>
- ((brw->fragment_program->Base.InputsRead & FRAG_BIT_WPOS) ? 0 : 1));
- }
/* Create the mapping from the FS inputs we produce to the VS outputs
* they source from.
if (attr == FRAG_ATTRIB_PNTC)
dw10 |= (1 << input_index);
+ /* flat shading */
+ if (ctx->Light.ShadeModel == GL_FLAT) {
+ /*
+ * Setup the Constant Interpolation Enable bit mask for each
+ * corresponding attribute(currently, we only care two attrs:
+ * FRAG_BIT_COL0 and FRAG_BIT_COL1).
+ *
+ * FIXME: should we care other attributes?
+ */
+ if (attr == FRAG_ATTRIB_COL0 || attr == FRAG_ATTRIB_COL1)
+ 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