X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fgenerate.h;h=bfd15a694d8341e6e281a529cc5ae77d185a4274;hb=d684e9f3007a0113c65c016ceb694eeac56a128c;hp=c7a162e5c6c7e81f81a30d104f0763e81ff8f0ee;hpb=9229a3e70dace406d897148857ed6567986c3bcd;p=libs%2Fgl.git diff --git a/source/glsl/generate.h b/source/glsl/generate.h index c7a162e5..bfd15a69 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,8 @@ private: bool record_target; bool r_self_referencing; Assignment::Target r_assignment_target; + std::vector redeclared_builtins; + std::set nodes_to_remove; public: VariableResolver(); @@ -116,6 +101,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 &); }; @@ -163,6 +149,7 @@ private: void visit(BinaryExpression &, bool); virtual void visit(BinaryExpression &); virtual void visit(Assignment &); + virtual void visit(TernaryExpression &); virtual void visit(FunctionCall &); virtual void visit(BasicTypeDeclaration &); virtual void visit(VariableDeclaration &);