21.06.2014 Views

OpenGL 4.2 (Compatibility Profile) - April 27, 2012

OpenGL 4.2 (Compatibility Profile) - April 27, 2012

OpenGL 4.2 (Compatibility Profile) - April 27, 2012

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.10. TEXTURING 362<br />

3.10.22 Texture Image Loads and Stores<br />

The contents of a texture may be made available for shaders to read and write by<br />

binding the texture to one of a collection of image units. The GL implementation<br />

provides an array of image units numbered beginning with zero, with the total<br />

number of image units provided given by the implementation-dependent value of<br />

MAX_IMAGE_UNITS. Unlike texture image units, image units do not have a separate<br />

attachment for each texture target texture; each image unit may have only one<br />

texture bound at a time.<br />

A texture may be bound to an image unit for use by image loads and stores<br />

with the command<br />

void BindImageTexture( uint unit, uint texture, int level,<br />

boolean layered, int layer, enum access, enum format );<br />

where unit identifies the image unit, texture is the name of the texture, and level<br />

selects a single level of the texture. If texture is zero, any texture currently bound<br />

to image unit unit is unbound. If unit is greater than or equal to the value of MAX_-<br />

IMAGE_UNITS, if level or layer is less than zero, or if texture is not the name of an<br />

existing texture object, the error INVALID_VALUE is generated.<br />

If the texture identified by texture is a one-dimensional array, two-dimensional<br />

array, three-dimensional, cube map, cube map array, or two-dimensional multisample<br />

array texture, it is possible to bind either the entire texture level or a single<br />

layer or face of the texture level. If layered is TRUE, the entire level is bound. If<br />

layered is FALSE, only the single layer identified by layer will be bound. When<br />

layered is FALSE, the single bound layer is treated as a different texture target for<br />

image accesses:<br />

• one-dimensional array texture layers are treated as one-dimensional textures;<br />

• two-dimensional array, three-dimensional, cube map, cube map array texture<br />

layers are treated as two-dimensional textures; and<br />

• two-dimensional multisample array textures are treated as two-dimensional<br />

multisample textures.<br />

For cube map textures where layered is FALSE, the face is taken by mapping<br />

the layer number to a face according to table 4.13. For cube map array textures<br />

where layered is FALSE, the selected layer number is mapped to a texture layer<br />

and cube face using the following equations and mapping face to a face according<br />

to table 4.13.<br />

<strong>OpenGL</strong> <strong>4.2</strong> (<strong>Compatibility</strong> <strong>Profile</strong>) - <strong>April</strong> <strong>27</strong>, <strong>2012</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!