v3d: Stop advertising support for flat shading.

The GL frontend can lower this weird GL feature away for us.  This should
fix redeclaration of the gl_Color/SecondaryColor as centroid, since that
case had been missed in the !flat special case here.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>
This commit is contained in:
Eric Anholt
2021-01-20 13:22:23 -08:00
parent ff805f8ac7
commit bcb5f9f94a
5 changed files with 1 additions and 29 deletions
-23
View File
@@ -955,28 +955,6 @@ emit_fragment_varying(struct v3d_compile *c, nir_variable *var,
struct qreg result;
switch (var->data.interpolation) {
case INTERP_MODE_NONE:
/* If a gl_FrontColor or gl_BackColor input has no interp
* qualifier, then if we're using glShadeModel(GL_FLAT) it
* needs to be flat shaded.
*/
switch (var->data.location + array_index) {
case VARYING_SLOT_COL0:
case VARYING_SLOT_COL1:
case VARYING_SLOT_BFC0:
case VARYING_SLOT_BFC1:
if (c->fs_key->shade_model_flat) {
BITSET_SET(c->flat_shade_flags, i);
vir_MOV_dest(c, c->undef, vary);
result = vir_MOV(c, r5);
} else {
result = vir_FADD(c, vir_FMUL(c, vary,
c->payload_w), r5);
}
goto done;
default:
break;
}
/* FALLTHROUGH */
case INTERP_MODE_SMOOTH:
if (var->data.centroid) {
BITSET_SET(c->centroid_flags, i);
@@ -1002,7 +980,6 @@ emit_fragment_varying(struct v3d_compile *c, nir_variable *var,
unreachable("Bad interp mode");
}
done:
if (input_idx >= 0)
c->inputs[input_idx] = result;
return result;
-1
View File
@@ -389,7 +389,6 @@ struct v3d_fs_key {
bool sample_coverage;
bool sample_alpha_to_coverage;
bool sample_alpha_to_one;
bool shade_model_flat;
/* Mask of which color render targets are present. */
uint8_t cbufs;
uint8_t swap_color_rb;
-3
View File
@@ -1188,9 +1188,6 @@ pipeline_populate_v3d_fs_key(struct v3d_fs_key *key,
key->point_coord_upper_left = true;
}
}
/* FIXME: ditto, although for flat lighting. Again, neet to confirm.*/
key->shade_model_flat = false;
}
static void