+private:
+ virtual void visit(StructDeclaration &);
+ virtual void visit(VariableDeclaration &);
+};
+
+/** Assigns location and binding layout qualifiers to interface variables and
+blocks. */
+class LocationAllocator: private TraversingVisitor
+{
+private:
+ struct Uniform
+ {
+ int location = -1;
+ int desc_set = 0;
+ int bind_point = -1;
+ };
+
+ Features features;
+ bool alloc_new = true;
+ std::map<std::string, std::set<unsigned> > used_locations;
+ std::map<std::string, Uniform> uniforms;
+ std::map<unsigned, std::set<unsigned> > used_bindings;
+ std::vector<VariableDeclaration *> unplaced_variables;
+ std::vector<VariableDeclaration *> unbound_textures;
+ std::vector<VariableDeclaration *> unbound_blocks;