nir: Use b2b opcodes for shared and constant memory
[mesa.git] / src / compiler / nir / nir_lower_wpos_center.c
index 3c114936f7e8aba5ca2d2022b15cb482064e50a7..56a392768b9312e6adae4463bfa7b53bb46281e4 100644 (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;
          }
       }
    }