From 28527ed557923aecff5d3b88e5d7776f04389547 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 29 Jun 2010 00:47:44 -0700 Subject: [PATCH] glsl2: Add a method for querying if an AST type has any qualifiers. --- src/glsl/ast.h | 1 + src/glsl/ast_type.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) 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; +} -- 2.30.2