diff options
author | Timothy Arceri <[email protected]> | 2015-11-09 07:48:46 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2015-11-21 07:27:56 +1100 |
commit | 0954b813a3a356b5836f4169783b8c8c58ff2158 (patch) | |
tree | 8f99932d53084c30adf1cb7989abe83f1eb8d374 /src/glsl/ast.h | |
parent | 4196af4ce7cdb0217a7cc6e196b1a788d32c5b6f (diff) |
glsl: add new type for compile time constants
In this patch we introduce a new ast type for holding the new
compile-time constant expressions. The main reason for this is that
we can no longer do merging of layout qualifiers before they have been
converted into GLSL IR so we need to store them to be proccessed later.
The new type has two helper functions:
- process_qualifier_constant()
Used to merge and then evaluate qualifier expressions
- merge_qualifier()
Simply appends a qualifier to a list to be merged later by
process_qualifier_constant()
In order to avoid cascading error messages the process_qualifier_constant()
helpers return a bool
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/glsl/ast.h')
-rw-r--r-- | src/glsl/ast.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h index ae763424f71..ca493401d7c 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -350,6 +350,26 @@ public: exec_list array_dimensions; }; +class ast_layout_expression : public ast_node { +public: + ast_layout_expression(const struct YYLTYPE &locp, ast_expression *expr) + { + set_location(locp); + layout_const_expressions.push_tail(&expr->link); + } + + bool process_qualifier_constant(struct _mesa_glsl_parse_state *state, + const char *qual_indentifier, + unsigned *value, bool can_be_zero); + + void merge_qualifier(ast_layout_expression *l_expr) + { + layout_const_expressions.append_list(&l_expr->layout_const_expressions); + } + + exec_list layout_const_expressions; +}; + /** * C-style aggregate initialization class * |