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=
"glGetActiveSubroutineUniformName">
9 <holder>Khronos Group.
</holder>
12 <refentrytitle>glGetActiveSubroutineUniformName
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGetActiveSubroutineUniformName
</refname>
17 <refpurpose>query the name of an active shader subroutine uniform
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glGetActiveSubroutineUniformName
</function></funcdef>
23 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
24 <paramdef>GLenum
<parameter>shadertype
</parameter></paramdef>
25 <paramdef>GLuint
<parameter>index
</parameter></paramdef>
26 <paramdef>GLsizei
<parameter>bufsize
</parameter></paramdef>
27 <paramdef>GLsizei *
<parameter>length
</parameter></paramdef>
28 <paramdef>GLchar *
<parameter>name
</parameter></paramdef>
32 <!-- eqn: ignoring delim $$ -->
33 <refsect1 id=
"parameters"><title>Parameters
</title>
36 <term><parameter>program
</parameter></term>
39 Specifies the name of the program containing the subroutine.
44 <term><parameter>shadertype
</parameter></term>
47 Specifies the shader stage from which to query for the subroutine parameter.
<parameter>shadertype
</parameter>
48 must be one of
<constant>GL_VERTEX_SHADER
</constant>,
<constant>GL_TESS_CONTROL_SHADER
</constant>,
49 <constant>GL_TESS_EVALUATION_SHADER
</constant>,
<constant>GL_GEOMETRY_SHADER
</constant> or
50 <constant>GL_FRAGMENT_SHADER
</constant>.
55 <term><parameter>index
</parameter></term>
58 Specifies the index of the shader subroutine uniform.
63 <term><parameter>bufsize
</parameter></term>
66 Specifies the size of the buffer whose address is given in
<parameter>name
</parameter>.
71 <term><parameter>length
</parameter></term>
74 Specifies the address of a variable into which is written the number of characters copied into
<parameter>name
</parameter>.
79 <term><parameter>name
</parameter></term>
82 Specifies the address of a buffer that will receive the name of the specified shader subroutine uniform.
88 <refsect1 id=
"description"><title>Description
</title>
90 <function>glGetActiveSubroutineUniformName
</function> retrieves the name of an active shader subroutine uniform.
91 <parameter>program
</parameter> contains the name of the program containing the uniform.
<parameter>shadertype
</parameter>
92 specifies the stage for which which the uniform location, given by
<parameter>index
</parameter>, is valid.
<parameter>index
</parameter>
93 must be between zero and the value of
<constant>GL_ACTIVE_SUBROUTINE_UNIFORMS
</constant> minus one for the
97 The uniform name is returned as a null-terminated string in
<parameter>name
</parameter>. The actual number of characters
98 written into
<parameter>name
</parameter>, excluding the null terminator is returned in
<parameter>length
</parameter>.
99 If
<parameter>length
</parameter> is
<constant>NULL
</constant>, no length is returned. The maximum number of characters
100 that may be written into
<parameter>name
</parameter>, including the null terminator, is specified by
<parameter>bufsize
</parameter>.
101 The length of the longest subroutine uniform name in
<parameter>program
</parameter> and
<parameter>shadertype
</parameter> is given
102 by the value of
<constant>GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH
</constant>, which can be queried with
103 <citerefentry><refentrytitle>glGetProgramStage
</refentrytitle></citerefentry>.
106 <refsect1 id=
"errors"><title>Errors
</title>
108 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>shadertype
</parameter> or
<parameter>pname
</parameter>
109 is not one of the accepted values.
112 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>index
</parameter> is greater than or equal to
113 the value of
<constant>GL_ACTIVE_SUBROUTINES
</constant>.
116 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>program
</parameter> is not the name of an
117 existing program object.
120 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
122 <citerefentry><refentrytitle>glGetProgramStage
</refentrytitle></citerefentry> with argument
<constant>GL_ACTIVE_SUBROUTINE_UNIFORMS
</constant>
125 <refsect1 id=
"seealso"><title>See Also
</title>
127 <citerefentry><refentrytitle>glGetSubroutineIndex
</refentrytitle></citerefentry>,
128 <citerefentry><refentrytitle>glGetActiveSubroutineUniform
</refentrytitle></citerefentry>,
129 <citerefentry><refentrytitle>glGetProgramStage
</refentrytitle></citerefentry>
132 <refsect1 id=
"Copyright"><title>Copyright
</title>
134 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
135 This material may be distributed subject to the terms and conditions set forth in
136 the Open Publication License, v
1.0,
8 June
1999.
137 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.