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=
"glUseProgramStages">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glUseProgramStages
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glUseProgramStages
</refname>
17 <refpurpose>bind stages of a program object to a program pipeline
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glUseProgramStages
</function></funcdef>
23 <paramdef>GLuint
<parameter>pipeline
</parameter></paramdef>
24 <paramdef>GLbitfield
<parameter>stages
</parameter></paramdef>
25 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
29 <refsect1 id=
"parameters"><title>Parameters
</title>
32 <term><parameter>pipeline
</parameter></term>
35 Specifies the program pipeline object to which to bind stages from
<parameter>program
</parameter>.
40 <term><parameter>stages
</parameter></term>
43 Specifies a set of program stages to bind to the program pipeline object.
48 <term><parameter>program
</parameter></term>
51 Specifies the program object containing the shader executables to use in
<parameter>pipeline
</parameter>.
57 <refsect1 id=
"description"><title>Description
</title>
59 <function>glUseProgramStages
</function> binds executables from a program object
60 associated with a specified set of shader stages to the program pipeline object given
61 by
<parameter>pipeline
</parameter>.
62 <parameter>pipeline
</parameter> specifies the program pipeline object to which to bind
63 the executables.
<parameter>stages
</parameter> contains a logical combination of bits
64 indicating the shader stages to use within
<parameter>program
</parameter> with the program
65 pipeline object
<parameter>pipeline
</parameter>.
<parameter>stages
</parameter> must be
66 a logical combination of
<constant>GL_VERTEX_SHADER_BIT
</constant>,
67 <constant>GL_TESS_CONTROL_SHADER_BIT
</constant>,
<constant>GL_TESS_EVALUATION_SHADER_BIT
</constant>,
68 <constant>GL_GEOMETRY_SHADER_BIT
</constant>,
<constant>GL_FRAGMENT_SHADER_BIT
</constant> and
<constant>GL_COMPUTE_SHADER_BIT
</constant>.
69 Additionally, the special value
<constant>GL_ALL_SHADER_BITS
</constant> may be specified to
70 indicate that all executables contained in
<parameter>program
</parameter> should be
71 installed in
<parameter>pipeline
</parameter>.
74 If
<parameter>program
</parameter> refers to a program object with a valid shader attached for
75 an indicated shader stage,
<function>glUseProgramStages
</function> installs the executable
76 code for that stage in the indicated program pipeline object
<parameter>pipeline
</parameter>.
77 If
<parameter>program
</parameter> is zero, or refers to a program object with no valid shader
78 executable for a given stage, it is as if the pipeline object has no programmable stage configured
79 for the indicated shader stages. If
<parameter>stages
</parameter> contains bits other than those
80 listed above, and is not equal to
<constant>GL_ALL_SHADER_BITS
</constant>, an error is generated.
83 <refsect1 id=
"notes"><title>Notes
</title>
85 The
<constant>GL_COMPUTE_SHADER_BIT
</constant> bit is available only if the GL version is
4.3 or greater.
88 <refsect1 id=
"errors"><title>Errors
</title>
90 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>shaders
</parameter> contains
91 set bits that are not recognized, and is not the reserved value
<constant>GL_ALL_SHADER_BITS
</constant>.
94 <constant>GL_INVALID_OPERATION
</constant> is generated if
<parameter>program
</parameter> refers
95 to a program object that was not linked with its
<constant>GL_PROGRAM_SEPARABLE
</constant> status set.
98 <constant>GL_INVALID_OPERATION
</constant> is generated if
<parameter>program
</parameter> refers
99 to a program object that has not been successfully linked.
102 <constant>GL_INVALID_OPERATION
</constant> is generated if
<parameter>pipeline
</parameter> is not
103 a name previously returned from a call to
<citerefentry><refentrytitle>glGenProgramPipelines
</refentrytitle></citerefentry>
104 or if such a name has been deleted by a call to
105 <citerefentry><refentrytitle>glDeleteProgramPipelines
</refentrytitle></citerefentry>.
108 <refsect1 id=
"seealso"><title>See Also
</title>
110 <citerefentry><refentrytitle>glGenProgramPipelines
</refentrytitle></citerefentry>,
111 <citerefentry><refentrytitle>glDeleteProgramPipelines
</refentrytitle></citerefentry>,
112 <citerefentry><refentrytitle>glIsProgramPipeline
</refentrytitle></citerefentry>
115 <refsect1 id=
"Copyright"><title>Copyright
</title>
117 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
118 This material may be distributed subject to the terms and conditions set forth in
119 the Open Publication License, v
1.0,
8 June
1999.
120 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.