Commit | Line | Data |
---|---|---|
7faf1d71 AW |
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="glGetActiveUniform"> | |
5 | <refmeta> | |
6 | <refentrytitle>glGetActiveUniform</refentrytitle> | |
7 | <manvolnum>3G</manvolnum> | |
8 | </refmeta> | |
9 | <refnamediv> | |
10 | <refname>glGetActiveUniform</refname> | |
11 | <refpurpose>Returns information about an active uniform variable for the specified program object</refpurpose> | |
12 | </refnamediv> | |
13 | <refsynopsisdiv><title>C Specification</title> | |
14 | <funcsynopsis> | |
15 | <funcprototype> | |
16 | <funcdef>void <function>glGetActiveUniform</function></funcdef> | |
17 | <paramdef>GLuint <parameter>program</parameter></paramdef> | |
18 | <paramdef>GLuint <parameter>index</parameter></paramdef> | |
19 | <paramdef>GLsizei <parameter>bufSize</parameter></paramdef> | |
20 | <paramdef>GLsizei *<parameter>length</parameter></paramdef> | |
21 | <paramdef>GLint *<parameter>size</parameter></paramdef> | |
22 | <paramdef>GLenum *<parameter>type</parameter></paramdef> | |
23 | <paramdef>GLchar *<parameter>name</parameter></paramdef> | |
24 | </funcprototype> | |
25 | </funcsynopsis> | |
26 | </refsynopsisdiv> | |
27 | <refsect1 id="parameters"><title>Parameters</title> | |
28 | <variablelist> | |
29 | <varlistentry> | |
30 | <term><parameter>program</parameter></term> | |
31 | <listitem> | |
32 | <para>Specifies the program object to be | |
33 | queried.</para> | |
34 | </listitem> | |
35 | </varlistentry> | |
36 | <varlistentry> | |
37 | <term><parameter>index</parameter></term> | |
38 | <listitem> | |
39 | <para>Specifies the index of the uniform variable to | |
40 | be queried.</para> | |
41 | </listitem> | |
42 | </varlistentry> | |
43 | <varlistentry> | |
44 | <term><parameter>bufSize</parameter></term> | |
45 | <listitem> | |
46 | <para>Specifies the maximum number of characters | |
47 | OpenGL is allowed to write in the character buffer | |
48 | indicated by <parameter>name</parameter>.</para> | |
49 | </listitem> | |
50 | </varlistentry> | |
51 | <varlistentry> | |
52 | <term><parameter>length</parameter></term> | |
53 | <listitem> | |
54 | <para>Returns the number of characters actually | |
55 | written by OpenGL in the string indicated by | |
56 | <parameter>name</parameter> (excluding the null | |
57 | terminator) if a value other than | |
58 | <constant>NULL</constant> is passed.</para> | |
59 | </listitem> | |
60 | </varlistentry> | |
61 | <varlistentry> | |
62 | <term><parameter>size</parameter></term> | |
63 | <listitem> | |
64 | <para>Returns the size of the uniform | |
65 | variable.</para> | |
66 | </listitem> | |
67 | </varlistentry> | |
68 | <varlistentry> | |
69 | <term><parameter>type</parameter></term> | |
70 | <listitem> | |
71 | <para>Returns the data type of the uniform | |
72 | variable.</para> | |
73 | </listitem> | |
74 | </varlistentry> | |
75 | <varlistentry> | |
76 | <term><parameter>name</parameter></term> | |
77 | <listitem> | |
78 | <para>Returns a null terminated string containing | |
79 | the name of the uniform variable.</para> | |
80 | </listitem> | |
81 | </varlistentry> | |
82 | </variablelist> | |
83 | </refsect1> | |
84 | <refsect1 id="description"><title>Description</title> | |
85 | <para><function>glGetActiveUniform</function> returns | |
86 | information about an active uniform variable in the program | |
87 | object specified by <parameter>program</parameter>. The number | |
88 | of active uniform variables can be obtained by calling | |
89 | <citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry> | |
90 | with the value <constant>GL_ACTIVE_UNIFORMS</constant>. A value | |
91 | of 0 for <parameter>index</parameter> selects the first active | |
92 | uniform variable. Permissible values for | |
93 | <parameter>index</parameter> range from 0 to the number of | |
94 | active uniform variables minus 1.</para> | |
95 | ||
96 | <para>Shaders may use either built-in uniform variables, | |
97 | user-defined uniform variables, or both. Built-in uniform | |
98 | variables have a prefix of "gl_" and reference | |
99 | existing OpenGL state or values derived from such state (e.g., | |
100 | <parameter>gl_DepthRangeParameters</parameter>, see the OpenGL | |
101 | Shading Language specification for a complete list.) | |
102 | User-defined uniform variables have arbitrary names and obtain | |
103 | their values from the application through calls to | |
104 | <citerefentry><refentrytitle>glUniform</refentrytitle></citerefentry>. | |
105 | A uniform variable (either built-in or user-defined) is | |
106 | considered active if it is determined during the link operation | |
107 | that it may be accessed during program execution. Therefore, | |
108 | <parameter>program</parameter> should have previously been the | |
109 | target of a call to | |
110 | <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>, | |
111 | but it is not necessary for it to have been linked | |
112 | successfully.</para> | |
113 | ||
114 | <para>The size of the character buffer required to store the | |
115 | longest uniform variable name in <parameter>program</parameter> | |
116 | can be obtained by calling | |
117 | <citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry> | |
118 | with the value | |
119 | <constant>GL_ACTIVE_UNIFORM_MAX_LENGTH</constant>. This value | |
120 | should be used to allocate a buffer of sufficient size to store | |
121 | the returned uniform variable name. The size of this character | |
122 | buffer is passed in <parameter>bufSize</parameter>, and a | |
123 | pointer to this character buffer is passed in | |
124 | <parameter>name.</parameter></para> | |
125 | ||
126 | <para><function>glGetActiveUniform</function> returns the name | |
127 | of the uniform variable indicated by | |
128 | <parameter>index</parameter>, storing it in the character buffer | |
129 | specified by <parameter>name</parameter>. The string returned | |
130 | will be null terminated. The actual number of characters written | |
131 | into this buffer is returned in <parameter>length</parameter>, | |
132 | and this count does not include the null termination character. | |
133 | If the length of the returned string is not required, a value of | |
134 | <constant>NULL</constant> can be passed in the | |
135 | <parameter>length</parameter> argument.</para> | |
136 | ||
137 | <para>The <parameter>type</parameter> | |
138 | argument will return a pointer to the uniform variable's data | |
139 | type. The symbolic constants returned for uniform types are shown in the | |
140 | table below. | |
141 | <informaltable frame="topbot"> | |
142 | <tgroup cols="2" align="left"> | |
143 | <colspec colwidth="1.1*" /> | |
144 | <colspec colwidth="1*" /> | |
145 | <thead> | |
146 | <row> | |
147 | <entry rowsep="1" align="left"><emphasis role="bold"> | |
148 | Returned Symbolic Contant | |
149 | </emphasis></entry> | |
150 | <entry rowsep="1" align="left"><emphasis role="bold"> | |
151 | Shader Uniform Type | |
152 | </emphasis></entry> | |
153 | </row> | |
154 | </thead> | |
155 | <tbody> | |
156 | <row> | |
157 | <entry align="left"> | |
158 | <constant>GL_FLOAT</constant> | |
159 | </entry> | |
160 | <entry align="left"> | |
161 | <constant>float</constant> | |
162 | </entry> | |
163 | </row> | |
164 | <row> | |
165 | <entry align="left"> | |
166 | <constant>GL_FLOAT_VEC2</constant> | |
167 | </entry> | |
168 | <entry align="left"> | |
169 | <constant>vec2</constant> | |
170 | </entry> | |
171 | </row> | |
172 | <row> | |
173 | <entry align="left"> | |
174 | <constant>GL_FLOAT_VEC3</constant> | |
175 | </entry> | |
176 | <entry align="left"> | |
177 | <constant>vec3</constant> | |
178 | </entry> | |
179 | </row> | |
180 | <row> | |
181 | <entry align="left"> | |
182 | <constant>GL_FLOAT_VEC4</constant> | |
183 | </entry> | |
184 | <entry align="left"> | |
185 | <constant>vec4</constant> | |
186 | </entry> | |
187 | </row> | |
188 | <row> | |
189 | <entry align="left"> | |
190 | <constant>GL_INT</constant> | |
191 | </entry> | |
192 | <entry align="left"> | |
193 | <constant>int</constant> | |
194 | </entry> | |
195 | </row> | |
196 | <row> | |
197 | <entry align="left"> | |
198 | <constant>GL_INT_VEC2</constant> | |
199 | </entry> | |
200 | <entry align="left"> | |
201 | <constant>ivec2</constant> | |
202 | </entry> | |
203 | </row> | |
204 | <row> | |
205 | <entry align="left"> | |
206 | <constant>GL_INT_VEC3</constant> | |
207 | </entry> | |
208 | <entry align="left"> | |
209 | <constant>ivec3</constant> | |
210 | </entry> | |
211 | </row> | |
212 | <row> | |
213 | <entry align="left"> | |
214 | <constant>GL_INT_VEC4</constant> | |
215 | </entry> | |
216 | <entry align="left"> | |
217 | <constant>ivec4</constant> | |
218 | </entry> | |
219 | </row> | |
220 | <row> | |
221 | <entry align="left"> | |
222 | <constant>GL_UNSIGNED_INT</constant> | |
223 | </entry> | |
224 | <entry align="left"> | |
225 | <constant>unsigned int</constant> | |
226 | </entry> | |
227 | </row> | |
228 | <row> | |
229 | <entry align="left"> | |
230 | <constant>GL_UNSIGNED_INT_VEC2</constant> | |
231 | </entry> | |
232 | <entry align="left"> | |
233 | <constant>uvec2</constant> | |
234 | </entry> | |
235 | </row> | |
236 | <row> | |
237 | <entry align="left"> | |
238 | <constant>GL_UNSIGNED_INT_VEC3</constant> | |
239 | </entry> | |
240 | <entry align="left"> | |
241 | <constant>uvec3</constant> | |
242 | </entry> | |
243 | </row> | |
244 | <row> | |
245 | <entry align="left"> | |
246 | <constant>GL_UNSIGNED_INT_VEC4</constant> | |
247 | </entry> | |
248 | <entry align="left"> | |
249 | <constant>uvec4</constant> | |
250 | </entry> | |
251 | </row> | |
252 | <row> | |
253 | <entry align="left"> | |
254 | <constant>GL_BOOL</constant> | |
255 | </entry> | |
256 | <entry align="left"> | |
257 | <constant>bool</constant> | |
258 | </entry> | |
259 | </row> | |
260 | <row> | |
261 | <entry align="left"> | |
262 | <constant>GL_BOOL_VEC2</constant> | |
263 | </entry> | |
264 | <entry align="left"> | |
265 | <constant>bvec2</constant> | |
266 | </entry> | |
267 | </row> | |
268 | <row> | |
269 | <entry align="left"> | |
270 | <constant>GL_BOOL_VEC3</constant> | |
271 | </entry> | |
272 | <entry align="left"> | |
273 | <constant>bvec3</constant> | |
274 | </entry> | |
275 | </row> | |
276 | <row> | |
277 | <entry align="left"> | |
278 | <constant>GL_BOOL_VEC4</constant> | |
279 | </entry> | |
280 | <entry align="left"> | |
281 | <constant>bvec4</constant> | |
282 | </entry> | |
283 | </row> | |
284 | <row> | |
285 | <entry align="left"> | |
286 | <constant>GL_FLOAT_MAT2</constant> | |
287 | </entry> | |
288 | <entry align="left"> | |
289 | <constant>mat2</constant> | |
290 | </entry> | |
291 | </row> | |
292 | <row> | |
293 | <entry align="left"> | |
294 | <constant>GL_FLOAT_MAT3</constant> | |
295 | </entry> | |
296 | <entry align="left"> | |
297 | <constant>mat3</constant> | |
298 | </entry> | |
299 | </row> | |
300 | <row> | |
301 | <entry align="left"> | |
302 | <constant>GL_FLOAT_MAT4</constant> | |
303 | </entry> | |
304 | <entry align="left"> | |
305 | <constant>mat4</constant> | |
306 | </entry> | |
307 | </row> | |
308 | <row> | |
309 | <entry align="left"> | |
310 | <constant>GL_FLOAT_MAT2x3</constant> | |
311 | </entry> | |
312 | <entry align="left"> | |
313 | <constant>mat2x3</constant> | |
314 | </entry> | |
315 | </row> | |
316 | <row> | |
317 | <entry align="left"> | |
318 | <constant>GL_FLOAT_MAT2x4</constant> | |
319 | </entry> | |
320 | <entry align="left"> | |
321 | <constant>mat2x4</constant> | |
322 | </entry> | |
323 | </row> | |
324 | <row> | |
325 | <entry align="left"> | |
326 | <constant>GL_FLOAT_MAT3x2</constant> | |
327 | </entry> | |
328 | <entry align="left"> | |
329 | <constant>mat3x2</constant> | |
330 | </entry> | |
331 | </row> | |
332 | <row> | |
333 | <entry align="left"> | |
334 | <constant>GL_FLOAT_MAT3x4</constant> | |
335 | </entry> | |
336 | <entry align="left"> | |
337 | <constant>mat3x4</constant> | |
338 | </entry> | |
339 | </row> | |
340 | <row> | |
341 | <entry align="left"> | |
342 | <constant>GL_FLOAT_MAT4x2</constant> | |
343 | </entry> | |
344 | <entry align="left"> | |
345 | <constant>mat4x2</constant> | |
346 | </entry> | |
347 | </row> | |
348 | <row> | |
349 | <entry align="left"> | |
350 | <constant>GL_FLOAT_MAT4x3</constant> | |
351 | </entry> | |
352 | <entry align="left"> | |
353 | <constant>mat4x3</constant> | |
354 | </entry> | |
355 | </row> | |
356 | <row> | |
357 | <entry align="left"> | |
358 | <constant>GL_SAMPLER_1D</constant> | |
359 | </entry> | |
360 | <entry align="left"> | |
361 | <constant>sampler1D</constant> | |
362 | </entry> | |
363 | </row> | |
364 | <row> | |
365 | <entry align="left"> | |
366 | <constant>GL_SAMPLER_2D</constant> | |
367 | </entry> | |
368 | <entry align="left"> | |
369 | <constant>sampler2D</constant> | |
370 | </entry> | |
371 | </row> | |
372 | <row> | |
373 | <entry align="left"> | |
374 | <constant>GL_SAMPLER_3D</constant> | |
375 | </entry> | |
376 | <entry align="left"> | |
377 | <constant>sampler3D</constant> | |
378 | </entry> | |
379 | </row> | |
380 | <row> | |
381 | <entry align="left"> | |
382 | <constant>GL_SAMPLER_CUBE</constant> | |
383 | </entry> | |
384 | <entry align="left"> | |
385 | <constant>samplerCube</constant> | |
386 | </entry> | |
387 | </row> | |
388 | <row> | |
389 | <entry align="left"> | |
390 | <constant>GL_SAMPLER_1D_SHADOW</constant> | |
391 | </entry> | |
392 | <entry align="left"> | |
393 | <constant>sampler1DShadow</constant> | |
394 | </entry> | |
395 | </row> | |
396 | <row> | |
397 | <entry align="left"> | |
398 | <constant>GL_SAMPLER_2D_SHADOW</constant> | |
399 | </entry> | |
400 | <entry align="left"> | |
401 | <constant>sampler2DShadow</constant> | |
402 | </entry> | |
403 | </row> | |
404 | <row> | |
405 | <entry align="left"> | |
406 | <constant>GL_SAMPLER_1D_ARRAY</constant> | |
407 | </entry> | |
408 | <entry align="left"> | |
409 | <constant>sampler1DArray</constant> | |
410 | </entry> | |
411 | </row> | |
412 | <row> | |
413 | <entry align="left"> | |
414 | <constant>GL_SAMPLER_2D_ARRAY</constant> | |
415 | </entry> | |
416 | <entry align="left"> | |
417 | <constant>sampler2DArray</constant> | |
418 | </entry> | |
419 | </row> | |
420 | <row> | |
421 | <entry align="left"> | |
422 | <constant>GL_SAMPLER_1D_ARRAY_SHADOW</constant> | |
423 | </entry> | |
424 | <entry align="left"> | |
425 | <constant>sampler1DArrayShadow</constant> | |
426 | </entry> | |
427 | </row> | |
428 | <row> | |
429 | <entry align="left"> | |
430 | <constant>GL_SAMPLER_2D_ARRAY_SHADOW</constant> | |
431 | </entry> | |
432 | <entry align="left"> | |
433 | <constant>sampler2DArrayShadow</constant> | |
434 | </entry> | |
435 | </row> | |
436 | <row> | |
437 | <entry align="left"> | |
438 | <constant>GL_SAMPLER_2D_MULTISAMPLE</constant> | |
439 | </entry> | |
440 | <entry align="left"> | |
441 | <constant>sampler2DMS</constant> | |
442 | </entry> | |
443 | </row> | |
444 | <row> | |
445 | <entry align="left"> | |
446 | <constant>GL_SAMPLER_2D_MULTISAMPLE_ARRAY</constant> | |
447 | </entry> | |
448 | <entry align="left"> | |
449 | <constant>sampler2DMSArray</constant> | |
450 | </entry> | |
451 | </row> | |
452 | <row> | |
453 | <entry align="left"> | |
454 | <constant>GL_SAMPLER_CUBE_SHADOW</constant> | |
455 | </entry> | |
456 | <entry align="left"> | |
457 | <constant>samplerCubeShadow</constant> | |
458 | </entry> | |
459 | </row> | |
460 | <row> | |
461 | <entry align="left"> | |
462 | <constant>GL_SAMPLER_BUFFER</constant> | |
463 | </entry> | |
464 | <entry align="left"> | |
465 | <constant>samplerBuffer</constant> | |
466 | </entry> | |
467 | </row> | |
468 | <row> | |
469 | <entry align="left"> | |
470 | <constant>GL_SAMPLER_2D_RECT</constant> | |
471 | </entry> | |
472 | <entry align="left"> | |
473 | <constant>sampler2DRect</constant> | |
474 | </entry> | |
475 | </row> | |
476 | <row> | |
477 | <entry align="left"> | |
478 | <constant>GL_SAMPLER_2D_RECT_SHADOW</constant> | |
479 | </entry> | |
480 | <entry align="left"> | |
481 | <constant>sampler2DRectShadow</constant> | |
482 | </entry> | |
483 | </row> | |
484 | <row> | |
485 | <entry align="left"> | |
486 | <constant>GL_INT_SAMPLER_1D</constant> | |
487 | </entry> | |
488 | <entry align="left"> | |
489 | <constant>isampler1D</constant> | |
490 | </entry> | |
491 | </row> | |
492 | <row> | |
493 | <entry align="left"> | |
494 | <constant>GL_INT_SAMPLER_2D</constant> | |
495 | </entry> | |
496 | <entry align="left"> | |
497 | <constant>isampler2D</constant> | |
498 | </entry> | |
499 | </row> | |
500 | <row> | |
501 | <entry align="left"> | |
502 | <constant>GL_INT_SAMPLER_3D</constant> | |
503 | </entry> | |
504 | <entry align="left"> | |
505 | <constant>isampler3D</constant> | |
506 | </entry> | |
507 | </row> | |
508 | <row> | |
509 | <entry align="left"> | |
510 | <constant>GL_INT_SAMPLER_CUBE</constant> | |
511 | </entry> | |
512 | <entry align="left"> | |
513 | <constant>isamplerCube</constant> | |
514 | </entry> | |
515 | </row> | |
516 | <row> | |
517 | <entry align="left"> | |
518 | <constant>GL_INT_SAMPLER_1D_ARRAY</constant> | |
519 | </entry> | |
520 | <entry align="left"> | |
521 | <constant>isampler1DArray</constant> | |
522 | </entry> | |
523 | </row> | |
524 | <row> | |
525 | <entry align="left"> | |
526 | <constant>GL_INT_SAMPLER_2D_ARRAY</constant> | |
527 | </entry> | |
528 | <entry align="left"> | |
529 | <constant>isampler2DArray</constant> | |
530 | </entry> | |
531 | </row> | |
532 | <row> | |
533 | <entry align="left"> | |
534 | <constant>GL_INT_SAMPLER_2D_MULTISAMPLE</constant> | |
535 | </entry> | |
536 | <entry align="left"> | |
537 | <constant>isampler2DMS</constant> | |
538 | </entry> | |
539 | </row> | |
540 | <row> | |
541 | <entry align="left"> | |
542 | <constant>GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY</constant> | |
543 | </entry> | |
544 | <entry align="left"> | |
545 | <constant>isampler2DMSArray</constant> | |
546 | </entry> | |
547 | </row> | |
548 | <row> | |
549 | <entry align="left"> | |
550 | <constant>GL_INT_SAMPLER_BUFFER</constant> | |
551 | </entry> | |
552 | <entry align="left"> | |
553 | <constant>isamplerBuffer</constant> | |
554 | </entry> | |
555 | </row> | |
556 | <row> | |
557 | <entry align="left"> | |
558 | <constant>GL_INT_SAMPLER_2D_RECT</constant> | |
559 | </entry> | |
560 | <entry align="left"> | |
561 | <constant>isampler2DRect</constant> | |
562 | </entry> | |
563 | </row> | |
564 | <row> | |
565 | <entry align="left"> | |
566 | <constant>GL_UNSIGNED_INT_SAMPLER_1D</constant> | |
567 | </entry> | |
568 | <entry align="left"> | |
569 | <constant>usampler1D</constant> | |
570 | </entry> | |
571 | </row> | |
572 | <row> | |
573 | <entry align="left"> | |
574 | <constant>GL_UNSIGNED_INT_SAMPLER_2D</constant> | |
575 | </entry> | |
576 | <entry align="left"> | |
577 | <constant>usampler2D</constant> | |
578 | </entry> | |
579 | </row> | |
580 | <row> | |
581 | <entry align="left"> | |
582 | <constant>GL_UNSIGNED_INT_SAMPLER_3D</constant> | |
583 | </entry> | |
584 | <entry align="left"> | |
585 | <constant>usampler3D</constant> | |
586 | </entry> | |
587 | </row> | |
588 | <row> | |
589 | <entry align="left"> | |
590 | <constant>GL_UNSIGNED_INT_SAMPLER_CUBE</constant> | |
591 | </entry> | |
592 | <entry align="left"> | |
593 | <constant>usamplerCube</constant> | |
594 | </entry> | |
595 | </row> | |
596 | <row> | |
597 | <entry align="left"> | |
598 | <constant>GL_UNSIGNED_INT_SAMPLER_1D_ARRAY</constant> | |
599 | </entry> | |
600 | <entry align="left"> | |
601 | <constant>usampler2DArray</constant> | |
602 | </entry> | |
603 | </row> | |
604 | <row> | |
605 | <entry align="left"> | |
606 | <constant>GL_UNSIGNED_INT_SAMPLER_2D_ARRAY</constant> | |
607 | </entry> | |
608 | <entry align="left"> | |
609 | <constant>usampler2DArray</constant> | |
610 | </entry> | |
611 | </row> | |
612 | <row> | |
613 | <entry align="left"> | |
614 | <constant>GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE</constant> | |
615 | </entry> | |
616 | <entry align="left"> | |
617 | <constant>usampler2DMS</constant> | |
618 | </entry> | |
619 | </row> | |
620 | <row> | |
621 | <entry align="left"> | |
622 | <constant>GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY</constant> | |
623 | </entry> | |
624 | <entry align="left"> | |
625 | <constant>usampler2DMSArray</constant> | |
626 | </entry> | |
627 | </row> | |
628 | <row> | |
629 | <entry align="left"> | |
630 | <constant>GL_UNSIGNED_INT_SAMPLER_BUFFER</constant> | |
631 | </entry> | |
632 | <entry align="left"> | |
633 | <constant>usamplerBuffer</constant> | |
634 | </entry> | |
635 | </row> | |
636 | <row> | |
637 | <entry align="left"> | |
638 | <constant>GL_UNSIGNED_INT_SAMPLER_2D_RECT</constant> | |
639 | </entry> | |
640 | <entry align="left"> | |
641 | <constant>usampler2DRect</constant> | |
642 | </entry> | |
643 | </row> | |
644 | </tbody> | |
645 | </tgroup> | |
646 | </informaltable> | |
647 | </para> | |
648 | ||
649 | <para>If one or more elements of an array are active, the name | |
650 | of the array is returned in <parameter>name</parameter>, the | |
651 | type is returned in <parameter>type</parameter>, and the | |
652 | <parameter>size</parameter> parameter returns the highest array | |
653 | element index used, plus one, as determined by the compiler | |
654 | and/or linker. Only one active uniform variable will be reported | |
655 | for a uniform array.</para> | |
656 | ||
657 | <para>Uniform variables that are declared as structures or | |
658 | arrays of structures will not be returned directly by this | |
659 | function. Instead, each of these uniform variables will be | |
660 | reduced to its fundamental components containing the | |
661 | "." and "[]" operators such that each of the | |
662 | names is valid as an argument to | |
663 | <citerefentry><refentrytitle>glGetUniformLocation</refentrytitle></citerefentry>. | |
664 | Each of these reduced uniform variables is counted as one active | |
665 | uniform variable and is assigned an index. A valid name cannot | |
666 | be a structure, an array of structures, or a subcomponent of a | |
667 | vector or matrix.</para> | |
668 | ||
669 | <para>The size of the uniform variable will be returned in | |
670 | <parameter>size</parameter>. Uniform variables other than arrays | |
671 | will have a size of 1. Structures and arrays of structures will | |
672 | be reduced as described earlier, such that each of the names | |
673 | returned will be a data type in the earlier list. If this | |
674 | reduction results in an array, the size returned will be as | |
675 | described for uniform arrays; otherwise, the size returned will | |
676 | be 1.</para> | |
677 | ||
678 | <para>The list of active uniform variables may include both | |
679 | built-in uniform variables (which begin with the prefix | |
680 | "gl_") as well as user-defined uniform variable | |
681 | names.</para> | |
682 | ||
683 | <para>This function will return as much information as it can | |
684 | about the specified active uniform variable. If no information | |
685 | is available, <parameter>length</parameter> will be 0, and | |
686 | <parameter>name</parameter> will be an empty string. This | |
687 | situation could occur if this function is called after a link | |
688 | operation that failed. If an error occurs, the return values | |
689 | <parameter>length</parameter>, <parameter>size</parameter>, | |
690 | <parameter>type</parameter>, and <parameter>name</parameter> | |
691 | will be unmodified.</para> | |
692 | </refsect1> | |
693 | <refsect1 id="errors"><title>Errors</title> | |
694 | <para><constant>GL_INVALID_VALUE</constant> is generated if | |
695 | <parameter>program</parameter> is not a value generated by | |
696 | OpenGL.</para> | |
697 | ||
698 | <para><constant>GL_INVALID_OPERATION</constant> is generated if | |
699 | <parameter>program</parameter> is not a program object.</para> | |
700 | ||
701 | <para><constant>GL_INVALID_VALUE</constant> is generated if | |
702 | <parameter>index</parameter> is greater than or equal to the | |
703 | number of active uniform variables in | |
704 | <parameter>program</parameter>.</para> | |
705 | ||
706 | <para><constant>GL_INVALID_VALUE</constant> is generated if | |
707 | <parameter>bufSize</parameter> is less than 0.</para> | |
708 | </refsect1> | |
709 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
710 | <para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> | |
711 | with argument <constant>GL_MAX_VERTEX_UNIFORM_COMPONENTS</constant>, | |
712 | <constant>GL_MAX_GEOMETRY_UNIFORM_COMPONENTS</constant>, | |
713 | <constant>GL_MAX_FRAGMENT_UNIFORM_COMPONENTS</constant>, or | |
714 | <constant>GL_MAX_COMBINED_UNIFORM_COMPONENTS</constant>.</para> | |
715 | ||
716 | <para><citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry> | |
717 | with argument <constant>GL_ACTIVE_UNIFORMS</constant> or | |
718 | <constant>GL_ACTIVE_UNIFORM_MAX_LENGTH</constant>.</para> | |
719 | ||
720 | <para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para> | |
721 | </refsect1> | |
722 | <refsect1 id="seealso"><title>See Also</title> | |
723 | <para><citerefentry><refentrytitle>glGetUniform</refentrytitle></citerefentry>, | |
724 | <citerefentry><refentrytitle>glGetUniformLocation</refentrytitle></citerefentry>, | |
725 | <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>, | |
726 | <citerefentry><refentrytitle>glUniform</refentrytitle></citerefentry>, | |
727 | <citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry></para> | |
728 | </refsect1> | |
729 | <refsect1 id="Copyright"><title>Copyright</title> | |
730 | <para> | |
731 | Copyright <trademark class="copyright"></trademark> 2003-2005 3Dlabs Inc. Ltd. | |
732 | Copyright <trademark class="copyright"></trademark> 2010 Khronos Group | |
733 | This material may be distributed subject to the terms and conditions set forth in | |
734 | the Open Publication License, v 1.0, 8 June 1999. | |
735 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>. | |
736 | </para> | |
737 | </refsect1> | |
738 | </refentry> |