- nir_foreach_shader_in_variable(var, b->shader) {
- if (var->data.location == VARYING_SLOT_POS)
- return nir_load_var(b, var);
+ nir_variable *pos =
+ nir_find_variable_with_location(b->shader, nir_var_shader_in,
+ VARYING_SLOT_POS);
+ if (pos == NULL) {
+ pos = nir_variable_create(b->shader, nir_var_shader_in,
+ glsl_vec4_type(), NULL);
+ pos->data.location = VARYING_SLOT_POS;