aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/ast.h')
-rw-r--r--mesalib/src/glsl/ast.h58
1 files changed, 50 insertions, 8 deletions
diff --git a/mesalib/src/glsl/ast.h b/mesalib/src/glsl/ast.h
index 5f2d5b1e4..2cf86e797 100644
--- a/mesalib/src/glsl/ast.h
+++ b/mesalib/src/glsl/ast.h
@@ -439,6 +439,12 @@ struct ast_type_qualifier {
unsigned column_major:1;
unsigned row_major:1;
/** \} */
+
+ /** \name Layout qualifiers for GLSL 1.50 geometry shaders */
+ /** \{ */
+ unsigned prim_type:1;
+ unsigned max_vertices:1;
+ /** \} */
}
/** \brief Set of flags, accessed by name. */
q;
@@ -465,6 +471,12 @@ struct ast_type_qualifier {
*/
int index;
+ /** Maximum output vertices in GLSL 1.50 geometry shaders. */
+ int max_vertices;
+
+ /** Input or output primitive type in GLSL 1.50 geometry shaders */
+ GLenum prim_type;
+
/**
* Binding specified via GL_ARB_shading_language_420pack's "binding" keyword.
*
@@ -899,12 +911,14 @@ public:
class ast_interface_block : public ast_node {
public:
ast_interface_block(ast_type_qualifier layout,
- const char *instance_name,
- ast_expression *array_size)
+ const char *instance_name,
+ bool is_array,
+ ast_expression *array_size)
: layout(layout), block_name(NULL), instance_name(instance_name),
- array_size(array_size)
+ is_array(is_array), array_size(array_size)
{
- /* empty */
+ if (!is_array)
+ assert(array_size == NULL);
}
virtual ir_rvalue *hir(exec_list *instructions,
@@ -925,16 +939,44 @@ public:
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.
+ * True if the block is declared as an array
*
* \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.
+ * field is true, ::instance_name must also not be \c NULL.
+ */
+ bool is_array;
+
+ /**
+ * Declared array size of the block instance
+ *
+ * If the block is not declared as an array or if the block instance array
+ * is unsized, this field will be \c NULL.
*/
ast_expression *array_size;
};
+
+
+/**
+ * AST node representing a declaration of the input layout for geometry
+ * shaders.
+ */
+class ast_gs_input_layout : public ast_node
+{
+public:
+ ast_gs_input_layout(const struct YYLTYPE &locp, GLenum prim_type)
+ : prim_type(prim_type)
+ {
+ set_location(locp);
+ }
+
+ virtual ir_rvalue *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+
+private:
+ const GLenum prim_type;
+};
+
/*@}*/
extern void