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=
"glGetProgram">
6 <refentrytitle>glGetProgram
</refentrytitle>
7 <manvolnum>3G
</manvolnum>
10 <refname>glGetProgramiv
</refname>
11 <refpurpose>Returns a parameter from a program object
</refpurpose>
13 <refsynopsisdiv><title>C Specification
</title>
16 <funcdef>void
<function>glGetProgramiv
</function></funcdef>
17 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
18 <paramdef>GLenum
<parameter>pname
</parameter></paramdef>
19 <paramdef>GLint *
<parameter>params
</parameter></paramdef>
23 <refsect1 id=
"parameters"><title>Parameters
</title>
26 <term><parameter>program
</parameter></term>
28 <para>Specifies the program object to be
33 <term><parameter>pname
</parameter></term>
35 <para>Specifies the object parameter. Accepted
37 <constant>GL_DELETE_STATUS
</constant>,
38 <constant>GL_LINK_STATUS
</constant>,
39 <constant>GL_VALIDATE_STATUS
</constant>,
40 <constant>GL_INFO_LOG_LENGTH
</constant>,
41 <constant>GL_ATTACHED_SHADERS
</constant>,
42 <constant>GL_ACTIVE_ATOMIC_COUNTER_BUFFERS
</constant>,
43 <constant>GL_ACTIVE_ATTRIBUTES
</constant>,
44 <constant>GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
</constant>,
45 <constant>GL_ACTIVE_UNIFORMS
</constant>,
46 <constant>GL_ACTIVE_UNIFORM_BLOCKS
</constant>,
47 <constant>GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH
</constant>,
48 <constant>GL_ACTIVE_UNIFORM_MAX_LENGTH
</constant>,
49 <constant>GL_COMPUTE_WORK_GROUP_SIZE
</constant>
50 <constant>GL_PROGRAM_BINARY_LENGTH
</constant>,
51 <constant>GL_TRANSFORM_FEEDBACK_BUFFER_MODE
</constant>,
52 <constant>GL_TRANSFORM_FEEDBACK_VARYINGS
</constant>,
53 <constant>GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH
</constant>,
54 <constant>GL_GEOMETRY_VERTICES_OUT
</constant>,
55 <constant>GL_GEOMETRY_INPUT_TYPE
</constant>, and
56 <constant>GL_GEOMETRY_OUTPUT_TYPE
</constant>.
</para>
60 <term><parameter>params
</parameter></term>
62 <para>Returns the requested object parameter.
</para>
67 <refsect1 id=
"description"><title>Description
</title>
68 <para><function>glGetProgram
</function>
69 returns in
<parameter>params
</parameter>
70 the value of a parameter for a specific program object. The following parameters are defined:
</para>
74 <term><constant>GL_DELETE_STATUS
</constant></term>
78 <para> <parameter>params
</parameter> returns
79 <constant>GL_TRUE
</constant> if
80 <parameter>program
</parameter> is currently flagged
81 for deletion, and
<constant>GL_FALSE
</constant>
87 <term><constant>GL_LINK_STATUS
</constant></term>
91 <para> <parameter>params
</parameter> returns
92 <constant>GL_TRUE
</constant> if the last link
93 operation on
<parameter>program
</parameter> was
94 successful, and
<constant>GL_FALSE
</constant>
100 <term><constant>GL_VALIDATE_STATUS
</constant></term>
104 <para> <parameter>params
</parameter> returns
105 <constant>GL_TRUE
</constant> or if the last
106 validation operation on
107 <parameter>program
</parameter> was successful, and
108 <constant>GL_FALSE
</constant>
114 <term><constant>GL_INFO_LOG_LENGTH
</constant></term>
118 <para> <parameter>params
</parameter> returns the
119 number of characters in the information log for
120 <parameter>program
</parameter> including the null
121 termination character (i.e., the size of the
122 character buffer required to store the information
123 log). If
<parameter>program
</parameter> has no
124 information log, a value of
0 is
130 <term><constant>GL_ATTACHED_SHADERS
</constant></term>
134 <para> <parameter>params
</parameter> returns the
135 number of shader objects attached to
136 <parameter>program
</parameter>.
</para>
141 <term><constant>GL_ACTIVE_ATOMIC_COUNTER_BUFFERS
</constant></term>
145 <para> <parameter>params
</parameter> returns the
146 number of active attribute atomic counter buffers used by
147 <parameter>program
</parameter>.
</para>
152 <term><constant>GL_ACTIVE_ATTRIBUTES
</constant></term>
156 <para> <parameter>params
</parameter> returns the
157 number of active attribute variables for
158 <parameter>program
</parameter>.
</para>
163 <term><constant>GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
</constant></term>
167 <para> <parameter>params
</parameter> returns the
168 length of the longest active attribute name for
169 <parameter>program
</parameter>, including the null
170 termination character (i.e., the size of the
171 character buffer required to store the longest
172 attribute name). If no active attributes exist,
0 is
178 <term><constant>GL_ACTIVE_UNIFORMS
</constant></term>
182 <para> <parameter>params
</parameter> returns the
183 number of active uniform variables for
184 <parameter>program
</parameter>.
</para>
189 <term><constant>GL_ACTIVE_UNIFORM_MAX_LENGTH
</constant></term>
193 <para> <parameter>params
</parameter> returns the
194 length of the longest active uniform variable name
195 for
<parameter>program
</parameter>, including the
196 null termination character (i.e., the size of the
197 character buffer required to store the longest
198 uniform variable name). If no active uniform
199 variables exist,
0 is returned.
</para>
204 <term><constant>GL_PROGRAM_BINARY_LENGTH
</constant></term>
208 <para> <parameter>params
</parameter> returns the
209 length of the program binary, in bytes that will be returned by
210 a call to
<citerefentry><refentrytitle>glGetProgramBinary
</refentrytitle></citerefentry>.
211 When a progam's
<constant>GL_LINK_STATUS
</constant> is
<constant>GL_FALSE
</constant>,
212 its program binary length is zero.
218 <term><constant>GL_COMPUTE_WORK_GROUP_SIZE
</constant></term>
222 <para> <parameter>params
</parameter> returns an
223 array of three integers containing the local work group size of
224 the compute program as specified by its input layout qualifier(s).
225 <parameter>program
</parameter> must be the name of a program object
226 that has been previously linked successfully and contains a binary
227 for the compute shader stage.
233 <term><constant>GL_TRANSFORM_FEEDBACK_BUFFER_MODE
</constant></term>
237 <para> <parameter>params
</parameter> returns a symbolic constant
238 indicating the buffer mode used when transform feedback is active.
239 This may be
<constant>GL_SEPARATE_ATTRIBS
</constant> or
240 <constant>GL_INTERLEAVED_ATTRIBS
</constant>.
</para>
245 <term><constant>GL_TRANSFORM_FEEDBACK_VARYINGS
</constant></term>
249 <para> <parameter>params
</parameter> returns the number of varying
250 variables to capture in transform feedback mode for the program.
</para>
255 <term><constant>GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH
</constant></term>
259 <para> <parameter>params
</parameter> returns the length of the longest
260 variable name to be used for transform feedback, including the null-terminator.
</para>
265 <term><constant>GL_GEOMETRY_VERTICES_OUT
</constant></term>
269 <para> <parameter>params
</parameter> returns the maximum number of vertices
270 that the geometry shader in
<parameter>program
</parameter> will output.
</para>
275 <term><constant>GL_GEOMETRY_INPUT_TYPE
</constant></term>
279 <para> <parameter>params
</parameter> returns a symbolic constant indicating
280 the primitive type accepted as input to the geometry shader contained in
281 <parameter>program
</parameter>.
</para>
286 <term><constant>GL_GEOMETRY_OUTPUT_TYPE
</constant></term>
290 <para> <parameter>params
</parameter> returns a symbolic constant indicating
291 the primitive type that will be output by the geometry shader contained
292 in
<parameter>program
</parameter>.
</para>
297 <refsect1 id=
"notes"><title>Notes
</title>
299 <constant>GL_ACTIVE_UNIFORM_BLOCKS
</constant> and
300 <constant>GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH
</constant>
301 are available only if the GL version
3.1 or greater.
304 <constant>GL_GEOMETRY_VERTICES_OUT
</constant>,
<constant>GL_GEOMETRY_INPUT_TYPE
</constant>
305 and
<constant>GL_GEOMETRY_OUTPUT_TYPE
</constant> are accepted only if the GL
306 version is
3.2 or greater.
309 <constant>GL_COMPUTE_WORK_GROUP_SIZE
</constant> is accepted only if the
310 GL version is
4.3 or greater.
313 <para>If an error is generated, no change is made to the
314 contents of
<parameter>params
</parameter>.
</para>
316 <refsect1 id=
"errors"><title>Errors
</title>
317 <para><constant>GL_INVALID_VALUE
</constant>
318 is generated if
<parameter>program
</parameter>
319 is not a value generated by OpenGL.
</para>
321 <para><constant>GL_INVALID_OPERATION
</constant>
322 is generated if
<parameter>program
</parameter>
323 does not refer to a program object.
</para>
325 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
326 <parameter>pname
</parameter> is
<constant>GL_GEOMETRY_VERTICES_OUT
</constant>,
327 <constant>GL_GEOMETRY_INPUT_TYPE
</constant>, or
<constant>GL_GEOMETRY_OUTPUT_TYPE
</constant>,
328 and
<parameter>program
</parameter> does not contain a geometry shader.
</para>
330 <para><constant>GL_INVALID_ENUM
</constant>
331 is generated if
<parameter>pname
</parameter>
332 is not an accepted value.
</para>
334 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
<parameter>pname
</parameter>
335 is
<constant>GL_COMPUTE_WORK_GROUP_SIZE
</constant> and
<parameter>program
</parameter>
336 does not contain a binary for the compute shader stage.
</para>
339 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
340 <para><citerefentry><refentrytitle>glGetActiveAttrib
</refentrytitle></citerefentry>
341 with argument
<parameter>program
</parameter></para>
343 <para><citerefentry><refentrytitle>glGetActiveUniform
</refentrytitle></citerefentry>
344 with argument
<parameter>program
</parameter></para>
346 <para><citerefentry><refentrytitle>glGetAttachedShaders
</refentrytitle></citerefentry>
347 with argument
<parameter>program
</parameter></para>
349 <para><citerefentry><refentrytitle>glGetProgramInfoLog
</refentrytitle></citerefentry>
350 with argument
<parameter>program
</parameter></para>
352 <para><citerefentry><refentrytitle>glIsProgram
</refentrytitle></citerefentry>
353 <parameter></parameter></para>
355 <refsect1 id=
"seealso"><title>See Also
</title>
356 <para><citerefentry><refentrytitle>glAttachShader
</refentrytitle></citerefentry>,
357 <citerefentry><refentrytitle>glCreateProgram
</refentrytitle></citerefentry>,
358 <citerefentry><refentrytitle>glDeleteProgram
</refentrytitle></citerefentry>,
359 <citerefentry><refentrytitle>glGetShader
</refentrytitle></citerefentry>,
360 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry>,
361 <citerefentry><refentrytitle>glValidateProgram
</refentrytitle></citerefentry></para>
363 <refsect1 id=
"Copyright"><title>Copyright
</title>
365 Copyright
<trademark class=
"copyright"></trademark> 2003-
2005 3Dlabs Inc. Ltd.
366 Copyright
<trademark class=
"copyright"></trademark> 2010-
2011 Khronos Group.
367 This material may be distributed subject to the terms and conditions set forth in
368 the Open Publication License, v
1.0,
8 June
1999.
369 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.