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=
"glGetUniformIndices">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glGetUniformIndices
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGetUniformIndices
</refname>
17 <refpurpose>retrieve the index of a named uniform block
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>GLuint
<function>glGetUniformIndices
</function></funcdef>
23 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
24 <paramdef>GLsizei
<parameter>uniformCount
</parameter></paramdef>
25 <paramdef>const GLchar **
<parameter>uniformNames
</parameter></paramdef>
26 <paramdef>GLuint *
<parameter>uniformIndices
</parameter></paramdef>
30 <refsect1 id=
"parameters"><title>Parameters
</title>
33 <term><parameter>program
</parameter></term>
36 Specifies the name of a program containing uniforms whose indices to query.
41 <term><parameter>uniformCount
</parameter></term>
44 Specifies the number of uniforms whose indices to query.
49 <term><parameter>uniformNames
</parameter></term>
52 Specifies the address of an array of pointers to buffers containing the names of the queried uniforms.
57 <term><parameter>uniformIndices
</parameter></term>
60 Specifies the address of an array that will receive the indices of the uniforms.
66 <refsect1 id=
"description"><title>Description
</title>
68 <function>glGetUniformIndices
</function> retrieves the indices of a number of uniforms within
<parameter>program
</parameter>.
71 <parameter>program
</parameter> must be the name of a program object for which the command
72 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry> must have been called in the past, although it is not required that
73 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry> must have succeeded. The link could have failed because the number
74 of active uniforms exceeded the limit.
77 <parameter>uniformCount
</parameter> indicates both the number of elements in the array of names
<parameter>uniformNames
</parameter> and the
78 number of indices that may be written to
<parameter>uniformIndices
</parameter>.
81 <parameter>uniformNames
</parameter> contains a list of
<parameter>uniformCount
</parameter> name strings identifying the uniform names to be
82 queried for indices. For each name string in
<parameter>uniformNames
</parameter>, the index assigned to the active uniform of that name will
83 be written to the corresponding element of
<parameter>uniformIndices
</parameter>. If a string in
<parameter>uniformNames
</parameter> is not
84 the name of an active uniform, the special value
<constant>GL_INVALID_INDEX
</constant> will be written to the corresponding element of
85 <parameter>uniformIndices
</parameter>.
88 If an error occurs, nothing is written to
<parameter>uniformIndices
</parameter>.
91 <refsect1 id=
"errors"><title>Errors
</title>
93 <constant>GL_INVALID_OPERATION
</constant> is generated if
<parameter>program
</parameter> is not the name of a program object for which
94 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry> has been called in the past.
97 <refsect1 id=
"notes"><title>Notes
</title>
99 <function>glGetUniformIndices
</function> is available only if the GL version is
3.1 or greater.
102 <refsect1 id=
"seealso"><title>See Also
</title>
104 <citerefentry><refentrytitle>glGetActiveUniform
</refentrytitle></citerefentry>,
105 <citerefentry><refentrytitle>glGetActiveUniformName
</refentrytitle></citerefentry>,
106 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry>
109 <refsect1 id=
"Copyright"><title>Copyright
</title>
111 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
112 This material may be distributed subject to the terms and conditions set forth in
113 the Open Publication License, v
1.0,
8 June
1999.
114 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.