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="glGetActiveSubroutineUniformName"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>2010</year> | |
9 | <holder>Khronos Group.</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glGetActiveSubroutineUniformName</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glGetActiveSubroutineUniformName</refname> | |
17 | <refpurpose>query the name of an active shader subroutine uniform</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glGetActiveSubroutineUniformName</function></funcdef> | |
23 | <paramdef>GLuint <parameter>program</parameter></paramdef> | |
24 | <paramdef>GLenum <parameter>shadertype</parameter></paramdef> | |
25 | <paramdef>GLuint <parameter>index</parameter></paramdef> | |
26 | <paramdef>GLsizei <parameter>bufsize</parameter></paramdef> | |
27 | <paramdef>GLsizei *<parameter>length</parameter></paramdef> | |
28 | <paramdef>GLchar *<parameter>name</parameter></paramdef> | |
29 | </funcprototype> | |
30 | </funcsynopsis> | |
31 | </refsynopsisdiv> | |
32 | <!-- eqn: ignoring delim $$ --> | |
33 | <refsect1 id="parameters"><title>Parameters</title> | |
34 | <variablelist> | |
35 | <varlistentry> | |
36 | <term><parameter>program</parameter></term> | |
37 | <listitem> | |
38 | <para> | |
39 | Specifies the name of the program containing the subroutine. | |
40 | </para> | |
41 | </listitem> | |
42 | </varlistentry> | |
43 | <varlistentry> | |
44 | <term><parameter>shadertype</parameter></term> | |
45 | <listitem> | |
46 | <para> | |
47 | Specifies the shader stage from which to query for the subroutine parameter. <parameter>shadertype</parameter> | |
48 | must be one of <constant>GL_VERTEX_SHADER</constant>, <constant>GL_TESS_CONTROL_SHADER</constant>, | |
49 | <constant>GL_TESS_EVALUATION_SHADER</constant>, <constant>GL_GEOMETRY_SHADER</constant> or | |
50 | <constant>GL_FRAGMENT_SHADER</constant>. | |
51 | </para> | |
52 | </listitem> | |
53 | </varlistentry> | |
54 | <varlistentry> | |
55 | <term><parameter>index</parameter></term> | |
56 | <listitem> | |
57 | <para> | |
58 | Specifies the index of the shader subroutine uniform. | |
59 | </para> | |
60 | </listitem> | |
61 | </varlistentry> | |
62 | <varlistentry> | |
63 | <term><parameter>bufsize</parameter></term> | |
64 | <listitem> | |
65 | <para> | |
66 | Specifies the size of the buffer whose address is given in <parameter>name</parameter>. | |
67 | </para> | |
68 | </listitem> | |
69 | </varlistentry> | |
70 | <varlistentry> | |
71 | <term><parameter>length</parameter></term> | |
72 | <listitem> | |
73 | <para> | |
74 | Specifies the address of a variable into which is written the number of characters copied into <parameter>name</parameter>. | |
75 | </para> | |
76 | </listitem> | |
77 | </varlistentry> | |
78 | <varlistentry> | |
79 | <term><parameter>name</parameter></term> | |
80 | <listitem> | |
81 | <para> | |
82 | Specifies the address of a buffer that will receive the name of the specified shader subroutine uniform. | |
83 | </para> | |
84 | </listitem> | |
85 | </varlistentry> | |
86 | </variablelist> | |
87 | </refsect1> | |
88 | <refsect1 id="description"><title>Description</title> | |
89 | <para> | |
90 | <function>glGetActiveSubroutineUniformName</function> retrieves the name of an active shader subroutine uniform. | |
91 | <parameter>program</parameter> contains the name of the program containing the uniform. <parameter>shadertype</parameter> | |
92 | specifies the stage for which which the uniform location, given by <parameter>index</parameter>, is valid. <parameter>index</parameter> | |
93 | must be between zero and the value of <constant>GL_ACTIVE_SUBROUTINE_UNIFORMS</constant> minus one for the | |
94 | shader stage. | |
95 | </para> | |
96 | <para> | |
97 | The uniform name is returned as a null-terminated string in <parameter>name</parameter>. The actual number of characters | |
98 | written into <parameter>name</parameter>, excluding the null terminator is returned in <parameter>length</parameter>. | |
99 | If <parameter>length</parameter> is <constant>NULL</constant>, no length is returned. The maximum number of characters | |
100 | that may be written into <parameter>name</parameter>, including the null terminator, is specified by <parameter>bufsize</parameter>. | |
101 | The length of the longest subroutine uniform name in <parameter>program</parameter> and <parameter>shadertype</parameter> is given | |
102 | by the value of <constant>GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH</constant>, which can be queried with | |
103 | <citerefentry><refentrytitle>glGetProgramStage</refentrytitle></citerefentry>. | |
104 | </para> | |
105 | </refsect1> | |
106 | <refsect1 id="errors"><title>Errors</title> | |
107 | <para> | |
108 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>shadertype</parameter> or <parameter>pname</parameter> | |
109 | is not one of the accepted values. | |
110 | </para> | |
111 | <para> | |
112 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>index</parameter> is greater than or equal to | |
113 | the value of <constant>GL_ACTIVE_SUBROUTINES</constant>. | |
114 | </para> | |
115 | <para> | |
116 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>program</parameter> is not the name of an | |
117 | existing program object. | |
118 | </para> | |
119 | </refsect1> | |
120 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
121 | <para> | |
122 | <citerefentry><refentrytitle>glGetProgramStage</refentrytitle></citerefentry> with argument <constant>GL_ACTIVE_SUBROUTINE_UNIFORMS</constant> | |
123 | </para> | |
124 | </refsect1> | |
125 | <refsect1 id="seealso"><title>See Also</title> | |
126 | <para> | |
127 | <citerefentry><refentrytitle>glGetSubroutineIndex</refentrytitle></citerefentry>, | |
128 | <citerefentry><refentrytitle>glGetActiveSubroutineUniform</refentrytitle></citerefentry>, | |
129 | <citerefentry><refentrytitle>glGetProgramStage</refentrytitle></citerefentry> | |
130 | </para> | |
131 | </refsect1> | |
132 | <refsect1 id="Copyright"><title>Copyright</title> | |
133 | <para> | |
134 | Copyright <trademark class="copyright"></trademark> 2010 Khronos Group. | |
135 | This material may be distributed subject to the terms and conditions set forth in | |
136 | the Open Publication License, v 1.0, 8 June 1999. | |
137 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>. | |
138 | </para> | |
139 | </refsect1> | |
140 | </refentry> |