X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fglsl%2Ffinalize.h;h=28145aebd9e2837abedcb2b5ec54ae3b8f745414;hb=c6b29fbf9927467b21dca65539a1fa2c98f96e0e;hp=357351b476bd071500847c5653e044025a82c082;hpb=9cfccf5c4e366e033cfd5eebf8955d2b13202b46;p=libs%2Fgl.git diff --git a/source/glsl/finalize.h b/source/glsl/finalize.h index 357351b4..28145aeb 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 @@ -62,6 +82,7 @@ private: bool supports_centroid_sampling() const; bool supports_sample_sampling() const; bool supports_uniform_location() const; + bool supports_binding() const; virtual void visit(VariableDeclaration &); bool supports_interface_blocks(const std::string &) const; bool supports_interface_block_location() const;