Commit | Line | Data |
---|---|---|
7faf1d71 AW |
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"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>2010</year> | |
9 | <holder>Khronos Group</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glUniformBlockBinding</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glUniformBlockBinding</refname> | |
17 | <refpurpose>assign a binding point to an active uniform block</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
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> | |
26 | </funcprototype> | |
27 | </funcsynopsis> | |
28 | </refsynopsisdiv> | |
29 | <refsect1 id="parameters"><title>Parameters</title> | |
30 | <variablelist> | |
31 | <varlistentry> | |
32 | <term><parameter>program</parameter></term> | |
33 | <listitem> | |
34 | <para> | |
35 | The name of a program object containing the active uniform block whose binding to assign. | |
36 | </para> | |
37 | </listitem> | |
38 | </varlistentry> | |
39 | <varlistentry> | |
40 | <term><parameter>uniformBlockIndex</parameter></term> | |
41 | <listitem> | |
42 | <para> | |
43 | The index of the active uniform block within <parameter>program</parameter> whose binding to assign. | |
44 | </para> | |
45 | </listitem> | |
46 | </varlistentry> | |
47 | <varlistentry> | |
48 | <term><parameter>uniformBlockBinding</parameter></term> | |
49 | <listitem> | |
50 | <para> | |
51 | Specifies the binding point to which to bind the uniform block with index <parameter>uniformBlockIndex</parameter> within <parameter>program</parameter>. | |
52 | </para> | |
53 | </listitem> | |
54 | </varlistentry> | |
55 | </variablelist> | |
56 | </refsect1> | |
57 | <refsect1 id="description"><title>Description</title> | |
58 | <para> | |
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. | |
62 | </para> | |
63 | <para> | |
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>. | |
67 | </para> | |
68 | <para> | |
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. | |
70 | </para> | |
71 | </refsect1> | |
72 | <refsect1 id="errors"><title>Errors</title> | |
73 | <para> | |
74 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>uniformBlockIndex</parameter> is not an active uniform block index of <parameter>program</parameter>. | |
75 | </para> | |
76 | <para> | |
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>. | |
78 | </para> | |
79 | <para> | |
80 | <constant>GL_INVALID_VALUE</constant> is generated <parameter>program</parameter> is not the name of a program object generated by the GL. | |
81 | </para> | |
82 | </refsect1> | |
83 | <refsect1 id="notes"><title>Notes</title> | |
84 | <para> | |
85 | <function>glUniformBlockBinding</function> is available only if the GL version is 3.1 or greater. | |
86 | </para> | |
87 | </refsect1> | |
88 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
89 | <para> | |
90 | <citerefentry><refentrytitle>glGetActiveUniformBlock</refentrytitle></citerefentry> with argument <constant>GL_UNIFORM_BLOCK_BINDING</constant> | |
91 | </para> | |
92 | </refsect1> | |
93 | <refsect1 id="seealso"><title>See Also</title> | |
94 | <para> | |
95 | <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>, | |
96 | <citerefentry><refentrytitle>glBindBufferBase</refentrytitle></citerefentry>, | |
97 | <citerefentry><refentrytitle>glBindBufferRange</refentrytitle></citerefentry>, | |
98 | <citerefentry><refentrytitle>glGetActiveUniformBlock</refentrytitle></citerefentry> | |
99 | </para> | |
100 | </refsect1> | |
101 | ||
102 | <refsect1 id="Copyright"><title>Copyright</title> | |
103 | <para> | |
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>. | |
108 | </para> | |
109 | </refsect1> | |
110 | </refentry> |