i->location = glGetUniformLocation(id, i->name.c_str());
i->block = &default_block;
default_block.uniforms.push_back(&*i);
+
+ if(is_image(i->type) && i->location>=0)
+ glGetUniformiv(id, i->location, &i->binding);
}
default_block.layout_hash = compute_layout_hash(default_block.uniforms);
block.uniforms.push_back(&uni);
uni.block = █
}
+ sort(block.uniforms, uniform_location_compare);
block.layout_hash = compute_layout_hash(block.uniforms);
}
return i!=uniforms.end() && i->tag==tag && i->block->bind_point<0 ? i->location : -1;
}
+int Program::get_uniform_binding(Tag tag) const
+{
+ vector<UniformInfo>::const_iterator i = lower_bound_member(uniforms, tag, &UniformInfo::tag);
+ return i!=uniforms.end() && i->tag==tag ? i->binding : -1;
+}
+
const Program::AttributeInfo &Program::get_attribute_info(const string &name) const
{
vector<AttributeInfo>::const_iterator i = lower_bound_member(attributes, name, &AttributeInfo::name);
array_size(0),
array_stride(0),
matrix_stride(0),
- type(VOID)
+ type(VOID),
+ binding(-1)
{ }