1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glGetSubroutineUniformLocation">
9 <holder>Khronos Group.
</holder>
12 <refentrytitle>glGetSubroutineUniformLocation
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGetSubroutineUniformLocation
</refname>
17 <refpurpose>retrieve the location of a subroutine uniform of a given shader stage within a program
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>GLint
<function>glGetSubroutineUniformLocation
</function></funcdef>
23 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
24 <paramdef>GLenum
<parameter>shadertype
</parameter></paramdef>
25 <paramdef>const GLchar *
<parameter>name
</parameter></paramdef>
29 <!-- eqn: ignoring delim $$ -->
30 <refsect1 id=
"parameters"><title>Parameters
</title>
33 <term><parameter>program
</parameter></term>
36 Specifies the name of the program containing shader stage.
41 <term><parameter>shadertype
</parameter></term>
44 Specifies the shader stage from which to query for subroutine uniform index.
45 <parameter>shadertype
</parameter>
46 must be one of
<constant>GL_VERTEX_SHADER
</constant>,
<constant>GL_TESS_CONTROL_SHADER
</constant>,
47 <constant>GL_TESS_EVALUATION_SHADER
</constant>,
<constant>GL_GEOMETRY_SHADER
</constant> or
48 <constant>GL_FRAGMENT_SHADER
</constant>.
53 <term><parameter>name
</parameter></term>
56 Specifies the name of the subroutine uniform whose index to query.
62 <refsect1 id=
"description"><title>Description
</title>
64 <function>glGetSubroutineUniformLocation
</function> returns the location of the subroutine uniform variable
65 <parameter>name
</parameter> in the shader stage of type
<parameter>shadertype
</parameter> attached to
66 <parameter>program
</parameter>, with behavior otherwise identical to
67 <citerefentry><refentrytitle>glGetUniformLocation
</refentrytitle></citerefentry>.
70 If
<parameter>name
</parameter> is not the name of a subroutine uniform in the shader stage, -
1
71 is returned, but no error is generated. If
<parameter>name
</parameter> is the name of a subroutine uniform in the shader stage,
72 a value between zero and the value of
<constant>GL_ACTIVE_SUBROUTINE_LOCATIONS
</constant> minus one will be returned.
73 Subroutine locations are assigned using consecutive integers in the range from zero to the value
74 of
<constant>GL_ACTIVE_SUBROUTINE_LOCATIONS
</constant> minus one for the shader stage. For active subroutine uniforms
75 declared as arrays, the declared array elements are assigned consecutive locations.
78 <refsect1 id=
"errors"><title>Errors
</title>
80 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>shadertype
</parameter> or
<parameter>pname
</parameter>
81 is not one of the accepted values.
84 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>program
</parameter> is not the name of an
85 existing program object.
88 <refsect1 id=
"seealso"><title>See Also
</title>
90 <citerefentry><refentrytitle>glGetProgram
</refentrytitle></citerefentry>,
91 <citerefentry><refentrytitle>glGetActiveSubroutineUniform
</refentrytitle></citerefentry>,
92 <citerefentry><refentrytitle>glGetActiveSubroutineUniformName
</refentrytitle></citerefentry>,
93 <citerefentry><refentrytitle>glGetUniformLocation
</refentrytitle></citerefentry>
96 <refsect1 id=
"Copyright"><title>Copyright
</title>
98 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
99 This material may be distributed subject to the terms and conditions set forth in
100 the Open Publication License, v
1.0,
8 June
1999.
101 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.