rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / manglsl / gl_PrimitiveID.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="gl_PrimitiveID">\r
5 <refmeta>\r
6 <refmetainfo>\r
7 <copyright>\r
8 <year>2011</year>\r
9 <holder>Khronos Group</holder>\r
10 </copyright>\r
11 </refmetainfo>\r
12 <refentrytitle>gl_PrimitiveID</refentrytitle>\r
13 <manvolnum>3G</manvolnum>\r
14 </refmeta>\r
15 <refnamediv>\r
16 <refname>gl_PrimitiveID</refname>\r
17 <refpurpose>contains the index of the current primitive</refpurpose>\r
18 </refnamediv>\r
19 <refsynopsisdiv><title>Declaration</title>\r
20 <funcsynopsis>\r
21 <function>in int gl_PrimitiveID;</function> (Tessellation control, tessellation evaluation and fragment languages)<sbr/>\r
22 <function>out int gl_PrimitiveID;</function> (Geometry language)\r
23 </funcsynopsis>\r
24 </refsynopsisdiv>\r
25 <refsect1 id="description"><title>Description</title>\r
26 <para>\r
27 <function>gl_PrimitiveID</function> is a tessellation control, tessellation evaluation\r
28 and fragment language input variable. For the tessellation control and tessellation\r
29 evaluation languages, it holds the number of primitives processed by\r
30 the shader since the current set of rendering primitives was started. The first\r
31 primitive processed by the drawing command is numbered zero and the primitive ID counter is incremented after every individual point, line\r
32 or triangle primitive is processed. For triangles drawn in point or line mode, the\r
33 primitive ID counter is incremented only once, even through multiple points or lines\r
34 may actually be drawn. Restarting a primitive topology using the primitive restart\r
35 index has no effect on the primitive ID counter.\r
36 </para>\r
37 <para>\r
38 In the geometry language, <function>gl_PrimitiveID</function> is an output\r
39 variable that is passed to the corresponding <function>gl_PrimitiveID</function> input\r
40 variable in the fragment shader. If no geomery shader is present then <function>gl_PrimitiveID</function>\r
41 in the fragment language behaves identically as it would in the tessellation control and evaluation\r
42 languages. If a geometry shader is present but does not write to <function>gl_PrimitiveID</function>,\r
43 the value of <function>gl_PrimitiveID</function> in the fragment shader is undefined.\r
44 </para>\r
45 </refsect1>\r
46 <refsect1 id="versions"><title>Version Support</title>\r
47 <informaltable frame="topbot">\r
48 <tgroup cols="3" align="left">\r
49 <colspec colwidth="1.1*" />\r
50 <colspec colwidth="1*" align="center" />\r
51 <colspec colwidth="1*" align="center" />\r
52 <colspec colwidth="1*" align="center" />\r
53 <colspec colwidth="1*" align="center" />\r
54 <colspec colwidth="1*" align="center" />\r
55 <colspec colwidth="1*" align="center" />\r
56 <colspec colwidth="1*" align="center" />\r
57 <colspec colwidth="1*" align="center" />\r
58 <thead>\r
59 <row>\r
60 <entry rowsep="1" align="left"><emphasis role="bold">\r
61 Variable\r
62 </emphasis></entry>\r
63 <entry rowsep="1" align="left"><emphasis role="bold">\r
64 Version 1.10\r
65 </emphasis></entry>\r
66 <entry rowsep="1" align="left"><emphasis role="bold">\r
67 Version 1.20\r
68 </emphasis></entry>\r
69 <entry rowsep="1" align="left"><emphasis role="bold">\r
70 Version 1.30\r
71 </emphasis></entry>\r
72 <entry rowsep="1" align="left"><emphasis role="bold">\r
73 Version 1.40\r
74 </emphasis></entry>\r
75 <entry rowsep="1" align="left"><emphasis role="bold">\r
76 Version 1.50\r
77 </emphasis></entry>\r
78 <entry rowsep="1" align="left"><emphasis role="bold">\r
79 Version 3.30\r
80 </emphasis></entry>\r
81 <entry rowsep="1" align="left"><emphasis role="bold">\r
82 Version 4.00\r
83 </emphasis></entry>\r
84 <entry rowsep="1" align="left"><emphasis role="bold">\r
85 Version 4.10\r
86 </emphasis></entry>\r
87 </row>\r
88 <row>\r
89 <entry>\r
90 gl_PrimitiveID\r
91 </entry>\r
92 <entry>\r
93 <emphasis>Y</emphasis> <!-- 1.10, OpenGL 2.0 -->\r
94 </entry>\r
95 <entry>\r
96 <emphasis>Y</emphasis> <!-- 1.20, OpenGL 2.1 -->\r
97 </entry>\r
98 <entry>\r
99 <emphasis>Y</emphasis> <!-- 1.30, OpenGL 3.0 -->\r
100 </entry>\r
101 <entry>\r
102 <emphasis>Y</emphasis> <!-- 1.40, OpenGL 3.1 -->\r
103 </entry>\r
104 <entry>\r
105 <emphasis>Y</emphasis> <!-- 1.50, OpenGL 3.2 -->\r
106 </entry>\r
107 <entry>\r
108 <emphasis>Y</emphasis> <!-- 3.30, OpenGL 3.3 -->\r
109 </entry>\r
110 <entry>\r
111 <emphasis>Y</emphasis> <!-- 4.00, OpenGL 4.0 -->\r
112 </entry>\r
113 <entry>\r
114 <emphasis>Y</emphasis> <!-- 4.10, OpenGL 4.1 -->\r
115 </entry>\r
116 </row>\r
117 </thead>\r
118 </tgroup>\r
119 </informaltable>\r
120 </refsect1>\r
121 <refsect1 id="seealso"><title>See Also</title>\r
122 <para>\r
123 <citerefentry><refentrytitle>gl_InstanceID</refentrytitle></citerefentry>,\r
124 <citerefentry><refentrytitle>gl_VertexID</refentrytitle></citerefentry>,\r
125 <citerefentry><refentrytitle>gl_PrimitiveIDIn</refentrytitle></citerefentry>\r
126 </para>\r
127 </refsect1>\r
128 <refsect1 id="Copyright"><title>Copyright</title>\r
129 <para>\r
130 Copyright <trademark class="copyright"></trademark> 2011 Khronos Group. \r
131 This material may be distributed subject to the terms and conditions set forth in \r
132 the Open Publication License, v 1.0, 8 June 1999.\r
133 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r
134 </para>\r
135 </refsect1>\r
136</refentry>\r