for(vector<int>::iterator j=indices.begin(); j!=indices.end(); ++j)
if(uniforms_by_index[*j]->size>1)
indices2.push_back(*j);
- glGetActiveUniformsiv(id, indices2.size(), &indices2[0], GL_UNIFORM_ARRAY_STRIDE, &values[0]);
- for(unsigned j=0; j<indices2.size(); ++j)
- uniforms_by_index[indices[j]]->array_stride = values[j];
+ if(!indices2.empty())
+ {
+ glGetActiveUniformsiv(id, indices2.size(), &indices2[0], GL_UNIFORM_ARRAY_STRIDE, &values[0]);
+ for(unsigned j=0; j<indices2.size(); ++j)
+ uniforms_by_index[indices[j]]->array_stride = values[j];
+ }
indices2.clear();
for(vector<int>::iterator j=indices.begin(); j!=indices.end(); ++j)
t==GL_FLOAT_MAT3x4 || t==GL_FLOAT_MAT4x2 || t==GL_FLOAT_MAT4x3)
indices2.push_back(*j);
}
- glGetActiveUniformsiv(id, indices2.size(), &indices2[0], GL_UNIFORM_MATRIX_STRIDE, &values[0]);
- for(unsigned j=0; j<indices2.size(); ++j)
- uniforms_by_index[indices[j]]->matrix_stride = values[j];
+ if(!indices2.empty())
+ {
+ glGetActiveUniformsiv(id, indices2.size(), &indices2[0], GL_UNIFORM_MATRIX_STRIDE, &values[0]);
+ for(unsigned j=0; j<indices2.size(); ++j)
+ uniforms_by_index[indices[j]]->matrix_stride = values[j];
+ }
info.layout_hash = compute_layout_hash(info.uniforms);
info.bind_point = info.layout_hash%BufferRange::get_n_uniform_buffer_bindings();