if(!var.sampling.empty())
formatted += format("%s ", var.sampling);
if(!var.interface.empty() && var.interface!=block_interface)
- formatted += format("%s ", var.interface);
+ {
+ string interface = var.interface;
+ if(stage->required_version<Version(1, 30))
+ {
+ if(stage->type==VERTEX && var.interface=="in")
+ interface = "attribute";
+ else if((stage->type==VERTEX && var.interface=="out") || (stage->type==FRAGMENT && var.interface=="in"))
+ interface = "varying";
+ }
+ formatted += format("%s ", interface);
+ }
formatted += format("%s %s", var.type, var.name);
if(var.array)
{
if((var.interface=="in" || var.interface=="out") && !check_version(Version(1, 30)))
{
- if(stage->type==VERTEX && var.interface=="in")
- var.interface = "attribute";
- else if((stage->type==VERTEX && var.interface=="out") || (stage->type==FRAGMENT && var.interface=="in"))
- var.interface = "varying";
- else if(stage->type==FRAGMENT && var.interface=="out")
+ if(stage->type==FRAGMENT && var.interface=="out")
{
frag_out_name = var.name;
remove_node = true;