a040830ec74fb2498a360a3d58d2e36b20afbb4e
[clinton/guile-figl.git] / upstream-man-pages / man4 / glGetProgramResourceIndex.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="glGetProgramResourceIndex">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2012</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glGetProgramResourceIndex</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glGetProgramResourceIndex</refname>
17 <refpurpose>query the index of a named resource within a program</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>GLuint <function>glGetProgramResourceIndex</function></funcdef>
23 <paramdef>GLuint <parameter>program</parameter></paramdef>
24 <paramdef>GLenum <parameter>programInterface</parameter></paramdef>
25 <paramdef>const char * <parameter>name</parameter></paramdef>
26 </funcprototype>
27 </funcsynopsis>
28 </refsynopsisdiv>
29 <refsect1 id="parameters"><title>Parameters</title>
30 <variablelist>
31 <varlistentry>
32 <term><parameter>program</parameter></term>
33 <listitem>
34 <para>
35 The name of a program object whose resources to query.
36 </para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>programInterface</parameter></term>
41 <listitem>
42 <para>
43 A token identifying the interface within <parameter>program</parameter> containing the resource named <parameter>name</parameter>.
44 </para>
45 </listitem>
46 </varlistentry>
47 <varlistentry>
48 <term><parameter>name</parameter></term>
49 <listitem>
50 <para>
51 The name of the resource to query the index of.
52 </para>
53 </listitem>
54 </varlistentry>
55 </variablelist>
56 </refsect1>
57 <refsect1 id="description"><title>Description</title>
58 <para>
59 <function>glGetProgramResourceIndex</function> returns the unsigned
60 integer index assigned to a resource named <parameter>name</parameter> in
61 the interface type <parameter>programInterface</parameter> of program object <parameter>program</parameter>.
62 </para>
63 <para>
64 <parameter>program</parameter> must be the name of an existing program object. <parameter>programInterface</parameter>
65 is the name of the interface within <parameter>program</parameter> which contains the resource named
66 <parameter>name</parameter>and must be one of the following
67 values:
68 </para>
69 <variablelist>
70 <varlistentry>
71 <term><constant>GL_UNIFORM</constant></term>
72 <listitem>
73 <para>
74 The query is targeted at the set of active uniforms within <parameter>program</parameter>.
75 </para>
76 </listitem>
77 </varlistentry>
78 <varlistentry>
79 <term><constant>GL_UNIFORM_BLOCK</constant></term>
80 <listitem>
81 <para>
82 The query is targeted at the set of active uniform blocks within <parameter>program</parameter>.
83 </para>
84 </listitem>
85 </varlistentry>
86 <varlistentry>
87 <term><constant>GL_PROGRAM_INPUT</constant></term>
88 <listitem>
89 <para>
90 The query is targeted at the set of active input variables used by the first shader stage of <parameter>program</parameter>.
91 If <parameter>program</parameter> contains multiple shader stages then input variables from any stage other than the first
92 will not be enumerated.
93 </para>
94 </listitem>
95 </varlistentry>
96 <varlistentry>
97 <term><constant>GL_PROGRAM_OUTPUT</constant></term>
98 <listitem>
99 <para>
100 The query is targeted at the set of active output variables produced by the last shader stage of <parameter>program</parameter>.
101 If <parameter>program</parameter> contains multiple shader stages then output variables from any stage other than the last
102 will not be enumerated.
103 </para>
104 </listitem>
105 </varlistentry>
106 <varlistentry>
107 <term><constant>GL_VERTEX_SUBROUTINE</constant></term>,
108 <term><constant>GL_TESS_CONTROL_SUBROUTINE</constant></term>,
109 <term><constant>GL_TESS_EVALUATION_SUBROUTINE</constant></term>,
110 <term><constant>GL_GEOMETRY_SUBROUTINE</constant></term>,
111 <term><constant>GL_FRAGMENT_SUBROUTINE</constant></term>,
112 <term><constant>GL_COMPUTE_SUBROUTINE</constant></term>
113 <listitem>
114 <para>
115 The query is targeted at the set of active subroutines for the vertex, tessellation control, tessellation evaluation,
116 geometry, fragment and compute shader stages of <parameter>program</parameter>, respectively.
117 </para>
118 </listitem>
119 </varlistentry>
120 <varlistentry>
121 <term><constant>GL_VERTEX_SUBROUTINE_UNIFORM</constant></term>,
122 <term><constant>GL_TESS_CONTROL_SUBROUTINE_UNIFORM</constant></term>,
123 <term><constant>GL_TESS_EVALUATION_SUBROUTINE_UNIFORM</constant></term>,
124 <term><constant>GL_GEOMETRY_SUBROUTINE_UNIFORM</constant></term>,
125 <term><constant>GL_FRAGMENT_SUBROUTINE_UNIFORM</constant></term>,
126 <term><constant>GL_COMPUTE_SUBROUTINE_UNIFORM</constant></term>
127 <listitem>
128 <para>
129 The query is targeted at the set of active subroutine uniform variables used by the vertex, tessellation control, tessellation evaluation,
130 geometry, fragment and compute shader stages of <parameter>program</parameter>, respectively.
131 </para>
132 </listitem>
133 </varlistentry>
134 <varlistentry>
135 <term><constant>GL_TRANSFORM_FEEDBACK_VARYING</constant></term>
136 <listitem>
137 <para>
138 The query is targeted at the set of output variables from the last non-fragment stage of <parameter>program</parameter> that would be
139 captured if transform feedback were active.
140 </para>
141 </listitem>
142 </varlistentry>
143 <varlistentry>
144 <term><constant>GL_BUFFER_VARIABLE</constant></term>
145 <listitem>
146 <para>
147 The query is targeted at the set of active buffer variables used by <parameter>program</parameter>.
148 </para>
149 </listitem>
150 </varlistentry>
151 <varlistentry>
152 <term><constant>GL_SHADER_STORAGE_BLOCK</constant></term>
153 <listitem>
154 <para>
155 The query is targeted at the set of active shader storage blocks used by <parameter>program</parameter>.
156 </para>
157 </listitem>
158 </varlistentry>
159 </variablelist>
160 <para>
161 If <parameter>name</parameter> exactly matches the name string of one of the active resources
162 for <parameter>programInterface</parameter>, the index of the matched resource is returned.
163 Additionally, if <parameter>name</parameter> would exactly match the name string of an active
164 resource if "[0]" were appended to <parameter>name</parameter>, the index of the matched
165 resource is returned. Otherwise, <parameter>name</parameter> is considered not to be the name
166 of an active resource, and <constant>GL_INVALID_INDEX</constant> is returned.
167 </para>
168 <para>
169 For the interface <constant>GL_TRANSFORM_FEEDBACK_VARYING</constant>, the value <constant>GL_INVALID_INDEX</constant>
170 should be returned when querying the index assigned to the special names
171 <code>gl_NextBuffer</code>, <code>gl_SkipComponents1</code>, <code>gl_SkipComponents2</code>,
172 <code>gl_SkipComponents3</code>, or <code>gl_SkipComponents4</code>.
173 </para>
174 </refsect1>
175 <refsect1 id="errors"><title>Errors</title>
176 <para>
177 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>programInterface</parameter>
178 is not one of the accepted interface types.
179 </para>
180 <para>
181 Although not an error, <constant>GL_INVALID_INDEX</constant> is returned if <parameter>name</parameter>
182 is not the name of a resource within the interface identified by <parameter>programInterface</parameter>.
183 </para>
184 </refsect1>
185 <refsect1 id="seealso"><title>See Also</title>
186 <para>
187 <citerefentry><refentrytitle>glGetProgramResourceName</refentrytitle></citerefentry>,
188 <citerefentry><refentrytitle>glGetGetProgramResource</refentrytitle></citerefentry>,
189 <citerefentry><refentrytitle>glGetProgramResourceLocation</refentrytitle></citerefentry>,
190 <citerefentry><refentrytitle>glGetProgramResourceLocationIndex</refentrytitle></citerefentry>.
191 </para>
192 </refsect1>
193 <refsect1 id="Copyright"><title>Copyright</title>
194 <para>
195 Copyright <trademark class="copyright"></trademark> 2012 Khronos Group.
196 This material may be distributed subject to the terms and conditions set forth in
197 the Open Publication License, v 1.0, 8 June 1999.
198 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
199 </para>
200 </refsect1>
201 </refentry>