X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fgenerate.h;h=48fc742342bdf042aa32bdbd5686e61e1e43bbe0;hb=518f751d385b733adbf43fe4056403740709edec;hp=b82bdca365bc02e7fd856c86f5011eb124517f92;hpb=30465dd3b9f55ec42c4b19c3c2077eede7237a26;p=libs%2Fgl.git diff --git a/source/glsl/generate.h b/source/glsl/generate.h index b82bdca3..48fc7423 100644 --- a/source/glsl/generate.h +++ b/source/glsl/generate.h @@ -24,8 +24,8 @@ public: private: virtual void visit(Block &); - virtual void visit(FunctionDeclaration &); virtual void visit(VariableDeclaration &); + virtual void visit(FunctionDeclaration &) { } }; /** Manipulates specialization constants. If values are specified, turns @@ -61,7 +61,6 @@ class VariableResolver: private TraversingVisitor { private: Stage *stage; - Block *builtins; std::map *members; RefPtr iface_ref; std::string block_interface; @@ -75,8 +74,6 @@ public: void apply(Stage &); private: - Block *next_block(Block &); - virtual void enter(Block &); virtual void visit(VariableReference &); virtual void visit(InterfaceBlockReference &); @@ -93,7 +90,7 @@ class FunctionResolver: private TraversingVisitor { private: Stage *stage; - std::map > functions; + std::map > declarations; public: void apply(Stage &); @@ -144,39 +141,6 @@ private: virtual void visit(Passthrough &); }; -/** Reorders declarations to ensure that declarations always appear before -references. */ -class DeclarationReorderer: private TraversingVisitor -{ -private: - enum DeclarationKind - { - NO_DECLARATION, - LAYOUT, - STRUCT, - VARIABLE, - FUNCTION - }; - - DeclarationKind kind; - std::set ordered_funcs; - std::set needed_funcs; - -public: - DeclarationReorderer(); - - void apply(Stage &s) { s.content.visit(*this); } - -private: - virtual void visit(Block &); - virtual void visit(FunctionCall &); - virtual void visit(InterfaceLayout &) { kind = LAYOUT; } - virtual void visit(StructDeclaration &) { kind = STRUCT; } - virtual void visit(VariableDeclaration &); - virtual void visit(InterfaceBlock &) { kind = VARIABLE; } - virtual void visit(FunctionDeclaration &); -}; - } // namespace SL } // namespace GL } // namespace Msp