This change makes it so we emit a load_input intrinsic when Layer
is read in a fragment shader.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
break;
case SpvBuiltInLayer:
*location = VARYING_SLOT_LAYER;
- *mode = nir_var_shader_out;
+ if (b->shader->stage == MESA_SHADER_FRAGMENT)
+ *mode = nir_var_shader_in;
+ else if (b->shader->stage == MESA_SHADER_GEOMETRY)
+ *mode = nir_var_shader_out;
+ else
+ unreachable("invalid stage for SpvBuiltInLayer");
break;
case SpvBuiltInViewportIndex:
*location = VARYING_SLOT_VIEWPORT;