X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Ffinalize.h;h=36b349125f51eb236cff061d9c08c0ad49c2a542;hp=357351b476bd071500847c5653e044025a82c082;hb=7b03ca83ca6c48b9f8c3f77c13760e7f87e9632d;hpb=9cfccf5c4e366e033cfd5eebf8955d2b13202b46 diff --git a/source/glsl/finalize.h b/source/glsl/finalize.h index 357351b4..36b34912 100644 --- a/source/glsl/finalize.h +++ b/source/glsl/finalize.h @@ -8,6 +8,26 @@ namespace Msp { namespace GL { namespace SL { +class LocationAllocator: private TraversingVisitor +{ +private: + std::map > used_locations; + std::map uniform_locations; + std::vector unplaced_variables; + +public: + void apply(Module &); +private: + void apply(Stage &); + + void allocate_locations(const std::string &); + void add_location(RefPtr &, unsigned); + + virtual void visit(VariableDeclaration &); + virtual void visit(InterfaceBlock &) { } + virtual void visit(FunctionDeclaration &) { } +}; + /** Generates default precision declarations or removes precision declarations according to the requirements of the target API. */ class PrecisionConverter: private TraversingVisitor