summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast.h
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2013-06-29 19:27:50 -0700
committerMatt Turner <[email protected]>2013-07-11 20:58:59 -0700
commitae79e86d4c0d82b4102e2ec65c93c8240fd22e9d (patch)
tree680138963d2e10b66964d350efd8836c20bff596 /src/glsl/ast.h
parent8d45caaebaa017e910ae985e005fadc6b626de7d (diff)
glsl: Add infrastructure for aggregate initializers.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/ast.h')
-rw-r--r--src/glsl/ast.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index 8abea5225f0..44e9f1874b5 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -189,7 +189,8 @@ enum ast_operators {
ast_float_constant,
ast_bool_constant,
- ast_sequence
+ ast_sequence,
+ ast_aggregate
};
/**
@@ -292,6 +293,29 @@ private:
bool cons;
};
+/**
+ * C-style aggregate initialization class
+ *
+ * Represents C-style initializers of vectors, matrices, arrays, and
+ * structures. E.g., vec3 pos = {1.0, 0.0, -1.0} is equivalent to
+ * vec3 pos = vec3(1.0, 0.0, -1.0).
+ *
+ * Specified in GLSL 4.20 and GL_ARB_shading_language_420pack.
+ *
+ * \sa _mesa_ast_set_aggregate_type
+ */
+class ast_aggregate_initializer : public ast_expression {
+public:
+ ast_aggregate_initializer()
+ : ast_expression(ast_aggregate, NULL, NULL, NULL)
+ {
+ /* empty */
+ }
+
+ ast_type_specifier *constructor_type;
+ virtual ir_rvalue *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+};
/**
* Number of possible operators for an ast_expression