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.h54
1 files changed, 47 insertions, 7 deletions
diff --git a/mesalib/src/glsl/ast.h b/mesalib/src/glsl/ast.h
index 61fd923bc..1efb30679 100644
--- a/mesalib/src/glsl/ast.h
+++ b/mesalib/src/glsl/ast.h
@@ -280,14 +280,14 @@ class ast_array_specifier : public ast_node {
public:
/** Unsized array specifier ([]) */
explicit ast_array_specifier(const struct YYLTYPE &locp)
- : dimension_count(1), is_unsized_array(true)
+ : is_unsized_array(true)
{
set_location(locp);
}
/** Sized array specifier ([dim]) */
ast_array_specifier(const struct YYLTYPE &locp, ast_expression *dim)
- : dimension_count(1), is_unsized_array(false)
+ : is_unsized_array(false)
{
set_location(locp);
array_dimensions.push_tail(&dim->link);
@@ -296,14 +296,10 @@ public:
void add_dimension(ast_expression *dim)
{
array_dimensions.push_tail(&dim->link);
- dimension_count++;
}
virtual void print(void) const;
- /* Count including sized and unsized dimensions */
- unsigned dimension_count;
-
/* If true, this means that the array has an unsized outermost dimension. */
bool is_unsized_array;
@@ -466,17 +462,36 @@ struct ast_type_qualifier {
* local_size_x, and so on.
*/
unsigned local_size:3;
+
+ /** \name Layout and memory qualifiers for ARB_shader_image_load_store. */
+ /** \{ */
+ unsigned early_fragment_tests:1;
+ unsigned explicit_image_format:1;
+ unsigned coherent:1;
+ unsigned _volatile:1;
+ unsigned restrict_flag:1;
+ unsigned read_only:1; /**< "readonly" qualifier. */
+ unsigned write_only:1; /**< "writeonly" qualifier. */
+ /** \} */
+
+ /** \name Layout qualifiers for GL_ARB_gpu_shader5 */
+ /** \{ */
+ unsigned invocations:1;
+ /** \} */
}
/** \brief Set of flags, accessed by name. */
q;
/** \brief Set of flags, accessed as a bitmask. */
- unsigned i;
+ uint64_t i;
} flags;
/** Precision of the type (highp/medium/lowp). */
unsigned precision:2;
+ /** Geometry shader invocations for GL_ARB_gpu_shader5. */
+ int invocations;
+
/**
* Location specified via GL_ARB_explicit_attrib_location layout
*
@@ -523,6 +538,25 @@ struct ast_type_qualifier {
int local_size[3];
/**
+ * Image format specified with an ARB_shader_image_load_store
+ * layout qualifier.
+ *
+ * \note
+ * This field is only valid if \c explicit_image_format is set.
+ */
+ GLenum image_format;
+
+ /**
+ * Base type of the data read from or written to this image. Only
+ * the following enumerants are allowed: GLSL_TYPE_UINT,
+ * GLSL_TYPE_INT, GLSL_TYPE_FLOAT.
+ *
+ * \note
+ * This field is only valid if \c explicit_image_format is set.
+ */
+ glsl_base_type image_base_type;
+
+ /**
* Return true if and only if an interpolation qualifier is present.
*/
bool has_interpolation() const;
@@ -557,6 +591,12 @@ struct ast_type_qualifier {
bool merge_qualifier(YYLTYPE *loc,
_mesa_glsl_parse_state *state,
ast_type_qualifier q);
+
+ bool merge_in_qualifier(YYLTYPE *loc,
+ _mesa_glsl_parse_state *state,
+ ast_type_qualifier q,
+ ast_node* &node);
+
};
class ast_declarator_list;