update upstream sources
[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
c7b31271 48 #VARTABLECOLS#\r
7faf1d71 49 <thead>\r
c7b31271 50 #FUNCTABLEHEADER#\r
7faf1d71 51 <row>\r
c7b31271 52 <entry><function>gl_PrimitiveID</function> (Fragment and Geometry Languages)</entry>#newin15#\r
7faf1d71
AW
53 </row>\r
54 <row>\r
c7b31271 55 <entry><function>gl_PrimitiveID</function> (Tessellation Control and Evaluation Languages)</entry>#newin40#\r
7faf1d71
AW
56 </row>\r
57 </thead>\r
58 </tgroup>\r
59 </informaltable>\r
60 </refsect1>\r
61 <refsect1 id="seealso"><title>See Also</title>\r
62 <para>\r
63 <citerefentry><refentrytitle>gl_InstanceID</refentrytitle></citerefentry>,\r
64 <citerefentry><refentrytitle>gl_VertexID</refentrytitle></citerefentry>,\r
65 <citerefentry><refentrytitle>gl_PrimitiveIDIn</refentrytitle></citerefentry>\r
66 </para>\r
67 </refsect1>\r
68 <refsect1 id="Copyright"><title>Copyright</title>\r
69 <para>\r
70 Copyright <trademark class="copyright"></trademark> 2011 Khronos Group. \r
71 This material may be distributed subject to the terms and conditions set forth in \r
72 the Open Publication License, v 1.0, 8 June 1999.\r
73 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r
74 </para>\r
75 </refsect1>\r
76</refentry>\r