summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-06-12 14:03:49 -0700
committerPaul Berry <stereotype441@gmail.com>2013-08-01 20:23:33 -0700
commit624b7bac76c3f70a3a110d114a3c1c327d3dad5f (patch)
treef0be97cc9ddfe6d4bd5762801e5f46801ea4077d /src/glsl/ast.h
parentf2e14238a79100f22ccdcdda2a2267ff9fc85655 (diff)
downloadexternal_mesa3d-624b7bac76c3f70a3a110d114a3c1c327d3dad5f.zip
external_mesa3d-624b7bac76c3f70a3a110d114a3c1c327d3dad5f.tar.gz
external_mesa3d-624b7bac76c3f70a3a110d114a3c1c327d3dad5f.tar.bz2
glsl: Parse the GLSL 1.50 GS layout qualifiers.
Limited semantic checking (compatibility between declarations, checking that they're in the right shader target, etc.) is done. v2: Remove stray debug printfs. v3 (Paul Berry <stereotype441@gmail.com>): Process input layout qualifiers at ast_to_hir time rather than at parse time, since certain error conditions depend on the relative ordering between input layout qualifiers, declarations, and calls to .length(). Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glsl/ast.h')
-rw-r--r--src/glsl/ast.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index d98f1a3..3ef9913 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -435,6 +435,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;
@@ -461,6 +467,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.
*
@@ -931,6 +943,28 @@ public:
*/
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