From ede0bc3f5c7124ef100576ad4b0890c9cd13c79d Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 21 Feb 2021 12:19:52 +0200 Subject: [PATCH 1/1] Allow using SL::Formatter on single nodes This is occasionally useful for debugging. --- source/glsl/output.cpp | 4 ++-- source/glsl/output.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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 &); -- 2.45.2