rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man3 / glBindFragDataLocationIndexed.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="glBindFragDataLocationIndexed">\r
5 <refmeta>\r
6 <refmetainfo>\r
7 <copyright>\r
8 <year>2010</year>\r
9 <holder>Khronos Group</holder>\r
10 </copyright>\r
11 </refmetainfo>\r
12 <refentrytitle>glBindFragDataLocationIndexed</refentrytitle>\r
13 <manvolnum>3G</manvolnum>\r
14 </refmeta>\r
15 <refnamediv>\r
16 <refname>glBindFragDataLocationIndexed</refname>\r
17 <refpurpose>bind a user-defined varying out variable to a fragment shader color number and index</refpurpose>\r
18 </refnamediv>\r
19 <refsynopsisdiv><title>C Specification</title>\r
20 <funcsynopsis>\r
21 <funcprototype>\r
22 <funcdef>void <function>glBindFragDataLocationIndexed</function></funcdef>\r
23 <paramdef>GLuint <parameter>program</parameter></paramdef>\r
24 <paramdef>GLuint <parameter>colorNumber</parameter></paramdef>\r
25 <paramdef>GLuint <parameter>index</parameter></paramdef>\r
26 <paramdef>const char *<parameter>name</parameter></paramdef>\r
27 </funcprototype>\r
28 </funcsynopsis>\r
29 </refsynopsisdiv>\r
30 <refsect1 id="parameters"><title>Parameters</title>\r
31 <variablelist>\r
32 <varlistentry>\r
33 <term><parameter>program</parameter></term>\r
34 <listitem>\r
35 <para>\r
36 The name of the program containing varying out variable whose binding to modify\r
37 </para>\r
38 </listitem>\r
39 </varlistentry>\r
40 <varlistentry>\r
41 <term><parameter>colorNumber</parameter></term>\r
42 <listitem>\r
43 <para>\r
44 The color number to bind the user-defined varying out variable to\r
45 </para>\r
46 </listitem>\r
47 </varlistentry>\r
48 <varlistentry>\r
49 <term><parameter>index</parameter></term>\r
50 <listitem>\r
51 <para>\r
52 The index of the color input to bind the user-defined varying out variable to\r
53 </para>\r
54 </listitem>\r
55 </varlistentry>\r
56 <varlistentry>\r
57 <term><parameter>name</parameter></term>\r
58 <listitem>\r
59 <para>\r
60 The name of the user-defined varying out variable whose binding to modify\r
61 </para>\r
62 </listitem>\r
63 </varlistentry>\r
64 </variablelist>\r
65 </refsect1>\r
66 <refsect1 id="description"><title>Description</title>\r
67 <para>\r
68 <function>glBindFragDataLocationIndexed</function> specifies that the varying out variable <parameter>name</parameter> in\r
69 <parameter>program</parameter> should be bound to fragment color <parameter>colorNumber</parameter> when the program is next\r
70 linked. <parameter>index</parameter> may be zero or one to specify that the color be used as either the first or second color\r
71 input to the blend equation, respectively.\r
72 </para>\r
73 <para>\r
74 The bindings specified by <function>glBindFragDataLocationIndexed</function> have no effect until <parameter>program</parameter>\r
75 is next linked. Bindings may be specified at any time after <parameter>program</parameter> has been created. Specifically,\r
76 they may be specified before shader objects are attached to the program. Therefore, any name may be specified in <parameter>name</parameter>,\r
77 including a name that is never used as a varying out variable in any fragment shader object. Names beginning with <constant>gl_</constant> are\r
78 reserved by the GL.\r
79 </para>\r
80 <para>\r
81 If <parameter>name</parameter> was bound previously, its assigned binding is replaced with <parameter>colorNumber</parameter> and\r
82 <parameter>index</parameter>. <parameter>name</parameter> must be a null-terminated string. <parameter>index</parameter> must be less than or equal to one,\r
83 and <parameter>colorNumber</parameter> must be less than the value of <constant>GL_MAX_DRAW_BUFFERS</constant> if <parameter>index</parameter>\r
84 is zero, and less than the value of <constant>GL_MAX_DUAL_SOURCE_DRAW_BUFFERS</constant> if index is greater than or equal to one.\r
85 </para>\r
86 <para>\r
87 In addition to the errors generated by <function>glBindFragDataLocationIndexed</function>, the\r
88 program <parameter>program</parameter> will fail to link if:\r
89 <itemizedlist>\r
90 <listitem>\r
91 <para>\r
92 The number of active outputs is greater than the value <constant>GL_MAX_DRAW_BUFFERS</constant>.\r
93 </para>\r
94 </listitem>\r
95 <listitem>\r
96 <para>\r
97 More than one varying out variable is bound to the same color number.\r
98 </para>\r
99 </listitem>\r
100 </itemizedlist>\r
101 </para>\r
102 </refsect1>\r
103 <refsect1 id="notes"><title>Notes</title>\r
104 <para>\r
105 Varying out varyings may have locations assigned explicitly in the shader text using a <code>location</code>\r
106 layout qualifier. If a shader statically assigns a location to a varying out variable in the shader text,\r
107 that location is used and any location assigned with <function>glBindFragDataLocation</function> is ignored.\r
108 </para>\r
109 </refsect1>\r
110 <refsect1 id="errors"><title>Errors</title>\r
111 <para>\r
112 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>colorNumber</parameter> is greater than or equal to <constant>GL_MAX_DRAW_BUFFERS</constant>.\r
113 </para>\r
114 <para>\r
115 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>colorNumber</parameter> is greater than or equal to <constant>GL_MAX_DUAL_SOURCE_DRAW_BUFERS</constant>\r
116 and <parameter>index</parameter> is greater than or equal to one.\r
117 </para>\r
118 <para>\r
119 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>index</parameter> is greater than one.\r
120 </para>\r
121 <para>\r
122 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>name</parameter> starts with the reserved <constant>gl_</constant> prefix.\r
123 </para>\r
124 <para>\r
125 <constant>GL_INVALID_OPERATION</constant> is generated if <function>program</function> is not the name of a program object.\r
126 </para>\r
127 </refsect1>\r
128 <refsect1 id="associatedgets"><title>Associated Gets</title>\r
129 <para>\r
130 <citerefentry><refentrytitle>glGetFragDataLocation</refentrytitle></citerefentry> with a valid program object\r
131 and the the name of a user-defined varying out variable\r
132 </para>\r
133 <para>\r
134 <citerefentry><refentrytitle>glGetFragDataIndex</refentrytitle></citerefentry> with a valid program object\r
135 and the the name of a user-defined varying out variable\r
136 </para>\r
137 </refsect1>\r
138 <refsect1 id="seealso"><title>See Also</title>\r
139 <para>\r
140 <citerefentry><refentrytitle>glCreateProgram</refentrytitle></citerefentry>,\r
141 <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>\r
142 <citerefentry><refentrytitle>glGetFragDataLocation</refentrytitle></citerefentry>,\r
143 <citerefentry><refentrytitle>glGetFragDataIndex</refentrytitle></citerefentry>\r
144 <citerefentry><refentrytitle>glBindFragDataLocation</refentrytitle></citerefentry>\r
145 </para>\r
146 </refsect1>\r
147 <refsect1 id="Copyright"><title>Copyright</title>\r
148 <para>\r
149 Copyright <trademark class="copyright"></trademark> 2010 Khronos Group. \r
150 This material may be distributed subject to the terms and conditions set forth in \r
151 the Open Publication License, v 1.0, 8 June 1999.\r
152 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r
153 </para>\r
154 </refsect1>\r
155</refentry>\r