1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
|
<!DOCTYPE refentry [ <!ENTITY % mathent SYSTEM "math.ent"> %mathent; ]>
<!-- Converted by db4-upgrade version 1.1 -->
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="glBindImageTexture">
<info>
<copyright>
<year>2011-2014</year>
<holder>Khronos Group</holder>
</copyright>
</info>
<refmeta>
<refentrytitle>glBindImageTexture</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBindImageTexture</refname>
<refpurpose>bind a level of a texture to an image unit</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindImageTexture</function></funcdef>
<paramdef>GLuint <parameter>unit</parameter></paramdef>
<paramdef>GLuint <parameter>texture</parameter></paramdef>
<paramdef>GLint <parameter>level</parameter></paramdef>
<paramdef>GLboolean <parameter>layered</parameter></paramdef>
<paramdef>GLint <parameter>layer</parameter></paramdef>
<paramdef>GLenum <parameter>access</parameter></paramdef>
<paramdef>GLenum <parameter>format</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 xml:id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>unit</parameter></term>
<listitem>
<para>
Specifies the index of the image unit to which to bind the texture
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>texture</parameter></term>
<listitem>
<para>
Specifies the name of the texture to bind to the image unit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>level</parameter></term>
<listitem>
<para>
Specifies the level of the texture that is to be bound.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>layered</parameter></term>
<listitem>
<para>
Specifies whether a layered texture binding is to be established.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>layer</parameter></term>
<listitem>
<para>
If <parameter>layered</parameter> is <constant>GL_FALSE</constant>, specifies the layer of <parameter>texture</parameter> to be bound to the image unit. Ignored otherwise.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>access</parameter></term>
<listitem>
<para>
Specifies a token indicating the type of access that will be performed on the image.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>format</parameter></term>
<listitem>
<para>
Specifies the format that the elements of the image will be treated as for the purposes of formatted stores.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 xml:id="description"><title>Description</title>
<para>
<function>glBindImageTexture</function> binds a single level of a texture to an image unit for the purpose of
reading and writing it from shaders. <parameter>unit</parameter> specifies the zero-based index of the image
unit to which to bind the texture level. <parameter>texture</parameter> specifies the name of an existing texture
object to bind to the image unit. If <parameter>texture</parameter> is zero, then any existing binding to
the image unit is broken. <parameter>level</parameter> specifies the level of the texture to bind to the image
unit.
</para>
<para>
If <parameter>texture</parameter> is the name of a one-, two-, or three-dimensional array texture, a cube map
or cube map array texture, or a two-dimensional multisample array texture, then it is possible to bind either
the entire array, or only a single layer of the array to the image unit. In such cases, if <parameter>layered</parameter>
is <constant>GL_TRUE</constant>, the entire array is attached to the image unit and <parameter>layer</parameter>
is ignored. However, if <parameter>layered</parameter> is <constant>GL_FALSE</constant> then <parameter>layer</parameter>
specifies the layer of the array to attach to the image unit.
</para>
<para>
<parameter>access</parameter> specifies the access types to be performed by shaders and may be set to
<constant>GL_READ_ONLY</constant>, <constant>GL_WRITE_ONLY</constant>, or <constant>GL_READ_WRITE</constant>
to indicate read-only, write-only or read-write access, respectively. Violation of the access type specified in <parameter>access</parameter>
(for example, if a shader writes to an image bound with <parameter>access</parameter> set to <constant>GL_READ_ONLY</constant>)
will lead to undefined results, possibly including program termination.
</para>
<para>
<parameter>format</parameter> specifies the format that is to be used when performing formatted stores into the
image from shaders. <parameter>format</parameter> must be compatible with the texture's internal format and must
be one of the formats listed in the following table.
</para>
<para>
<table>
<title>Internal Image Formats</title>
<tgroup cols="2" align="left">
<colspec/>
<colspec/>
<thead>
<row>
<entry>
<emphasis role="bold"> Image Unit Format </emphasis>
</entry>
<entry>
<emphasis role="bold"> Format Qualifier </emphasis>
</entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>GL_RGBA32F</constant></entry>
<entry><code>rgba32f</code></entry>
</row>
<row>
<entry><constant>GL_RGBA16F</constant></entry>
<entry><code>rgba16f</code></entry>
</row>
<row>
<entry><constant>GL_RG32F</constant></entry>
<entry><code>rg32f</code></entry>
</row>
<row>
<entry><constant>GL_RG16F</constant></entry>
<entry><code>rg16f</code></entry>
</row>
<row>
<entry><constant>GL_R11F_G11F_B10F</constant></entry>
<entry><code>r11f_g11f_b10f</code></entry>
</row>
<row>
<entry><constant>GL_R32F</constant></entry>
<entry><code>r32f</code></entry>
</row>
<row>
<entry><constant>GL_R16F</constant></entry>
<entry><code>r16f</code></entry>
</row>
<row>
<entry><constant>GL_RGBA32UI</constant></entry>
<entry><code>rgba32ui</code></entry>
</row>
<row>
<entry><constant>GL_RGBA16UI</constant></entry>
<entry><code>rgba16ui</code></entry>
</row>
<row>
<entry><constant>GL_RGB10_A2UI</constant></entry>
<entry><code>rgb10_a2ui</code></entry>
</row>
<row>
<entry><constant>GL_RGBA8UI</constant></entry>
<entry><code>rgba8ui</code></entry>
</row>
<row>
<entry><constant>GL_RG32UI</constant></entry>
<entry><code>rg32ui</code></entry>
</row>
<row>
<entry><constant>GL_RG16UI</constant></entry>
<entry><code>rg16ui</code></entry>
</row>
<row>
<entry><constant>GL_RG8UI</constant></entry>
<entry><code>rg8ui</code></entry>
</row>
<row>
<entry><constant>GL_R32UI</constant></entry>
<entry><code>r32ui</code></entry>
</row>
<row>
<entry><constant>GL_R16UI</constant></entry>
<entry><code>r16ui</code></entry>
</row>
<row>
<entry><constant>GL_R8UI</constant></entry>
<entry><code>r8ui</code></entry>
</row>
<row>
<entry><constant>GL_RGBA32I</constant></entry>
<entry><code>rgba32i</code></entry>
</row>
<row>
<entry><constant>GL_RGBA16I</constant></entry>
<entry><code>rgba16i</code></entry>
</row>
<row>
<entry><constant>GL_RGBA8I</constant></entry>
<entry><code>rgba8i</code></entry>
</row>
<row>
<entry><constant>GL_RG32I</constant></entry>
<entry><code>rg32i</code></entry>
</row>
<row>
<entry><constant>GL_RG16I</constant></entry>
<entry><code>rg16i</code></entry>
</row>
<row>
<entry><constant>GL_RG8I</constant></entry>
<entry><code>rg8i</code></entry>
</row>
<row>
<entry><constant>GL_R32I</constant></entry>
<entry><code>r32i</code></entry>
</row>
<row>
<entry><constant>GL_R16I</constant></entry>
<entry><code>r16i</code></entry>
</row>
<row>
<entry><constant>GL_R8I</constant></entry>
<entry><code>r8i</code></entry>
</row>
<row>
<entry><constant>GL_RGBA16</constant></entry>
<entry><code>rgba16</code></entry>
</row>
<row>
<entry><constant>GL_RGB10_A2</constant></entry>
<entry><code>rgb10_a2</code></entry>
</row>
<row>
<entry><constant>GL_RGBA8</constant></entry>
<entry><code>rgba8</code></entry>
</row>
<row>
<entry><constant>GL_RG16</constant></entry>
<entry><code>rg16</code></entry>
</row>
<row>
<entry><constant>GL_RG8</constant></entry>
<entry><code>rg8</code></entry>
</row>
<row>
<entry><constant>GL_R16</constant></entry>
<entry><code>r16</code></entry>
</row>
<row>
<entry><constant>GL_R8</constant></entry>
<entry><code>r8</code></entry>
</row>
<row>
<entry><constant>GL_RGBA16_SNORM</constant></entry>
<entry><code>rgba16_snorm</code></entry>
</row>
<row>
<entry><constant>GL_RGBA8_SNORM</constant></entry>
<entry><code>rgba8_snorm</code></entry>
</row>
<row>
<entry><constant>GL_RG16_SNORM</constant></entry>
<entry><code>rg16_snorm</code></entry>
</row>
<row>
<entry><constant>GL_RG8_SNORM</constant></entry>
<entry><code>rg8_snorm</code></entry>
</row>
<row>
<entry><constant>GL_R16_SNORM</constant></entry>
<entry><code>r16_snorm</code></entry>
</row>
<row>
<entry><constant>GL_R8_SNORM</constant></entry>
<entry><code>r8_snorm</code></entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
When a texture is bound to an image unit, the <parameter>format</parameter> parameter for the image
unit need not exactly match the texture internal format as long as the formats are
considered compatible as defined in the OpenGL Specification. The matching criterion used
for a given texture may be determined by calling <citerefentry><refentrytitle>glGetTexParameter</refentrytitle></citerefentry>
with <parameter>value</parameter>
set to <constant>GL_IMAGE_FORMAT_COMPATIBILITY_TYPE</constant>, with return values of <constant>GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE</constant>
and <constant>GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS</constant>, specifying matches by size and class, respectively.
</para>
</refsect1>
<refsect1 xml:id="notes"><title>Notes</title>
<para>
The <function>glBindImageTexture</function> is available only if the GL version is 4.2 or greater.
</para>
</refsect1>
<refsect1 xml:id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>unit</parameter> greater than or equal to the
value of <constant>GL_MAX_IMAGE_UNITS</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>texture</parameter> is not the name of
an existing texture object.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>level</parameter> or <parameter>layer</parameter>
is less than zero.
</para>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>access</parameter> or <parameter>format</parameter>
is not one of the supported tokens.
</para>
</refsect1>
<refsect1 xml:id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_IMAGE_BINDING_NAME</constant>.
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_IMAGE_BINDING_LEVEL</constant>.
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_IMAGE_BINDING_LAYERED</constant>.
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_IMAGE_BINDING_LAYER</constant>.
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_IMAGE_BINDING_ACCESS</constant>.
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_IMAGE_BINDING_FORMAT</constant>.
</para>
</refsect1>
<refsect1 xml:id="versions"><title>Version Support</title>
<informaltable>
<tgroup cols="13" align="left">
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apifunchead.xml" xpointer="xpointer(/*/*)"/>
<tbody>
<row>
<entry><function>glBindImageTexture</function></entry>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='42']/*)"/>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 xml:id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenTextures</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexStorage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexStorage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexStorage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindTexture</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 xml:id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"/> 2011-2014 Khronos Group.
This material may be distributed subject to the terms and conditions set forth in
the Open Publication License, v 1.0, 8 June 1999.
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://opencontent.org/openpub/">http://opencontent.org/openpub/</link>.
</para>
</refsect1>
</refentry>
|