formatted = format("Stage: %s\n", Stage::get_stage_name(stage.type));
tree.push_back(BRANCH);
append(format("Version: %d.%02d", stage.required_features.glsl_version.major, stage.required_features.glsl_version.minor));
+
+ for(std::map<string, StructDeclaration *>::const_iterator i=stage.types.begin(); i!=stage.types.end(); ++i)
+ append(format("Type: %%%d %s", get_label(*i->second), i->first));
+
+ set<InterfaceBlock *> seen_interfaces;
+ for(std::map<string, InterfaceBlock *>::const_iterator i=stage.interface_blocks.begin(); i!=stage.interface_blocks.end(); ++i)
+ if(seen_interfaces.insert(i->second).second)
+ {
+ string text = format("Interface block: %%%d %s %s", get_label(*i->second), i->second->interface, i->second->name);
+ if(!i->second->instance_name.empty())
+ text += format(" %s", i->second->instance_name);
+ append(text);
+ }
+
last_branch();
stage.content.visit(*this);
return formatted;
append(format("Block %s", (block.use_braces ? "{}" : "(inline)")));
begin_sub();
- for(std::map<string, StructDeclaration *>::const_iterator i=block.types.begin(); i!=block.types.end(); ++i)
- append(format("Type: %%%d %s", get_label(*i->second), i->first));
-
for(std::map<string, VariableDeclaration *>::const_iterator i=block.variables.begin(); i!=block.variables.end(); ++i)
append(format("Variable: %%%d %s %s", get_label(*i->second), i->second->type, i->first));
- set<InterfaceBlock *> seen_interfaces;
- for(std::map<string, InterfaceBlock *>::const_iterator i=block.interfaces.begin(); i!=block.interfaces.end(); ++i)
- if(seen_interfaces.insert(i->second).second)
- {
- string text = format("Interface: %%%d %s %s", get_label(*i->second), i->second->interface, i->second->name);
- if(!i->second->instance_name.empty())
- text += format(" %s", i->second->instance_name);
- append(text);
- }
-
- bool labeled_body = (!block.types.empty() || !block.variables.empty());
+ bool labeled_body = !block.variables.empty();
if(labeled_body)
{
last_branch();