]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/output.cpp
Inject builtins into the module
[libs/gl.git] / source / glsl / output.cpp
index 44acd634d388e1d3f9c7ab86081e43e4368f01ee..81f335735e80eb433fd746ae85216dc59b309e83 100644 (file)
@@ -161,10 +161,14 @@ void Formatter::visit(Block &block)
 
        SetForScope<unsigned> set(indent, indent+(indent>0 || use_braces));
        string spaces(indent*2, ' ');
+       bool first = true;
        for(NodeList<Statement>::iterator i=block.body.begin(); i!=block.body.end(); ++i)
        {
-               if(i!=block.body.begin())
+               if((*i)->source==BUILTIN_SOURCE)
+                       continue;
+               if(!first)
                        append('\n');
+               first = false;
                set_source((*i)->source, (*i)->line);
                append(spaces);
                (*i)->visit(*this);