X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fdebug.cpp;h=60b7c2477cf093664f4fc2ac8bcfdb52f56fb5b1;hp=5ee30e0996c4dfc6ff5331d1c1b200f472c6fcf1;hb=HEAD;hpb=b23a9af95c65c01d949153fc49e5091aaa7c3d30 diff --git a/source/glsl/debug.cpp b/source/glsl/debug.cpp index 5ee30e09..a090c362 100644 --- a/source/glsl/debug.cpp +++ b/source/glsl/debug.cpp @@ -183,19 +183,10 @@ void DumpTree::visit(VariableReference &var) string text; if(var.declaration) text += format("%s ", get_label(*var.declaration)); - text += format("%s (var) -> %s", format_name(var.name), format_type(var.type)); + text += format("%s -> %s", format_name(var.name), format_type(var.type)); append(var, text); } -void DumpTree::visit(InterfaceBlockReference &iface) -{ - string text; - if(iface.declaration) - text += format("%s ", get_label(*iface.declaration)); - text += format("%s (iface) -> %s", format_name(iface.name), format_type(iface.type)); - append(iface, text); -} - void DumpTree::visit(MemberAccess &memacc) { string text = "Member access:"; @@ -349,6 +340,8 @@ void DumpTree::visit(BasicTypeDeclaration &type) branches.emplace_back(format("Vector: %d", type.size)); else if(type.kind==BasicTypeDeclaration::MATRIX) branches.emplace_back(format("Matrix: %dx%d", type.size&0xFFFF, type.size>>16)); + if(type.extended_alignment) + branches.emplace_back("Extended alignment"); append_subtree(branches); } @@ -362,15 +355,27 @@ void DumpTree::visit(ImageTypeDeclaration &type) branches.emplace_back(format("Dimensions: %s%s", dims[type.dimensions-1], (type.array ? " array" : ""))); if(type.base_type) branches.emplace_back(format("Element type: %s %s", get_label(*type.base_type), format_type(type.base_type->name))); + if(!type.format.empty()) + branches.emplace_back(format("Texel format: %s", type.format)); + if(type.sampled) + branches.emplace_back("Sampled"); if(type.shadow) branches.emplace_back("Shadow"); + if(type.multisample) + branches.emplace_back("Multisample"); append_subtree(branches); } void DumpTree::visit(StructDeclaration &strct) { append(strct, format("%s struct %s", get_label(strct), strct.name)); - append_subtree(strct.members); + vector branches; + if(!strct.block_name.empty()) + branches.emplace_back(format("Interface block: %s", format_name(strct.block_name))); + if(strct.extended_alignment) + branches.emplace_back("Extended alignment"); + branches.emplace_back(&strct.members); + append_subtree(branches); } void DumpTree::visit(VariableDeclaration &var) @@ -396,6 +401,8 @@ void DumpTree::visit(VariableDeclaration &var) vector branches; if(var.type_declaration) branches.emplace_back(format("Type: %s %s", get_label(*var.type_declaration), format_type(var.type_declaration->name))); + if(var.block_declaration) + branches.emplace_back(format("Interface block: %s", format_name(var.block_declaration->block_name))); if(var.layout) branches.emplace_back(var.layout.get()); if(var.array) @@ -410,29 +417,6 @@ void DumpTree::visit(VariableDeclaration &var) append_subtree(branches); } -void DumpTree::visit(InterfaceBlock &iface) -{ - string head = format("%s %s %s", get_label(iface), iface.interface, format_name(iface.block_name)); - if(!iface.instance_name.empty()) - head += format(" %s", format_name(iface.instance_name)); - if(iface.array) - head += "[]"; - if(iface.source==BUILTIN_SOURCE) - head += " (builtin)"; - else if(iface.linked_block) - head += " (linked)"; - append(iface, head); - - vector branches; - if(iface.type_declaration) - branches.emplace_back(format("Type: %s %s", get_label(*iface.type_declaration), format_type(iface.type_declaration->name))); - if(iface.layout) - branches.emplace_back(iface.layout.get()); - if(iface.members) - branches.emplace_back(iface.members.get()); - append_subtree(branches); -} - void DumpTree::visit(FunctionDeclaration &func) { string text = format("%s %s %s%s", get_label(func), format_type(func.return_type), format_name(func.name), (func.signature.empty() ? "(?)" : func.signature));