nir: Remove deref chain support from lower_drawpixels
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 2 Apr 2018 22:59:39 +0000 (15:59 -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_drawpixels.c

index 05131affdb29282aebe2c037950256b16b221a34..f8fecebe6d264c831b19c75cc4d92806f7b71206 100644 (file)
@@ -225,19 +225,6 @@ lower_drawpixels_block(lower_drawpixels_state *state, nir_block *block)
                assert(deref->deref_type == nir_deref_type_var);
                lower_texcoord(state, intr);
             }
-         } else if (intr->intrinsic == nir_intrinsic_load_var) {
-            nir_deref_var *dvar = intr->variables[0];
-            nir_variable *var = dvar->var;
-
-            if (var->data.location == VARYING_SLOT_COL0) {
-               /* gl_Color should not have array/struct derefs: */
-               assert(dvar->deref.child == NULL);
-               lower_color(state, intr);
-            } else if (var->data.location == VARYING_SLOT_TEX0) {
-               /* gl_TexCoord should not have array/struct derefs: */
-               assert(dvar->deref.child == NULL);
-               lower_texcoord(state, intr);
-            }
          }
       }
    }
@@ -266,6 +253,11 @@ nir_lower_drawpixels(nir_shader *shader,
       .shader = shader,
    };
 
+   /* note that this pass already assumes texture/sampler derefs are already
+    * lowered to index
+    */
+   nir_assert_unlowered_derefs(shader, nir_lower_load_store_derefs);
+
    assert(shader->info.stage == MESA_SHADER_FRAGMENT);
 
    nir_foreach_function(function, shader) {