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=
"glUniformSubroutines">
9 <holder>Khronos Group.
</holder>
12 <refentrytitle>glUniformSubroutines
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glUniformSubroutines
</refname>
17 <refpurpose>load active subroutine uniforms
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glUniformSubroutinesuiv
</function></funcdef>
23 <paramdef>GLenum
<parameter>shadertype
</parameter></paramdef>
24 <paramdef>GLsizei
<parameter>count
</parameter></paramdef>
25 <paramdef>const GLuint *
<parameter>indices
</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>count
</parameter></term>
48 Specifies the number of uniform indices stored in
<parameter>indices
</parameter>.
53 <term><parameter>indices
</parameter></term>
56 Specifies the address of an array holding the indices to load into the shader subroutine variables.
62 <refsect1 id=
"description"><title>Description
</title>
64 <function>glUniformSubroutines
</function> loads all active subroutine uniforms for shader stage
65 <parameter>shadertype
</parameter> of the current program with subroutine indices from
<parameter>indices
</parameter>,
66 storing
<parameter>indices[i]
</parameter> into the uniform at location
<parameter>i
</parameter>.
67 <parameter>count
</parameter> must be equal to the value of
<constant>GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS
</constant>
68 for the program currently in use at shader stage
<parameter>shadertype
</parameter>. Furthermore, all values in
69 <parameter>indices
</parameter> must be less than the value of
<constant>GL_ACTIVE_SUBROUTINES
</constant>
73 <refsect1 id=
"errors"><title>Errors
</title>
75 <constant>GL_INVALID_OPERATION
</constant> is generated if no program object is current.
78 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>count
</parameter> is not equal to the value
79 of
<constant>GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS
</constant> for the shader stage
<parameter>shadertype
</parameter>
80 of the current program.
83 <constant>GL_INVALID_VALUE
</constant> is generated if any value in
<parameter>indices
</parameter> is geater
84 than or equal to the value of
<constant>GL_ACTIVE_SUBROUTINES
</constant> for the shader stage
<parameter>shadertype
</parameter>
85 of the current program.
88 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>shadertype
</parameter> is not one of the accepted values.
91 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
93 <citerefentry><refentrytitle>glGetProgramStage
</refentrytitle></citerefentry> with argument
<constant>GL_ACTIVE_SUBROUTINES
</constant>
96 <citerefentry><refentrytitle>glGetProgramStage
</refentrytitle></citerefentry> with argument
<constant>GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS
</constant>
99 <refsect1 id=
"seealso"><title>See Also
</title>
101 <citerefentry><refentrytitle>glGetProgram
</refentrytitle></citerefentry>,
102 <citerefentry><refentrytitle>glGetActiveSubroutineUniform
</refentrytitle></citerefentry>,
103 <citerefentry><refentrytitle>glGetActiveSubroutineUniformName
</refentrytitle></citerefentry>,
104 <citerefentry><refentrytitle>glGetProgramStage
</refentrytitle></citerefentry>
107 <refsect1 id=
"Copyright"><title>Copyright
</title>
109 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
110 This material may be distributed subject to the terms and conditions set forth in
111 the Open Publication License, v
1.0,
8 June
1999.
112 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.