uniforms_by_index[indices[j]]->matrix_stride = values[j];
}
+ sort(info.uniforms.begin(), info.uniforms.end(), uniform_location_compare);
info.layout_hash = compute_layout_hash(info.uniforms);
info.bind_point = info.layout_hash%BufferRange::get_n_uniform_buffer_bindings();
glUniformBlockBinding(id, i, info.bind_point);
return hash32(layout_descriptor);
}
+bool Program::uniform_location_compare(const UniformInfo *uni1, const UniformInfo *uni2)
+{
+ return uni1->location<uni2->location;
+}
+
string Program::get_info_log() const
{
GLsizei len = 0;
void link();
private:
static unsigned compute_layout_hash(const std::vector<const UniformInfo *> &);
+ static bool uniform_location_compare(const UniformInfo *, const UniformInfo *);
public:
bool is_linked() const { return linked; }
std::string get_info_log() const;