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.mode == nir_var_shader_in &&
- var->data.location == VARYING_SLOT_POS) {
+ 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);