From: Kenneth Graunke Date: Tue, 29 Jun 2010 07:47:44 +0000 (-0700) Subject: glsl2: Add a method for querying if an AST type has any qualifiers. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=28527ed557923aecff5d3b88e5d7776f04389547;p=mesa.git glsl2: Add a method for querying if an AST type has any qualifiers. --- 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; +}