X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Freflect.h;h=72a50c3eb6368b303ba5bd6e2fad8f7095e0189b;hp=a48ad53f8cfa9b960665af6a61cd66e2a475d686;hb=42903b905cd3924ecc45d3cb08222bc3548cab91;hpb=03d9003072e85c934f5624329fb4a34db8763db2 diff --git a/source/glsl/reflect.h b/source/glsl/reflect.h index a48ad53f..72a50c3e 100644 --- a/source/glsl/reflect.h +++ b/source/glsl/reflect.h @@ -25,6 +25,24 @@ private: virtual void visit(VariableDeclaration &); }; +/** Collects dependencies of a function. This includes global variables, +interface blocks, other functions and types. */ +class DependencyCollector: private TraversingVisitor +{ +private: + std::set dependencies; + std::set locals; + +public: + std::set apply(FunctionDeclaration &); + +private: + virtual void visit(VariableReference &); + virtual void visit(InterfaceBlockReference &); + virtual void visit(FunctionCall &); + virtual void visit(VariableDeclaration &); +}; + } // namespace SL } // namespace GL } // namespace Msp