Commit | Line | Data |
---|---|---|
7faf1d71 AW |
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="glGetSubroutineIndex"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>2010</year> | |
9 | <holder>Khronos Group.</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glGetSubroutineIndex</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glGetSubroutineIndex</refname> | |
17 | <refpurpose>retrieve the index 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>GLuint <function>glGetSubroutineIndex</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>glGetSubroutineIndex</function> returns the index of a subroutine uniform within a shader stage attached to a program object. | |
65 | <parameter>program</parameter> contains the name of the program to which the shader is attached. <parameter>shadertype</parameter> | |
66 | specifies the stage from which to query shader subroutine index. <parameter>name</parameter> contains the null-terminated | |
67 | name of the subroutine uniform whose name to query. | |
68 | </para> | |
69 | <para> | |
70 | If <parameter>name</parameter> is not the name of a subroutine uniform in the shader stage, <constant>GL_INVALID_INDEX</constant> | |
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_SUBROUTINES</constant> minus one will be returned. Subroutine indices | |
73 | are assigned using consecutive integers in the range from zero to the value of <constant>GL_ACTIVE_SUBROUTINES</constant> minus | |
74 | one for the shader stage. | |
75 | </para> | |
76 | </refsect1> | |
77 | <refsect1 id="errors"><title>Errors</title> | |
78 | <para> | |
79 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>shadertype</parameter> or <parameter>pname</parameter> | |
80 | is not one of the accepted values. | |
81 | </para> | |
82 | <para> | |
83 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>program</parameter> is not the name of an | |
84 | existing program object. | |
85 | </para> | |
86 | </refsect1> | |
87 | <refsect1 id="seealso"><title>See Also</title> | |
88 | <para> | |
89 | <citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry>, | |
90 | <citerefentry><refentrytitle>glGetActiveSubroutineUniform</refentrytitle></citerefentry>, | |
91 | <citerefentry><refentrytitle>glGetActiveSubroutineUniformName</refentrytitle></citerefentry> | |
92 | </para> | |
93 | </refsect1> | |
94 | <refsect1 id="Copyright"><title>Copyright</title> | |
95 | <para> | |
96 | Copyright <trademark class="copyright"></trademark> 2010 Khronos Group. | |
97 | This material may be distributed subject to the terms and conditions set forth in | |
98 | the Open Publication License, v 1.0, 8 June 1999. | |
99 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>. | |
100 | </para> | |
101 | </refsect1> | |
102 | </refentry> |