void *mem_ctx = state;
bool create_gs_ast = false;
bool create_cs_ast = false;
+ ast_type_qualifier valid_in_mask;
+ valid_in_mask.flags.i = 0;
switch (state->stage) {
case MESA_SHADER_GEOMETRY:
create_gs_ast |=
q.flags.q.prim_type &&
!state->in_qualifier->flags.q.prim_type;
+
+ valid_in_mask.flags.q.prim_type = 1;
break;
case MESA_SHADER_FRAGMENT:
if (q.flags.q.early_fragment_tests) {
create_cs_ast |=
q.flags.q.local_size != 0 &&
state->in_qualifier->flags.q.local_size == 0;
+
+ valid_in_mask.flags.q.local_size = 1;
break;
default:
_mesa_glsl_error(loc, state,
break;
}
+ /* Generate an error when invalid input layout qualifiers are used. */
+ if ((q.flags.i & ~valid_in_mask.flags.i) != 0) {
+ _mesa_glsl_error(loc, state,
+ "invalid input layout qualifiers used");
+ return false;
+ }
+
/* Input layout qualifiers can be specified multiple
* times in separate declarations, as long as they match.
*/