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=
"glGetUniformSubroutine">
9 <holder>Khronos Group.
</holder>
12 <refentrytitle>glGetUniformSubroutine
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGetUniformSubroutine
</refname>
17 <refpurpose>retrieve the value of a subroutine uniform of a given shader stage of the current program
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glGetUniformSubroutineuiv
</function></funcdef>
23 <paramdef>GLenum
<parameter>shadertype
</parameter></paramdef>
24 <paramdef>GLint
<parameter>location
</parameter></paramdef>
25 <paramdef>GLuint *
<parameter>values
</parameter></paramdef>
29 <!-- eqn: ignoring delim $$ -->
30 <refsect1 id=
"parameters"><title>Parameters
</title>
33 <term><parameter>shadertype
</parameter></term>
36 Specifies the shader stage from which to query for subroutine uniform index.
37 <parameter>shadertype
</parameter>
38 must be one of
<constant>GL_VERTEX_SHADER
</constant>,
<constant>GL_TESS_CONTROL_SHADER
</constant>,
39 <constant>GL_TESS_EVALUATION_SHADER
</constant>,
<constant>GL_GEOMETRY_SHADER
</constant> or
40 <constant>GL_FRAGMENT_SHADER
</constant>.
45 <term><parameter>location
</parameter></term>
48 Specifies the location of the subroutine uniform.
53 <term><parameter>values
</parameter></term>
56 Specifies the address of a variable to receive the value or values of the subroutine uniform.
62 <refsect1 id=
"description"><title>Description
</title>
64 <function>glGetUniformSubroutine
</function> retrieves the value of the subroutine uniform at location
65 <parameter>location
</parameter> for shader stage
<parameter>shadertype
</parameter> of the current
66 program.
<parameter>location
</parameter> must be less than the value of
67 <constant>GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS
</constant> for the shader currently in use at
68 shader stage
<parameter>shadertype
</parameter>. The value of the subroutine uniform is returned in
69 <parameter>values
</parameter>.
72 <refsect1 id=
"errors"><title>Errors
</title>
74 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>shadertype
</parameter> is not one of the accepted values.
77 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>location
</parameter> is greater than or equal to
78 the value of
<constant>GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS
</constant> for the shader currently in use at
79 shader stage
<parameter>shadertype
</parameter>.
82 <constant>GL_INVALID_OPERATION
</constant> is generated if no program is active.
85 <refsect1 id=
"seealso"><title>See Also
</title>
87 <citerefentry><refentrytitle>glGetProgram
</refentrytitle></citerefentry>,
88 <citerefentry><refentrytitle>glGetActiveSubroutineUniform
</refentrytitle></citerefentry>,
89 <citerefentry><refentrytitle>glGetActiveSubroutineUniformName
</refentrytitle></citerefentry>,
90 <citerefentry><refentrytitle>glGetUniformLocation
</refentrytitle></citerefentry>
93 <refsect1 id=
"Copyright"><title>Copyright
</title>
95 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
96 This material may be distributed subject to the terms and conditions set forth in
97 the Open Publication License, v
1.0,
8 June
1999.
98 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.