for(Stage &s: module->stages)
generate(s);
ConstantIdAssigner().apply(*module, features);
+ LocationAllocator().apply(*module, features, false);
for(Stage &s: module->stages)
validate(s);
}
-void LocationAllocator::apply(Module &module, const Features &features)
+void LocationAllocator::apply(Module &module, const Features &features, bool a)
{
+ alloc_new = a;
for(Stage &s: module.stages)
apply(s);
}
}
+ if(!alloc_new)
+ continue;
+
set<unsigned> &used = used_locations[(*i)->interface];
unsigned size = LocationCounter().apply(**i);
auto i = uniforms.find(name);
if(i!=uniforms.end() && i->second.bind_point>=0)
add_layout_qualifier(layout, Layout::Qualifier("binding", i->second.bind_point));
- else
+ else if(alloc_new)
{
set<unsigned> &used = used_bindings[0];
Uniform(): location(-1), desc_set(-1), bind_point(-1) { }
};
+ 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<InterfaceBlock *> unbound_blocks;
public:
- void apply(Module &, const Features &);
+ void apply(Module &, const Features &, bool = true);
private:
void apply(Stage &);