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