summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-05-18 09:31:49 -0700
committerKenneth Graunke <[email protected]>2016-05-20 14:29:04 -0700
commit88ea960aa74402ea358d05b95709c3299002ad83 (patch)
tree80e8a4fcc44a6679356850f73b27bb6983d2637e /src/compiler/nir
parentc9192fcbd28063f1273917d258456a5cd38dd119 (diff)
nir: Make nir_lower_wpos_ytransform() match FragCoord by location.
gl_FragCoord is a shader input with location == VARYING_SLOT_POS. ARB_fragment_programs have an equivalent input at VARYING_SLOT_POS, but it isn't called gl_FragCoord. We do want to transform it. Matching by location guarantees we catch both. Fixes several fp tests on a branch which uses this pass on i965. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_lower_wpos_ytransform.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_lower_wpos_ytransform.c b/src/compiler/nir/nir_lower_wpos_ytransform.c
index 4dc9d950e06..c437b3a2797 100644
--- a/src/compiler/nir/nir_lower_wpos_ytransform.c
+++ b/src/compiler/nir/nir_lower_wpos_ytransform.c
@@ -286,7 +286,8 @@ lower_wpos_ytransform_block(lower_wpos_ytransform_state *state, nir_block *block
nir_deref_var *dvar = intr->variables[0];
nir_variable *var = dvar->var;
- if (strcmp(var->name, "gl_FragCoord") == 0) {
+ if (var->data.mode == nir_var_shader_in &&
+ var->data.location == VARYING_SLOT_POS) {
/* gl_FragCoord should not have array/struct deref's: */
assert(dvar->deref.child == NULL);
lower_fragcoord(state, intr);