nir: Remove deref chain support from lower_wpos_center
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 27 Mar 2018 16:14:56 +0000 (09:14 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 23 Jun 2018 03:54:00 +0000 (20:54 -0700)
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/nir/nir_lower_wpos_center.c

index 5b68caca35817cc3c365368b7b50a9a00e6a9de1..26f2b5d165f68ffc1993674832768e5faa271ad8 100644 (file)
@@ -92,17 +92,6 @@ lower_wpos_center_block(nir_builder *b, nir_block *block,
                update_fragcoord(b, intr, for_sample_shading);
                progress = true;
             }
-         } else if (intr->intrinsic == nir_intrinsic_load_var) {
-            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) {
-               /* gl_FragCoord should not have array/struct derefs: */
-               assert(dvar->deref.child == NULL);
-               update_fragcoord(b, intr, for_sample_shading);
-               progress = true;
-            }
          }
       }
    }
@@ -118,6 +107,8 @@ nir_lower_wpos_center(nir_shader *shader, const bool for_sample_shading)
 
    assert(shader->info.stage == MESA_SHADER_FRAGMENT);
 
+   nir_assert_unlowered_derefs(shader, nir_lower_load_store_derefs);
+
    nir_foreach_function(function, shader) {
       if (function->impl) {
          nir_builder_init(&b, function->impl);