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);
- }
}
}
}
.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) {