bool first = true;
for(NodeList<Statement>::iterator i=block.body.begin(); i!=block.body.end(); ++i)
{
- if((*i)->source==BUILTIN_SOURCE)
+ if((*i)->source<=BUILTIN_SOURCE)
continue;
if(!first)
append('\n');
append(format("%s ", var.interpolation));
if(!var.sampling.empty())
append(format("%s ", var.sampling));
- if(!var.interface.empty() && var.interface!=block_interface)
+ if(!var.interface.empty())
{
string interface = var.interface;
if(mode==Compiler::PROGRAM && stage && stage->required_features.glsl_version<Version(1, 30))
}
if(!var.precision.empty())
append(format("%s ", var.precision));
- append(format("%s %s", var.type_declaration->name, var.name));
+ string type_name = var.type_declaration->name;
+ if(var.array)
+ type_name = type_name.substr(0, type_name.find('['));
+ append(format("%s %s", type_name, var.name));
if(var.array)
{
append('[');
void Formatter::visit(InterfaceBlock &iface)
{
- SetForScope<string> set(block_interface, iface.interface);
append(format("%s %s\n", iface.interface, iface.name));
- iface.members.visit(*this);
+ if(iface.struct_declaration)
+ iface.struct_declaration->members.visit(*this);
if(!iface.instance_name.empty())
{
append(' ');