Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?>\r |
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"\r | |
3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">\r | |
4 | <refentry id="glGetActiveUniformBlock">\r | |
5 | <refmeta>\r | |
6 | <refmetainfo>\r | |
7 | <copyright>\r | |
8 | <year>2010</year>\r | |
9 | <holder>Khronos Group</holder>\r | |
10 | </copyright>\r | |
11 | </refmetainfo>\r | |
12 | <refentrytitle>glGetActiveUniformBlock</refentrytitle>\r | |
13 | <manvolnum>3G</manvolnum>\r | |
14 | </refmeta>\r | |
15 | <refnamediv>\r | |
16 | <refname>glGetActiveUniformBlock</refname>\r | |
17 | <refpurpose>query information about an active uniform block</refpurpose>\r | |
18 | </refnamediv>\r | |
19 | <refsynopsisdiv><title>C Specification</title>\r | |
20 | <funcsynopsis>\r | |
21 | <funcprototype>\r | |
22 | <funcdef>void <function>glGetActiveUniformBlockiv</function></funcdef>\r | |
23 | <paramdef>GLuint <parameter>program</parameter></paramdef>\r | |
24 | <paramdef>GLuint <parameter>uniformBlockIndex</parameter></paramdef>\r | |
25 | <paramdef>GLenum <parameter>pname</parameter></paramdef>\r | |
c7b31271 | 26 | <paramdef>GLint *<parameter>params</parameter></paramdef>\r |
7faf1d71 AW |
27 | </funcprototype>\r |
28 | </funcsynopsis>\r | |
29 | </refsynopsisdiv>\r | |
30 | <refsect1 id="parameters"><title>Parameters</title>\r | |
31 | <variablelist>\r | |
32 | <varlistentry>\r | |
33 | <term><parameter>program</parameter></term>\r | |
34 | <listitem>\r | |
35 | <para>\r | |
36 | Specifies the name of a program containing the uniform block.\r | |
37 | </para>\r | |
38 | </listitem>\r | |
39 | </varlistentry>\r | |
40 | <varlistentry>\r | |
41 | <term><parameter>uniformBlockIndex</parameter></term>\r | |
42 | <listitem>\r | |
43 | <para>\r | |
44 | Specifies the index of the uniform block within <parameter>program</parameter>.\r | |
45 | </para>\r | |
46 | </listitem>\r | |
47 | </varlistentry>\r | |
48 | <varlistentry>\r | |
49 | <term><parameter>pname</parameter></term>\r | |
50 | <listitem>\r | |
51 | <para>\r | |
52 | Specifies the name of the parameter to query.\r | |
53 | </para>\r | |
54 | </listitem>\r | |
55 | </varlistentry>\r | |
56 | <varlistentry>\r | |
57 | <term><parameter>params</parameter></term>\r | |
58 | <listitem>\r | |
59 | <para>\r | |
60 | Specifies the address of a variable to receive the result of the query.\r | |
61 | </para>\r | |
62 | </listitem>\r | |
63 | </varlistentry>\r | |
64 | </variablelist>\r | |
65 | </refsect1>\r | |
66 | <refsect1 id="description"><title>Description</title>\r | |
67 | <para>\r | |
68 | <function>glGetActiveUniformBlockiv</function> retrieves information about an active uniform block within <parameter>program</parameter>.\r | |
69 | </para>\r | |
70 | <para>\r | |
71 | <parameter>program</parameter> must be the name of a program object for which the command\r | |
72 | <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry> must have been called in the past, although it is not required that\r | |
73 | <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry> must have succeeded. The link could have failed because the number\r | |
74 | of active uniforms exceeded the limit.\r | |
75 | </para>\r | |
76 | <para>\r | |
77 | <parameter>uniformBlockIndex</parameter> is an active uniform block index of <parameter>program</parameter>, and must be less than the value\r | |
78 | of <constant>GL_ACTIVE_UNIFORM_BLOCKS</constant>.\r | |
79 | </para>\r | |
80 | <para>\r | |
81 | Upon success, the uniform block parameter(s) specified by <parameter>pname</parameter> are returned in <parameter>params</parameter>. If an error\r | |
82 | occurs, nothing will be written to <parameter>params</parameter>.\r | |
83 | </para>\r | |
84 | <para>\r | |
85 | If <parameter>pname</parameter> is <constant>GL_UNIFORM_BLOCK_BINDING</constant>, then the index of the uniform buffer binding point\r | |
86 | last selected by the uniform block specified by <parameter>uniformBlockIndex</parameter> for <parameter>program</parameter> is returned. If\r | |
87 | no uniform block has been previously specified, zero is returned.\r | |
88 | </para>\r | |
89 | <para>\r | |
90 | If <parameter>pname</parameter> is <constant>GL_UNIFORM_BLOCK_DATA_SIZE</constant>, then the implementation-dependent minimum total buffer\r | |
91 | object size, in basic machine units, required to hold all active uniforms in the uniform block identified by <parameter>uniformBlockIndex</parameter>\r | |
92 | is returned. It is neither guaranteed nor expected that a given implementation will arrange uniform values as tightly packed in a buffer\r | |
93 | object. The exception to this is the <emphasis>std140 uniform block layout</emphasis>, which guarantees specific packing behavior and does not\r | |
94 | require the application to query for offsets and strides. In this case the minimum size may still be queried, even though it is determined in\r | |
95 | advance based only on the uniform block declaration.\r | |
96 | </para>\r | |
97 | <para>\r | |
98 | If <parameter>pname</parameter> is <constant>GL_UNIFORM_BLOCK_NAME_LENGTH</constant>, then the total length (including the nul terminator) of\r | |
99 | the name of the uniform block identified by <parameter>uniformBlockIndex</parameter> is returned.\r | |
100 | </para>\r | |
101 | <para>\r | |
102 | If <parameter>pname</parameter> is <constant>GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS</constant>, then the number of active uniforms in the uniform\r | |
103 | block identified by <parameter>uniformBlockIndex</parameter> is returned.\r | |
104 | </para>\r | |
105 | <para>\r | |
106 | If <parameter>pname</parameter> is <constant>GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES</constant>, then a list of the active uniform indices\r | |
107 | for the uniform block identified by <parameter>uniformBlockIndex</parameter> is returned. The number of elements that will be written to\r | |
108 | <parameter>params</parameter> is the value of <constant>GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS</constant> for <parameter>uniformBlockIndex</parameter>.\r | |
109 | </para>\r | |
110 | <para>\r | |
111 | If <parameter>pname</parameter> is <constant>GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER</constant>, <constant>GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER</constant>,\r | |
112 | or <constant>GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER</constant>, then a boolean value indicating whether the uniform block identified by\r | |
113 | <parameter>uniformBlockIndex</parameter> is referenced by the vertex, geometry, or fragment programming stages of program, respectively, is returned.\r | |
114 | </para>\r | |
115 | </refsect1>\r | |
116 | <refsect1 id="errors"><title>Errors</title>\r | |
117 | <para>\r | |
118 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>uniformBlockIndex</parameter> is greater than or equal to the value\r | |
119 | of <constant>GL_ACTIVE_UNIFORM_BLOCKS</constant> or is not the index of an active uniform block in <parameter>program</parameter>.\r | |
120 | </para>\r | |
121 | <para>\r | |
122 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>pname</parameter> is not one of the accepted tokens.\r | |
123 | </para>\r | |
124 | <para>\r | |
125 | <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>program</parameter> is not the name of a program object for which\r | |
126 | <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry> has been called in the past.\r | |
127 | </para>\r | |
128 | </refsect1>\r | |
129 | <refsect1 id="notes"><title>Notes</title>\r | |
130 | <para>\r | |
131 | <function>glGetActiveUniformBlockiv</function> is available only if the GL version is 3.1 or greater.\r | |
132 | </para>\r | |
133 | </refsect1>\r | |
134 | <refsect1 id="seealso"><title>See Also</title>\r | |
135 | <para>\r | |
136 | <citerefentry><refentrytitle>glGetActiveUniformBlockName</refentrytitle></citerefentry>,\r | |
137 | <citerefentry><refentrytitle>glGetUniformBlockIndex</refentrytitle></citerefentry>,\r | |
138 | <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>\r | |
139 | </para>\r | |
140 | </refsect1>\r | |
141 | <refsect1 id="Copyright"><title>Copyright</title>\r | |
142 | <para>\r | |
c7b31271 | 143 | Copyright <trademark class="copyright"></trademark> 2010-2013 Khronos Group. \r |
7faf1d71 AW |
144 | This material may be distributed subject to the terms and conditions set forth in \r |
145 | the Open Publication License, v 1.0, 8 June 1999.\r | |
146 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r | |
147 | </para>\r | |
148 | </refsect1>\r | |
149 | </refentry>\r |