]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/debug.cpp
Inject builtins into the module
[libs/gl.git] / source / glsl / debug.cpp
index 50d2b985604ccfa4f5a4c1c2afe0d667d02be01c..5397372e611bd7108c3e3da0fc254e4bc9a575b4 100644 (file)
@@ -254,7 +254,9 @@ void DumpTree::visit(VariableDeclaration &var)
        if(!var.precision.empty())
                decl += format("%s ", var.precision);
        decl += format("%s %s", var.type, var.name);
-       if(var.linked_declaration)
+       if(var.source==BUILTIN_SOURCE)
+               decl += " (builtin)";
+       else if(var.linked_declaration)
                decl += " (linked)";
        append(decl);
 
@@ -290,7 +292,9 @@ void DumpTree::visit(InterfaceBlock &block)
                head += format(" %s", block.instance_name);
        if(block.array)
                head += "[]";
-       if(block.linked_block)
+       if(block.source==BUILTIN_SOURCE)
+               head += " (builtin)";
+       else if(block.linked_block)
                head += " (linked)";
        annotated_branch(head, block.members);
 }
@@ -298,7 +302,9 @@ void DumpTree::visit(InterfaceBlock &block)
 void DumpTree::visit(FunctionDeclaration &func)
 {
        string text = format("%%%d %s %s", get_label(func), func.return_type, func.name);
-       if(!func.definition)
+       if(func.source==BUILTIN_SOURCE)
+               text += " (builtin)";
+       else if(!func.definition)
                text += " (undefined)";
        append(text);
        begin_sub();