rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man4 / glGetSubroutineUniformLocation.xml
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="glGetSubroutineUniformLocation">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2010</year>
9 <holder>Khronos Group.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glGetSubroutineUniformLocation</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glGetSubroutineUniformLocation</refname>
17 <refpurpose>retrieve the location of a subroutine uniform of a given shader stage within a program</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>GLint <function>glGetSubroutineUniformLocation</function></funcdef>
23 <paramdef>GLuint <parameter>program</parameter></paramdef>
24 <paramdef>GLenum <parameter>shadertype</parameter></paramdef>
25 <paramdef>const GLchar *<parameter>name</parameter></paramdef>
26 </funcprototype>
27 </funcsynopsis>
28 </refsynopsisdiv>
29 <!-- eqn: ignoring delim $$ -->
30 <refsect1 id="parameters"><title>Parameters</title>
31 <variablelist>
32 <varlistentry>
33 <term><parameter>program</parameter></term>
34 <listitem>
35 <para>
36 Specifies the name of the program containing shader stage.
37 </para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>shadertype</parameter></term>
42 <listitem>
43 <para>
44 Specifies the shader stage from which to query for subroutine uniform index.
45 <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>.
49 </para>
50 </listitem>
51 </varlistentry>
52 <varlistentry>
53 <term><parameter>name</parameter></term>
54 <listitem>
55 <para>
56 Specifies the name of the subroutine uniform whose index to query.
57 </para>
58 </listitem>
59 </varlistentry>
60 </variablelist>
61 </refsect1>
62 <refsect1 id="description"><title>Description</title>
63 <para>
64 <function>glGetSubroutineUniformLocation</function> returns the location of the subroutine uniform variable
65 <parameter>name</parameter> in the shader stage of type <parameter>shadertype</parameter> attached to
66 <parameter>program</parameter>, with behavior otherwise identical to
67 <citerefentry><refentrytitle>glGetUniformLocation</refentrytitle></citerefentry>.
68 </para>
69 <para>
70 If <parameter>name</parameter> is not the name of a subroutine uniform in the shader stage, -1
71 is returned, but no error is generated. If <parameter>name</parameter> is the name of a subroutine uniform in the shader stage,
72 a value between zero and the value of <constant>GL_ACTIVE_SUBROUTINE_LOCATIONS</constant> minus one will be returned.
73 Subroutine locations are assigned using consecutive integers in the range from zero to the value
74 of <constant>GL_ACTIVE_SUBROUTINE_LOCATIONS</constant> minus one for the shader stage. For active subroutine uniforms
75 declared as arrays, the declared array elements are assigned consecutive locations.
76 </para>
77 </refsect1>
78 <refsect1 id="errors"><title>Errors</title>
79 <para>
80 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>shadertype</parameter> or <parameter>pname</parameter>
81 is not one of the accepted values.
82 </para>
83 <para>
84 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>program</parameter> is not the name of an
85 existing program object.
86 </para>
87 </refsect1>
88 <refsect1 id="seealso"><title>See Also</title>
89 <para>
90 <citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry>,
91 <citerefentry><refentrytitle>glGetActiveSubroutineUniform</refentrytitle></citerefentry>,
92 <citerefentry><refentrytitle>glGetActiveSubroutineUniformName</refentrytitle></citerefentry>,
93 <citerefentry><refentrytitle>glGetUniformLocation</refentrytitle></citerefentry>
94 </para>
95 </refsect1>
96 <refsect1 id="Copyright"><title>Copyright</title>
97 <para>
98 Copyright <trademark class="copyright"></trademark> 2010 Khronos Group.
99 This material may be distributed subject to the terms and conditions set forth in
100 the Open Publication License, v 1.0, 8 June 1999.
101 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
102 </para>
103 </refsect1>
104 </refentry>