arb_uniform_buffer_object(false),
ext_gpu_shader4(false),
ext_texture_array(false),
- max_constant_id(0x7FFFFFFF)
+ constant_id_range(0x80000000U)
{ }
Features Features::from_context()
for(list<Stage>::iterator i=module.stages.begin(); i!=module.stages.end(); ++i)
i->content.visit(*this);
- unsigned max_id = features.max_constant_id;
for(vector<VariableDeclaration *>::iterator i=auto_constants.begin(); i!=auto_constants.end(); ++i)
{
- unsigned id = hash32((*i)->name)%(max_id+1);
+ unsigned id = hash32((*i)->name)%features.constant_id_range;
while(used_ids.count(id))
- ++id;
+ id = (id+1)%features.constant_id_range;
vector<Layout::Qualifier> &qualifiers = (*i)->layout->qualifiers;
for(vector<Layout::Qualifier>::iterator j=qualifiers.begin(); j!=qualifiers.end(); ++j)