rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man4 / glGetProgramResourceName.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="glGetProgramResourceName">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2012</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glGetProgramResourceName</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glGetProgramResourceName</refname>
17 <refpurpose>query the name of an indexed resource within a program</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glGetProgramResourceName</function></funcdef>
23 <paramdef>GLuint <parameter>program</parameter></paramdef>
24 <paramdef>GLenum <parameter>programInterface</parameter></paramdef>
25 <paramdef>GLuint <parameter>index</parameter></paramdef>
26 <paramdef>GLsizei <parameter>bufSize</parameter></paramdef>
27 <paramdef>GLsizei * <parameter>length</parameter></paramdef>
28 <paramdef>char * <parameter>name</parameter></paramdef>
29 </funcprototype>
30 </funcsynopsis>
31 </refsynopsisdiv>
32 <refsect1 id="parameters"><title>Parameters</title>
33 <variablelist>
34 <varlistentry>
35 <term><parameter>program</parameter></term>
36 <listitem>
37 <para>
38 The name of a program object whose resources to query.
39 </para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term><parameter>programInterface</parameter></term>
44 <listitem>
45 <para>
46 A token identifying the interface within <parameter>program</parameter> containing the indexed resource.
47 </para>
48 </listitem>
49 </varlistentry>
50 <varlistentry>
51 <term><parameter>index</parameter></term>
52 <listitem>
53 <para>
54 The index of the resource within <parameter>programInterface</parameter> of <parameter>program</parameter>.
55 </para>
56 </listitem>
57 </varlistentry>
58 <varlistentry>
59 <term><parameter>bufSize</parameter></term>
60 <listitem>
61 <para>
62 The size of the character array whose address is given by <parameter>name</parameter>.
63 </para>
64 </listitem>
65 </varlistentry>
66 <varlistentry>
67 <term><parameter>length</parameter></term>
68 <listitem>
69 <para>
70 The address of a variable which will receive the length of the resource name.
71 </para>
72 </listitem>
73 </varlistentry>
74 <varlistentry>
75 <term><parameter>name</parameter></term>
76 <listitem>
77 <para>
78 The address of a character array into which will be written the name of the resource.
79 </para>
80 </listitem>
81 </varlistentry>
82 </variablelist>
83 </refsect1>
84 <refsect1 id="description"><title>Description</title>
85 <para>
86 <function>glGetProgramResourceName</function> retrieves the name string
87 assigned to the single active resource with an index of <parameter>index</parameter>
88 in the interface <parameter>programInterface</parameter> of program object
89 <parameter>program</parameter>. <parameter>index</parameter> must be less than
90 the number of entries in the active resource list for <parameter>programInterface</parameter>.
91 </para>
92 <para>
93 <parameter>program</parameter> must be the name of an existing program object. <parameter>programInterface</parameter>
94 is the name of the interface within <parameter>program</parameter> which contains the resource and must be one of the following
95 values:
96 </para>
97 <variablelist>
98 <varlistentry>
99 <term><constant>GL_UNIFORM</constant></term>
100 <listitem>
101 <para>
102 The query is targeted at the set of active uniforms within <parameter>program</parameter>.
103 </para>
104 </listitem>
105 </varlistentry>
106 <varlistentry>
107 <term><constant>GL_UNIFORM_BLOCK</constant></term>
108 <listitem>
109 <para>
110 The query is targeted at the set of active uniform blocks within <parameter>program</parameter>.
111 </para>
112 </listitem>
113 </varlistentry>
114 <varlistentry>
115 <term><constant>GL_PROGRAM_INPUT</constant></term>
116 <listitem>
117 <para>
118 The query is targeted at the set of active input variables used by the first shader stage of <parameter>program</parameter>.
119 If <parameter>program</parameter> contains multiple shader stages then input variables from any stage other than the first
120 will not be enumerated.
121 </para>
122 </listitem>
123 </varlistentry>
124 <varlistentry>
125 <term><constant>GL_PROGRAM_OUTPUT</constant></term>
126 <listitem>
127 <para>
128 The query is targeted at the set of active output variables produced by the last shader stage of <parameter>program</parameter>.
129 If <parameter>program</parameter> contains multiple shader stages then output variables from any stage other than the last
130 will not be enumerated.
131 </para>
132 </listitem>
133 </varlistentry>
134 <varlistentry>
135 <term><constant>GL_VERTEX_SUBROUTINE</constant></term>,
136 <term><constant>GL_TESS_CONTROL_SUBROUTINE</constant></term>,
137 <term><constant>GL_TESS_EVALUATION_SUBROUTINE</constant></term>,
138 <term><constant>GL_GEOMETRY_SUBROUTINE</constant></term>,
139 <term><constant>GL_FRAGMENT_SUBROUTINE</constant></term>,
140 <term><constant>GL_COMPUTE_SUBROUTINE</constant></term>
141 <listitem>
142 <para>
143 The query is targeted at the set of active subroutines for the vertex, tessellation control, tessellation evaluation,
144 geometry, fragment and compute shader stages of <parameter>program</parameter>, respectively.
145 </para>
146 </listitem>
147 </varlistentry>
148 <varlistentry>
149 <term><constant>GL_VERTEX_SUBROUTINE_UNIFORM</constant></term>,
150 <term><constant>GL_TESS_CONTROL_SUBROUTINE_UNIFORM</constant></term>,
151 <term><constant>GL_TESS_EVALUATION_SUBROUTINE_UNIFORM</constant></term>,
152 <term><constant>GL_GEOMETRY_SUBROUTINE_UNIFORM</constant></term>,
153 <term><constant>GL_FRAGMENT_SUBROUTINE_UNIFORM</constant></term>,
154 <term><constant>GL_COMPUTE_SUBROUTINE_UNIFORM</constant></term>
155 <listitem>
156 <para>
157 The query is targeted at the set of active subroutine uniform variables used by the vertex, tessellation control, tessellation evaluation,
158 geometry, fragment and compute shader stages of <parameter>program</parameter>, respectively.
159 </para>
160 </listitem>
161 </varlistentry>
162 <varlistentry>
163 <term><constant>GL_TRANSFORM_FEEDBACK_VARYING</constant></term>
164 <listitem>
165 <para>
166 The query is targeted at the set of output variables from the last non-fragment stage of <parameter>program</parameter> that would be
167 captured if transform feedback were active.
168 </para>
169 </listitem>
170 </varlistentry>
171 <varlistentry>
172 <term><constant>GL_BUFFER_VARIABLE</constant></term>
173 <listitem>
174 <para>
175 The query is targeted at the set of active buffer variables used by <parameter>program</parameter>.
176 </para>
177 </listitem>
178 </varlistentry>
179 <varlistentry>
180 <term><constant>GL_SHADER_STORAGE_BLOCK</constant></term>
181 <listitem>
182 <para>
183 The query is targeted at the set of active shader storage blocks used by <parameter>program</parameter>.
184 </para>
185 </listitem>
186 </varlistentry>
187 </variablelist>
188 <para>
189 The name string assigned to the active resource identified by <parameter>index</parameter> is
190 returned as a null-terminated string in the character array whose address is given in <parameter>name</parameter>. The actual number of
191 characters written into <parameter>name</parameter>, excluding the null terminator, is returned
192 in <parameter>length</parameter>. If <parameter>length</parameter> is NULL, no length is returned. The maximum
193 number of characters that may be written into <parameter>name</parameter>, including the null
194 terminator, is specified by <parameter>bufSize</parameter>. If the length of the name string
195 <emphasis>including the null terminator</emphasis> is greater than <parameter>bufSize</parameter>, the first
196 <parameter>bufSize</parameter>-1 characters of the name string will be written to <parameter>name</parameter>,
197 followed by a null terminator. If <parameter>bufSize</parameter> is zero, no error will be
198 generated but no characters will be written to <parameter>name</parameter>. The length of the
199 longest name string for <parameter>programInterface</parameter>>, including a null terminator,
200 can be queried by calling <citerefentry><refentrytitle>glGetProgramInterface</refentrytitle></citerefentry> with a <parameter>pname</parameter> of
201 <constant>GL_MAX_NAME_LENGTH</constant>.
202 </para>
203 </refsect1>
204 <refsect1 id="errors"><title>Errors</title>
205 <para>
206 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>programInterface</parameter>
207 is not one of the accepted interface types.
208 </para>
209 <para>
210 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>progam</parameter> is not
211 the name of an existing program.
212 </para>
213 <para>
214 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>index</parameter> is greater
215 than or equal to the number of entries in the active resource list for
216 <parameter>programInterface</parameter>.
217 </para>
218 </refsect1>
219 <refsect1 id="seealso"><title>See Also</title>
220 <para>
221 <citerefentry><refentrytitle>glGetProgramResourceIndex</refentrytitle></citerefentry>,
222 <citerefentry><refentrytitle>glGetGetProgramResource</refentrytitle></citerefentry>,
223 <citerefentry><refentrytitle>glGetProgramResourceLocation</refentrytitle></citerefentry>,
224 <citerefentry><refentrytitle>glGetProgramResourceLocationIndex</refentrytitle></citerefentry>.
225 </para>
226 </refsect1>
227 <refsect1 id="Copyright"><title>Copyright</title>
228 <para>
229 Copyright <trademark class="copyright"></trademark> 2012 Khronos Group.
230 This material may be distributed subject to the terms and conditions set forth in
231 the Open Publication License, v 1.0, 8 June 1999.
232 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
233 </para>
234 </refsect1>
235 </refentry>