--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"\r
+ "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">\r
+<refentry id="gl_PrimitiveID">\r
+ <refmeta>\r
+ <refmetainfo>\r
+ <copyright>\r
+ <year>2011</year>\r
+ <holder>Khronos Group</holder>\r
+ </copyright>\r
+ </refmetainfo>\r
+ <refentrytitle>gl_PrimitiveID</refentrytitle>\r
+ <manvolnum>3G</manvolnum>\r
+ </refmeta>\r
+ <refnamediv>\r
+ <refname>gl_PrimitiveID</refname>\r
+ <refpurpose>contains the index of the current primitive</refpurpose>\r
+ </refnamediv>\r
+ <refsynopsisdiv><title>Declaration</title>\r
+ <funcsynopsis>\r
+ <function>in int gl_PrimitiveID;</function> (Tessellation control, tessellation evaluation and fragment languages)<sbr/>\r
+ <function>out int gl_PrimitiveID;</function> (Geometry language)\r
+ </funcsynopsis>\r
+ </refsynopsisdiv>\r
+ <refsect1 id="description"><title>Description</title>\r
+ <para>\r
+ <function>gl_PrimitiveID</function> is a tessellation control, tessellation evaluation\r
+ and fragment language input variable. For the tessellation control and tessellation\r
+ evaluation languages, it holds the number of primitives processed by\r
+ the shader since the current set of rendering primitives was started. The first\r
+ primitive processed by the drawing command is numbered zero and the primitive ID counter is incremented after every individual point, line\r
+ or triangle primitive is processed. For triangles drawn in point or line mode, the\r
+ primitive ID counter is incremented only once, even through multiple points or lines\r
+ may actually be drawn. Restarting a primitive topology using the primitive restart\r
+ index has no effect on the primitive ID counter.\r
+ </para>\r
+ <para>\r
+ In the geometry language, <function>gl_PrimitiveID</function> is an output\r
+ variable that is passed to the corresponding <function>gl_PrimitiveID</function> input\r
+ variable in the fragment shader. If no geomery shader is present then <function>gl_PrimitiveID</function>\r
+ in the fragment language behaves identically as it would in the tessellation control and evaluation\r
+ languages. If a geometry shader is present but does not write to <function>gl_PrimitiveID</function>,\r
+ the value of <function>gl_PrimitiveID</function> in the fragment shader is undefined.\r
+ </para>\r
+ </refsect1>\r
+ <refsect1 id="versions"><title>Version Support</title>\r
+ <informaltable frame="topbot">\r
+ <tgroup cols="3" align="left">\r
+ <colspec colwidth="1.1*" />\r
+ <colspec colwidth="1*" align="center" />\r
+ <colspec colwidth="1*" align="center" />\r
+ <colspec colwidth="1*" align="center" />\r
+ <colspec colwidth="1*" align="center" />\r
+ <colspec colwidth="1*" align="center" />\r
+ <colspec colwidth="1*" align="center" />\r
+ <colspec colwidth="1*" align="center" />\r
+ <colspec colwidth="1*" align="center" />\r
+ <thead>\r
+ <row>\r
+ <entry rowsep="1" align="left"><emphasis role="bold">\r
+ Variable\r
+ </emphasis></entry>\r
+ <entry rowsep="1" align="left"><emphasis role="bold">\r
+ Version 1.10\r
+ </emphasis></entry>\r
+ <entry rowsep="1" align="left"><emphasis role="bold">\r
+ Version 1.20\r
+ </emphasis></entry>\r
+ <entry rowsep="1" align="left"><emphasis role="bold">\r
+ Version 1.30\r
+ </emphasis></entry>\r
+ <entry rowsep="1" align="left"><emphasis role="bold">\r
+ Version 1.40\r
+ </emphasis></entry>\r
+ <entry rowsep="1" align="left"><emphasis role="bold">\r
+ Version 1.50\r
+ </emphasis></entry>\r
+ <entry rowsep="1" align="left"><emphasis role="bold">\r
+ Version 3.30\r
+ </emphasis></entry>\r
+ <entry rowsep="1" align="left"><emphasis role="bold">\r
+ Version 4.00\r
+ </emphasis></entry>\r
+ <entry rowsep="1" align="left"><emphasis role="bold">\r
+ Version 4.10\r
+ </emphasis></entry>\r
+ </row>\r
+ <row>\r
+ <entry>\r
+ gl_PrimitiveID\r
+ </entry>\r
+ <entry>\r
+ <emphasis>Y</emphasis> <!-- 1.10, OpenGL 2.0 -->\r
+ </entry>\r
+ <entry>\r
+ <emphasis>Y</emphasis> <!-- 1.20, OpenGL 2.1 -->\r
+ </entry>\r
+ <entry>\r
+ <emphasis>Y</emphasis> <!-- 1.30, OpenGL 3.0 -->\r
+ </entry>\r
+ <entry>\r
+ <emphasis>Y</emphasis> <!-- 1.40, OpenGL 3.1 -->\r
+ </entry>\r
+ <entry>\r
+ <emphasis>Y</emphasis> <!-- 1.50, OpenGL 3.2 -->\r
+ </entry>\r
+ <entry>\r
+ <emphasis>Y</emphasis> <!-- 3.30, OpenGL 3.3 -->\r
+ </entry>\r
+ <entry>\r
+ <emphasis>Y</emphasis> <!-- 4.00, OpenGL 4.0 -->\r
+ </entry>\r
+ <entry>\r
+ <emphasis>Y</emphasis> <!-- 4.10, OpenGL 4.1 -->\r
+ </entry>\r
+ </row>\r
+ </thead>\r
+ </tgroup>\r
+ </informaltable>\r
+ </refsect1>\r
+ <refsect1 id="seealso"><title>See Also</title>\r
+ <para>\r
+ <citerefentry><refentrytitle>gl_InstanceID</refentrytitle></citerefentry>,\r
+ <citerefentry><refentrytitle>gl_VertexID</refentrytitle></citerefentry>,\r
+ <citerefentry><refentrytitle>gl_PrimitiveIDIn</refentrytitle></citerefentry>\r
+ </para>\r
+ </refsect1>\r
+ <refsect1 id="Copyright"><title>Copyright</title>\r
+ <para>\r
+ Copyright <trademark class="copyright"></trademark> 2011 Khronos Group. \r
+ This material may be distributed subject to the terms and conditions set forth in \r
+ the Open Publication License, v 1.0, 8 June 1999.\r
+ <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r
+ </para>\r
+ </refsect1>\r
+</refentry>\r