summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/ast.h')
-rw-r--r--src/glsl/ast.h28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index cd933cfc588..0e2811ca665 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -318,7 +318,8 @@ public:
enum {
- ast_precision_high = 0, /**< Default precision. */
+ ast_precision_none = 0, /**< Absence of precision qualifier. */
+ ast_precision_high,
ast_precision_medium,
ast_precision_low
};
@@ -364,6 +365,23 @@ struct ast_type_qualifier {
* This field is only valid if \c explicit_location is set.
*/
unsigned location;
+
+ /**
+ * Return true if and only if an interpolation qualifier is present.
+ */
+ bool has_interpolation() const;
+
+ /**
+ * \brief Return string representation of interpolation qualifier.
+ *
+ * If an interpolation qualifier is present, then return that qualifier's
+ * string representation. Otherwise, return null. For example, if the
+ * noperspective bit is set, then this returns "noperspective".
+ *
+ * If multiple interpolation qualifiers are somehow present, then the
+ * returned string is undefined but not null.
+ */
+ const char *interpolation_string() const;
};
class ast_struct_specifier : public ast_node {
@@ -444,7 +462,8 @@ public:
/** Construct a type specifier from a type name */
ast_type_specifier(const char *name)
: type_specifier(ast_type_name), type_name(name), structure(NULL),
- is_array(false), array_size(NULL), precision(ast_precision_high)
+ is_array(false), array_size(NULL), precision(ast_precision_none),
+ is_precision_statement(false)
{
/* empty */
}
@@ -452,7 +471,8 @@ public:
/** Construct a type specifier from a structure definition */
ast_type_specifier(ast_struct_specifier *s)
: type_specifier(ast_struct), type_name(s->name), structure(s),
- is_array(false), array_size(NULL), precision(ast_precision_high)
+ is_array(false), array_size(NULL), precision(ast_precision_none),
+ is_precision_statement(false)
{
/* empty */
}
@@ -474,6 +494,8 @@ public:
ast_expression *array_size;
unsigned precision:2;
+
+ bool is_precision_statement;
};