diff options
author | Kenneth Graunke <[email protected]> | 2010-06-29 00:47:44 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-06-29 11:12:53 -0700 |
commit | 28527ed557923aecff5d3b88e5d7776f04389547 (patch) | |
tree | b72ecc8908a41d2686e78218b74396923c2995fb | |
parent | 18707eba1cd6c07fa8b63d0ba5b26f6433f1ae91 (diff) |
glsl2: Add a method for querying if an AST type has any qualifiers.
-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 de300e719c4..adb5fb11d47 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 49dfde20e97..e2510a10c62 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; +} |