X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Ffinalize.h;h=f9502954f6b1d6ed9983e403c14414870ae63090;hb=e98188ff6c9bba9761b71f2a69f3be7eb89ba3da;hp=263be454f252038cbee069abedcf854c9729ec97;hpb=c32051dc7e77faf0fe6bdad2a6f1025e7b43da19;p=libs%2Fgl.git diff --git a/source/glsl/finalize.h b/source/glsl/finalize.h index 263be454..f9502954 100644 --- a/source/glsl/finalize.h +++ b/source/glsl/finalize.h @@ -29,13 +29,13 @@ class LocationAllocator: private TraversingVisitor private: struct Uniform { - int location; - int desc_set; - int bind_point; - - Uniform(): location(-1), desc_set(-1), bind_point(-1) { } + int location = -1; + int desc_set = 0; + int bind_point = -1; }; + Features features; + bool alloc_new = true; std::map > used_locations; std::map uniforms; std::map > used_bindings; @@ -44,14 +44,14 @@ private: std::vector unbound_blocks; public: - void apply(Module &, const Features &); + void apply(Module &, const Features &, bool = true); private: void apply(Stage &); void allocate_locations(const std::string &); void bind_uniform(RefPtr &, const std::string &, unsigned); - void add_layout_value(RefPtr &, const std::string &, unsigned); + bool visit_uniform(const std::string &, RefPtr &); virtual void visit(VariableDeclaration &); virtual void visit(InterfaceBlock &); virtual void visit(FunctionDeclaration &) { }