67a566f535665e6337526f82985c1b51782b7de8
[clinton/guile-figl.git] / upstream-man-pages / manglsl / gl_SampleID.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id="gl_SampleID">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2011</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>gl_SampleID</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>gl_SampleID</refname>
17 <refpurpose>contains the index of the sample currently being processed</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>Declaration</title>
20 <funcsynopsis>
21 <function>in int gl_SampleID;</function>
22 </funcsynopsis>
23 </refsynopsisdiv>
24 <refsect1 id="description"><title>Description</title>
25 <para>
26 <function>gl_SampleID</function> is a fragment language input variable that contains
27 the index of the sample currently being processed. This variable is in the range
28 0 to <citerefentry><refentrytitle>gl_NumSamples</refentrytitle></citerefentry> - 1, where
29 <citerefentry><refentrytitle>gl_NumSamples</refentrytitle></citerefentry>
30 is the total number of samples in each fragment for the current framebuffer (and thus 1 if
31 rendering to a non-multisample buffer). Any static use of this variable in a fragment
32 shader causes the entire shader to be evaluated per-sample rather than per-fragment.
33 </para>
34 <para>
35 When rendering to a non-multisample buffer, or if multisample rasterization is disabled,
36 <function>gl_SampleID</function> will always be zero. <citerefentry><refentrytitle>gl_NumSamples</refentrytitle></citerefentry>
37 is the sample count of the framebuffer regardless of whether multisample rasterization is
38 enabled or not.
39 </para>
40 </refsect1>
41 <refsect1 id="versions"><title>Version Support</title>
42 <informaltable frame="topbot">
43 #VARTABLECOLS#
44 <thead>
45 #VARTABLEHEADER#
46 <row>
47 <entry>gl_SampleID</entry>#newin40#
48 </row>
49 </thead>
50 </tgroup>
51 </informaltable>
52 </refsect1>
53 <refsect1 id="seealso"><title>See Also</title>
54 <para>
55 <citerefentry><refentrytitle>gl_SamplePosition</refentrytitle></citerefentry>,
56 <citerefentry><refentrytitle>gl_NumSamples</refentrytitle></citerefentry>
57 </para>
58 </refsect1>
59 <refsect1 id="Copyright"><title>Copyright</title>
60 <para>
61 Copyright <trademark class="copyright"></trademark> 2011 Khronos Group.
62 This material may be distributed subject to the terms and conditions set forth in
63 the Open Publication License, v 1.0, 8 June 1999.
64 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
65 </para>
66 </refsect1>
67 </refentry>