X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fdebug.cpp;h=beafaddf47605454f177e4f529235aa01c4fefaf;hb=1c58cd2d741c962484e55decc069ed3046b40f60;hp=c02d914720a35707d2e40d167d31f0538f7ec901;hpb=4e3c03e2b60f9d6a9b8ed69b7150eb91e2db2e34;p=libs%2Fgl.git diff --git a/source/glsl/debug.cpp b/source/glsl/debug.cpp index c02d9147..beafaddf 100644 --- a/source/glsl/debug.cpp +++ b/source/glsl/debug.cpp @@ -8,19 +8,19 @@ namespace Msp { namespace GL { namespace SL { -std::string DumpTree::apply(Stage &stage) +string DumpTree::apply(Stage &stage) { formatted = format("Stage: %s\n", Stage::get_stage_name(stage.type)); begin_sub(); append(format("Version: %d.%02d", stage.required_features.glsl_version.major, stage.required_features.glsl_version.minor)); - for(std::map::const_iterator i=stage.types.begin(); i!=stage.types.end(); ++i) + for(map::const_iterator i=stage.types.begin(); i!=stage.types.end(); ++i) append(format("Type: %%%d %s", get_label(*i->second), i->first)); - for(std::map::const_iterator i=stage.interface_blocks.begin(); i!=stage.interface_blocks.end(); ++i) + for(map::const_iterator i=stage.interface_blocks.begin(); i!=stage.interface_blocks.end(); ++i) append(format("Interface block: %%%d %s", get_label(*i->second), i->first)); - for(std::map::const_iterator i=stage.functions.begin(); i!=stage.functions.end(); ++i) + for(map::const_iterator i=stage.functions.begin(); i!=stage.functions.end(); ++i) append(format("Function: %%%d %s", get_label(*i->second), i->first)); last_branch(); @@ -122,7 +122,7 @@ void DumpTree::visit(Block &block) append(block, format("Block %s", (block.use_braces ? "{}" : "(inline)"))); begin_sub(); - for(std::map::const_iterator i=block.variables.begin(); i!=block.variables.end(); ++i) + for(map::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)); for(NodeList::const_iterator i=block.body.begin(); i!=block.body.end(); ) @@ -162,7 +162,7 @@ void DumpTree::visit(MemberAccess &memacc) string text = "Member access:"; if(memacc.declaration) text += format(" %%%d", get_label(*memacc.declaration)); - text += format(" .%s -> %s", memacc.member, format_type(memacc.type)); + text += format(" .%s (%d) -> %s", memacc.member, memacc.index, format_type(memacc.type)); append(memacc, text); append_subtree(*memacc.left); } @@ -373,10 +373,7 @@ void DumpTree::visit(VariableDeclaration &var) void DumpTree::visit(InterfaceBlock &iface) { - string head; - if(!iface.instance_name.empty()) - head += format("%%%d ", get_label(iface)); - head += format("%s %s", iface.interface, iface.block_name); + string head = format("%%%d %s %s", get_label(iface), iface.interface, iface.block_name); if(!iface.instance_name.empty()) head += format(" %s", iface.instance_name); if(iface.array)