summaryrefslogtreecommitdiff
path: root/src/glsl/ast_type.cpp
diff options
context:
space:
mode:
authorChad Versace <chad.versace@intel.com>2011-01-11 16:59:24 -0800
committerChad Versace <chad.versace@intel.com>2011-01-17 09:41:24 -0800
commit0e2f8936c8ef872cb464e54a9f09ae0324487147 (patch)
tree8dc8259289ca4067512c5c73bac027d91232bdfe /src/glsl/ast_type.cpp
parent5a64626ee57183a404827e2cda8359db3529b180 (diff)
glsl: Add method ast_type_qualifier::interpolation_string()
If an interpolation qualifier is present, then the method returns that qualifier's string representation. For example, if the noperspective bit is set, then it returns "noperspective".
Diffstat (limited to 'src/glsl/ast_type.cpp')
-rw-r--r--src/glsl/ast_type.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
index b7488cf6e90..a8761611d36 100644
--- a/src/glsl/ast_type.cpp
+++ b/src/glsl/ast_type.cpp
@@ -116,3 +116,16 @@ ast_fully_specified_type::has_qualifiers() const
{
return this->qualifier.flags.i != 0;
}
+
+const char*
+ast_type_qualifier::interpolation_string() const
+{
+ if (this->flags.q.smooth)
+ return "smooth";
+ else if (this->flags.q.flat)
+ return "flat";
+ else if (this->flags.q.noperspective)
+ return "noperspective";
+ else
+ return NULL;
+}