X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglsl%2Fast_type.cpp;h=c680ae5f67123f326f3ccf41c6b112fa817b9c51;hb=2b13e135942ea7ebe1426a1809bf0efb7891387d;hp=b7488cf6e90e7f722c690162fbc00dae9dd768dd;hpb=e24d35a5b59ca1e75b69a32db6294787378a963f;p=mesa.git diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp index b7488cf6e90..c680ae5f671 100644 --- a/src/glsl/ast_type.cpp +++ b/src/glsl/ast_type.cpp @@ -21,7 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -#include #include "ast.h" extern "C" { #include "program/symbol_table.h" @@ -49,7 +48,8 @@ ast_type_specifier::print(void) const ast_type_specifier::ast_type_specifier(int specifier) : type_specifier(ast_types(specifier)), type_name(NULL), structure(NULL), - is_array(false), array_size(NULL), precision(ast_precision_high) + is_array(false), array_size(NULL), precision(ast_precision_none), + is_precision_statement(false) { static const char *const names[] = { "void", @@ -116,3 +116,23 @@ ast_fully_specified_type::has_qualifiers() const { return this->qualifier.flags.i != 0; } + +bool ast_type_qualifier::has_interpolation() const +{ + return this->flags.q.smooth + || this->flags.q.flat + || this->flags.q.noperspective; +} + +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; +}