<constant>GL_FRAGMENT_SUBROUTINE_UNIFORM</constant>, <constant>GL_COMPUTE_SUBROUTINE_UNIFORM</constant>, or <constant>GL_TRANSFORM_FEEDBACK_BUFFER</constant>.
</para>
<para>
The value -1 will be returned if an error occurs, if <parameter>name</parameter> does not identify an active variable on
<parameter>programInterface</parameter>, or if <parameter>name</parameter> identifies an active variable that does
not have a valid location assigned, as described above. The locations
returned by these commands are the same locations returned when querying
the <constant>GL_LOCATION</constant> and <constant>GL_LOCATION_INDEX</constant> resource properties.
</para>
<para>
A string provided to <function>glGetProgramResourceLocation</function> is considered to match an active variable if:
</para>
<itemizedlist>
<listitem>
<para>
the string exactly matches the name of the active variable
</para>
</listitem>
<listitem>
<para>
if the string identifies the base name of an active array, where the
string would exactly match the name of the variable if the suffix
"[0]" were appended to the string
</para>
</listitem>
<listitem>
<para>
if the string identifies an active element of the array, where the
string ends with the concatenation of the "[" character, an integer
<emphasis>with no "+" sign, extra leading zeroes, or whitespace</emphasis> identifying an
array element, and the "]" character, the integer is less than the
number of active elements of the array variable, and where the string
would exactly match the enumerated name of the array if the decimal
integer were replaced with zero.
</para>
</listitem>
</itemizedlist>
<para>
Any other string is considered not to identify an active variable. If the
string specifies an element of an array variable,
<function>glGetProgramResourceLocation</function> returns the
location assigned to that element. If it
specifies the base name of an array, it identifies the resources
associated with the first element of the array.
</para>
</refsect1>
<refsect1id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>program</parameter>
is not the name of an existing program object.
</para>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>programInterface</parameter>
is not one of the accepted interface types.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>program</parameter>