diff options
author | Ian Romanick <[email protected]> | 2012-12-11 12:13:30 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-01-25 09:07:33 -0500 |
commit | a39a70c8d41d2758d6909a68a5b9163b81f4b003 (patch) | |
tree | ab26eda56ed2ccce042881a6550e4fdf058c92dc /src/glsl/ast.h | |
parent | 34f966bdcb22733a159fb680859a83f88ef01d2a (diff) |
glsl: Parse interface array size
The size is parsed and stored in the AST, but it is not used yet.
Processing of the array size is added in the patch "glsl: Handle
instance array declarations"
v2: Update the commit message (suggested by Carl Worth). Add a comment
to ast_uniform_block::array_size (suggested by Paul Berry).
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast.h')
-rw-r--r-- | src/glsl/ast.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 7d7f72d54a4..1a28963c437 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -804,12 +804,12 @@ public: class ast_uniform_block : public ast_node { public: ast_uniform_block(ast_type_qualifier layout, - const char *block_name, - ast_declarator_list *member_list, - const char *instance_name) - : layout(layout), block_name(block_name), instance_name(instance_name) + const char *instance_name, + ast_expression *array_size) + : layout(layout), block_name(NULL), instance_name(instance_name), + array_size(array_size) { - declarations.push_degenerate_list_at_head(&member_list->link); + /* empty */ } virtual ir_rvalue *hir(exec_list *instructions, @@ -828,6 +828,17 @@ public: /** List of ast_declarator_list * */ exec_list declarations; + + /** + * Declared array size of the block instance + * + * If the block is not declared as an array, this field will be \c NULL. + * + * \note + * A block can only be an array if it also has an instance name. If this + * field is not \c NULL, ::instance_name must also not be \c NULL. + */ + ast_expression *array_size; }; /*@}*/ |