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="glBindSampler">
9 <holder>Khronos Group</holder>
12 <refentrytitle>glBindSampler</refentrytitle>
13 <manvolnum>3G</manvolnum>
16 <refname>glBindSampler</refname>
17 <refpurpose>bind a named sampler to a texturing target</refpurpose>
19 <refsynopsisdiv><title>C Specification</title>
22 <funcdef>void <function>glBindSampler</function></funcdef>
23 <paramdef>GLuint <parameter>unit</parameter></paramdef>
24 <paramdef>GLuint <parameter>sampler</parameter></paramdef>
28 <refsect1 id="parameters"><title>Parameters</title>
31 <term><parameter>unit</parameter></term>
34 Specifies the index of the texture unit to which the sampler is bound.
39 <term><parameter>sampler</parameter></term>
42 Specifies the name of a sampler.
48 <refsect1 id="description"><title>Description</title>
50 <function>glBindSampler</function> binds <parameter>sampler</parameter> to the texture unit at index <parameter>unit</parameter>.
51 <parameter>sampler</parameter> must be zero or the name of a sampler object previously returned from a call to
52 <citerefentry><refentrytitle>glGenSamplers</refentrytitle></citerefentry>. <parameter>unit</parameter> must be less than the value
53 of <constant>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</constant>.
56 When a sampler object is bound to a texture unit, its state supersedes that of
57 the texture object bound to that texture unit. If the sampler name zero is bound to
58 a texture unit, the currently bound texture's sampler state becomes active. A single
59 sampler object may be bound to multiple texture units simultaneously.
62 <refsect1 id="notes"><title>Notes</title>
64 <function>glBindSampler</function> is available only if the GL version is 3.3 or higher.
67 <refsect1 id="errors"><title>Errors</title>
69 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>unit</parameter> is greater than or equal to the value of
70 <constant>GL_MAX_COMBIED_TEXTURE_IMAGE_UNITS</constant>.
73 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>sampler</parameter> is not zero or a name previously
74 returned from a call to <citerefentry><refentrytitle>glGenSamplers</refentrytitle></citerefentry>, or if such a name has
75 been deleted by a call to <citerefentry><refentrytitle>glDeleteSamplers</refentrytitle></citerefentry>.
78 <refsect1 id="associatedgets"><title>Associated Gets</title>
80 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_SAMPLER_BINDING</constant>
83 <refsect1 id="seealso"><title>See Also</title>
85 <citerefentry><refentrytitle>glGenSamplers</refentrytitle></citerefentry>,
86 <citerefentry><refentrytitle>glDeleteSamplers</refentrytitle></citerefentry>,
87 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>,
88 <citerefentry><refentrytitle>glSamplerParameter</refentrytitle></citerefentry>,
89 <citerefentry><refentrytitle>glGetSamplerParameter</refentrytitle></citerefentry>,
90 <citerefentry><refentrytitle>glGenTextures</refentrytitle></citerefentry>,
91 <citerefentry><refentrytitle>glBindTexture</refentrytitle></citerefentry>,
92 <citerefentry><refentrytitle>glDeleteTextures</refentrytitle></citerefentry>
95 <refsect1 id="Copyright"><title>Copyright</title>
97 Copyright <trademark class="copyright"></trademark> 2010 Khronos Group.
98 This material may be distributed subject to the terms and conditions set forth in
99 the Open Publication License, v 1.0, 8 June 1999.
100 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.