I use one uniform block like this:
uniform matrices
{
mat4 pv_matrix;
mat4 screen_matrix;
};
in different shaders with the same binding point defined explicitly by UniformBlockBinding
.
To work with a Uniform Buffer Object need to query the offsets this way:
int offsets = new int[Length];
GL.GetActiveUniforms(id_program, Length, indices,
ActiveUniformParameter.UniformOffset, offsets);
And I call this code for every shader program with the same result.
If I understood correct, the offsets are representing the structure of the uniform buffer object which is one for all called programs.
Does it make sense to call many times or it should be enough to call it ones?