summaryrefslogtreecommitdiff
path: root/ir.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-06-18 19:00:28 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-06-23 10:56:03 -0700
commit950ceb2bd60c25e7fecdff0fbcbf6e69015588f3 (patch)
tree15e91df092d34ec3b9b9daca22e35c220bbaed35 /ir.cpp
parentcc22c5a5447d1d710e49524ee61b76268c7da6b9 (diff)
ir_variable: Add method to get string representing interpolation qualifier
Diffstat (limited to 'ir.cpp')
-rw-r--r--ir.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/ir.cpp b/ir.cpp
index 7fc260db39..61589c3ff2 100644
--- a/ir.cpp
+++ b/ir.cpp
@@ -738,6 +738,23 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name)
}
+const char *
+ir_variable::interpolation_string() const
+{
+ if (!this->shader_in && !this->shader_out)
+ return "";
+
+ switch (this->interpolation) {
+ case ir_var_smooth: return "smooth";
+ case ir_var_flat: return "flat";
+ case ir_var_noperspective: return "noperspective";
+ }
+
+ assert(!"Should not get here.");
+ return "";
+}
+
+
ir_function_signature::ir_function_signature(const glsl_type *return_type)
: return_type(return_type), is_defined(false)
{