}
if(var.constant)
formatted += "const ";
+ if(!var.interpolation.empty())
+ formatted += format("%s ", var.interpolation);
if(!var.sampling.empty())
formatted += format("%s ", var.sampling);
if(!var.interface.empty() && var.interface!=block_interface)
return token=="centroid";
}
+bool ProgramParser::is_interpolation_qualifier(const string &token)
+{
+ return (token=="smooth" || token=="flat" || token=="noperspective");
+}
+
bool ProgramParser::is_precision_qualifier(const string &token)
{
return (token=="highp" || token=="mediump" || token=="lowp");
bool ProgramParser::is_qualifier(const string &token)
{
- return (token=="const" || is_interface_qualifier(token) || is_sampling_qualifier(token) || is_precision_qualifier(token));
+ return (token=="const" ||
+ is_interface_qualifier(token) ||
+ is_sampling_qualifier(token) ||
+ is_interpolation_qualifier(token) ||
+ is_precision_qualifier(token));
}
bool ProgramParser::is_builtin_type(const string &token)
var->interface = token;
else if(is_sampling_qualifier(token))
var->sampling = token;
+ else if(is_interpolation_qualifier(token))
+ var->interpolation = token;
else if(is_precision_qualifier(token))
var->precision = token;
else if(token=="const")
static bool is_interface_qualifier(const std::string &);
static bool is_sampling_qualifier(const std::string &);
+ static bool is_interpolation_qualifier(const std::string &);
static bool is_precision_qualifier(const std::string &);
static bool is_qualifier(const std::string &);
static bool is_builtin_type(const std::string &);