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=
"glUniformBlockBinding">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glUniformBlockBinding
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glUniformBlockBinding
</refname>
17 <refpurpose>assign a binding point to an active uniform block
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glUniformBlockBinding
</function></funcdef>
23 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
24 <paramdef>GLuint
<parameter>uniformBlockIndex
</parameter></paramdef>
25 <paramdef>GLuint
<parameter>uniformBlockBinding
</parameter></paramdef>
29 <refsect1 id=
"parameters"><title>Parameters
</title>
32 <term><parameter>program
</parameter></term>
35 The name of a program object containing the active uniform block whose binding to assign.
40 <term><parameter>uniformBlockIndex
</parameter></term>
43 The index of the active uniform block within
<parameter>program
</parameter> whose binding to assign.
48 <term><parameter>uniformBlockBinding
</parameter></term>
51 Specifies the binding point to which to bind the uniform block with index
<parameter>uniformBlockIndex
</parameter> within
<parameter>program
</parameter>.
57 <refsect1 id=
"description"><title>Description
</title>
59 Binding points for active uniform blocks are assigned using
<function>glUniformBlockBinding
</function>. Each of a program's active uniform
60 blocks has a corresponding uniform buffer binding point.
<parameter>program
</parameter> is the name of a program object for which the command
61 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry> has been issued in the past.
64 If successful,
<function>glUniformBlockBinding
</function> specifies that
<parameter>program
</parameter> will use the data store of the
65 buffer object bound to the binding point
<parameter>uniformBlockBinding
</parameter> to extract the values of the uniforms in the
66 uniform block identified by
<parameter>uniformBlockIndex
</parameter>.
69 When a program object is linked or re-linked, the uniform buffer object binding point assigned to each of its active uniform blocks is reset to zero.
72 <refsect1 id=
"errors"><title>Errors
</title>
74 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>uniformBlockIndex
</parameter> is not an active uniform block index of
<parameter>program
</parameter>.
77 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>uniformBlockBinding
</parameter> is greater than or equal to the value of
<constant>GL_MAX_UNIFORM_BUFFER_BINDINGS
</constant>.
80 <constant>GL_INVALID_VALUE
</constant> is generated
<parameter>program
</parameter> is not the name of a program object generated by the GL.
83 <refsect1 id=
"notes"><title>Notes
</title>
85 <function>glUniformBlockBinding
</function> is available only if the GL version is
3.1 or greater.
88 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
90 <citerefentry><refentrytitle>glGetActiveUniformBlock
</refentrytitle></citerefentry> with argument
<constant>GL_UNIFORM_BLOCK_BINDING
</constant>
93 <refsect1 id=
"seealso"><title>See Also
</title>
95 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry>,
96 <citerefentry><refentrytitle>glBindBufferBase
</refentrytitle></citerefentry>,
97 <citerefentry><refentrytitle>glBindBufferRange
</refentrytitle></citerefentry>,
98 <citerefentry><refentrytitle>glGetActiveUniformBlock
</refentrytitle></citerefentry>
102 <refsect1 id=
"Copyright"><title>Copyright
</title>
104 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
105 This material may be distributed subject to the terms and conditions set forth in
106 the Open Publication License, v
1.0,
8 June
1999.
107 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.