From: Mikko Rasa Date: Wed, 10 Mar 2021 10:18:23 +0000 (+0200) Subject: Don't omit builtins when formatting a single node X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=3e24a1bfd5a259b185ff0f37046dd0489e1908a3;p=libs%2Fgl.git Don't omit builtins when formatting a single node This produces more useful output for debugging. --- diff --git a/source/glsl/output.cpp b/source/glsl/output.cpp index 43f337ca..718b1a8b 100644 --- a/source/glsl/output.cpp +++ b/source/glsl/output.cpp @@ -13,12 +13,14 @@ Formatter::Formatter(): source_index(0), source_line(1), indent(0), - parameter_list(false) + parameter_list(false), + omit_builtin(false) { } const string &Formatter::apply(Stage &s) { stage = &s; + omit_builtin = true; const Version &ver = s.required_features.glsl_version; @@ -92,7 +94,7 @@ void Formatter::visit(Block &block) bool first = true; for(NodeList::iterator i=block.body.begin(); i!=block.body.end(); ++i) { - if((*i)->source<=BUILTIN_SOURCE) + if(omit_builtin && (*i)->source<=BUILTIN_SOURCE) continue; if(!first) append('\n'); diff --git a/source/glsl/output.h b/source/glsl/output.h index 58983fca..0a506a5d 100644 --- a/source/glsl/output.h +++ b/source/glsl/output.h @@ -19,6 +19,7 @@ private: unsigned source_line; unsigned indent; bool parameter_list; + bool omit_builtin; public: Formatter();