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="glGetProgramResource">\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>glGetProgramResource</refentrytitle>\r | |
13 | <manvolnum>3G</manvolnum>\r | |
14 | </refmeta>\r | |
15 | <refnamediv>\r | |
16 | <refname>glGetProgramResource</refname>\r | |
17 | <refpurpose>retrieve values for multiple properties of a single active resource within a program object</refpurpose>\r | |
18 | </refnamediv>\r | |
19 | <refsynopsisdiv><title>C Specification</title>\r | |
20 | <funcsynopsis>\r | |
21 | <funcprototype>\r | |
22 | <funcdef>void <function>glGetProgramResourceiv</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>propCount</parameter></paramdef>\r | |
27 | <paramdef>const Glenum * <parameter>props</parameter></paramdef>\r | |
28 | <paramdef>GLsizei <parameter>bufSize</parameter></paramdef>\r | |
29 | <paramdef>GLsizei * <parameter>length</parameter></paramdef>\r | |
30 | <paramdef>GLint * <parameter>params</parameter></paramdef>\r | |
31 | </funcprototype>\r | |
32 | </funcsynopsis>\r | |
33 | </refsynopsisdiv>\r | |
34 | <refsect1 id="parameters"><title>Parameters</title>\r | |
35 | <variablelist>\r | |
36 | <varlistentry>\r | |
37 | <term><parameter>program</parameter></term>\r | |
38 | <listitem>\r | |
39 | <para>\r | |
40 | The name of a program object whose resources to query.\r | |
41 | </para>\r | |
42 | </listitem>\r | |
43 | </varlistentry>\r | |
44 | <varlistentry>\r | |
45 | <term><parameter>programInterface</parameter></term>\r | |
46 | <listitem>\r | |
47 | <para>\r | |
48 | A token identifying the interface within <parameter>program</parameter> containing the resource named <parameter>name</parameter>.\r | |
49 | </para>\r | |
50 | </listitem>\r | |
51 | </varlistentry>\r | |
52 | </variablelist>\r | |
53 | </refsect1>\r | |
54 | <refsect1 id="description"><title>Description</title>\r | |
55 | <para>\r | |
56 | <function>glGetProgramResourceiv</function> returns values for multiple properties of a single active resource with an\r | |
57 | index of <parameter>index</parameter> in the interface <parameter>programInterface</parameter> of program object\r | |
58 | <parameter>program</parameter>. For each resource, values for <parameter>propCount</parameter> properties specified\r | |
59 | by the array <parameter>props</parameter> are returned. <parameter>propCount</parameter> may not be zero.\r | |
60 | An error is generated if any value\r | |
61 | in <parameter>props</parameter> is not one of the properties described immediately belowor if any value in <parameter>props</parameter> is not\r | |
62 | allowed for <parameter>programInterface</parameter>. The set of allowed <parameter>programInterface</parameter>\r | |
63 | values for each property can be found in the following table:\r | |
64 | </para>\r | |
65 | <informaltable frame="topbot">\r | |
66 | <tgroup cols="2" align="left">\r | |
67 | <colspec colnum="1" colname="col1" colwidth="1*"/>\r | |
68 | <colspec colnum="2" colname="col2" colwidth="2*"/>\r | |
69 | <thead>\r | |
70 | <row>\r | |
71 | <entry morerows="1" rowsep="1" align="center">Property</entry>\r | |
72 | <entry morerows="1" rowsep="1" align="center">Supported Interfaces</entry>\r | |
73 | </row>\r | |
74 | </thead>\r | |
75 | <tbody>\r | |
76 | <row>\r | |
77 | <entry align="left"><constant>GL_NAME_LENGTH</constant></entry>\r | |
78 | <entry align="left">Any except <constant>GL_ATOMIC_COUNTER_BUFFER</constant></entry>\r | |
79 | </row>\r | |
80 | <row>\r | |
81 | <entry align="left"><constant>GL_TYPE</constant></entry>\r | |
82 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_PROGRAM_INPUT</constant>, <constant>GL_PROGRAM_OUTPUT</constant>, <constant>GL_TRANSFORM_FEEDBACK_VARYING</constant>, <constant>GL_BUFFER_VARIABLE</constant></entry>\r | |
83 | </row>\r | |
84 | <row>\r | |
85 | <entry align="left"><constant>GL_ARRAY_SIZE</constant></entry>\r | |
86 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_BUFFER_VARIABLE</constant>, <constant>GL_PROGRAM_INPUT</constant>,\r | |
87 | <constant>GL_PROGRAM_OUTPUT, VERTEX_SUBROUTINE_UNIFORM</constant>, <constant>GL_TESS_CONTROL_SUBROUTINE_UNIFORM</constant>,\r | |
88 | <constant>GL_TESS_EVALUATION_SUBROUTINE_UNIFORM</constant>, <constant>GL_GEOMETRY_SUBROUTINE_UNIFORM</constant>,\r | |
89 | <constant>GL_FRAGMENT_SUBROUTINE_UNIFORM</constant>, <constant>GL_COMPUTE_SUBROUTINE_UNIFORM</constant>, <constant>GL_TRANSFORM_FEEDBACK_VARYING</constant></entry>\r | |
90 | </row>\r | |
91 | <row>\r | |
92 | <entry align="left"><constant>GL_OFFSET</constant></entry>\r | |
93 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_BUFFER_VARIABLE</constant></entry>\r | |
94 | </row>\r | |
95 | <row>\r | |
96 | <entry align="left"><constant>GL_BLOCK_INDEX</constant></entry>\r | |
97 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_BUFFER_VARIABLE</constant></entry>\r | |
98 | </row>\r | |
99 | <row>\r | |
100 | <entry align="left"><constant>GL_ARRAY_STRIDE</constant></entry>\r | |
101 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_BUFFER_VARIABLE</constant></entry>\r | |
102 | </row>\r | |
103 | <row>\r | |
104 | <entry align="left"><constant>GL_MATRIX_STRIDE</constant></entry>\r | |
105 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_BUFFER_VARIABLE</constant></entry>\r | |
106 | </row>\r | |
107 | <row>\r | |
108 | <entry align="left"><constant>GL_IS_ROW_MAJOR</constant></entry>\r | |
109 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_BUFFER_VARIABLE</constant></entry>\r | |
110 | </row>\r | |
111 | <row>\r | |
112 | <entry align="left"><constant>GL_ATOMIC_COUNTER_BUFFER_INDEX</constant></entry>\r | |
113 | <entry align="left"><constant>GL_UNIFORM</constant></entry>\r | |
114 | </row>\r | |
115 | <row>\r | |
116 | <entry align="left"><constant>GL_TEXTURE_BUFFER</constant></entry>\r | |
117 | <entry align="left"><emph>none</emph></entry>\r | |
118 | </row>\r | |
119 | <row>\r | |
120 | <entry align="left"><constant>GL_BUFFER_BINDING</constant></entry>\r | |
121 | <entry align="left"><constant>GL_UNIFORM_BLOCK</constant>, <constant>GL_ATOMIC_COUNTER_BUFFER</constant>, <constant>GL_SHADER_STORAGE_BLOCK</constant></entry>\r | |
122 | </row>\r | |
123 | <row>\r | |
124 | <entry align="left"><constant>GL_BUFFER_DATA_SIZE</constant></entry>\r | |
125 | <entry align="left"><constant>GL_UNIFORM_BLOCK</constant>, <constant>GL_ATOMIC_COUNTER_BUFFER</constant>, <constant>GL_SHADER_STORAGE_BLOCK</constant></entry>\r | |
126 | </row>\r | |
127 | <row>\r | |
128 | <entry align="left"><constant>GL_NUM_ACTIVE_VARIABLES</constant></entry>\r | |
129 | <entry align="left"><constant>GL_UNIFORM_BLOCK</constant>, <constant>GL_ATOMIC_COUNTER_BUFFER</constant>, <constant>GL_SHADER_STORAGE_BLOCK</constant></entry>\r | |
130 | </row>\r | |
131 | <row>\r | |
132 | <entry align="left"><constant>GL_ACTIVE_VARIABLES</constant></entry>\r | |
133 | <entry align="left"><constant>GL_UNIFORM_BLOCK</constant>, <constant>GL_ATOMIC_COUNTER_BUFFER</constant>, <constant>GL_SHADER_STORAGE_BLOCK</constant></entry>\r | |
134 | </row>\r | |
135 | <row>\r | |
136 | <entry align="left"><constant>GL_REFERENCED_BY_VERTEX_SHADER</constant></entry>\r | |
137 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_UNIFORM_BLOCK</constant>, <constant>GL_ATOMIC_COUNTER_SHADER</constant>,\r | |
138 | <constant>GL_BUFFER</constant>, <constant>GL_SHADER_STORAGE_BLOCK</constant>, <constant>GL_BUFFER_VARIABLE</constant>,\r | |
139 | <constant>GL_PROGRAM_INPUT</constant>, <constant>GL_PROGRAM_OUTPUT</constant></entry>\r | |
140 | </row>\r | |
141 | <row>\r | |
142 | <entry align="left"><constant>GL_REFERENCED_BY_TESS_CONTROL_SHADER</constant></entry>\r | |
143 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_UNIFORM_BLOCK</constant>, <constant>GL_ATOMIC_COUNTER_SHADER</constant>,\r | |
144 | <constant>GL_BUFFER</constant>, <constant>GL_SHADER_STORAGE_BLOCK</constant>, <constant>GL_BUFFER_VARIABLE</constant>,\r | |
145 | <constant>GL_PROGRAM_INPUT</constant>, <constant>GL_PROGRAM_OUTPUT</constant></entry>\r | |
146 | </row>\r | |
147 | <row>\r | |
148 | <entry align="left"><constant>GL_REFERENCED_BY_TESS_EVALUATION_SHADER</constant></entry>\r | |
149 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_UNIFORM_BLOCK</constant>, <constant>GL_ATOMIC_COUNTER_SHADER</constant>,\r | |
150 | <constant>GL_BUFFER</constant>, <constant>GL_SHADER_STORAGE_BLOCK</constant>, <constant>GL_BUFFER_VARIABLE</constant>,\r | |
151 | <constant>GL_PROGRAM_INPUT</constant>, <constant>GL_PROGRAM_OUTPUT</constant></entry>\r | |
152 | </row>\r | |
153 | <row>\r | |
154 | <entry align="left"><constant>GL_REFERENCED_BY_GEOMETRY_SHADER</constant></entry>\r | |
155 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_UNIFORM_BLOCK</constant>, <constant>GL_ATOMIC_COUNTER_SHADER</constant>,\r | |
156 | <constant>GL_BUFFER</constant>, <constant>GL_SHADER_STORAGE_BLOCK</constant>, <constant>GL_BUFFER_VARIABLE</constant>,\r | |
157 | <constant>GL_PROGRAM_INPUT</constant>, <constant>GL_PROGRAM_OUTPUT</constant></entry>\r | |
158 | </row>\r | |
159 | <row>\r | |
160 | <entry align="left"><constant>GL_REFERENCED_BY_FRAGMENT_SHADER</constant></entry>\r | |
161 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_UNIFORM_BLOCK</constant>, <constant>GL_ATOMIC_COUNTER_SHADER</constant>,\r | |
162 | <constant>GL_BUFFER</constant>, <constant>GL_SHADER_STORAGE_BLOCK</constant>, <constant>GL_BUFFER_VARIABLE</constant>,\r | |
163 | <constant>GL_PROGRAM_INPUT</constant>, <constant>GL_PROGRAM_OUTPUT</constant></entry>\r | |
164 | </row>\r | |
165 | <row>\r | |
166 | <entry align="left"><constant>GL_REFERENCED_BY_COMPUTE_SHADER</constant></entry>\r | |
167 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_UNIFORM_BLOCK</constant>, <constant>GL_ATOMIC_COUNTER_SHADER</constant>,\r | |
168 | <constant>GL_BUFFER</constant>, <constant>GL_SHADER_STORAGE_BLOCK</constant>, <constant>GL_BUFFER_VARIABLE</constant>,\r | |
169 | <constant>GL_PROGRAM_INPUT</constant>, <constant>GL_PROGRAM_OUTPUT</constant></entry>\r | |
170 | </row>\r | |
171 | <row>\r | |
172 | <entry align="left"><constant>GL_NUM_COMPATIBLE_SUBROUTINES</constant></entry>\r | |
173 | <entry align="left"><constant>GL_VERTEX_SUBROUTINE_UNIFORM</constant>, <constant>GL_TESS_CONTROL_SUBROUTINE_UNIFORM</constant>,\r | |
174 | <constant>GL_TESS_EVALUATION_SUBROUTINE_UNIFORM</constant>, <constant>GL_GEOMETRY_SUBROUTINE_UNIFORM</constant>,\r | |
175 | <constant>GL_FRAGMENT_SUBROUTINE_UNIFORM</constant>, <constant>GL_COMPUTE_SUBROUTINE_UNIFORM</constant></entry>\r | |
176 | </row>\r | |
177 | <row>\r | |
178 | <entry align="left"><constant>GL_COMPATIBLE_SUBROUTINES</constant></entry>\r | |
179 | <entry align="left"><constant>GL_VERTEX_SUBROUTINE_UNIFORM</constant>, <constant>GL_TESS_CONTROL_SUBROUTINE_UNIFORM</constant>,\r | |
180 | <constant>GL_TESS_EVALUATION_SUBROUTINE_UNIFORM</constant>, <constant>GL_GEOMETRY_SUBROUTINE_UNIFORM</constant>,\r | |
181 | <constant>GL_FRAGMENT_SUBROUTINE_UNIFORM</constant>, <constant>GL_COMPUTE_SUBROUTINE_UNIFORM</constant></entry>\r | |
182 | </row>\r | |
183 | <row>\r | |
184 | <entry align="left"><constant>GL_TOP_LEVEL_ARRAY_SIZE</constant></entry>\r | |
185 | <entry align="left"><constant>GL_BUFFER_VARIABLE</constant></entry>\r | |
186 | </row>\r | |
187 | <row>\r | |
188 | <entry align="left"><constant>GL_TOP_LEVEL_ARRAY_STRIDE</constant></entry>\r | |
189 | <entry align="left"><constant>GL_BUFFER_VARIABLE</constant></entry>\r | |
190 | </row>\r | |
191 | <row>\r | |
192 | <entry align="left"><constant>GL_LOCATION</constant></entry>\r | |
193 | <entry align="left"><constant>GL_UNIFORM</constant>, <constant>GL_PROGRAM_INPUT</constant>, <constant>GL_PROGRAM_OUTPUT</constant>,\r | |
194 | <constant>GL_VERTEX_SUBROUTINE_UNIFORM</constant>, <constant>GL_TESS_CONTROL_SUBROUTINE_UNIFORM</constant>,\r | |
195 | <constant>GL_TESS_EVALUATION_SUBROUTINE_UNIFORM</constant>, <constant>GL_GEOMETRY_SUBROUTINE_UNIFORM</constant>,\r | |
196 | <constant>GL_FRAGMENT_SUBROUTINE_UNIFORM</constant>, <constant>GL_COMPUTE_SUBROUTINE_UNIFORM</constant></entry>\r | |
197 | </row>\r | |
198 | <row>\r | |
199 | <entry align="left"><constant>GL_LOCATION_INDEX</constant></entry>\r | |
200 | <entry align="left"><constant>GL_PROGRAM_OUTPUT</constant></entry>\r | |
201 | </row>\r | |
202 | <row>\r | |
203 | <entry align="left"><constant>GL_IS_PER_PATCH</constant></entry>\r | |
204 | <entry align="left"><constant>GL_PROGRAM_INPUT</constant>, <constant>GL_PROGRAM_OUTPUT</constant></entry>\r | |
205 | </row>\r | |
206 | </tbody>\r | |
207 | </tgroup>\r | |
208 | </informaltable>\r | |
209 | \r | |
210 | <para>\r | |
211 | For the property <constant>GL_NAME_LENGTH</constant>, a single integer identifying the length of\r | |
212 | the name string associated with an active variable, interface block, or\r | |
213 | subroutine is written to <parameter>params</parameter>. The name length includes a terminating\r | |
214 | null character.\r | |
215 | \r | |
216 | For the property <constant>GL_TYPE</constant>, a single integer identifying the type of an active\r | |
217 | variable is written to <parameter>params</parameter>. The integer returned is one of the\r | |
218 | values found in table 2.16.\r | |
219 | \r | |
220 | For the property <constant>GL_ARRAY_SIZE</constant>, a single integer identifying the number of\r | |
221 | active array elements of an active variable is written to <parameter>params</parameter>. The\r | |
222 | array size returned is in units of the type associated with the property\r | |
223 | TYPE. For active variables not corresponding to an array of basic types,\r | |
224 | the value zero is written to <parameter>params</parameter>.\r | |
225 | \r | |
226 | For the property <constant>GL_BLOCK_INDEX</constant>, a single integer identifying the index of\r | |
227 | the active interface block containing an active variable is written to\r | |
228 | <parameter>params</parameter>. If the variable is not the member of an interface block, the\r | |
229 | value -1 is written to <parameter>params</parameter>.\r | |
230 | \r | |
231 | For the property <constant>GL_OFFSET</constant>, a single integer identifying the offset of an\r | |
232 | active variable is written to <parameter>params</parameter>. For active variables backed by a\r | |
233 | buffer object, the value written is the offset, in basic machine units,\r | |
234 | relative to the base of buffer range holding the values of the variable.\r | |
235 | For active variables not backed by a buffer object, an offset of -1 is\r | |
236 | written to <parameter>params</parameter>.\r | |
237 | \r | |
238 | For the property <constant>GL_ARRAY_STRIDE</constant>, a single integer identifying the stride\r | |
239 | between array elements in an active variable is written to <parameter>params</parameter>. For\r | |
240 | active variables declared as an array of basic types, the value written is\r | |
241 | the difference, in basic machine units, between the offsets of consecutive\r | |
242 | elements in an array. For active variables not declared as an array of\r | |
243 | basic types, zero is written to <parameter>params</parameter>. For active variables not backed\r | |
244 | by a buffer object, -1 is written to <parameter>params</parameter>, regardless of the variable\r | |
245 | type.\r | |
246 | \r | |
247 | For the property <constant>GL_MATRIX_STRIDE</constant>, a single integer identifying the stride\r | |
248 | between columns of a column-major matrix or rows of a row-major matrix is\r | |
249 | written to <parameter>params</parameter>. For active variables declared a single matrix or\r | |
250 | array of matrices, the value written is the difference, in basic machine\r | |
251 | units, between the offsets of consecutive columns or rows in each matrix.\r | |
252 | For active variables not declared as a matrix or array of matrices, zero\r | |
253 | is written to <parameter>params</parameter>. For active variables not backed by a buffer\r | |
254 | object, -1 is written to <parameter>params</parameter>, regardless of the variable type.\r | |
255 | \r | |
256 | For the property <constant>GL_IS_ROW_MAJOR</constant>, a single integer identifying whether an\r | |
257 | active variable is a row-major matrix is written to <parameter>params</parameter>. For active\r | |
258 | variables backed by a buffer object, declared as a single matrix or array\r | |
259 | of matrices, and stored in row-major order, one is written to <parameter>params</parameter>.\r | |
260 | For all other active variables, zero is written to <parameter>params</parameter>.\r | |
261 | \r | |
262 | For the property <constant>GL_ATOMIC_COUNTER_BUFFER_INDEX</constant>, a single integer identifying\r | |
263 | the index of the active atomic counter buffer containing an active\r | |
264 | variable is written to <parameter>params</parameter>. If the variable is not an atomic counter\r | |
265 | uniform, the value -1 is written to <parameter>params</parameter>.\r | |
266 | \r | |
267 | For the property <constant>GL_BUFFER_BINDING</constant>, to index of the buffer binding point\r | |
268 | associated with the active uniform block, shader storage block, or atomic\r | |
269 | counter buffer is written to <parameter>params</parameter>.\r | |
270 | \r | |
271 | For the property <constant>GL_BUFFER_DATA_SIZE</constant>, then the implementation-dependent\r | |
272 | minimum total buffer object size, in basic machine units, required to hold\r | |
273 | all active variables associated with an active uniform block, shader\r | |
274 | storage block, or atomic counter buffer is written to <parameter>params</parameter>. If the\r | |
275 | final member of an active shader storage block is array with no declared\r | |
276 | size, the minimum buffer size is computed assuming the array was declared\r | |
277 | as an array with one element.\r | |
278 | \r | |
279 | For the property <constant>GL_NUM_ACTIVE_VARIABLES</constant>, the number of active variables\r | |
280 | associated with an active uniform block, shader storage block, or atomic\r | |
281 | counter buffer is written to <parameter>params</parameter>.\r | |
282 | \r | |
283 | For the property <constant>GL_of ACTIVE_VARIABLES</constant>, an array of active variable indices\r | |
284 | associated with an active uniform block, shader storage block, or atomic\r | |
285 | counter buffer is written to <parameter>params</parameter>. The number of values written to\r | |
286 | <parameter>params</parameter> for an active resource is given by the value of the property\r | |
287 | <constant>GL_NUM_ACTIVE_VARIABLES</constant> for the resource.\r | |
288 | \r | |
289 | For the properties <constant>GL_REFERENCED_BY_VERTEX_SHADER</constant>,\r | |
290 | <constant>GL_REFERENCED_BY_TESS_CONTROL_SHADER</constant>, <constant>GL_REFERENCED_BY_TESS_EVALUATION_SHADER</constant>,\r | |
291 | <constant>GL_REFERENCED_BY_GEOMETRY_SHADER</constant>, <constant>GL_REFERENCED_BY_FRAGMENT_SHADER</constant>, and\r | |
292 | <constant>GL_REFERENCED_BY_COMPUTE_SHADER</constant>, a single integer is written to <parameter>params</parameter>,\r | |
293 | identifying whether the active resource is referenced by the vertex,\r | |
294 | tessellation control, tessellation evaluation, geometry, or fragment\r | |
295 | shaders, respectively, in the program object. The value one is written to\r | |
296 | <parameter>params</parameter> if an active variable is referenced by the corresponding shader,\r | |
297 | or if an active uniform block, shader storage block, or atomic counter\r | |
298 | buffer contains at least one variable referenced by the corresponding\r | |
299 | shader. Otherwise, the value zero is written to <parameter>params</parameter>.\r | |
300 | \r | |
301 | For the property <constant>GL_TOP_LEVEL_ARRAY_SIZE</constant>, a single integer identifying the\r | |
302 | number of active array elements of the top-level shader storage block\r | |
303 | member containing to the active variable is written to <parameter>params</parameter>. If the\r | |
304 | top-level block member is not declared as an array, the value one is\r | |
305 | written to <parameter>params</parameter>. If the top-level block member is an array with no\r | |
306 | declared size, the value zero is written to <parameter>params</parameter>.\r | |
307 | \r | |
308 | For the property <constant>GL_TOP_LEVEL_ARRAY_STRIDE</constant>, a single integer identifying the\r | |
309 | stride between array elements of the top-level shader storage block member\r | |
310 | containing the active variable is written to <parameter>params</parameter>. For top-level\r | |
311 | block members declared as arrays, the value written is the difference, in\r | |
312 | basic machine units, between the offsets of the active variable for\r | |
313 | consecutive elements in the top-level array. For top-level block members\r | |
314 | not declared as an array, zero is written to <parameter>params</parameter>.\r | |
315 | \r | |
316 | For the property <constant>GL_LOCATION</constant>, a single integer identifying the assigned\r | |
317 | location for an active uniform, input, output, or subroutine uniform\r | |
318 | variable is written to <parameter>params</parameter>. For input, output, or uniform variables\r | |
319 | with locations specified by a layout qualifier, the specified location is\r | |
320 | used. For vertex shader input or fragment shader output variables without\r | |
321 | a layout qualifier, the location assigned when a program is linked is\r | |
322 | written to <parameter>params</parameter>. For all other input and output variables, the value\r | |
323 | -1 is written to <parameter>params</parameter>. For uniforms in uniform blocks, the value -1\r | |
324 | is written to <parameter>params</parameter>.\r | |
325 | \r | |
326 | For the property <constant>GL_LOCATION_INDEX</constant>, a single integer identifying the fragment\r | |
327 | color index of an active fragment shader output variable is written to\r | |
328 | <parameter>params</parameter>. If the active variable is an output for a non-fragment shader,\r | |
329 | the value -1 will be written to <parameter>params</parameter>.\r | |
330 | \r | |
331 | For the property <constant>GL_IS_PER_PATCH</constant>, a single integer identifying whether the\r | |
332 | input or output is a per-patch attribute. If the active variable is a\r | |
333 | per-patch attribute (declared with the <code>patch</code> qualifier), the value one\r | |
334 | is written to <parameter>params</parameter>; otherwise, the value zero is written to <parameter>params</parameter>.\r | |
335 | </para>\r | |
336 | </refsect1>\r | |
337 | <refsect1 id="errors"><title>Errors</title>\r | |
338 | <para>\r | |
339 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>program</parameter> is\r | |
340 | not the name of an existing program object.\r | |
341 | </para>\r | |
342 | <para>\r | |
343 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>propCount</parameter> is\r | |
344 | zero.\r | |
345 | </para>\r | |
346 | <para>\r | |
347 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>programInterface</parameter>\r | |
348 | is not one of the accepted interface types.\r | |
349 | </para>\r | |
350 | <para>\r | |
351 | <constant>GL_INVLALID_ENUM</constant> is generated if any value in <parameter>props</parameter>\r | |
352 | is not one of the accepted tokens for the interface <parameter>programInterface</parameter>\r | |
353 | </para>\r | |
354 | </refsect1>\r | |
355 | <refsect1 id="seealso"><title>See Also</title>\r | |
356 | <para>\r | |
357 | <citerefentry><refentrytitle>glGetProgramResourceName</refentrytitle></citerefentry>,\r | |
358 | <citerefentry><refentrytitle>glGetGetProgramResourceIndex</refentrytitle></citerefentry>,\r | |
359 | <citerefentry><refentrytitle>glGetProgramResourceLocation</refentrytitle></citerefentry>,\r | |
360 | <citerefentry><refentrytitle>glGetProgramResourceLocationIndex</refentrytitle></citerefentry>.\r | |
361 | </para>\r | |
362 | </refsect1>\r | |
363 | <refsect1 id="Copyright"><title>Copyright</title>\r | |
364 | <para>\r | |
365 | Copyright <trademark class="copyright"></trademark> 2012 Khronos Group. \r | |
366 | This material may be distributed subject to the terms and conditions set forth in \r | |
367 | the Open Publication License, v 1.0, 8 June 1999.\r | |
368 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r | |
369 | </para>\r | |
370 | </refsect1>\r | |
371 | </refentry>\r |