diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2010-06-29 00:47:44 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-06-29 11:12:53 -0700 |
commit | 28527ed557923aecff5d3b88e5d7776f04389547 (patch) | |
tree | b72ecc8908a41d2686e78218b74396923c2995fb /src/glsl | |
parent | 18707eba1cd6c07fa8b63d0ba5b26f6433f1ae91 (diff) |
glsl2: Add a method for querying if an AST type has any qualifiers.
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/ast.h | 1 | ||||
-rw-r--r-- | src/glsl/ast_type.cpp | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h index de300e719c..adb5fb11d4 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -418,6 +418,7 @@ public: class ast_fully_specified_type : public ast_node { public: virtual void print(void) const; + bool has_qualifiers() const; ast_type_qualifier qualifier; ast_type_specifier *specifier; diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp index 49dfde20e9..e2510a10c6 100644 --- a/src/glsl/ast_type.cpp +++ b/src/glsl/ast_type.cpp @@ -110,3 +110,13 @@ ast_type_specifier::ast_type_specifier(int specifier) type_name = names[specifier]; } + +bool +ast_fully_specified_type::has_qualifiers() const +{ + return qualifier.invariant || qualifier.constant || qualifier.attribute + || qualifier.varying || qualifier.in + || qualifier.out || qualifier.centroid + || qualifier.uniform || qualifier.smooth + || qualifier.flat || qualifier.noperspective; +} |