Commit | Line | Data |
---|---|---|
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="glBindFragDataLocation">\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>glBindFragDataLocation</refentrytitle>\r | |
13 | <manvolnum>3G</manvolnum>\r | |
14 | </refmeta>\r | |
15 | <refnamediv>\r | |
16 | <refname>glBindFragDataLocation</refname>\r | |
17 | <refpurpose>bind a user-defined varying out variable to a fragment shader color number</refpurpose>\r | |
18 | </refnamediv>\r | |
19 | <refsynopsisdiv><title>C Specification</title>\r | |
20 | <funcsynopsis>\r | |
21 | <funcprototype>\r | |
22 | <funcdef>void <function>glBindFragDataLocation</function></funcdef>\r | |
23 | <paramdef>GLuint <parameter>program</parameter></paramdef>\r | |
24 | <paramdef>GLuint <parameter>colorNumber</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 the program containing varying out variable whose binding to modify\r | |
36 | </para>\r | |
37 | </listitem>\r | |
38 | </varlistentry>\r | |
39 | <varlistentry>\r | |
40 | <term><parameter>colorNumber</parameter></term>\r | |
41 | <listitem>\r | |
42 | <para>\r | |
43 | The color number to bind the user-defined varying out variable to\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 user-defined varying out variable whose binding to modify\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>glBindFragDataLocation</function> explicitly specifies the binding of the user-defined varying out variable\r | |
60 | <parameter>name</parameter> to fragment shader color number <parameter>colorNumber</parameter> for program\r | |
61 | <parameter>program</parameter>. If <parameter>name</parameter> was bound previously, its assigned binding is replaced\r | |
62 | with <parameter>colorNumber</parameter>. <parameter>name</parameter> must be a null-terminated string. <parameter>colorNumber</parameter>\r | |
63 | must be less than <constant>GL_MAX_DRAW_BUFFERS</constant>.\r | |
64 | </para>\r | |
65 | <para>\r | |
66 | The bindings specified by <function>glBindFragDataLocation</function> have no effect until <parameter>program</parameter>\r | |
67 | is next linked. Bindings may be specified at any time after <parameter>program</parameter> has been created. Specifically,\r | |
68 | they may be specified before shader objects are attached to the program. Therefore, any name may be specified in <parameter>name</parameter>,\r | |
69 | 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 | |
70 | reserved by the GL.\r | |
71 | </para>\r | |
72 | <para>\r | |
73 | In addition to the errors generated by <function>glBindFragDataLocation</function>, the\r | |
74 | program <parameter>program</parameter> will fail to link if:\r | |
75 | <itemizedlist>\r | |
76 | <listitem>\r | |
77 | <para>\r | |
78 | The number of active outputs is greater than the value <constant>GL_MAX_DRAW_BUFFERS</constant>.\r | |
79 | </para>\r | |
80 | </listitem>\r | |
81 | <listitem>\r | |
82 | <para>\r | |
83 | More than one varying out variable is bound to the same color number.\r | |
84 | </para>\r | |
85 | </listitem>\r | |
86 | </itemizedlist>\r | |
87 | </para>\r | |
88 | </refsect1>\r | |
89 | <refsect1 id="notes"><title>Notes</title>\r | |
90 | <para>\r | |
91 | Varying out varyings may have indexed locations assigned explicitly in the shader text using a <code>location</code>\r | |
92 | layout qualifier. If a shader statically assigns a location to a varying out variable in the shader text,\r | |
93 | that location is used and any location assigned with <function>glBindFragDataLocation</function> is ignored.\r | |
94 | </para>\r | |
95 | </refsect1>\r | |
96 | <refsect1 id="errors"><title>Errors</title>\r | |
97 | <para>\r | |
98 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>colorNumber</parameter> is greater than or equal to <constant>GL_MAX_DRAW_BUFFERS</constant>.\r | |
99 | </para>\r | |
100 | <para>\r | |
101 | <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>name</parameter> starts with the reserved <constant>gl_</constant> prefix.\r | |
102 | </para>\r | |
103 | <para>\r | |
104 | <constant>GL_INVALID_OPERATION</constant> is generated if <function>program</function> is not the name of a program object.\r | |
105 | </para>\r | |
106 | </refsect1>\r | |
107 | <refsect1 id="associatedgets"><title>Associated Gets</title>\r | |
108 | <para>\r | |
109 | <citerefentry><refentrytitle>glGetFragDataLocation</refentrytitle></citerefentry> with a valid program object\r | |
110 | and the the name of a user-defined varying out variable\r | |
111 | </para>\r | |
112 | </refsect1>\r | |
113 | <refsect1 id="seealso"><title>See Also</title>\r | |
114 | <para>\r | |
115 | <citerefentry><refentrytitle>glCreateProgram</refentrytitle></citerefentry>,\r | |
116 | <citerefentry><refentrytitle>glGetFragDataLocation</refentrytitle></citerefentry>\r | |
117 | </para>\r | |
118 | </refsect1>\r | |
119 | <refsect1 id="Copyright"><title>Copyright</title>\r | |
120 | <para>\r | |
121 | Copyright <trademark class="copyright"></trademark> 2010 Khronos Group. \r | |
122 | This material may be distributed subject to the terms and conditions set forth in \r | |
123 | the Open Publication License, v 1.0, 8 June 1999.\r | |
124 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r | |
125 | </para>\r | |
126 | </refsect1>\r | |
127 | </refentry>\r |