X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fdebug.cpp;h=32eb0ec307a05db3904e2313f74008e0127a32c3;hb=5c33b56c3b97ca0381ac216a603c7553f4bea499;hp=4de8ac90ad927ed05175923827a25895ab176d71;hpb=90c3973fcadf28e25797656154e42dd3d2915144;p=libs%2Fgl.git diff --git a/source/glsl/debug.cpp b/source/glsl/debug.cpp index 4de8ac90..32eb0ec3 100644 --- a/source/glsl/debug.cpp +++ b/source/glsl/debug.cpp @@ -17,7 +17,7 @@ const std::string &DumpTree::apply(Stage &stage) for(map::const_iterator i=stage.out_variables.begin(); i!=stage.out_variables.end(); ++i) append(format("Output: %%%d %s %s", get_label(*i->second), i->second->type, i->first)); last_branch(); - visit(stage.content); + stage.content.visit(*this); return formatted; } @@ -127,7 +127,11 @@ void DumpTree::visit(VariableReference &var) void DumpTree::visit(MemberAccess &memacc) { - annotated_branch(format("Member access: .%s", memacc.member), *memacc.left); + string text = "Member access:"; + if(memacc.declaration) + text += format(" %%%d", get_label(*memacc.declaration)); + text += format(" .%s", memacc.member); + annotated_branch(text, *memacc.left); } void DumpTree::visit(UnaryExpression &unary) @@ -241,7 +245,12 @@ void DumpTree::visit(VariableDeclaration &var) if(!var.init_expression) last_branch(); if(var.array) - annotated_branch("Array []", *var.array_size); + { + if(var.array_size) + annotated_branch("Array []", *var.array_size); + else + append("Array []"); + } last_branch(); if(var.init_expression)