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=
"glGetProgramStage">
9 <holder>Khronos Group.
</holder>
12 <refentrytitle>glGetProgramStage
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGetProgramStage
</refname>
17 <refpurpose>retrieve properties of a program object corresponding to a specified shader stage
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glGetProgramStageiv
</function></funcdef>
23 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
24 <paramdef>GLenum
<parameter>shadertype
</parameter></paramdef>
25 <paramdef>GLenum
<parameter>pname
</parameter></paramdef>
26 <paramdef>GLint *
<parameter>values
</parameter></paramdef>
30 <!-- eqn: ignoring delim $$ -->
31 <refsect1 id=
"parameters"><title>Parameters
</title>
34 <term><parameter>program
</parameter></term>
37 Specifies the name of the program containing shader stage.
42 <term><parameter>shadertype
</parameter></term>
45 Specifies the shader stage from which to query for the subroutine parameter.
<parameter>shadertype
</parameter>
46 must be one of
<constant>GL_VERTEX_SHADER
</constant>,
<constant>GL_TESS_CONTROL_SHADER
</constant>,
47 <constant>GL_TESS_EVALUATION_SHADER
</constant>,
<constant>GL_GEOMETRY_SHADER
</constant> or
48 <constant>GL_FRAGMENT_SHADER
</constant>.
53 <term><parameter>pname
</parameter></term>
56 Specifies the parameter of the shader to query.
<parameter>pname
</parameter>
57 must be
<constant>GL_ACTIVE_SUBROUTINE_UNIFORMS
</constant>,
58 <constant>GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS
</constant>,
59 <constant>GL_ACTIVE_SUBROUTINES
</constant>,
60 <constant>GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH
</constant>,
61 or
<constant>GL_ACTIVE_SUBROUTINE_MAX_LENGTH
</constant>.
66 <term><parameter>values
</parameter></term>
69 Specifies the address of a variable into which the queried value or values will be placed.
75 <refsect1 id=
"description"><title>Description
</title>
77 <function>glGetProgramStage
</function> queries a parameter of a shader stage attached to a program object.
78 <parameter>program
</parameter> contains the name of the program to which the shader is attached.
<parameter>shadertype
</parameter>
79 specifies the stage from which to query the parameter.
<parameter>pname
</parameter> specifies which parameter
80 should be queried. The value or values of the parameter to be queried is returned in the variable whose address
81 is given in
<parameter>values
</parameter>.
84 If
<parameter>pname
</parameter> is
<constant>GL_ACTIVE_SUBROUTINE_UNIFORMS
</constant>, the number
85 of active subroutine variables in the stage is returned in
<parameter>values
</parameter>.
88 If
<parameter>pname
</parameter> is
<constant>GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS
</constant>,
89 the number of active subroutine variable locations in the stage is returned in
<parameter>values
</parameter>.
92 If
<parameter>pname
</parameter> is
<constant>GL_ACTIVE_SUBROUTINES
</constant>,
93 the number of active subroutines in the stage is returned in
<parameter>values
</parameter>.
96 If
<parameter>pname
</parameter> is
<constant>GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH
</constant>,
97 the length of the longest subroutine uniform for the stage is returned in
<parameter>values
</parameter>.
100 If
<parameter>pname
</parameter> is
<constant>GL_ACTIVE_SUBROUTINE_MAX_LENGTH
</constant>,
101 the length of the longest subroutine name for the stage is returned in
<parameter>values
</parameter>. The
102 returned name length includes space for the null-terminator.
105 If there is no shader present of type
<parameter>shadertype
</parameter>, the returned value will be consistent
106 with a shader containing no subroutines or subroutine uniforms.
109 <refsect1 id=
"errors"><title>Errors
</title>
111 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>shadertype
</parameter> or
<parameter>pname
</parameter>
112 is not one of the accepted values.
115 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>program
</parameter> is not the name of an
116 existing program object.
119 <refsect1 id=
"seealso"><title>See Also
</title>
121 <citerefentry><refentrytitle>glGetProgram
</refentrytitle></citerefentry>
124 <refsect1 id=
"Copyright"><title>Copyright
</title>
126 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
127 This material may be distributed subject to the terms and conditions set forth in
128 the Open Publication License, v
1.0,
8 June
1999.
129 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.