+ for(Stage &s: module.stages)
+ s.content.visit(*this);
+
+ for(VariableDeclaration *v: auto_constants)
+ {
+ unsigned id = hash32(v->name)%features.constant_id_range;
+ while(used_ids.count(id))
+ id = (id+1)%features.constant_id_range;
+
+ auto i = find_member(v->layout->qualifiers, string("constant_id"), &Layout::Qualifier::name);
+ if(i!=v->layout->qualifiers.end())
+ i->value = id;
+
+ used_ids.insert(id);
+ }