From: Mikko Rasa Date: Sun, 21 Feb 2021 10:19:52 +0000 (+0200) Subject: Allow using SL::Formatter on single nodes X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=ede0bc3f5c7124ef100576ad4b0890c9cd13c79d Allow using SL::Formatter on single nodes This is occasionally useful for debugging. --- diff --git a/source/glsl/output.cpp b/source/glsl/output.cpp index 973ff832..f97b8cdb 100644 --- a/source/glsl/output.cpp +++ b/source/glsl/output.cpp @@ -65,7 +65,7 @@ void Formatter::set_source(unsigned index, unsigned line) else { unsigned l = line; - if(stage->required_versionrequired_versionrequired_versionrequired_versiontype==Stage::VERTEX && var.interface=="in") interface = "attribute"; diff --git a/source/glsl/output.h b/source/glsl/output.h index 5b034202..5f741909 100644 --- a/source/glsl/output.h +++ b/source/glsl/output.h @@ -23,6 +23,7 @@ public: Formatter(); const std::string &apply(Stage &); + const std::string &apply(Node &n) { n.visit(*this); return formatted; } private: void append(const std::string &);