11591693c7b415e9869157c711fe11263c95d74eDavid LiName
21591693c7b415e9869157c711fe11263c95d74eDavid Li
31591693c7b415e9869157c711fe11263c95d74eDavid Li    MESA_texture_array
41591693c7b415e9869157c711fe11263c95d74eDavid Li
51591693c7b415e9869157c711fe11263c95d74eDavid LiName Strings
61591693c7b415e9869157c711fe11263c95d74eDavid Li
71591693c7b415e9869157c711fe11263c95d74eDavid Li    GL_MESA_texture_array
81591693c7b415e9869157c711fe11263c95d74eDavid Li
91591693c7b415e9869157c711fe11263c95d74eDavid LiContact
101591693c7b415e9869157c711fe11263c95d74eDavid Li
111591693c7b415e9869157c711fe11263c95d74eDavid Li    Ian Romanick, IBM (idr 'at' us.ibm.com)
121591693c7b415e9869157c711fe11263c95d74eDavid Li
131591693c7b415e9869157c711fe11263c95d74eDavid LiIP Status
141591693c7b415e9869157c711fe11263c95d74eDavid Li
151591693c7b415e9869157c711fe11263c95d74eDavid Li    No known IP issues.
161591693c7b415e9869157c711fe11263c95d74eDavid Li
171591693c7b415e9869157c711fe11263c95d74eDavid LiStatus
181591693c7b415e9869157c711fe11263c95d74eDavid Li
191591693c7b415e9869157c711fe11263c95d74eDavid Li    Shipping in Mesa 7.1
201591693c7b415e9869157c711fe11263c95d74eDavid Li
211591693c7b415e9869157c711fe11263c95d74eDavid LiVersion
221591693c7b415e9869157c711fe11263c95d74eDavid Li
231591693c7b415e9869157c711fe11263c95d74eDavid Li
241591693c7b415e9869157c711fe11263c95d74eDavid LiNumber
251591693c7b415e9869157c711fe11263c95d74eDavid Li
261591693c7b415e9869157c711fe11263c95d74eDavid Li    TBD
271591693c7b415e9869157c711fe11263c95d74eDavid Li
281591693c7b415e9869157c711fe11263c95d74eDavid LiDependencies
291591693c7b415e9869157c711fe11263c95d74eDavid Li
301591693c7b415e9869157c711fe11263c95d74eDavid Li    OpenGL 1.2 or GL_EXT_texture3D is required.
311591693c7b415e9869157c711fe11263c95d74eDavid Li
321591693c7b415e9869157c711fe11263c95d74eDavid Li    Support for ARB_fragment_program is assumed, but not required.
331591693c7b415e9869157c711fe11263c95d74eDavid Li
341591693c7b415e9869157c711fe11263c95d74eDavid Li    Support for ARB_fragment_program_shadow is assumed, but not required.
351591693c7b415e9869157c711fe11263c95d74eDavid Li
361591693c7b415e9869157c711fe11263c95d74eDavid Li    Support for EXT_framebuffer_object is assumed, but not required.
371591693c7b415e9869157c711fe11263c95d74eDavid Li
381591693c7b415e9869157c711fe11263c95d74eDavid Li    Written based on the wording of the OpenGL 2.0 specification and
391591693c7b415e9869157c711fe11263c95d74eDavid Li    ARB_fragment_program_shadow but not dependent on them.
401591693c7b415e9869157c711fe11263c95d74eDavid Li
411591693c7b415e9869157c711fe11263c95d74eDavid LiOverview
421591693c7b415e9869157c711fe11263c95d74eDavid Li
431591693c7b415e9869157c711fe11263c95d74eDavid Li    There are a number of circumstances where an application may wish to
441591693c7b415e9869157c711fe11263c95d74eDavid Li    blend two textures out of a larger set of textures.  Moreover, in some
451591693c7b415e9869157c711fe11263c95d74eDavid Li    cases the selected textures may vary on a per-fragment basis within
461591693c7b415e9869157c711fe11263c95d74eDavid Li    a polygon.  Several examples include:
471591693c7b415e9869157c711fe11263c95d74eDavid Li
481591693c7b415e9869157c711fe11263c95d74eDavid Li       1. High dynamic range textures.  The application stores several
491591693c7b415e9869157c711fe11263c95d74eDavid Li       different "exposures" of an image as different textures.  On a
501591693c7b415e9869157c711fe11263c95d74eDavid Li       per-fragment basis, the application selects which exposures are
511591693c7b415e9869157c711fe11263c95d74eDavid Li       used.
521591693c7b415e9869157c711fe11263c95d74eDavid Li
531591693c7b415e9869157c711fe11263c95d74eDavid Li       2. A terrain engine where the altitude of a point determines the
541591693c7b415e9869157c711fe11263c95d74eDavid Li       texture applied to it.  If the transition is from beach sand to
551591693c7b415e9869157c711fe11263c95d74eDavid Li       grass to rocks to snow, the application will store each texture
561591693c7b415e9869157c711fe11263c95d74eDavid Li       in a different texture map, and dynamically select which two
571591693c7b415e9869157c711fe11263c95d74eDavid Li       textures to blend at run-time.
581591693c7b415e9869157c711fe11263c95d74eDavid Li
591591693c7b415e9869157c711fe11263c95d74eDavid Li       3. Storing short video clips in textures.  Each depth slice is a
601591693c7b415e9869157c711fe11263c95d74eDavid Li       single frame of video.
611591693c7b415e9869157c711fe11263c95d74eDavid Li
621591693c7b415e9869157c711fe11263c95d74eDavid Li    Several solutions to this problem have been proposed, but they either
631591693c7b415e9869157c711fe11263c95d74eDavid Li    involve using a separate texture unit for each texture map or using 3D
641591693c7b415e9869157c711fe11263c95d74eDavid Li    textures without mipmaps.  Both of these options have major drawbacks.
651591693c7b415e9869157c711fe11263c95d74eDavid Li
661591693c7b415e9869157c711fe11263c95d74eDavid Li    This extension provides a third alternative that eliminates the major
671591693c7b415e9869157c711fe11263c95d74eDavid Li    drawbacks of both previous methods.  A new texture target,
681591693c7b415e9869157c711fe11263c95d74eDavid Li    TEXTURE_2D_ARRAY, is added that functions identically to TEXTURE_3D in
691591693c7b415e9869157c711fe11263c95d74eDavid Li    all aspects except the sizes of the non-base level images.  In
701591693c7b415e9869157c711fe11263c95d74eDavid Li    traditional 3D texturing, the size of the N+1 LOD is half the size
711591693c7b415e9869157c711fe11263c95d74eDavid Li    of the N LOD in all three dimensions.  For the TEXTURE_2D_ARRAY target,
721591693c7b415e9869157c711fe11263c95d74eDavid Li    the height and width of the N+1 LOD is halved, but the depth is the
731591693c7b415e9869157c711fe11263c95d74eDavid Li    same for all levels of detail. The texture then becomes an array of
741591693c7b415e9869157c711fe11263c95d74eDavid Li    2D textures.  The per-fragment texel is selected by the R texture
751591693c7b415e9869157c711fe11263c95d74eDavid Li    coordinate.
761591693c7b415e9869157c711fe11263c95d74eDavid Li
771591693c7b415e9869157c711fe11263c95d74eDavid Li    References:
781591693c7b415e9869157c711fe11263c95d74eDavid Li
791591693c7b415e9869157c711fe11263c95d74eDavid Li        http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=011557
801591693c7b415e9869157c711fe11263c95d74eDavid Li        http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=000516
811591693c7b415e9869157c711fe11263c95d74eDavid Li        http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=011903
821591693c7b415e9869157c711fe11263c95d74eDavid Li        http://www.delphi3d.net/articles/viewarticle.php?article=terraintex.htm
831591693c7b415e9869157c711fe11263c95d74eDavid Li
841591693c7b415e9869157c711fe11263c95d74eDavid LiNew Procedures and Functions
851591693c7b415e9869157c711fe11263c95d74eDavid Li
861591693c7b415e9869157c711fe11263c95d74eDavid Li    All functions come directly from EXT_texture_array.
871591693c7b415e9869157c711fe11263c95d74eDavid Li
881591693c7b415e9869157c711fe11263c95d74eDavid Li    void FramebufferTextureLayerEXT(enum target, enum attachment,
891591693c7b415e9869157c711fe11263c95d74eDavid Li                                    uint texture, int level, int layer);
901591693c7b415e9869157c711fe11263c95d74eDavid Li
911591693c7b415e9869157c711fe11263c95d74eDavid LiNew Tokens
921591693c7b415e9869157c711fe11263c95d74eDavid Li
931591693c7b415e9869157c711fe11263c95d74eDavid Li    All token names and values come directly from EXT_texture_array.
941591693c7b415e9869157c711fe11263c95d74eDavid Li
951591693c7b415e9869157c711fe11263c95d74eDavid Li    Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
961591693c7b415e9869157c711fe11263c95d74eDavid Li    the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
971591693c7b415e9869157c711fe11263c95d74eDavid Li    GetDoublev, and by the <target> parameter of TexImage3D, GetTexImage,
981591693c7b415e9869157c711fe11263c95d74eDavid Li    GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv, and
991591693c7b415e9869157c711fe11263c95d74eDavid Li    GetTexParameterfv:
1001591693c7b415e9869157c711fe11263c95d74eDavid Li
1011591693c7b415e9869157c711fe11263c95d74eDavid Li        TEXTURE_1D_ARRAY_EXT                            0x8C18
1021591693c7b415e9869157c711fe11263c95d74eDavid Li        TEXTURE_2D_ARRAY_EXT                            0x8C1A
1031591693c7b415e9869157c711fe11263c95d74eDavid Li
1041591693c7b415e9869157c711fe11263c95d74eDavid Li    Accepted by the <target> parameter of TexImage2D, TexSubImage2D,
1051591693c7b415e9869157c711fe11263c95d74eDavid Li    CopyTexImage2D, CopyTexSubImage2D, CompressedTexImage2D,
1061591693c7b415e9869157c711fe11263c95d74eDavid Li    CompressedTexSubImage2D, GetTexLevelParameteriv, and 
1071591693c7b415e9869157c711fe11263c95d74eDavid Li    GetTexLevelParameterfv:
1081591693c7b415e9869157c711fe11263c95d74eDavid Li
1091591693c7b415e9869157c711fe11263c95d74eDavid Li        TEXTURE_1D_ARRAY_EXT
1101591693c7b415e9869157c711fe11263c95d74eDavid Li        PROXY_TEXTURE_1D_ARRAY_EXT                      0x8C19
1111591693c7b415e9869157c711fe11263c95d74eDavid Li
1121591693c7b415e9869157c711fe11263c95d74eDavid Li    Accepted by the <target> parameter of TexImage3D, TexSubImage3D,
1131591693c7b415e9869157c711fe11263c95d74eDavid Li    CopyTexSubImage3D, CompressedTexImage3D, CompressedTexSubImage3D,
1141591693c7b415e9869157c711fe11263c95d74eDavid Li    GetTexLevelParameteriv, and GetTexLevelParameterfv:
1151591693c7b415e9869157c711fe11263c95d74eDavid Li
1161591693c7b415e9869157c711fe11263c95d74eDavid Li        TEXTURE_2D_ARRAY_EXT
1171591693c7b415e9869157c711fe11263c95d74eDavid Li        PROXY_TEXTURE_2D_ARRAY_EXT                      0x8C1B
1181591693c7b415e9869157c711fe11263c95d74eDavid Li
1191591693c7b415e9869157c711fe11263c95d74eDavid Li    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
1201591693c7b415e9869157c711fe11263c95d74eDavid Li    GetFloatv, and GetDoublev
1211591693c7b415e9869157c711fe11263c95d74eDavid Li
1221591693c7b415e9869157c711fe11263c95d74eDavid Li        TEXTURE_BINDING_1D_ARRAY_EXT                    0x8C1C
1231591693c7b415e9869157c711fe11263c95d74eDavid Li        TEXTURE_BINDING_2D_ARRAY_EXT                    0x8C1D
1241591693c7b415e9869157c711fe11263c95d74eDavid Li        MAX_ARRAY_TEXTURE_LAYERS_EXT                    0x88FF
1251591693c7b415e9869157c711fe11263c95d74eDavid Li
1261591693c7b415e9869157c711fe11263c95d74eDavid Li    Accepted by the <param> parameter of TexParameterf, TexParameteri,
1271591693c7b415e9869157c711fe11263c95d74eDavid Li    TexParameterfv, and TexParameteriv when the <pname> parameter is
1281591693c7b415e9869157c711fe11263c95d74eDavid Li    TEXTURE_COMPARE_MODE_ARB:
1291591693c7b415e9869157c711fe11263c95d74eDavid Li
1301591693c7b415e9869157c711fe11263c95d74eDavid Li        COMPARE_REF_DEPTH_TO_TEXTURE_EXT                0x884E
1311591693c7b415e9869157c711fe11263c95d74eDavid Li
1321591693c7b415e9869157c711fe11263c95d74eDavid Li    (Note:  COMPARE_REF_DEPTH_TO_TEXTURE_EXT is simply an alias for the
1331591693c7b415e9869157c711fe11263c95d74eDavid Li    existing COMPARE_R_TO_TEXTURE token in OpenGL 2.0; the alternate name
1341591693c7b415e9869157c711fe11263c95d74eDavid Li    reflects the fact that the R coordinate is not always used.)
1351591693c7b415e9869157c711fe11263c95d74eDavid Li
1361591693c7b415e9869157c711fe11263c95d74eDavid Li    Accepted by the <internalformat> parameter of TexImage3D and
1371591693c7b415e9869157c711fe11263c95d74eDavid Li    CompressedTexImage3D, and by the <format> parameter of
1381591693c7b415e9869157c711fe11263c95d74eDavid Li    CompressedTexSubImage3D:
1391591693c7b415e9869157c711fe11263c95d74eDavid Li
1401591693c7b415e9869157c711fe11263c95d74eDavid Li        COMPRESSED_RGB_S3TC_DXT1_EXT
1411591693c7b415e9869157c711fe11263c95d74eDavid Li        COMPRESSED_RGBA_S3TC_DXT1_EXT
1421591693c7b415e9869157c711fe11263c95d74eDavid Li        COMPRESSED_RGBA_S3TC_DXT3_EXT
1431591693c7b415e9869157c711fe11263c95d74eDavid Li        COMPRESSED_RGBA_S3TC_DXT5_EXT
1441591693c7b415e9869157c711fe11263c95d74eDavid Li
1451591693c7b415e9869157c711fe11263c95d74eDavid Li    Accepted by the <pname> parameter of
1461591693c7b415e9869157c711fe11263c95d74eDavid Li    GetFramebufferAttachmentParameterivEXT:
1471591693c7b415e9869157c711fe11263c95d74eDavid Li
1481591693c7b415e9869157c711fe11263c95d74eDavid Li        FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT          0x8CD4
1491591693c7b415e9869157c711fe11263c95d74eDavid Li
1501591693c7b415e9869157c711fe11263c95d74eDavid Li    (Note:  FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER is simply an alias for the
1511591693c7b415e9869157c711fe11263c95d74eDavid Li    FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT token provided in
1521591693c7b415e9869157c711fe11263c95d74eDavid Li    EXT_framebuffer_object.  This extension generalizes the notion of
1531591693c7b415e9869157c711fe11263c95d74eDavid Li    "<zoffset>" to include layers of an array texture.)
1541591693c7b415e9869157c711fe11263c95d74eDavid Li
1551591693c7b415e9869157c711fe11263c95d74eDavid LiAdditions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation)
1561591693c7b415e9869157c711fe11263c95d74eDavid Li
1571591693c7b415e9869157c711fe11263c95d74eDavid Li    None
1581591693c7b415e9869157c711fe11263c95d74eDavid Li
1591591693c7b415e9869157c711fe11263c95d74eDavid LiAdditions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
1601591693c7b415e9869157c711fe11263c95d74eDavid Li
1611591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.8.1 "Texture Image Specification"
1621591693c7b415e9869157c711fe11263c95d74eDavid Li
1631591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the first paragraph (page 150) to say (spec changes identical to
1641591693c7b415e9869157c711fe11263c95d74eDavid Li       EXT_texture_array):
1651591693c7b415e9869157c711fe11263c95d74eDavid Li
1661591693c7b415e9869157c711fe11263c95d74eDavid Li       "The command
1671591693c7b415e9869157c711fe11263c95d74eDavid Li
1681591693c7b415e9869157c711fe11263c95d74eDavid Li         void TexImage3D(enum target, int level, int internalformat,
1691591693c7b415e9869157c711fe11263c95d74eDavid Li                         sizei width, sizei height, sizei depth, int border,
1701591693c7b415e9869157c711fe11263c95d74eDavid Li                         enum format, enum type, void *data);
1711591693c7b415e9869157c711fe11263c95d74eDavid Li
1721591693c7b415e9869157c711fe11263c95d74eDavid Li       is used to specify a three-dimensional texture image. target must be one
1731591693c7b415e9869157c711fe11263c95d74eDavid Li       one of TEXTURE_3D for a three-dimensional texture or
1741591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_2D_ARRAY_EXT for an two-dimensional array texture.
1751591693c7b415e9869157c711fe11263c95d74eDavid Li       Additionally, target may be either PROXY_TEXTURE_3D for a
1761591693c7b415e9869157c711fe11263c95d74eDavid Li       three-dimensional proxy texture, or PROXY_TEXTURE_2D_ARRAY_EXT for a
1771591693c7b415e9869157c711fe11263c95d74eDavid Li       two-dimensional proxy array texture."
1781591693c7b415e9869157c711fe11263c95d74eDavid Li
1791591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the fourth paragraph on page 151 to say (spec changes identical
1801591693c7b415e9869157c711fe11263c95d74eDavid Li       to EXT_texture_array):
1811591693c7b415e9869157c711fe11263c95d74eDavid Li
1821591693c7b415e9869157c711fe11263c95d74eDavid Li       "Textures with a base internal format of DEPTH_COMPONENT are supported
1831591693c7b415e9869157c711fe11263c95d74eDavid Li       by texture image specification commands only if target is TEXTURE_1D,
1841591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_2D, TEXTURE_1D_ARRAY_EXT, TEXTURE_2D_ARRAY_EXT,
1851591693c7b415e9869157c711fe11263c95d74eDavid Li       PROXY_TEXTURE_1D, PROXY_TEXTURE_2D, PROXY_TEXTURE_1D_ARRAY_EXT, or
1861591693c7b415e9869157c711fe11263c95d74eDavid Li       PROXY_TEXTURE_2D_ARRAY_EXT. Using this format in conjunction with any
1871591693c7b415e9869157c711fe11263c95d74eDavid Li       other target will result in an INVALID_OPERATION error."
1881591693c7b415e9869157c711fe11263c95d74eDavid Li
1891591693c7b415e9869157c711fe11263c95d74eDavid Li
1901591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the fourth paragraph on page 156 to say (spec changes identical
1911591693c7b415e9869157c711fe11263c95d74eDavid Li       to EXT_texture_array):
1921591693c7b415e9869157c711fe11263c95d74eDavid Li       
1931591693c7b415e9869157c711fe11263c95d74eDavid Li       "The command
1941591693c7b415e9869157c711fe11263c95d74eDavid Li
1951591693c7b415e9869157c711fe11263c95d74eDavid Li         void TexImage2D(enum target, int level,
1961591693c7b415e9869157c711fe11263c95d74eDavid Li                         int internalformat, sizei width, sizei height,
1971591693c7b415e9869157c711fe11263c95d74eDavid Li                         int border, enum format, enum type, void *data);
1981591693c7b415e9869157c711fe11263c95d74eDavid Li
1991591693c7b415e9869157c711fe11263c95d74eDavid Li       is used to specify a two-dimensional texture image. target must be one
2001591693c7b415e9869157c711fe11263c95d74eDavid Li       of TEXTURE_2D for a two-dimensional texture, TEXTURE_1D_ARRAY_EXT for a
2011591693c7b415e9869157c711fe11263c95d74eDavid Li       one-dimensional array texture, or one of TEXTURE_CUBE_MAP_POSITIVE_X,
2021591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y,
2031591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or
2041591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_CUBE_MAP_NEGATIVE_Z for a cube map texture. Additionally,
2051591693c7b415e9869157c711fe11263c95d74eDavid Li       target may be either PROXY_TEXTURE_2D for a two-dimensional proxy
2061591693c7b415e9869157c711fe11263c95d74eDavid Li       texture, PROXY_TEXTURE_1D_ARRAY_EXT for a one-dimensional proxy array
2071591693c7b415e9869157c711fe11263c95d74eDavid Li       texture, or PROXY TEXTURE_CUBE_MAP for a cube map proxy texture in the
2081591693c7b415e9869157c711fe11263c95d74eDavid Li       special case discussed in section 3.8.11.  The other parameters match
2091591693c7b415e9869157c711fe11263c95d74eDavid Li       the corresponding parameters of TexImage3D.
2101591693c7b415e9869157c711fe11263c95d74eDavid Li
2111591693c7b415e9869157c711fe11263c95d74eDavid Li       For the purposes of decoding the texture image, TexImage2D is
2121591693c7b415e9869157c711fe11263c95d74eDavid Li       equivalent to calling TexImage3D with corresponding arguments and depth
2131591693c7b415e9869157c711fe11263c95d74eDavid Li       of 1, except that
2141591693c7b415e9869157c711fe11263c95d74eDavid Li
2151591693c7b415e9869157c711fe11263c95d74eDavid Li         * The border depth, d_b, is zero, and the depth of the image is
2161591693c7b415e9869157c711fe11263c95d74eDavid Li           always 1 regardless of the value of border. 
2171591693c7b415e9869157c711fe11263c95d74eDavid Li
2181591693c7b415e9869157c711fe11263c95d74eDavid Li         * The border height, h_b, is zero if <target> is
2191591693c7b415e9869157c711fe11263c95d74eDavid Li           TEXTURE_1D_ARRAY_EXT, and <border> otherwise.
2201591693c7b415e9869157c711fe11263c95d74eDavid Li
2211591693c7b415e9869157c711fe11263c95d74eDavid Li         * Convolution will be performed on the image (possibly changing its
2221591693c7b415e9869157c711fe11263c95d74eDavid Li           width and height) if SEPARABLE 2D or CONVOLUTION 2D is enabled.
2231591693c7b415e9869157c711fe11263c95d74eDavid Li
2241591693c7b415e9869157c711fe11263c95d74eDavid Li         * UNPACK SKIP IMAGES is ignored."
2251591693c7b415e9869157c711fe11263c95d74eDavid Li
2261591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.8.2 "Alternate Texture Image Specification Commands"
2271591693c7b415e9869157c711fe11263c95d74eDavid Li
2281591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the second paragraph (page 159) (spec changes identical
2291591693c7b415e9869157c711fe11263c95d74eDavid Li       to EXT_texture_array):
2301591693c7b415e9869157c711fe11263c95d74eDavid Li
2311591693c7b415e9869157c711fe11263c95d74eDavid Li       "The command
2321591693c7b415e9869157c711fe11263c95d74eDavid Li
2331591693c7b415e9869157c711fe11263c95d74eDavid Li         void CopyTexImage2D(enum target, int level,
2341591693c7b415e9869157c711fe11263c95d74eDavid Li                             enum internalformat, int x, int y, sizei width,
2351591693c7b415e9869157c711fe11263c95d74eDavid Li                             sizei height, int border);
2361591693c7b415e9869157c711fe11263c95d74eDavid Li
2371591693c7b415e9869157c711fe11263c95d74eDavid Li       defines a two-dimensional texture image in exactly the manner of
2381591693c7b415e9869157c711fe11263c95d74eDavid Li       TexImage2D, except that the image data are taken from the framebuffer
2391591693c7b415e9869157c711fe11263c95d74eDavid Li       rather than from client memory. Currently, target must be one of
2401591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_2D, TEXTURE_1D_ARRAY_EXT, TEXTURE_CUBE_MAP_POSITIVE_X,
2411591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE MAP_POSITIVE_Y,
2421591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or
2431591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_CUBE_MAP_NEGATIVE_Z.
2441591693c7b415e9869157c711fe11263c95d74eDavid Li
2451591693c7b415e9869157c711fe11263c95d74eDavid Li
2461591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the last paragraph on page 160 to say (spec changes identical
2471591693c7b415e9869157c711fe11263c95d74eDavid Li       to EXT_texture_array):
2481591693c7b415e9869157c711fe11263c95d74eDavid Li
2491591693c7b415e9869157c711fe11263c95d74eDavid Li       "Currently the target arguments of TexSubImage1D and CopyTexSubImage1D
2501591693c7b415e9869157c711fe11263c95d74eDavid Li       must be TEXTURE_1D, the target arguments of TexSubImage2D and
2511591693c7b415e9869157c711fe11263c95d74eDavid Li       CopyTexSubImage2D must be one of TEXTURE_2D, TEXTURE_1D_ARRAY_EXT,
2521591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X,
2531591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y,
2541591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_CUBE_MAP_POSITIVE_Z, or TEXTURE_CUBE_MAP_NEGATIVE_Z, and the
2551591693c7b415e9869157c711fe11263c95d74eDavid Li       target arguments of TexSubImage3D and CopyTexSubImage3D must be
2561591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_3D or TEXTURE_2D_ARRAY_EXT. ..."
2571591693c7b415e9869157c711fe11263c95d74eDavid Li
2581591693c7b415e9869157c711fe11263c95d74eDavid Li
2591591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.8.4 "Texture Parameters"
2601591693c7b415e9869157c711fe11263c95d74eDavid Li
2611591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the first paragraph (page 166) to say:
2621591693c7b415e9869157c711fe11263c95d74eDavid Li
2631591693c7b415e9869157c711fe11263c95d74eDavid Li       "Various parameters control how the texel array is treated when
2641591693c7b415e9869157c711fe11263c95d74eDavid Li       specified or changed, and when applied to a fragment. Each parameter is
2651591693c7b415e9869157c711fe11263c95d74eDavid Li       set by calling
2661591693c7b415e9869157c711fe11263c95d74eDavid Li
2671591693c7b415e9869157c711fe11263c95d74eDavid Li         void TexParameter{if}(enum target, enum pname, T param); 
2681591693c7b415e9869157c711fe11263c95d74eDavid Li         void TexParameter{if}v(enum target, enum pname, T params);
2691591693c7b415e9869157c711fe11263c95d74eDavid Li
2701591693c7b415e9869157c711fe11263c95d74eDavid Li       target is the target, either TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
2711591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT."
2721591693c7b415e9869157c711fe11263c95d74eDavid Li
2731591693c7b415e9869157c711fe11263c95d74eDavid Li
2741591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.8.8 "Texture Minification" in the section "Scale Factor and Level of Detail"
2751591693c7b415e9869157c711fe11263c95d74eDavid Li
2761591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the first paragraph (page 172) to say:
2771591693c7b415e9869157c711fe11263c95d74eDavid Li
2781591693c7b415e9869157c711fe11263c95d74eDavid Li       "Let s(x,y) be the function that associates an s texture coordinate
2791591693c7b415e9869157c711fe11263c95d74eDavid Li       with each set of window coordinates (x,y) that lie within a primitive;
2801591693c7b415e9869157c711fe11263c95d74eDavid Li       define t(x,y) and r(x,y) analogously.  Let u(x,y) = w_t * s(x,y),
2811591693c7b415e9869157c711fe11263c95d74eDavid Li       v(x,y) = h_t * t(x,y), and w(x,y) = d_t * r(x,y), where w_t, h_t,
2821591693c7b415e9869157c711fe11263c95d74eDavid Li       and d_t are as defined by equations 3.15, 3.16, and 3.17 with
2831591693c7b415e9869157c711fe11263c95d74eDavid Li       w_s, h_s, and d_s equal to the width, height, and depth of the
2841591693c7b415e9869157c711fe11263c95d74eDavid Li       image array whose level is level_base.  For a one-dimensional
2851591693c7b415e9869157c711fe11263c95d74eDavid Li       texture or a one-dimensional array texture, define v(x,y) = 0 and
2861591693c7b415e9869157c711fe11263c95d74eDavid Li       w(x,y) = 0; for a two-dimensional texture or a two-dimensional array
2871591693c7b415e9869157c711fe11263c95d74eDavid Li       texture, define w(x,y) = 0..."
2881591693c7b415e9869157c711fe11263c95d74eDavid Li
2891591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.8.8 "Texture Minification" in the section "Mipmapping"
2901591693c7b415e9869157c711fe11263c95d74eDavid Li
2911591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the third paragraph (page 174) to say:
2921591693c7b415e9869157c711fe11263c95d74eDavid Li       
2931591693c7b415e9869157c711fe11263c95d74eDavid Li       "For a two-dimensional texture, two-dimensional array texture, or
2941591693c7b415e9869157c711fe11263c95d74eDavid Li       cube map texture,"
2951591693c7b415e9869157c711fe11263c95d74eDavid Li
2961591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the fourth paragraph (page 174) to say:
2971591693c7b415e9869157c711fe11263c95d74eDavid Li
2981591693c7b415e9869157c711fe11263c95d74eDavid Li       "And for a one-dimensional texture or a one-dimensional array texture,"
2991591693c7b415e9869157c711fe11263c95d74eDavid Li
3001591693c7b415e9869157c711fe11263c95d74eDavid Li       After the first paragraph (page 175) add:
3011591693c7b415e9869157c711fe11263c95d74eDavid Li
3021591693c7b415e9869157c711fe11263c95d74eDavid Li       "For one-dimensional array textures, h_b and d_b are treated as 1,
3031591693c7b415e9869157c711fe11263c95d74eDavid Li       regardless of the actual values, when performing mipmap calculations.
3041591693c7b415e9869157c711fe11263c95d74eDavid Li       For two-dimensional array textures, d_b is always treated as one,
3051591693c7b415e9869157c711fe11263c95d74eDavid Li       regardless of the actual value, when performing mipmap calculations."
3061591693c7b415e9869157c711fe11263c95d74eDavid Li
3071591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.8.8 "Automatic Mipmap Generation" in the section "Mipmapping"
3081591693c7b415e9869157c711fe11263c95d74eDavid Li
3091591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the third paragraph (page 176) to say (spec changes identical
3101591693c7b415e9869157c711fe11263c95d74eDavid Li       to EXT_texture_array):
3111591693c7b415e9869157c711fe11263c95d74eDavid Li
3121591693c7b415e9869157c711fe11263c95d74eDavid Li       "The contents of the derived arrays are computed by repeated, filtered
3131591693c7b415e9869157c711fe11263c95d74eDavid Li       reduction of the level_base array.  For one- and two-dimensional array
3141591693c7b415e9869157c711fe11263c95d74eDavid Li       textures, each layer is filtered independently.  ..."
3151591693c7b415e9869157c711fe11263c95d74eDavid Li
3161591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.8.8 "Manual Mipmap Generation" in the section "Mipmapping"
3171591693c7b415e9869157c711fe11263c95d74eDavid Li
3181591693c7b415e9869157c711fe11263c95d74eDavid Li       Change first paragraph to say (spec changes identical to
3191591693c7b415e9869157c711fe11263c95d74eDavid Li       EXT_texture_array):
3201591693c7b415e9869157c711fe11263c95d74eDavid Li
3211591693c7b415e9869157c711fe11263c95d74eDavid Li       "Mipmaps can be generated manually with the command
3221591693c7b415e9869157c711fe11263c95d74eDavid Li
3231591693c7b415e9869157c711fe11263c95d74eDavid Li         void GenerateMipmapEXT(enum target);
3241591693c7b415e9869157c711fe11263c95d74eDavid Li
3251591693c7b415e9869157c711fe11263c95d74eDavid Li       where <target> is one of TEXTURE_1D, TEXTURE_2D, TEXTURE_CUBE_MAP,
3261591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_3D, TEXTURE_1D_ARRAY, or TEXTURE_2D_ARRAY.  Mipmap generation
3271591693c7b415e9869157c711fe11263c95d74eDavid Li       affects the texture image attached to <target>.  ..."
3281591693c7b415e9869157c711fe11263c95d74eDavid Li
3291591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.8.10 "Texture Completeness"
3301591693c7b415e9869157c711fe11263c95d74eDavid Li
3311591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the second paragaph (page 177) to say (spec changes identical
3321591693c7b415e9869157c711fe11263c95d74eDavid Li       to EXT_texture_array):
3331591693c7b415e9869157c711fe11263c95d74eDavid Li
3341591693c7b415e9869157c711fe11263c95d74eDavid Li       "For one-, two-, or three-dimensional textures and one- or
3351591693c7b415e9869157c711fe11263c95d74eDavid Li       two-dimensional array textures, a texture is complete if the following
3361591693c7b415e9869157c711fe11263c95d74eDavid Li       conditions all hold true:"
3371591693c7b415e9869157c711fe11263c95d74eDavid Li
3381591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.8.11 "Texture State and Proxy State"
3391591693c7b415e9869157c711fe11263c95d74eDavid Li
3401591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the second and third paragraphs (page 179) to say (spec changes
3411591693c7b415e9869157c711fe11263c95d74eDavid Li       identical to EXT_texture_array):
3421591693c7b415e9869157c711fe11263c95d74eDavid Li
3431591693c7b415e9869157c711fe11263c95d74eDavid Li       "In addition to image arrays for one-, two-, and three-dimensional
3441591693c7b415e9869157c711fe11263c95d74eDavid Li       textures, one- and two-dimensional array textures, and the six image
3451591693c7b415e9869157c711fe11263c95d74eDavid Li       arrays for the cube map texture, partially instantiated image arrays
3461591693c7b415e9869157c711fe11263c95d74eDavid Li       are maintained for one-, two-, and three-dimensional textures and one-
3471591693c7b415e9869157c711fe11263c95d74eDavid Li       and two-dimensional array textures.  Additionally, a single proxy image
3481591693c7b415e9869157c711fe11263c95d74eDavid Li       array is maintained for the cube map texture.  Each proxy image array
3491591693c7b415e9869157c711fe11263c95d74eDavid Li       includes width, height, depth, border width, and internal format state
3501591693c7b415e9869157c711fe11263c95d74eDavid Li       values, as well as state for the red, green, blue, alpha, luminance,
3511591693c7b415e9869157c711fe11263c95d74eDavid Li       and intensity component resolutions. Proxy image arrays do not include
3521591693c7b415e9869157c711fe11263c95d74eDavid Li       image data, nor do they include texture properties. When TexImage3D is
3531591693c7b415e9869157c711fe11263c95d74eDavid Li       executed with target specified as PROXY_TEXTURE_3D, the
3541591693c7b415e9869157c711fe11263c95d74eDavid Li       three-dimensional proxy state values of the specified level-of-detail
3551591693c7b415e9869157c711fe11263c95d74eDavid Li       are recomputed and updated. If the image array would not be supported
3561591693c7b415e9869157c711fe11263c95d74eDavid Li       by TexImage3D called with target set to TEXTURE 3D, no error is
3571591693c7b415e9869157c711fe11263c95d74eDavid Li       generated, but the proxy width, height, depth, border width, and
3581591693c7b415e9869157c711fe11263c95d74eDavid Li       component resolutions are set to zero. If the image array would be
3591591693c7b415e9869157c711fe11263c95d74eDavid Li       supported by such a call to TexImage3D, the proxy state values are set
3601591693c7b415e9869157c711fe11263c95d74eDavid Li       exactly as though the actual image array were being specified. No pixel
3611591693c7b415e9869157c711fe11263c95d74eDavid Li       data are transferred or processed in either case.
3621591693c7b415e9869157c711fe11263c95d74eDavid Li
3631591693c7b415e9869157c711fe11263c95d74eDavid Li       Proxy arrays for one- and two-dimensional textures and one- and
3641591693c7b415e9869157c711fe11263c95d74eDavid Li       two-dimensional array textures are operated on in the same way when
3651591693c7b415e9869157c711fe11263c95d74eDavid Li       TexImage1D is executed with target specified as PROXY_TEXTURE_1D,
3661591693c7b415e9869157c711fe11263c95d74eDavid Li       TexImage2D is executed with target specified as PROXY_TEXTURE_2D or
3671591693c7b415e9869157c711fe11263c95d74eDavid Li       PROXY_TEXTURE_1D_ARRAY_EXT, or TexImage3D is executed with target
3681591693c7b415e9869157c711fe11263c95d74eDavid Li       specified as PROXY_TETXURE_2D_ARRAY_EXT."
3691591693c7b415e9869157c711fe11263c95d74eDavid Li
3701591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.8.12 "Texture Objects"
3711591693c7b415e9869157c711fe11263c95d74eDavid Li
3721591693c7b415e9869157c711fe11263c95d74eDavid Li       Change section (page 180) to say (spec changes identical to 
3731591693c7b415e9869157c711fe11263c95d74eDavid Li       EXT_texture_array):
3741591693c7b415e9869157c711fe11263c95d74eDavid Li
3751591693c7b415e9869157c711fe11263c95d74eDavid Li       "In addition to the default textures TEXTURE_1D, TEXTURE_2D,
3761591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, and TEXTURE_2D_EXT,
3771591693c7b415e9869157c711fe11263c95d74eDavid Li       named one-, two-, and three-dimensional, cube map, and one- and
3781591693c7b415e9869157c711fe11263c95d74eDavid Li       two-dimensional array texture objects can be created and operated upon.
3791591693c7b415e9869157c711fe11263c95d74eDavid Li       The name space for texture objects is the unsigned integers, with zero
3801591693c7b415e9869157c711fe11263c95d74eDavid Li       reserved by the GL.
3811591693c7b415e9869157c711fe11263c95d74eDavid Li
3821591693c7b415e9869157c711fe11263c95d74eDavid Li       A texture object is created by binding an unused name to TEXTURE_1D,
3831591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or
3841591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_2D_ARRAY_EXT. The binding is effected by calling
3851591693c7b415e9869157c711fe11263c95d74eDavid Li
3861591693c7b415e9869157c711fe11263c95d74eDavid Li         void BindTexture(enum target, uint texture);
3871591693c7b415e9869157c711fe11263c95d74eDavid Li
3881591693c7b415e9869157c711fe11263c95d74eDavid Li       with <target> set to the desired texture target and <texture> set to
3891591693c7b415e9869157c711fe11263c95d74eDavid Li       the unused name.  The resulting texture object is a new state vector,
3901591693c7b415e9869157c711fe11263c95d74eDavid Li       comprising all the state values listed in section 3.8.11, set to the
3911591693c7b415e9869157c711fe11263c95d74eDavid Li       same initial values. If the new texture object is bound to TEXTURE_1D,
3921591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or
3931591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_2D_ARRAY_EXT, it is and remains a one-, two-,
3941591693c7b415e9869157c711fe11263c95d74eDavid Li       three-dimensional, cube map, one- or two-dimensional array texture
3951591693c7b415e9869157c711fe11263c95d74eDavid Li       respectively until it is deleted.
3961591693c7b415e9869157c711fe11263c95d74eDavid Li
3971591693c7b415e9869157c711fe11263c95d74eDavid Li       BindTexture may also be used to bind an existing texture object to
3981591693c7b415e9869157c711fe11263c95d74eDavid Li       either TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP,
3991591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT. The error
4001591693c7b415e9869157c711fe11263c95d74eDavid Li       INVALID_OPERATION is generated if an attempt is made to bind a texture
4011591693c7b415e9869157c711fe11263c95d74eDavid Li       object of different dimensionality than the specified target. If the
4021591693c7b415e9869157c711fe11263c95d74eDavid Li       bind is successful no change is made to the state of the bound texture
4031591693c7b415e9869157c711fe11263c95d74eDavid Li       object, and any previous binding to target is broken.
4041591693c7b415e9869157c711fe11263c95d74eDavid Li
4051591693c7b415e9869157c711fe11263c95d74eDavid Li       While a texture object is bound, GL operations on the target to which
4061591693c7b415e9869157c711fe11263c95d74eDavid Li       it is bound affect the bound object, and queries of the target to which
4071591693c7b415e9869157c711fe11263c95d74eDavid Li       it is bound return state from the bound object. If texture mapping of
4081591693c7b415e9869157c711fe11263c95d74eDavid Li       the dimensionality of the target to which a texture object is bound is
4091591693c7b415e9869157c711fe11263c95d74eDavid Li       enabled, the state of the bound texture object directs the texturing
4101591693c7b415e9869157c711fe11263c95d74eDavid Li       operation.
4111591693c7b415e9869157c711fe11263c95d74eDavid Li
4121591693c7b415e9869157c711fe11263c95d74eDavid Li       In the initial state, TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
4131591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, and TEXTURE_2D_ARRAY_EXT have
4141591693c7b415e9869157c711fe11263c95d74eDavid Li       one-, two-, three-dimensional, cube map, and one- and two-dimensional
4151591693c7b415e9869157c711fe11263c95d74eDavid Li       array texture state vectors respectively associated with them. In order
4161591693c7b415e9869157c711fe11263c95d74eDavid Li       that access to these initial textures not be lost, they are treated as
4171591693c7b415e9869157c711fe11263c95d74eDavid Li       texture objects all of whose names are 0. The initial one-, two-,
4181591693c7b415e9869157c711fe11263c95d74eDavid Li       three-dimensional, cube map, one- and two-dimensional array textures
4191591693c7b415e9869157c711fe11263c95d74eDavid Li       are therefore operated upon, queried, and applied as TEXTURE_1D,
4201591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, and
4211591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_2D_ARRAY_EXT respectively while 0 is bound to the corresponding
4221591693c7b415e9869157c711fe11263c95d74eDavid Li       targets.
4231591693c7b415e9869157c711fe11263c95d74eDavid Li
4241591693c7b415e9869157c711fe11263c95d74eDavid Li       Change second paragraph on page 181 to say (spec changes identical to 
4251591693c7b415e9869157c711fe11263c95d74eDavid Li       EXT_texture_array):
4261591693c7b415e9869157c711fe11263c95d74eDavid Li       
4271591693c7b415e9869157c711fe11263c95d74eDavid Li       "...  If a texture that is currently bound to one of the targets
4281591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP,
4291591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT is deleted, it is as
4301591693c7b415e9869157c711fe11263c95d74eDavid Li       though BindTexture had been executed with the same target and texture
4311591693c7b415e9869157c711fe11263c95d74eDavid Li       zero. ..."
4321591693c7b415e9869157c711fe11263c95d74eDavid Li
4331591693c7b415e9869157c711fe11263c95d74eDavid Li       Change second paragraph on page 182 to say (spec changes identical to 
4341591693c7b415e9869157c711fe11263c95d74eDavid Li       EXT_texture_array):
4351591693c7b415e9869157c711fe11263c95d74eDavid Li       
4361591693c7b415e9869157c711fe11263c95d74eDavid Li       "The texture object name space, including the initial one-, two-, and
4371591693c7b415e9869157c711fe11263c95d74eDavid Li       three dimensional, cube map, and one- and two-dimensional array texture
4381591693c7b415e9869157c711fe11263c95d74eDavid Li       objects, is shared among all texture units. ..."
4391591693c7b415e9869157c711fe11263c95d74eDavid Li
4401591693c7b415e9869157c711fe11263c95d74eDavid Li
4411591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.8.14 "Depth Texture Comparison Modes" in "Texture Comparison Modes"
4421591693c7b415e9869157c711fe11263c95d74eDavid Li
4431591693c7b415e9869157c711fe11263c95d74eDavid Li       Change second through fourth paragraphs (page 188) to say:
4441591693c7b415e9869157c711fe11263c95d74eDavid Li
4451591693c7b415e9869157c711fe11263c95d74eDavid Li       "Let D_t be the depth texture value, in the range [0, 1].  For
4461591693c7b415e9869157c711fe11263c95d74eDavid Li       texture lookups from one- and two-dimesional, rectangle, and
4471591693c7b415e9869157c711fe11263c95d74eDavid Li       one-dimensional array targets, let R be the interpolated <r>
4481591693c7b415e9869157c711fe11263c95d74eDavid Li       texture coordinate, clamped to the range [0, 1].  For texture lookups
4491591693c7b415e9869157c711fe11263c95d74eDavid Li       from two-dimesional array texture targets, let R be the interpolated
4501591693c7b415e9869157c711fe11263c95d74eDavid Li       <q> texture coordinate, clamped to the range [0, 1].  Then the
4511591693c7b415e9869157c711fe11263c95d74eDavid Li       effective texture value L_t, I_t, or A_t is computed as follows:
4521591693c7b415e9869157c711fe11263c95d74eDavid Li
4531591693c7b415e9869157c711fe11263c95d74eDavid Li       If the value of TEXTURE_COMPARE_MODE is NONE, then
4541591693c7b415e9869157c711fe11263c95d74eDavid Li
4551591693c7b415e9869157c711fe11263c95d74eDavid Li          r = Dt
4561591693c7b415e9869157c711fe11263c95d74eDavid Li
4571591693c7b415e9869157c711fe11263c95d74eDavid Li       If the value of TEXTURE_COMPARE_MODE is
4581591693c7b415e9869157c711fe11263c95d74eDavid Li       COMPARE_REF_DEPTH_TO_TEXTURE_EXT), then r depends on the texture
4591591693c7b415e9869157c711fe11263c95d74eDavid Li       comparison function as shown in table 3.27."
4601591693c7b415e9869157c711fe11263c95d74eDavid Li
4611591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.8.15 "Texture Application"
4621591693c7b415e9869157c711fe11263c95d74eDavid Li
4631591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the first paragraph (page 189) to say:
4641591693c7b415e9869157c711fe11263c95d74eDavid Li
4651591693c7b415e9869157c711fe11263c95d74eDavid Li       "Texturing is enabled or disabled using the generic Enable and Disable
4661591693c7b415e9869157c711fe11263c95d74eDavid Li       commands, respectively, with the symbolic constants TEXTURE_1D,
4671591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or
4681591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_2D_ARRAY_EXT to enable one-, two-, three-dimensional, cube
4691591693c7b415e9869157c711fe11263c95d74eDavid Li       map, one-dimensional array, or two-dimensional array texture,
4701591693c7b415e9869157c711fe11263c95d74eDavid Li       respectively.  If both two- and one-dimensional textures are enabled,
4711591693c7b415e9869157c711fe11263c95d74eDavid Li       the two-dimensional texture is used.  If the three-dimensional and
4721591693c7b415e9869157c711fe11263c95d74eDavid Li       either of the two- or one-dimensional textures is enabled, the
4731591693c7b415e9869157c711fe11263c95d74eDavid Li       three-dimensional texture is used.  If the cube map texture and any of
4741591693c7b415e9869157c711fe11263c95d74eDavid Li       the three-, two-, or one-dimensional textures is enabled, then cube map
4751591693c7b415e9869157c711fe11263c95d74eDavid Li       texturing is used.  If one-dimensional array texture is enabled and any
4761591693c7b415e9869157c711fe11263c95d74eDavid Li       of cube map, three-, two-, or one-dimensional textures is enabled, 
4771591693c7b415e9869157c711fe11263c95d74eDavid Li       one-dimensional array texturing is used.  If two-dimensional array
4781591693c7b415e9869157c711fe11263c95d74eDavid Li       texture is enabled and any of cube map, three-, two-, one-dimensional
4791591693c7b415e9869157c711fe11263c95d74eDavid Li       textures or one-dimensional array texture is enabled, two-dimensional
4801591693c7b415e9869157c711fe11263c95d74eDavid Li       array texturing is used..."
4811591693c7b415e9869157c711fe11263c95d74eDavid Li
4821591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.11.2 of ARB_fragment_program (Fragment Program Grammar and Restrictions):
4831591693c7b415e9869157c711fe11263c95d74eDavid Li
4841591693c7b415e9869157c711fe11263c95d74eDavid Li       (mostly add to existing grammar rules)
4851591693c7b415e9869157c711fe11263c95d74eDavid Li
4861591693c7b415e9869157c711fe11263c95d74eDavid Li       <optionName>           ::= "MESA_texture_array"
4871591693c7b415e9869157c711fe11263c95d74eDavid Li
4881591693c7b415e9869157c711fe11263c95d74eDavid Li       <texTarget>            ::= "1D"
4891591693c7b415e9869157c711fe11263c95d74eDavid Li                               | "2D"
4901591693c7b415e9869157c711fe11263c95d74eDavid Li                               | "3D"
4911591693c7b415e9869157c711fe11263c95d74eDavid Li                               | "CUBE"
4921591693c7b415e9869157c711fe11263c95d74eDavid Li                               | "RECT"
4931591693c7b415e9869157c711fe11263c95d74eDavid Li                               | <arrayTarget> (if program option is present)
4941591693c7b415e9869157c711fe11263c95d74eDavid Li                               | <shadowTarget> (if program option is present)
4951591693c7b415e9869157c711fe11263c95d74eDavid Li
4961591693c7b415e9869157c711fe11263c95d74eDavid Li       <arrayTarget>          ::= "ARRAY1D"
4971591693c7b415e9869157c711fe11263c95d74eDavid Li                               | "ARRAY2D"
4981591693c7b415e9869157c711fe11263c95d74eDavid Li
4991591693c7b415e9869157c711fe11263c95d74eDavid Li       <shadowTarget>         ::= "SHADOW1D"
5001591693c7b415e9869157c711fe11263c95d74eDavid Li                               | "SHADOW2D"
5011591693c7b415e9869157c711fe11263c95d74eDavid Li                               | "SHADOWRECT"
5021591693c7b415e9869157c711fe11263c95d74eDavid Li                               | <shadowArrayTarget> (if program option is present)
5031591693c7b415e9869157c711fe11263c95d74eDavid Li
5041591693c7b415e9869157c711fe11263c95d74eDavid Li       <shadowArrayTarget>    ::= "SHADOWARRAY1D"
5051591693c7b415e9869157c711fe11263c95d74eDavid Li                               | "SHADOWARRAY2D"
5061591693c7b415e9869157c711fe11263c95d74eDavid Li
5071591693c7b415e9869157c711fe11263c95d74eDavid Li
5081591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Add Section 3.11.4.5.4 "Texture Stack Option"
5091591693c7b415e9869157c711fe11263c95d74eDavid Li
5101591693c7b415e9869157c711fe11263c95d74eDavid Li       "If a fragment program specifies the "MESA_texture_array" program
5111591693c7b415e9869157c711fe11263c95d74eDavid Li       option, the <texTarget> rule is modified to add the texture targets
5121591693c7b415e9869157c711fe11263c95d74eDavid Li       ARRAY1D and ARRAY2D (See Section 3.11.2)."
5131591693c7b415e9869157c711fe11263c95d74eDavid Li
5141591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.11.6 "Fragment Program Texture Instruction Set"
5151591693c7b415e9869157c711fe11263c95d74eDavid Li
5161591693c7b415e9869157c711fe11263c95d74eDavid Li       (replace 1st and 2nd paragraphs with the following paragraphs)
5171591693c7b415e9869157c711fe11263c95d74eDavid Li
5181591693c7b415e9869157c711fe11263c95d74eDavid Li       "The first three texture instructions described below specify the
5191591693c7b415e9869157c711fe11263c95d74eDavid Li       mapping of 4-tuple input vectors to 4-tuple output vectors.
5201591693c7b415e9869157c711fe11263c95d74eDavid Li       The sampling of the texture works as described in section 3.8,
5211591693c7b415e9869157c711fe11263c95d74eDavid Li       except that texture environments and texture functions are not
5221591693c7b415e9869157c711fe11263c95d74eDavid Li       applicable, and the texture enables hierarchy is replaced by explicit
5231591693c7b415e9869157c711fe11263c95d74eDavid Li       references to the desired texture target (i.e., 1D, 2D, 3D, cube map,
5241591693c7b415e9869157c711fe11263c95d74eDavid Li       rectangle, ARRAY1D, ARRAY2D).  These texture instructions specify
5251591693c7b415e9869157c711fe11263c95d74eDavid Li       how the 4-tuple is mapped into the coordinates used for sampling.  The
5261591693c7b415e9869157c711fe11263c95d74eDavid Li       following function is used to describe the texture sampling in the
5271591693c7b415e9869157c711fe11263c95d74eDavid Li       descriptions below: 
5281591693c7b415e9869157c711fe11263c95d74eDavid Li
5291591693c7b415e9869157c711fe11263c95d74eDavid Li         vec4 TextureSample(vec4 coord, float lodBias, int texImageUnit,
5301591693c7b415e9869157c711fe11263c95d74eDavid Li                            enum texTarget);
5311591693c7b415e9869157c711fe11263c95d74eDavid Li
5321591693c7b415e9869157c711fe11263c95d74eDavid Li       Note that not all four components of the texture coordinates <coord>
5331591693c7b415e9869157c711fe11263c95d74eDavid Li       are used by all texture targets.  Component usage for each <texTarget>
5341591693c7b415e9869157c711fe11263c95d74eDavid Li       is defined in table X.
5351591693c7b415e9869157c711fe11263c95d74eDavid Li
5361591693c7b415e9869157c711fe11263c95d74eDavid Li                                                        coordinates used
5371591693c7b415e9869157c711fe11263c95d74eDavid Li         texTarget          Texture Type               s t r  layer  shadow
5381591693c7b415e9869157c711fe11263c95d74eDavid Li         ----------------   ---------------------      -----  -----  ------
5391591693c7b415e9869157c711fe11263c95d74eDavid Li         1D                 TEXTURE_1D                 x - -    -      -
5401591693c7b415e9869157c711fe11263c95d74eDavid Li         2D                 TEXTURE_2D                 x y -    -      -
5411591693c7b415e9869157c711fe11263c95d74eDavid Li         3D                 TEXTURE_3D                 x y z    -      -
5421591693c7b415e9869157c711fe11263c95d74eDavid Li         CUBE               TEXTURE_CUBE_MAP           x y z    -      -
5431591693c7b415e9869157c711fe11263c95d74eDavid Li         RECT               TEXTURE_RECTANGLE_ARB      x y -    -      -
5441591693c7b415e9869157c711fe11263c95d74eDavid Li         ARRAY1D            TEXTURE_1D_ARRAY_EXT       x - -    y      -
5451591693c7b415e9869157c711fe11263c95d74eDavid Li         ARRAY2D            TEXTURE_2D_ARRAY_EXT       x y -    z      -
5461591693c7b415e9869157c711fe11263c95d74eDavid Li         SHADOW1D           TEXTURE_1D                 x - -    -      z
5471591693c7b415e9869157c711fe11263c95d74eDavid Li         SHADOW2D           TEXTURE_2D                 x y -    -      z
5481591693c7b415e9869157c711fe11263c95d74eDavid Li         SHADOWRECT         TEXTURE_RECTANGLE_ARB      x y -    -      z
5491591693c7b415e9869157c711fe11263c95d74eDavid Li         SHADOWARRAY1D      TEXTURE_1D_ARRAY_EXT       x - -    y      z
5501591693c7b415e9869157c711fe11263c95d74eDavid Li         SHADOWARRAY2D      TEXTURE_2D_ARRAY_EXT       x y -    z      w
5511591693c7b415e9869157c711fe11263c95d74eDavid Li
5521591693c7b415e9869157c711fe11263c95d74eDavid Li         Table X:  Texture types accessed for each of the <texTarget>, and
5531591693c7b415e9869157c711fe11263c95d74eDavid Li         coordinate mappings.  The "coordinates used" column indicate the
5541591693c7b415e9869157c711fe11263c95d74eDavid Li         input values used for each coordinate of the texture lookup, the
5551591693c7b415e9869157c711fe11263c95d74eDavid Li         layer selector for array textures, and the reference value for
5561591693c7b415e9869157c711fe11263c95d74eDavid Li         texture comparisons."
5571591693c7b415e9869157c711fe11263c95d74eDavid Li
5581591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 3.11.6.2 "TXP: Project coordinate and map to color"
5591591693c7b415e9869157c711fe11263c95d74eDavid Li    
5601591693c7b415e9869157c711fe11263c95d74eDavid Li       Add to the end of the section:
5611591693c7b415e9869157c711fe11263c95d74eDavid Li       
5621591693c7b415e9869157c711fe11263c95d74eDavid Li       "A program will fail to load if the TXP instruction is used in
5631591693c7b415e9869157c711fe11263c95d74eDavid Li       conjunction with the SHADOWARRAY2D target."
5641591693c7b415e9869157c711fe11263c95d74eDavid Li
5651591693c7b415e9869157c711fe11263c95d74eDavid LiAdditions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment Operations)
5661591693c7b415e9869157c711fe11263c95d74eDavid Li
5671591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 4.4.2.3 "Attaching Texture Images to a Framebuffer"
5681591693c7b415e9869157c711fe11263c95d74eDavid Li
5691591693c7b415e9869157c711fe11263c95d74eDavid Li       Add to the end of the section (spec changes identical to
5701591693c7b415e9869157c711fe11263c95d74eDavid Li       EXT_texture_array):
5711591693c7b415e9869157c711fe11263c95d74eDavid Li
5721591693c7b415e9869157c711fe11263c95d74eDavid Li       "The command
5731591693c7b415e9869157c711fe11263c95d74eDavid Li
5741591693c7b415e9869157c711fe11263c95d74eDavid Li         void FramebufferTextureLayerEXT(enum target, enum attachment,
5751591693c7b415e9869157c711fe11263c95d74eDavid Li                                         uint texture, int level, int layer);
5761591693c7b415e9869157c711fe11263c95d74eDavid Li
5771591693c7b415e9869157c711fe11263c95d74eDavid Li       operates identically to FramebufferTexture3DEXT, except that it
5781591693c7b415e9869157c711fe11263c95d74eDavid Li       attaches a single layer of a three-dimensional texture or a one- or
5791591693c7b415e9869157c711fe11263c95d74eDavid Li       two-dimensional array texture.  <layer> is an integer indicating the
5801591693c7b415e9869157c711fe11263c95d74eDavid Li       layer number, and is treated identically to the <zoffset> parameter in
5811591693c7b415e9869157c711fe11263c95d74eDavid Li       FramebufferTexture3DEXT.  The error INVALID_VALUE is generated if
5821591693c7b415e9869157c711fe11263c95d74eDavid Li       <layer> is negative.  The error INVALID_OPERATION is generated if
5831591693c7b415e9869157c711fe11263c95d74eDavid Li       <texture> is non-zero and is not the name of a three dimensional
5841591693c7b415e9869157c711fe11263c95d74eDavid Li       texture or one- or two-dimensional array texture.  Unlike
5851591693c7b415e9869157c711fe11263c95d74eDavid Li       FramebufferTexture3D, no <textarget> parameter is accepted.
5861591693c7b415e9869157c711fe11263c95d74eDavid Li
5871591693c7b415e9869157c711fe11263c95d74eDavid Li       If <texture> is non-zero and the command does not result in an error,
5881591693c7b415e9869157c711fe11263c95d74eDavid Li       the framebuffer attachment state corresponding to <attachment> is
5891591693c7b415e9869157c711fe11263c95d74eDavid Li       updated as in the other FramebufferTexture commands, except that
5901591693c7b415e9869157c711fe11263c95d74eDavid Li       FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT is set to <layer>."
5911591693c7b415e9869157c711fe11263c95d74eDavid Li
5921591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 4.4.4.1 "Framebuffer Attachment Completeness"
5931591693c7b415e9869157c711fe11263c95d74eDavid Li
5941591693c7b415e9869157c711fe11263c95d74eDavid Li      Add to the end of the list of completeness rules (spec changes
5951591693c7b415e9869157c711fe11263c95d74eDavid Li      identical to EXT_texture_array):
5961591693c7b415e9869157c711fe11263c95d74eDavid Li
5971591693c7b415e9869157c711fe11263c95d74eDavid Li        "* If FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is TEXTURE and
5981591693c7b415e9869157c711fe11263c95d74eDavid Li           FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT names a one- or 
5991591693c7b415e9869157c711fe11263c95d74eDavid Li           two-dimensional array texture, then
6001591693c7b415e9869157c711fe11263c95d74eDavid Li           FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT must be smaller than the
6011591693c7b415e9869157c711fe11263c95d74eDavid Li           number of layers in the texture."
6021591693c7b415e9869157c711fe11263c95d74eDavid Li
6031591693c7b415e9869157c711fe11263c95d74eDavid LiAdditions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions)
6041591693c7b415e9869157c711fe11263c95d74eDavid Li
6051591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 5.4 "Display Lists"
6061591693c7b415e9869157c711fe11263c95d74eDavid Li
6071591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the first paragraphi on page 242 to say (spec changes
6081591693c7b415e9869157c711fe11263c95d74eDavid Li       identical to EXT_texture_array):
6091591693c7b415e9869157c711fe11263c95d74eDavid Li
6101591693c7b415e9869157c711fe11263c95d74eDavid Li       "TexImage3D, TexImage2D, TexImage1D, Histogram, and ColorTable are
6111591693c7b415e9869157c711fe11263c95d74eDavid Li       executed immediately when called with the corresponding proxy arguments
6121591693c7b415e9869157c711fe11263c95d74eDavid Li       PROXY_TEXTURE_3D or PROXY_TEXTURE_2D_ARRAY_EXT; PROXY_TEXTURE_2D,
6131591693c7b415e9869157c711fe11263c95d74eDavid Li       PROXY_TEXTURE_CUBE_MAP, or PROXY_TEXTURE_1D_ARRAY_EXT;
6141591693c7b415e9869157c711fe11263c95d74eDavid Li       PROXY_TEXTURE_1D; PROXY_HISTOGRAM; and PROXY_COLOR_TABLE,
6151591693c7b415e9869157c711fe11263c95d74eDavid Li       PROXY_POST_CONVOLUTION_COLOR_TABLE, or
6161591693c7b415e9869157c711fe11263c95d74eDavid Li       PROXY_POST_COLOR_MATRIX_COLOR_TABLE."
6171591693c7b415e9869157c711fe11263c95d74eDavid Li
6181591693c7b415e9869157c711fe11263c95d74eDavid LiAdditions to Chapter 6 of the OpenGL 2.0 Specification (State and State Requests)
6191591693c7b415e9869157c711fe11263c95d74eDavid Li
6201591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 6.1.3 "Enumerated Queries"
6211591693c7b415e9869157c711fe11263c95d74eDavid Li
6221591693c7b415e9869157c711fe11263c95d74eDavid Li       Add after the line beginning "If the value of
6231591693c7b415e9869157c711fe11263c95d74eDavid Li       FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is TEXTURE" (spec changes
6241591693c7b415e9869157c711fe11263c95d74eDavid Li       identical to EXT_texture_array):
6251591693c7b415e9869157c711fe11263c95d74eDavid Li
6261591693c7b415e9869157c711fe11263c95d74eDavid Li       "If <pname> is FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT and the
6271591693c7b415e9869157c711fe11263c95d74eDavid Li       texture object named FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT is a
6281591693c7b415e9869157c711fe11263c95d74eDavid Li       three-dimensional texture or a one- or two-dimensional array texture,
6291591693c7b415e9869157c711fe11263c95d74eDavid Li       then <params> will contain the number of texture layer attached to the
6301591693c7b415e9869157c711fe11263c95d74eDavid Li       attachment point.  Otherwise, <params> will contain the value zero."
6311591693c7b415e9869157c711fe11263c95d74eDavid Li
6321591693c7b415e9869157c711fe11263c95d74eDavid Li    -- Section 6.1.4 "Texture Queries"
6331591693c7b415e9869157c711fe11263c95d74eDavid Li    
6341591693c7b415e9869157c711fe11263c95d74eDavid Li       Change the first three paragraphs (page 248) to say (spec changes
6351591693c7b415e9869157c711fe11263c95d74eDavid Li       identical to EXT_texture_array):
6361591693c7b415e9869157c711fe11263c95d74eDavid Li
6371591693c7b415e9869157c711fe11263c95d74eDavid Li       "The command
6381591693c7b415e9869157c711fe11263c95d74eDavid Li
6391591693c7b415e9869157c711fe11263c95d74eDavid Li         void GetTexImage(enum tex, int lod, enum format,
6401591693c7b415e9869157c711fe11263c95d74eDavid Li                          enum type, void *img);
6411591693c7b415e9869157c711fe11263c95d74eDavid Li
6421591693c7b415e9869157c711fe11263c95d74eDavid Li       is used to obtain texture images. It is somewhat different from the
6431591693c7b415e9869157c711fe11263c95d74eDavid Li       other get commands; tex is a symbolic value indicating which texture
6441591693c7b415e9869157c711fe11263c95d74eDavid Li       (or texture face in the case of a cube map texture target name) is to
6451591693c7b415e9869157c711fe11263c95d74eDavid Li       be obtained.  TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_1D_ARRAY_EXT,
6461591693c7b415e9869157c711fe11263c95d74eDavid Li       and TEXTURE_2D_ARRAY_EXT indicate a one-, two-, or three-dimensional
6471591693c7b415e9869157c711fe11263c95d74eDavid Li       texture, or one- or two-dimensional array texture, respectively.
6481591693c7b415e9869157c711fe11263c95d74eDavid Li       TEXTURE_CUBE_MAP_POSITIVE_X, ...
6491591693c7b415e9869157c711fe11263c95d74eDavid Li
6501591693c7b415e9869157c711fe11263c95d74eDavid Li       GetTexImage obtains... from the first image to the last for
6511591693c7b415e9869157c711fe11263c95d74eDavid Li       three-dimensional textures.  One- and two-dimensional array textures
6521591693c7b415e9869157c711fe11263c95d74eDavid Li       are treated as two- and three-dimensional images, respectively, where
6531591693c7b415e9869157c711fe11263c95d74eDavid Li       the layers are treated as rows or images.  These groups are then...
6541591693c7b415e9869157c711fe11263c95d74eDavid Li
6551591693c7b415e9869157c711fe11263c95d74eDavid Li       For three-dimensional and two-dimensional array textures, pixel storage
6561591693c7b415e9869157c711fe11263c95d74eDavid Li       operations are applied as if the image were two-dimensional, except
6571591693c7b415e9869157c711fe11263c95d74eDavid Li       that the additional pixel storage state values PACK_IMAGE_HEIGHT and
6581591693c7b415e9869157c711fe11263c95d74eDavid Li       PACK_SKIP_IMAGES are applied. ..."
6591591693c7b415e9869157c711fe11263c95d74eDavid Li
6601591693c7b415e9869157c711fe11263c95d74eDavid LiAdditions to Appendix A of the OpenGL 2.0 Specification (Invariance)
6611591693c7b415e9869157c711fe11263c95d74eDavid Li
6621591693c7b415e9869157c711fe11263c95d74eDavid Li    None
6631591693c7b415e9869157c711fe11263c95d74eDavid Li
6641591693c7b415e9869157c711fe11263c95d74eDavid LiAdditions to the AGL/GLX/WGL Specifications
6651591693c7b415e9869157c711fe11263c95d74eDavid Li
6661591693c7b415e9869157c711fe11263c95d74eDavid Li    None
6671591693c7b415e9869157c711fe11263c95d74eDavid Li
6681591693c7b415e9869157c711fe11263c95d74eDavid LiGLX Protocol
6691591693c7b415e9869157c711fe11263c95d74eDavid Li
6701591693c7b415e9869157c711fe11263c95d74eDavid Li    None
6711591693c7b415e9869157c711fe11263c95d74eDavid Li
6721591693c7b415e9869157c711fe11263c95d74eDavid LiDependencies on ARB_fragment_program
6731591693c7b415e9869157c711fe11263c95d74eDavid Li
6741591693c7b415e9869157c711fe11263c95d74eDavid Li    If ARB_fragment_program is not supported, the changes to section 3.11
6751591693c7b415e9869157c711fe11263c95d74eDavid Li    should be ignored.
6761591693c7b415e9869157c711fe11263c95d74eDavid Li
6771591693c7b415e9869157c711fe11263c95d74eDavid LiDependencies on EXT_framebuffer_object
6781591693c7b415e9869157c711fe11263c95d74eDavid Li
6791591693c7b415e9869157c711fe11263c95d74eDavid Li    If EXT_framebuffer_object is not supported, the changes to section
6801591693c7b415e9869157c711fe11263c95d74eDavid Li    3.8.8 ("Manual Mipmap Generation"), 4.4.2.3, and 6.1.3 should be ignored.
6811591693c7b415e9869157c711fe11263c95d74eDavid Li
6821591693c7b415e9869157c711fe11263c95d74eDavid LiDependencies on EXT_texture_compression_s3tc and NV_texture_compression_vtc
6831591693c7b415e9869157c711fe11263c95d74eDavid Li
6841591693c7b415e9869157c711fe11263c95d74eDavid Li    (Identical dependency as EXT_texture_array.)
6851591693c7b415e9869157c711fe11263c95d74eDavid Li
6861591693c7b415e9869157c711fe11263c95d74eDavid Li    S3TC texture compression is supported for two-dimensional array textures.
6871591693c7b415e9869157c711fe11263c95d74eDavid Li    When <target> is TEXTURE_2D_ARRAY_EXT, each layer is stored independently
6881591693c7b415e9869157c711fe11263c95d74eDavid Li    as a compressed two-dimensional textures.  When specifying or querying
6891591693c7b415e9869157c711fe11263c95d74eDavid Li    compressed images using one of the S3TC formats, the images are provided
6901591693c7b415e9869157c711fe11263c95d74eDavid Li    and/or returned as a series of two-dimensional textures stored
6911591693c7b415e9869157c711fe11263c95d74eDavid Li    consecutively in memory, with the layer closest to zero specified first.
6921591693c7b415e9869157c711fe11263c95d74eDavid Li    For array textures, images are not arranged in 4x4x4 or 4x4x2 blocks as in
6931591693c7b415e9869157c711fe11263c95d74eDavid Li    the three-dimensional compression format provided in the
6941591693c7b415e9869157c711fe11263c95d74eDavid Li    EXT_texture_compression_vtc extension.  Pixel store parameters, including
6951591693c7b415e9869157c711fe11263c95d74eDavid Li    those specific to three-dimensional images, are ignored when compressed
6961591693c7b415e9869157c711fe11263c95d74eDavid Li    image data are provided or returned, as in the
6971591693c7b415e9869157c711fe11263c95d74eDavid Li    EXT_texture_compression_s3tc extension.
6981591693c7b415e9869157c711fe11263c95d74eDavid Li
6991591693c7b415e9869157c711fe11263c95d74eDavid Li    S3TC compression is not supported for one-dimensional texture targets in
7001591693c7b415e9869157c711fe11263c95d74eDavid Li    EXT_texture_compression_s3tc, and is not supported for one-dimensional
7011591693c7b415e9869157c711fe11263c95d74eDavid Li    array textures in this extension.  If compressed one-dimensional arrays
7021591693c7b415e9869157c711fe11263c95d74eDavid Li    are needed, use a two-dimensional texture with a height of one.
7031591693c7b415e9869157c711fe11263c95d74eDavid Li
7041591693c7b415e9869157c711fe11263c95d74eDavid Li    This extension allows the use of the four S3TC internal format types in
7051591693c7b415e9869157c711fe11263c95d74eDavid Li    TexImage3D, CompressedTexImage3D, and CompressedTexSubImage3D calls.
7061591693c7b415e9869157c711fe11263c95d74eDavid Li
7071591693c7b415e9869157c711fe11263c95d74eDavid LiErrors
7081591693c7b415e9869157c711fe11263c95d74eDavid Li
7091591693c7b415e9869157c711fe11263c95d74eDavid Li    None
7101591693c7b415e9869157c711fe11263c95d74eDavid Li
7111591693c7b415e9869157c711fe11263c95d74eDavid LiNew State
7121591693c7b415e9869157c711fe11263c95d74eDavid Li
7131591693c7b415e9869157c711fe11263c95d74eDavid Li    (add to table 6.15, p. 276)
7141591693c7b415e9869157c711fe11263c95d74eDavid Li
7151591693c7b415e9869157c711fe11263c95d74eDavid Li                                                     Initial
7161591693c7b415e9869157c711fe11263c95d74eDavid Li    Get Value                     Type   Get Command  Value Description           Sec.    Attribute
7171591693c7b415e9869157c711fe11263c95d74eDavid Li    ----------------------------  -----  -----------  ----- --------------------  ------  ---------
7181591693c7b415e9869157c711fe11263c95d74eDavid Li    TEXTURE_BINDING_1D_ARRAY_EXT  2*xZ+  GetIntegerv    0   texture object bound  3.8.12  texture
7191591693c7b415e9869157c711fe11263c95d74eDavid Li                                                            to TEXTURE_1D_ARRAY
7201591693c7b415e9869157c711fe11263c95d74eDavid Li    TEXTURE_BINDING_2D_ARRAY_EXT  2*xZ+  GetIntegerv    0   texture object bound  3.8.12  texture
7211591693c7b415e9869157c711fe11263c95d74eDavid Li                                                            to TEXTURE_2D_ARRAY
7221591693c7b415e9869157c711fe11263c95d74eDavid Li
7231591693c7b415e9869157c711fe11263c95d74eDavid Li
7241591693c7b415e9869157c711fe11263c95d74eDavid LiNew Implementation Dependent State
7251591693c7b415e9869157c711fe11263c95d74eDavid Li
7261591693c7b415e9869157c711fe11263c95d74eDavid Li    (add to Table 6.32, p. 293)
7271591693c7b415e9869157c711fe11263c95d74eDavid Li
7281591693c7b415e9869157c711fe11263c95d74eDavid Li                                                    Minimum
7291591693c7b415e9869157c711fe11263c95d74eDavid Li    Get Value                     Type  Get Command  Value  Description         Sec.  Attribute
7301591693c7b415e9869157c711fe11263c95d74eDavid Li    ----------------------------  ----  ----------- ------- ------------------  ----- ---------
7311591693c7b415e9869157c711fe11263c95d74eDavid Li    MAX_TEXTURE_ARRAY_LAYERS_EXT   Z+   GetIntegerv   64    maximum number of   3.8.1     -
7321591693c7b415e9869157c711fe11263c95d74eDavid Li                                                            layers for texture
7331591693c7b415e9869157c711fe11263c95d74eDavid Li                                                            arrays
7341591693c7b415e9869157c711fe11263c95d74eDavid Li
7351591693c7b415e9869157c711fe11263c95d74eDavid LiIssues
7361591693c7b415e9869157c711fe11263c95d74eDavid Li
7371591693c7b415e9869157c711fe11263c95d74eDavid Li    (1) Is "texture stack" a good name for this functionality?
7381591693c7b415e9869157c711fe11263c95d74eDavid Li
7391591693c7b415e9869157c711fe11263c95d74eDavid Li        NO.  The name is changed to "array texture" to match the
7401591693c7b415e9869157c711fe11263c95d74eDavid Li        nomenclature used by GL_EXT_texture_array.
7411591693c7b415e9869157c711fe11263c95d74eDavid Li
7421591693c7b415e9869157c711fe11263c95d74eDavid Li    (2) Should the R texture coordinate be treated as normalized or
7431591693c7b415e9869157c711fe11263c95d74eDavid Li    un-normalized?  If it were un-normalized, floor(R) could be thought
7441591693c7b415e9869157c711fe11263c95d74eDavid Li    of as a direct index into the array texture.  This may be more
7451591693c7b415e9869157c711fe11263c95d74eDavid Li    convenient for applications.
7461591693c7b415e9869157c711fe11263c95d74eDavid Li
7471591693c7b415e9869157c711fe11263c95d74eDavid Li        RESOLVED.  All texture coordinates are normalized.  The issue of
7481591693c7b415e9869157c711fe11263c95d74eDavid Li        un-normalized texture coordinates has been discussed in the ARB
7491591693c7b415e9869157c711fe11263c95d74eDavid Li        before and should be left for a layered extension.
7501591693c7b415e9869157c711fe11263c95d74eDavid Li
7511591693c7b415e9869157c711fe11263c95d74eDavid Li        RE-RESOLVED.  The R coordinate is un-normalized.  Accessing an array
7521591693c7b415e9869157c711fe11263c95d74eDavid Li        using [0, layers-1] coordinates is much more natural.
7531591693c7b415e9869157c711fe11263c95d74eDavid Li
7541591693c7b415e9869157c711fe11263c95d74eDavid Li    (3) How does LOD selection work for stacked textures?
7551591693c7b415e9869157c711fe11263c95d74eDavid Li
7561591693c7b415e9869157c711fe11263c95d74eDavid Li        RESOLVED.  For 2D array textures the R coordinate is ignored, and
7571591693c7b415e9869157c711fe11263c95d74eDavid Li        the LOD selection equations for 2D textures are used.  For 1D
7581591693c7b415e9869157c711fe11263c95d74eDavid Li        array textures the T coordinate is ignored, and the LOD selection
7591591693c7b415e9869157c711fe11263c95d74eDavid Li        equations for 1D textures are used.  The expected usage is in a
7601591693c7b415e9869157c711fe11263c95d74eDavid Li        fragment program with an explicit LOD selection.
7611591693c7b415e9869157c711fe11263c95d74eDavid Li
7621591693c7b415e9869157c711fe11263c95d74eDavid Li    (4) What is the maximum size of a 2D array texture?  Is it the same
7631591693c7b415e9869157c711fe11263c95d74eDavid Li    as for a 3D texture, or should a new query be added?  How about for 1D
7641591693c7b415e9869157c711fe11263c95d74eDavid Li    array textures?
7651591693c7b415e9869157c711fe11263c95d74eDavid Li
7661591693c7b415e9869157c711fe11263c95d74eDavid Li        RESOLVED.  A new query is added.
7671591693c7b415e9869157c711fe11263c95d74eDavid Li
7681591693c7b415e9869157c711fe11263c95d74eDavid Li    (5) How are array textures exposed in GLSL?
7691591693c7b415e9869157c711fe11263c95d74eDavid Li    
7701591693c7b415e9869157c711fe11263c95d74eDavid Li        RESOLVED.  Use GL_EXT_texture_array.
7711591693c7b415e9869157c711fe11263c95d74eDavid Li        
7721591693c7b415e9869157c711fe11263c95d74eDavid Li    (6) Should a 1D array texture also be exposed?
7731591693c7b415e9869157c711fe11263c95d74eDavid Li
7741591693c7b415e9869157c711fe11263c95d74eDavid Li        RESOLVED.  For orthogonality, yes.
7751591693c7b415e9869157c711fe11263c95d74eDavid Li
7761591693c7b415e9869157c711fe11263c95d74eDavid Li    (7) How are stacked textures attached to framebuffer objects?
7771591693c7b415e9869157c711fe11263c95d74eDavid Li
7781591693c7b415e9869157c711fe11263c95d74eDavid Li        RESOLVED.  Layers of both one- and two-dimensional array textures
7791591693c7b415e9869157c711fe11263c95d74eDavid Li        are attached using FreambufferTextureLayerEXT.  Once attached, the
7801591693c7b415e9869157c711fe11263c95d74eDavid Li        array texture layer behaves exactly as either a one- or
7811591693c7b415e9869157c711fe11263c95d74eDavid Li        two-dimensional texture.
7821591693c7b415e9869157c711fe11263c95d74eDavid Li
7831591693c7b415e9869157c711fe11263c95d74eDavid Li    (8) How is this extension related to GL_EXT_texture_array?
7841591693c7b415e9869157c711fe11263c95d74eDavid Li    
7851591693c7b415e9869157c711fe11263c95d74eDavid Li        This extension adapats GL_MESAX_texture_stack to the notation,
7861591693c7b415e9869157c711fe11263c95d74eDavid Li        indexing, and FBO access of GL_EXT_texture_array.  This extension
7871591693c7b415e9869157c711fe11263c95d74eDavid Li        replaces the GLSL support of GL_EXT_texture_array with
7881591693c7b415e9869157c711fe11263c95d74eDavid Li        GL_ARB_fragment_program support.
7891591693c7b415e9869157c711fe11263c95d74eDavid Li
7901591693c7b415e9869157c711fe11263c95d74eDavid Li        Assembly program support is also provided by GL_NV_gpu_program4.
7911591693c7b415e9869157c711fe11263c95d74eDavid Li        GL_NV_gpu_program4 also adds support for other features that are
7921591693c7b415e9869157c711fe11263c95d74eDavid Li        specific to Nvidia hardware, while this extension adds only support
7931591693c7b415e9869157c711fe11263c95d74eDavid Li        for array textures.
7941591693c7b415e9869157c711fe11263c95d74eDavid Li
7951591693c7b415e9869157c711fe11263c95d74eDavid Li        Much of text of this extension that has changed since
7961591693c7b415e9869157c711fe11263c95d74eDavid Li        GL_MESAX_texture_stack comes directly from either
7971591693c7b415e9869157c711fe11263c95d74eDavid Li        GL_EXT_texture_array or GL_NV_gpu_program4.
7981591693c7b415e9869157c711fe11263c95d74eDavid Li
7991591693c7b415e9869157c711fe11263c95d74eDavid LiRevision History
8001591693c7b415e9869157c711fe11263c95d74eDavid Li
8011591693c7b415e9869157c711fe11263c95d74eDavid Li    ||2005/11/15||0.1||idr||Initial draft MESAX version.||
8021591693c7b415e9869157c711fe11263c95d74eDavid Li    ||2005/12/07||0.2||idr||Added framebuffer object interactions.||
8031591693c7b415e9869157c711fe11263c95d74eDavid Li    ||2005/12/12||0.3||idr||Updated fragment program interactions.||
8041591693c7b415e9869157c711fe11263c95d74eDavid Li    ||2007/05/16||0.4||idr||Converted to MESA_texture_array.  Brought in line with EXT_texture_array and NV_gpu_program4.||
805