X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Foptimize.h;h=9b7b7affecf58035f19c2457cbd08c8c4adddf3d;hb=7ab4261d281c7885bbdfb0a782ed231b2cd08293;hp=aebe080c585206b14d533a4c09ef3c926878392d;hpb=49e89e55692ecdbccd98b93578d29f89669a9fc0;p=libs%2Fgl.git diff --git a/source/glsl/optimize.h b/source/glsl/optimize.h index aebe080c..9b7b7aff 100644 --- a/source/glsl/optimize.h +++ b/source/glsl/optimize.h @@ -195,6 +195,7 @@ private: virtual void visit(StructDeclaration &) { } virtual void visit(VariableDeclaration &); virtual void visit(InterfaceBlock &) { } + virtual void visit(FunctionDeclaration &); }; /** Replaces expressions consisting entirely of literals with the results of @@ -275,6 +276,7 @@ private: virtual void visit(Iteration &); }; +/** Removes code which is never executed due to flow control statements. */ class UnreachableCodeRemover: private TraversingVisitor { private: @@ -327,7 +329,6 @@ private: struct VariableInfo { - InterfaceBlock *interface_block = 0; std::vector assignments; bool initialized = false; bool output = false; @@ -339,7 +340,6 @@ private: Stage *stage = 0; BlockVariableMap variables; std::list assignments; - InterfaceBlock *interface_block = 0; Assignment *r_assignment = 0; bool assignment_target = false; bool r_side_effects = false;