diff options
Diffstat (limited to 'mesalib/src/glsl/glsl_parser.yy')
-rw-r--r-- | mesalib/src/glsl/glsl_parser.yy | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mesalib/src/glsl/glsl_parser.yy b/mesalib/src/glsl/glsl_parser.yy index 920213c30..5753acf3c 100644 --- a/mesalib/src/glsl/glsl_parser.yy +++ b/mesalib/src/glsl/glsl_parser.yy @@ -1103,8 +1103,14 @@ layout_qualifier_id_list: if ($1.flags.q.explicit_location) $$.location = $1.location; + if ($1.flags.q.explicit_index) + $$.index = $1.index; + if ($3.flags.q.explicit_location) $$.location = $3.location; + + if ($3.flags.q.explicit_index) + $$.index = $3.index; } ; @@ -1191,6 +1197,20 @@ layout_qualifier_id: YYERROR; } } + + if (strcmp("index", $1) == 0) { + got_one = true; + + $$.flags.q.explicit_index = 1; + + if ($3 >= 0) { + $$.index = $3; + } else { + _mesa_glsl_error(& @3, state, + "invalid index %d specified\n", $3); + YYERROR; + } + } } /* If the identifier didn't match any known layout identifiers, |