glsl: split default out layout qualifier merge

Currently, the default out layout qualifier merge performs specific
validation and merge.

We want to split out the validation from the merge so they can be done
independently.

Additionally, for simplification, the direction of the validation and
merge is changed so the ast_type_qualifier calling the method is the
one validated and merged against the default out qualifier.

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
This commit is contained in:
Andres Gomez
2016-11-14 12:23:32 +02:00
parent 70456aca8d
commit fe5c522edd
3 changed files with 72 additions and 37 deletions

View File

@@ -755,10 +755,18 @@ struct ast_type_qualifier {
const ast_type_qualifier &q,
bool is_single_layout_merge);
bool merge_out_qualifier(YYLTYPE *loc,
_mesa_glsl_parse_state *state,
const ast_type_qualifier &q,
ast_node* &node, bool create_node);
/**
* Validate current qualifier against the global out one.
*/
bool validate_out_qualifier(YYLTYPE *loc,
_mesa_glsl_parse_state *state);
/**
* Merge current qualifier into the global out one.
*/
bool merge_into_out_qualifier(YYLTYPE *loc,
_mesa_glsl_parse_state *state,
ast_node* &node, bool create_node);
bool merge_in_qualifier(YYLTYPE *loc,
_mesa_glsl_parse_state *state,