summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-06-25 15:26:01 +0200
committerNicolai Hähnle <[email protected]>2017-07-31 14:55:28 +0200
commit5011923e09ec835dbd275a5137fde532ec600368 (patch)
tree5d38b882cf6f7a8b08d69c83b63bc6f4ff9e2570 /src/compiler
parentb27c2d402efb7dfbc6a8b9a6cbd2008cac3753e3 (diff)
nir: fix nir_lower_wpos_ytransform when gl_FragCoord is a system value
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_lower_wpos_ytransform.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_lower_wpos_ytransform.c b/src/compiler/nir/nir_lower_wpos_ytransform.c
index 873d259d7fc..771c6ffe4a5 100644
--- a/src/compiler/nir/nir_lower_wpos_ytransform.c
+++ b/src/compiler/nir/nir_lower_wpos_ytransform.c
@@ -302,8 +302,10 @@ 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 (var->data.mode == nir_var_shader_in &&
- var->data.location == VARYING_SLOT_POS) {
+ if ((var->data.mode == nir_var_shader_in &&
+ var->data.location == VARYING_SLOT_POS) ||
+ (var->data.mode == nir_var_system_value &&
+ var->data.location == SYSTEM_VALUE_FRAG_COORD)) {
/* gl_FragCoord should not have array/struct derefs: */
assert(dvar->deref.child == NULL);
lower_fragcoord(state, intr);