X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fgenerate.h;h=402f07f480b239e39f76dd7334656337955b2ff3;hp=0a940cea5599a8f1381aadf6b9051989ac607a29;hb=27e7b634d31498783ea6d24b72f02f3f1287851d;hpb=b32b8d605a39d058e4e7bbe1563441cca803b5d4 diff --git a/source/glsl/generate.h b/source/glsl/generate.h index 0a940cea..402f07f4 100644 --- a/source/glsl/generate.h +++ b/source/glsl/generate.h @@ -11,23 +11,6 @@ namespace Msp { namespace GL { namespace SL { -/** Combines multiple declarations of the same identifier into one. */ -class DeclarationCombiner: private TraversingVisitor -{ -private: - std::map > functions; - std::map variables; - std::set nodes_to_remove; - -public: - void apply(Stage &); - -private: - virtual void visit(Block &); - virtual void visit(VariableDeclaration &); - virtual void visit(FunctionDeclaration &) { } -}; - /** Manipulates specialization constants. If values are specified, turns specialization constants into normal constants. Without values assigns automatic constant_ids to specialization constants. */ @@ -99,6 +82,7 @@ private: bool record_target; bool r_self_referencing; Assignment::Target r_assignment_target; + std::set nodes_to_remove; public: VariableResolver(); @@ -116,6 +100,7 @@ private: virtual void visit(Swizzle &); virtual void visit(BinaryExpression &); virtual void visit(Assignment &); + void merge_layouts(Layout &, const Layout &); virtual void visit(VariableDeclaration &); virtual void visit(InterfaceBlock &); };