summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast.h
diff options
context:
space:
mode:
authorFabian Bieler <[email protected]>2014-03-20 22:44:43 +0100
committerMarek Olšák <[email protected]>2015-07-23 00:59:26 +0200
commit497eb295838baccde1420adfcc4ef7e8fdddd774 (patch)
tree517e56ea50330d128fca0ae95b4f7bf6a324fa6a /src/glsl/ast.h
parent206af9d049cab6e794db5abf63e3d11281343423 (diff)
glsl: add tessellation shader parsing support (v2)
v2: Fixed things that Ken suggested. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast.h')
-rw-r--r--src/glsl/ast.h54
1 files changed, 53 insertions, 1 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index 49212298e16..e185ed11e75 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -515,6 +515,17 @@ struct ast_type_qualifier {
unsigned stream:1; /**< Has stream value assigned */
unsigned explicit_stream:1; /**< stream value assigned explicitly by shader code */
/** \} */
+
+ /** \name Layout qualifiers for GL_ARB_tessellation_shader */
+ /** \{ */
+ /* tess eval input layout */
+ /* gs prim_type reused for primitive mode */
+ unsigned vertex_spacing:1;
+ unsigned ordering:1;
+ unsigned point_mode:1;
+ /* tess control output layout */
+ unsigned vertices:1;
+ /** \} */
}
/** \brief Set of flags, accessed by name. */
q;
@@ -550,7 +561,10 @@ struct ast_type_qualifier {
/** Stream in GLSL 1.50 geometry shaders. */
unsigned stream;
- /** Input or output primitive type in GLSL 1.50 geometry shaders */
+ /**
+ * Input or output primitive type in GLSL 1.50 geometry shaders
+ * and tessellation shaders.
+ */
GLenum prim_type;
/**
@@ -577,6 +591,18 @@ struct ast_type_qualifier {
*/
int local_size[3];
+ /** Tessellation evaluation shader: vertex spacing (equal, fractional even/odd) */
+ GLenum vertex_spacing;
+
+ /** Tessellation evaluation shader: vertex ordering (CW or CCW) */
+ GLenum ordering;
+
+ /** Tessellation evaluation shader: point mode */
+ bool point_mode;
+
+ /** Tessellation control shader: number of output vertices */
+ int vertices;
+
/**
* Image format specified with an ARB_shader_image_load_store
* layout qualifier.
@@ -632,6 +658,11 @@ struct ast_type_qualifier {
_mesa_glsl_parse_state *state,
ast_type_qualifier q);
+ bool merge_out_qualifier(YYLTYPE *loc,
+ _mesa_glsl_parse_state *state,
+ ast_type_qualifier q,
+ ast_node* &node);
+
bool merge_in_qualifier(YYLTYPE *loc,
_mesa_glsl_parse_state *state,
ast_type_qualifier q,
@@ -1032,6 +1063,27 @@ public:
/**
+ * AST node representing a declaration of the output layout for tessellation
+ * control shaders.
+ */
+class ast_tcs_output_layout : public ast_node
+{
+public:
+ ast_tcs_output_layout(const struct YYLTYPE &locp, int vertices)
+ : vertices(vertices)
+ {
+ set_location(locp);
+ }
+
+ virtual ir_rvalue *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+
+private:
+ const int vertices;
+};
+
+
+/**
* AST node representing a declaration of the input layout for geometry
* shaders.
*/