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