for(VariableDeclaration *b: unbound_blocks)
bind_uniform(b->layout, b->block_declaration->block_name, features.uniform_binding_range);
for(VariableDeclaration *t: unbound_textures)
- bind_uniform(t->layout, t->name, features.texture_binding_range);
+ {
+ const TypeDeclaration *base_type = get_ultimate_base_type(t->type_declaration);
+ unsigned range = (static_cast<const ImageTypeDeclaration *>(base_type)->sampled ?
+ features.texture_binding_range : features.storage_texture_binding_range);
+ bind_uniform(t->layout, t->name, range);
+ }
}
void LocationAllocator::apply(Stage &stage)