<function>glGetUniformBlockIndex</function> retrieves the index of a uniform block within <parameter>program</parameter>.
</para>
<para>
<parameter>program</parameter> must be the name of a program object for which the command
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry> must have been called in the past, although it is not required that
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry> must have succeeded. The link could have failed because the number
of active uniforms exceeded the limit.
</para>
<para>
<parameter>uniformBlockName</parameter> must contain a nul-terminated string specifying the name of the uniform block.
</para>
<para>
<function>glGetUniformBlockIndex</function> returns the uniform block index for the uniform block named <parameter>uniformBlockName</parameter>
of <parameter>program</parameter>. If <parameter>uniformBlockName</parameter> does not identify an active uniform block of <parameter>program</parameter>,
<function>glGetUniformBlockIndex</function> returns the special identifier, <constant>GL_INVALID_INDEX</constant>. Indices of the active uniform
blocks of a program are assigned in consecutive order, beginning with zero.
</para>
</refsect1>
<refsect1id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>program</parameter> is not the name of a program object for which
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry> has been called in the past.
</para>
</refsect1>
<refsect1id="notes"><title>Notes</title>
<para>
<function>glGetUniformBlockIndex</function> is available only if the GL version is 3.1 or greater.