intel: Use a system value for gl_FragCoord

It's kind-of an anomaly that the Intel drivers are still treating
gl_FragCoord as an input.  It also makes zero sense because we have to
special-case it in the back-end.

Because ANV is the only user of nir_lower_wpos_center, we go ahead and
just update it to look for nir_intrinsic_load_frag_coord as part of this
patch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Jason Ekstrand
2019-07-18 09:59:44 -05:00
parent 44268b1c72
commit 4bb6e6817e
11 changed files with 19 additions and 52 deletions

View File

@@ -80,19 +80,9 @@ lower_wpos_center_block(nir_builder *b, nir_block *block,
nir_foreach_instr(instr, block) {
if (instr->type == nir_instr_type_intrinsic) {
nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
if (intr->intrinsic == nir_intrinsic_load_deref) {
nir_deref_instr *deref = nir_src_as_deref(intr->src[0]);
if (deref->mode != nir_var_shader_in)
continue;
nir_variable *var = nir_deref_instr_get_variable(deref);
if (var->data.location == VARYING_SLOT_POS) {
/* gl_FragCoord should not have array/struct derefs: */
assert(deref->deref_type == nir_deref_type_var);
update_fragcoord(b, intr, for_sample_shading);
progress = true;
}
if (intr->intrinsic == nir_intrinsic_load_frag_coord) {
update_fragcoord(b, intr, for_sample_shading);
progress = true;
}
}
}