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