GLTEXTUREVIEW(3G)

    .SH "NAME" glTextureView - initialize a texture as a data alias of another texture's data store
    .SH "C SPECIFICATION"

            .HP u void glTextureView(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);

    .SH "PARAMETERS"

        .PP texture

                    Specifies the texture object to be initialized as a view.

            .RE
            .PP target

                        Specifies the target to be used for the newly initialized texture.

                .RE
                .PP origtexture

                            Specifies the name of a texture object of which to make a view.

                    .RE
                    .PP internalFormat

                                Specifies the internal format for the newly created view.

                        .RE
                        .PP minlevel

                                    Specifies lowest level of detail of the view.

                            .RE
                            .PP numlevels

                                        Specifies the number of levels of detail to include in the view.

                                .RE
                                .PP minlayer

                                            Specifies the index of the first layer to include in the view.

                                    .RE
                                    .PP numlayers

                                                Specifies the number of layers to include in the view.

                                        .RE

                                    .SH "DESCRIPTION"
                                        .PP glTextureView initializes a texture object as an alias, or view of another texture object, sharing some or all of the parent texture's data store with the initialized texture. texture specifies a name previously reserved by a successful call to glGenTextures() but that has not yet been bound or given a target. target specifies the target for the newly initialized texture and must be compatible with the target of the parent texture, given in origtexture as specified in the following table:
                                        .TS allbox tab(:); lB lB. T{ Original Target T}:T{ Compatible New Targets T} l l l l l l l l l l l l l l l l l l l l l l. T{ GL_TEXTURE_1D T}:T{ GL_TEXTURE_1D, GL_TEXTURE_1D_ARRAY T} T{ GL_TEXTURE_2D T}:T{ GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY T} T{ GL_TEXTURE_3D T}:T{ GL_TEXTURE_3D T} T{ GL_TEXTURE_CUBE_MAP T}:T{ GL_TEXTURE_CUBE_MAP, GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY, GL_TEXTURE_CUBE_MAP_ARRAY T} T{ GL_TEXTURE_RECTANGLE T}:T{ GL_TEXTURE_RECTANGLE T} T{ GL_TEXTURE_BUFFER T}:T{ none T} T{ GL_TEXTURE_1D_ARRAY T}:T{ GL_TEXTURE_1D, GL_TEXTURE_1D_ARRAY T} T{ GL_TEXTURE_2D_ARRAY T}:T{ GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY T} T{ GL_TEXTURE_CUBE_MAP_ARRAY T}:T{ GL_TEXTURE_CUBE_MAP, GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY, GL_TEXTURE_CUBE_MAP_ARRAY T} T{ GL_TEXTURE_2D_MULTISAMPLE T}:T{ GL_TEXTURE_2D_MULTISAMPLE, GL_TEXTURE_MULTISAMPLE_ARRAY T} T{ GL_TEXTURE_2D_MULTISAMPLE_ARRAY T}:T{ GL_TEXTURE_2D_MULTISAMPLE, GL_TEXTURE_MULTISAMPLE_ARRAY T}

                                        .PP The value of GL_TEXTURE_IMMUTABLE_FORMAT for origtexture must be GL_TRUE. After initialization, texture inherits the data store of the parent texture, origtexture and is usable as a normal texture object with target target. Data in the shared store is reinterpreted with the new internal format specified by internalformat. internalformat must be compatible with the internal format of the parent texture as specified in the following table:
                                        .TS allbox tab(:); lB lB. T{ Class T}:T{ Internal Formats T} l l l l l l l l l l l l l l l l l l l l l l l l. T{ 128-bit T}:T{ GL_RGBA32F, GL_RGBA32UI, GL_RGBA32I T} T{ 96-bit T}:T{ GL_RGB32F, GL_RGB32UI, GL_RGB32I T} T{ 64-bit T}:T{ GL_RGBA16F, GL_RG32F, GL_RGBA16UI,
                                                        GL_RG32UI, GL_RGBA16I, GL_RG32I, GL_RGBA16, GL_RGBA16_SNORM T} T{ 48-bit T}:T{ GL_RGB16, GL_RGB16_SNORM, GL_RGB16F, GL_RGB16UI, GL_RGB16I T} T{ 32-bit T}:T{ GL_RG16F, GL_R11F_G11F_B10F, GL_R32F, GL_RGB10_A2UI,
                                                        GL_RGBA8UI, GL_RG16UI, GL_R32UI, GL_RGBA8I,
                                                        GL_RG16I, GL_R32I, GL_RGB10_A2, GL_RGBA8,
                                                        GL_RG16, GL_RGBA8_SNORM, GL_RG16_SNORM, GL_SRGB8_ALPHA8,
                                                        GL_RGB9_E5 T} T{ 24-bit T}:T{ GL_RGB8, GL_RGB8_SNORM, GL_SRGB8,
                                                        GL_RGB8UI, GL_RGB8I T} T{ 16-bit T}:T{ GL_R16F, GL_RG8UI, GL_R16UI, GL_RG8I,
                                                        GL_R16I, GL_RG8, GL_R16, GL_RG8_SNORM, GL_R16_SNORM T} T{ 8-bit T}:T{ GL_R8UI, GL_R8I, GL_R8, GL_R8_SNORM T} T{ GL_RGTC1_RED T}:T{ GL_COMPRESSED_RED_RGTC1, GL_COMPRESSED_SIGNED_RED_RGTC1 T} T{ GL_RGTC2_RG T}:T{ GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_SIGNED_RG_RGTC2 T} T{ GL_BPTC_UNORM T}:T{ GL_COMPRESSED_RGBA_BPTC_UNORM, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM T} T{ GL_BPTC_FLOAT T}:T{ GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT T}

                                        .PP If the original texture is an array or has multiple mipmap levels, the parameters minlayer, numlayers, minlevel, and numlevels control which of those slices and levels are considered part of the texture. The minlevel and minlayer parameters are relative to the view of the original texture. If numlayers or numlevels extend beyond the original texture, they are clamped to the max extent of the original texture.
                                        .PP If the new texture's target is GL_TEXTURE_CUBE_MAP, the clamped numlayers must be equal to 6. If the new texture's target is GL_TEXTURE_CUBE_MAP_ARRAY, then numlayers counts layer-faces rather than layers, and the clamped numlayers must be a multiple of 6. If the new texture's target is GL_TEXTURE_CUBE_MAP or GL_TEXTURE_CUBE_MAP_ARRAY, the width and height of the original texture's levels must be equal.
                                        .PP When the original texture's target is GL_TEXTURE_CUBE_MAP, the layer parameters are interpreted in the same order as if it were a GL_TEXTURE_CUBE_MAP_ARRAY with 6 layer-faces.
                                        .PP If target is GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, GL_TEXTURE_RECTANGLE, or GL_TEXTURE_2D_MULTISAMPLE, numlayers must equal 1.
                                        .PP The dimensions of the original texture must be less than or equal to the maximum supported dimensions of the new target. For example, if the original texture has a GL_TEXTURE_2D_ARRAY target and its width is greater than GL_MAX_CUBE_MAP_TEXTURE_SIZE, an error will be generated if glTextureView is called to create a GL_TEXTURE_CUBE_MAP view.
                                        .PP Texture commands that take a level or layer parameter, such as glTexSubImage2D(), interpret that parameter to be relative to the view of the texture. i.e. the mipmap level of the data store that would be updated via glTexSubImage2D() would be the sum of level and the value of GL_TEXTURE_VIEW_MIN_LEVEL.

                                    .SH "ERRORS"
                                        .PP GL_INVALID_VALUE is generated if minlayer or minlevel are larger than the greatest layer or level of origtexture.
                                        .PP GL_INVALID_OPERATION is generated if target is not compatible with the target of origtexture.
                                        .PP GL_INVALID_OPERATION is generated if the dimensions of origtexture are greater than the maximum supported dimensions for target.
                                        .PP GL_INVALID_OPERATION is generated if internalformat is not compatible with the internal format of origtexture.
                                        .PP GL_INVALID_OPERATION is generated if texture has already been bound or otherwise given a target.
                                        .PP GL_INVALID_OPERATION is generated if the value of GL_TEXTURE_IMMUTABLE_FORMAT for origtexture is not GL_TRUE.
                                        .PP GL_INVALID_OPERATION is generated if origtexture is not the name of an existing texture object.
                                        .PP GL_INVALID_VALUE is generaged if target is GL_TEXTURE_CUBE_MAP and numlayers is not 6, or if target is GL_TEXTURE_CUBE_MAP_ARRAY and numlayers is not an integer multiple of 6.
                                        .PP GL_INVALID_VALUE is generated if target is GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, GL_TEXTURE_RECTANGLE, or GL_TEXTURE_2D_MULTISAMPLE and numlayers does not equal 1.
                                        .PP GL_INVALID_VALUE is generated if texture zero or is not the name of a texture previously returned from a successful call to glGenTextures().

                                    .SH "ASSOCIATED GETS"
                                        .PP glTexParameter() with arguments GL_TEXTURE_VIEW_MIN_LEVEL, GL_TEXTURE_VIEW_NUM_LEVELS, GL_TEXTURE_VIEW_MIN_LAYER, GL_TEXTURE_VIEW_NUM_LAYERS, or GL_TEXTURE_IMMUTABLE_LEVELS.

                                    .SH "VERSION SUPPORT"
                                        .TS allbox tab(:); l l l l l l l l l l l l l. T{ glTextureView T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}

                                    .SH "SEE ALSO"
                                        .PP glTexStorage1D(), glTexStorage2D(), glTexStorage3D(), glGetTexParameter().

                                    .SH "COPYRIGHT"
                                        .PP Copyright © 2013-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. http://opencontent.org/openpub/.

COPYRIGHT
Copyright © 2013-2014 Khronos Group