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=
"glValidateProgram">
6 <refentrytitle>glValidateProgram
</refentrytitle>
7 <manvolnum>3G
</manvolnum>
10 <refname>glValidateProgram
</refname>
11 <refpurpose>Validates a program object
</refpurpose>
13 <refsynopsisdiv><title>C Specification
</title>
16 <funcdef>void
<function>glValidateProgram
</function></funcdef>
17 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
21 <refsect1 id=
"parameters"><title>Parameters
</title>
24 <term><parameter>program
</parameter></term>
26 <para>Specifies the handle of the program object to
32 <refsect1 id=
"description"><title>Description
</title>
33 <para><function>glValidateProgram
</function> checks to see
34 whether the executables contained in
35 <parameter>program
</parameter> can execute given the current
36 OpenGL state. The information generated by the validation
37 process will be stored in
<parameter>program
</parameter>'s
38 information log. The validation information may consist of an
39 empty string, or it may be a string containing information about
40 how the current program object interacts with the rest of
41 current OpenGL state. This provides a way for OpenGL
42 implementers to convey more information about why the current
43 program is inefficient, suboptimal, failing to execute, and so
46 <para>The status of the validation operation will be stored as
47 part of the program object's state. This value will be set to
48 <constant>GL_TRUE
</constant> if the validation succeeded, and
49 <constant>GL_FALSE
</constant> otherwise. It can be queried by
51 <citerefentry><refentrytitle>glGetProgram
</refentrytitle></citerefentry>
52 with arguments
<parameter>program
</parameter> and
53 <constant>GL_VALIDATE_STATUS
</constant>. If validation is
54 successful,
<parameter>program
</parameter> is guaranteed to
55 execute given the current state. Otherwise,
56 <parameter>program
</parameter> is guaranteed to not execute.
</para>
58 <para>This function is typically useful only during application
59 development. The informational string stored in the information
60 log is completely implementation dependent; therefore, an
61 application should not expect different OpenGL implementations
62 to produce identical information strings.
</para>
64 <refsect1 id=
"notes"><title>Notes
</title>
65 <para><function>glValidateProgram
</function> is available only
66 if the GL version is
2.0 or greater.
</para>
68 <para>This function mimics the validation operation that OpenGL
69 implementations must perform when rendering commands are issued
70 while programmable shaders are part of current state. The error
71 <constant>GL_INVALID_OPERATION
</constant> will be generated by
72 <citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>,
73 <citerefentry><refentrytitle>glRasterPos
</refentrytitle></citerefentry>,
74 or any command that performs an implicit call to
75 <citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
80 <para>any two active samplers in the current program
81 object are of different types, but refer to the same
82 texture image unit,
</para>
85 <para>any active sampler in the current program object
86 refers to a texture image unit where fixed-function
87 fragment processing accesses a texture target that does
88 not match the sampler type, or
</para>
91 <para>the sum of the number of active samplers in the
92 program and the number of texture image units enabled
93 for fixed-function fragment processing exceeds the
94 combined limit on the total number of texture image
99 <para>It may be difficult or cause a performance degradation for
100 applications to catch these errors when rendering commands are
101 issued. Therefore, applications are advised to make calls to
102 <function>glValidateProgram
</function> to detect these issues
103 during application development.
</para>
105 <refsect1 id=
"errors"><title>Errors
</title>
106 <para><constant>GL_INVALID_VALUE
</constant> is generated if
107 <parameter>program
</parameter> is not a value generated by
110 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
111 <parameter>program
</parameter> is not a program object.
</para>
113 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
114 <function>glValidateProgram
</function> is executed between the
116 <citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
117 and the corresponding execution of
118 <citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
</para>
120 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
121 <para><citerefentry><refentrytitle>glGetProgram
</refentrytitle></citerefentry>
122 with arguments
<parameter>program
</parameter> and
123 <constant>GL_VALIDATE_STATUS
</constant></para>
125 <para><citerefentry><refentrytitle>glGetProgramInfoLog
</refentrytitle></citerefentry>
126 with argument
<parameter>program
</parameter></para>
128 <para><citerefentry><refentrytitle>glIsProgram
</refentrytitle></citerefentry></para>
130 <refsect1 id=
"seealso"><title>See Also
</title>
131 <para><citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry>,
132 <citerefentry><refentrytitle>glUseProgram
</refentrytitle></citerefentry></para>
134 <refsect1 id=
"Copyright"><title>Copyright
</title>
136 Copyright
<trademark class=
"copyright"></trademark> 2003-
2005 3Dlabs Inc. Ltd.
137 This material may be distributed subject to the terms and conditions set forth in
138 the Open Publication License, v
1.0,
8 June
1999.
139 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.