If the original texture is an array or has multiple mipmap levels,
the parameters <parameter>minlayer</parameter>, <parameter>numlayers</parameter>, <parameter>minlevel</parameter>, and <parameter>numlevels</parameter>
control which of those slices and levels are considered part of the texture.
The <parameter>minlevel</parameter> and <parameter>minlayer</parameter> parameters are relative to the view of the
original texture. If <parameter>numlayers</parameter> or <parameter>numlevels</parameter> extend beyond the original
texture, they are clamped to the max extent of the original texture.
</para>
<para>
If the new texture's target is <constant>GL_TEXTURE_CUBE_MAP</constant>, the clamped <parameter>numlayers</parameter>
must be equal to 6. If the new texture's target is <constant>GL_TEXTURE_CUBE_MAP_ARRAY</constant>,
then <parameter>numlayers</parameter> counts layer-faces rather than layers, and the clamped
<parameter>numlayers</parameter> must be a multiple of 6. If the new texture's target is <constant>GL_TEXTURE_CUBE_MAP</constant> or
<constant>GL_TEXTURE_CUBE_MAP_ARRAY</constant>, the width and height of the original texture's
levels must be equal.
</para>
<para>
When the original texture's target is <constant>GL_TEXTURE_CUBE_MAP</constant>, the layer
parameters are interpreted in the same order as if it were a
<constant>GL_TEXTURE_CUBE_MAP_ARRAY</constant> with 6 layer-faces.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_TEXTURE_1D</constant>, <constant>GL_TEXTURE_2D</constant>, <constant>GL_TEXTURE_3D</constant>, <constant>GL_TEXTURE_RECTANGLE</constant>, or
<constant>GL_TEXTURE_2D_MULTISAMPLE</constant>, <parameter>numlayers</parameter> must equal 1.
</para>
<para>
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 <constant>GL_TEXTURE_2D_ARRAY</constant>
target and its width is greater than <constant>GL_MAX_CUBE_MAP_TEXTURE_SIZE</constant>, an error
will be generated if <function>glTextureView</function> is called to create a <constant>GL_TEXTURE_CUBE_MAP</constant>
view.
</para>
<para>
Texture commands that take a <parameter>level</parameter> or <parameter>layer</parameter> parameter, such as
<citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>, 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
<citerefentry><refentrytitle>TexSubImage2D</refentrytitle></citerefentry> would be the sum of <parameter>level</parameter> and the value of
<constant>GL_TEXTURE_VIEW_MIN_LEVEL</constant>.
</para>
</refsect1>
<refsect1id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>minlayer</parameter> or <parameter>minlevel</parameter>
are larger than the greatest layer or level of <parameter>origtexture</parameter>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>target</parameter> is not compatible
with the target of <parameter>origtexture</parameter>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if the dimensions of <parameter>origtexture</parameter>
are greater than the maximum supported dimensions for <parameter>target</parameter>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>internalformat</parameter> is not compatible
with the internal format of <parameter>origtexture</parameter>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>texture</parameter> has already been bound
or otherwise given a target.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if the value of <constant>GL_TEXTURE_IMMUTABLE_FORMAT</constant>
for <parameter>origtexture</parameter> is not <constant>GL_TRUE</constant>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>origtexture</parameter> is not the name of an
existing texture object.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generaged if <parameter>target</parameter> is <constant>GL_TEXTURE_CUBE_MAP</constant>
and <parameter>numlayers</parameter> is not 6, or if <parameter>target</parameter> is <constant>GL_TEXTURE_CUBE_MAP_ARRAY</constant>
and <parameter>numlayers</parameter> is not an integer multiple of 6.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>target</parameter> is <constant>GL_TEXTURE_1D</constant>,
<constant>GL_TEXTURE_2D</constant>, <constant>GL_TEXTURE_3D</constant>, <constant>GL_TEXTURE_RECTANGLE</constant>, or
<constant>GL_TEXTURE_2D_MULTISAMPLE</constant> and <parameter>numlayers</parameter> does not equal 1.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>texture</parameter> zero or is not the name of a texture previously
returned from a successful call to <citerefentry><refentrytitle>glGenTextures</refentrytitle></citerefentry>.