summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2012-11-27 23:45:17 -0800
committerIan Romanick <[email protected]>2013-01-25 09:07:33 -0500
commit34f966bdcb22733a159fb680859a83f88ef01d2a (patch)
tree2e43d668ad60ef98960e72bab1c77e05fd8305b0 /src/glsl/ast.h
parent0d2e6336a21e20afe37861030ac2161aadd0499e (diff)
glsl: Parse non-array uniform block instance names in GLSL ES 3.00.
In GLSL ES 3.00 (and GLSL 1.50), uniform blocks can have an associated "instance name", which essentially namespaces the variables inside. This patch adds basic parsing for this new feature, but doesn't yet hook it up to actually do anything yet. It does not support for arrays of interface blocks; a later commit will take care of that. This change temporarily regresses the piglit test interface-name-access-without-interface-name.vert. This shader failed to compile before (the expected result), but it failed to compile for the wrong reason. This is not a real regression. v2: Add some comments to ast_uniform_block::instance_name. Suggested by Paul Berry. Reviewed-by: Carl Worth <[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.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index 50747822d2a..7d7f72d54a4 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -805,8 +805,9 @@ class ast_uniform_block : public ast_node {
public:
ast_uniform_block(ast_type_qualifier layout,
const char *block_name,
- ast_declarator_list *member_list)
- : layout(layout), block_name(block_name)
+ ast_declarator_list *member_list,
+ const char *instance_name)
+ : layout(layout), block_name(block_name), instance_name(instance_name)
{
declarations.push_degenerate_list_at_head(&member_list->link);
}
@@ -816,6 +817,15 @@ public:
ast_type_qualifier layout;
const char *block_name;
+
+ /**
+ * Declared name of the block instance, if specified.
+ *
+ * If the block does not have an instance name, this field will be
+ * \c NULL.
+ */
+ const char *instance_name;
+
/** List of ast_declarator_list * */
exec_list declarations;
};