summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
efbce87)
Uniform location and binding qualifiers should apply to all copies of the
variable even if the one originally containing them is optimized out.
for(Stage &s: module->stages)
generate(s);
ConstantIdAssigner().apply(*module, features);
for(Stage &s: module->stages)
generate(s);
ConstantIdAssigner().apply(*module, features);
+ LocationAllocator().apply(*module, features, false);
for(Stage &s: module->stages)
validate(s);
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)
for(Stage &s: module.stages)
apply(s);
for(Stage &s: module.stages)
apply(s);
+ if(!alloc_new)
+ continue;
+
set<unsigned> &used = used_locations[(*i)->interface];
unsigned size = LocationCounter().apply(**i);
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));
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));
{
set<unsigned> &used = used_bindings[0];
{
set<unsigned> &used = used_bindings[0];
Uniform(): location(-1), desc_set(-1), bind_point(-1) { }
};
Uniform(): location(-1), desc_set(-1), bind_point(-1) { }
};
std::map<std::string, std::set<unsigned> > used_locations;
std::map<std::string, Uniform> uniforms;
std::map<unsigned, std::set<unsigned> > used_bindings;
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:
std::vector<InterfaceBlock *> unbound_blocks;
public:
- void apply(Module &, const Features &);
+ void apply(Module &, const Features &, bool = true);
private:
void apply(Stage &);
private:
void apply(Stage &);