return check_version(Version(3, 30));
}
+bool ProgramCompiler::LegacyConverter::supports_centroid_sampling() const
+{
+ if(target_api==OPENGL_ES2)
+ return check_version(Version(3, 0));
+ else
+ return check_version(Version(1, 20));
+}
+
+bool ProgramCompiler::LegacyConverter::supports_sample_sampling() const
+{
+ if(target_api==OPENGL_ES2)
+ return check_version(Version(3, 20));
+ else
+ return check_version(Version(4, 0));
+}
+
void ProgramCompiler::LegacyConverter::visit(VariableDeclaration &var)
{
if(var.layout && !supports_interface_layouts())
}
}
+ if(var.sampling=="centroid")
+ {
+ if(!supports_centroid_sampling())
+ var.sampling = string();
+ }
+ else if(var.sampling=="sample")
+ {
+ if(!supports_sample_sampling())
+ var.sampling = string();
+ }
+
if((var.interface=="in" || var.interface=="out") && !supports_unified_interface_syntax())
{
if(stage->type==FRAGMENT && var.interface=="out")
bool supports_unified_sampling_functions() const;
virtual void visit(ProgramSyntax::FunctionCall &);
bool supports_interface_layouts() const;
+ bool supports_centroid_sampling() const;
+ bool supports_sample_sampling() const;
virtual void visit(ProgramSyntax::VariableDeclaration &);
bool supports_interface_blocks(const std::string &) const;
virtual void visit(ProgramSyntax::InterfaceBlock &);
bool ProgramParser::is_sampling_qualifier(const string &token)
{
- return token=="centroid";
+ return (token=="centroid" || token=="sample");
}
bool ProgramParser::is_interpolation_qualifier(const string &token)