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">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>gl_SampleID
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>gl_SampleID
</refname>
17 <refpurpose>contains the index of the sample currently being processed
</refpurpose>
19 <refsynopsisdiv><title>Declaration
</title>
21 <function>in int gl_SampleID;
</function>
24 <refsect1 id=
"description"><title>Description
</title>
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.
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
41 <refsect1 id=
"versions"><title>Version Support
</title>
42 <informaltable frame=
"topbot">
47 <entry>gl_SampleID
</entry>#newin40#
53 <refsect1 id=
"seealso"><title>See Also
</title>
55 <citerefentry><refentrytitle>gl_SamplePosition
</refentrytitle></citerefentry>,
56 <citerefentry><refentrytitle>gl_NumSamples
</refentrytitle></citerefentry>
59 <refsect1 id=
"Copyright"><title>Copyright
</title>
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>.