1848b8605SmrgName
2848b8605Smrg
3848b8605Smrg    MESA_texture_array
4848b8605Smrg
5848b8605SmrgName Strings
6848b8605Smrg
7848b8605Smrg    GL_MESA_texture_array
8848b8605Smrg
9848b8605SmrgContact
10848b8605Smrg
11848b8605Smrg    Ian Romanick, IBM (idr 'at' us.ibm.com)
12848b8605Smrg
13848b8605SmrgIP Status
14848b8605Smrg
15848b8605Smrg    No known IP issues.
16848b8605Smrg
17848b8605SmrgStatus
18848b8605Smrg
19848b8605Smrg    DEPRECATED - Support removed in Mesa 10.1.
20848b8605Smrg
21848b8605SmrgVersion
22848b8605Smrg
23848b8605Smrg
24848b8605SmrgNumber
25848b8605Smrg
26848b8605Smrg    TBD
27848b8605Smrg
28848b8605SmrgDependencies
29848b8605Smrg
30848b8605Smrg    OpenGL 1.2 or GL_EXT_texture3D is required.
31848b8605Smrg
32848b8605Smrg    Support for ARB_fragment_program is assumed, but not required.
33848b8605Smrg
34848b8605Smrg    Support for ARB_fragment_program_shadow is assumed, but not required.
35848b8605Smrg
36848b8605Smrg    Support for EXT_framebuffer_object is assumed, but not required.
37848b8605Smrg
38848b8605Smrg    Written based on the wording of the OpenGL 2.0 specification and
39848b8605Smrg    ARB_fragment_program_shadow but not dependent on them.
40848b8605Smrg
41848b8605SmrgOverview
42848b8605Smrg
43848b8605Smrg    There are a number of circumstances where an application may wish to
44848b8605Smrg    blend two textures out of a larger set of textures.  Moreover, in some
45848b8605Smrg    cases the selected textures may vary on a per-fragment basis within
46848b8605Smrg    a polygon.  Several examples include:
47848b8605Smrg
48848b8605Smrg       1. High dynamic range textures.  The application stores several
49848b8605Smrg       different "exposures" of an image as different textures.  On a
50848b8605Smrg       per-fragment basis, the application selects which exposures are
51848b8605Smrg       used.
52848b8605Smrg
53848b8605Smrg       2. A terrain engine where the altitude of a point determines the
54848b8605Smrg       texture applied to it.  If the transition is from beach sand to
55848b8605Smrg       grass to rocks to snow, the application will store each texture
56848b8605Smrg       in a different texture map, and dynamically select which two
57848b8605Smrg       textures to blend at run-time.
58848b8605Smrg
59848b8605Smrg       3. Storing short video clips in textures.  Each depth slice is a
60848b8605Smrg       single frame of video.
61848b8605Smrg
62848b8605Smrg    Several solutions to this problem have been proposed, but they either
63848b8605Smrg    involve using a separate texture unit for each texture map or using 3D
64848b8605Smrg    textures without mipmaps.  Both of these options have major drawbacks.
65848b8605Smrg
66848b8605Smrg    This extension provides a third alternative that eliminates the major
67848b8605Smrg    drawbacks of both previous methods.  A new texture target,
68848b8605Smrg    TEXTURE_2D_ARRAY, is added that functions identically to TEXTURE_3D in
69848b8605Smrg    all aspects except the sizes of the non-base level images.  In
70848b8605Smrg    traditional 3D texturing, the size of the N+1 LOD is half the size
71848b8605Smrg    of the N LOD in all three dimensions.  For the TEXTURE_2D_ARRAY target,
72848b8605Smrg    the height and width of the N+1 LOD is halved, but the depth is the
73848b8605Smrg    same for all levels of detail. The texture then becomes an array of
74848b8605Smrg    2D textures.  The per-fragment texel is selected by the R texture
75848b8605Smrg    coordinate.
76848b8605Smrg
77848b8605Smrg    References:
78848b8605Smrg
79b8e80941Smrg        https://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=011557
80b8e80941Smrg        https://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=000516
81b8e80941Smrg        https://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=011903
82848b8605Smrg        http://www.delphi3d.net/articles/viewarticle.php?article=terraintex.htm
83848b8605Smrg
84848b8605SmrgNew Procedures and Functions
85848b8605Smrg
86848b8605Smrg    All functions come directly from EXT_texture_array.
87848b8605Smrg
88848b8605Smrg    void FramebufferTextureLayerEXT(enum target, enum attachment,
89848b8605Smrg                                    uint texture, int level, int layer);
90848b8605Smrg
91848b8605SmrgNew Tokens
92848b8605Smrg
93848b8605Smrg    All token names and values come directly from EXT_texture_array.
94848b8605Smrg
95848b8605Smrg    Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
96848b8605Smrg    the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
97848b8605Smrg    GetDoublev, and by the <target> parameter of TexImage3D, GetTexImage,
98848b8605Smrg    GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv, and
99848b8605Smrg    GetTexParameterfv:
100848b8605Smrg
101848b8605Smrg        TEXTURE_1D_ARRAY_EXT                            0x8C18
102848b8605Smrg        TEXTURE_2D_ARRAY_EXT                            0x8C1A
103848b8605Smrg
104848b8605Smrg    Accepted by the <target> parameter of TexImage2D, TexSubImage2D,
105848b8605Smrg    CopyTexImage2D, CopyTexSubImage2D, CompressedTexImage2D,
106848b8605Smrg    CompressedTexSubImage2D, GetTexLevelParameteriv, and 
107848b8605Smrg    GetTexLevelParameterfv:
108848b8605Smrg
109848b8605Smrg        TEXTURE_1D_ARRAY_EXT
110848b8605Smrg        PROXY_TEXTURE_1D_ARRAY_EXT                      0x8C19
111848b8605Smrg
112848b8605Smrg    Accepted by the <target> parameter of TexImage3D, TexSubImage3D,
113848b8605Smrg    CopyTexSubImage3D, CompressedTexImage3D, CompressedTexSubImage3D,
114848b8605Smrg    GetTexLevelParameteriv, and GetTexLevelParameterfv:
115848b8605Smrg
116848b8605Smrg        TEXTURE_2D_ARRAY_EXT
117848b8605Smrg        PROXY_TEXTURE_2D_ARRAY_EXT                      0x8C1B
118848b8605Smrg
119848b8605Smrg    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
120848b8605Smrg    GetFloatv, and GetDoublev
121848b8605Smrg
122848b8605Smrg        TEXTURE_BINDING_1D_ARRAY_EXT                    0x8C1C
123848b8605Smrg        TEXTURE_BINDING_2D_ARRAY_EXT                    0x8C1D
124848b8605Smrg        MAX_ARRAY_TEXTURE_LAYERS_EXT                    0x88FF
125848b8605Smrg
126848b8605Smrg    Accepted by the <param> parameter of TexParameterf, TexParameteri,
127848b8605Smrg    TexParameterfv, and TexParameteriv when the <pname> parameter is
128848b8605Smrg    TEXTURE_COMPARE_MODE_ARB:
129848b8605Smrg
130848b8605Smrg        COMPARE_REF_DEPTH_TO_TEXTURE_EXT                0x884E
131848b8605Smrg
132848b8605Smrg    (Note:  COMPARE_REF_DEPTH_TO_TEXTURE_EXT is simply an alias for the
133848b8605Smrg    existing COMPARE_R_TO_TEXTURE token in OpenGL 2.0; the alternate name
134848b8605Smrg    reflects the fact that the R coordinate is not always used.)
135848b8605Smrg
136848b8605Smrg    Accepted by the <internalformat> parameter of TexImage3D and
137848b8605Smrg    CompressedTexImage3D, and by the <format> parameter of
138848b8605Smrg    CompressedTexSubImage3D:
139848b8605Smrg
140848b8605Smrg        COMPRESSED_RGB_S3TC_DXT1_EXT
141848b8605Smrg        COMPRESSED_RGBA_S3TC_DXT1_EXT
142848b8605Smrg        COMPRESSED_RGBA_S3TC_DXT3_EXT
143848b8605Smrg        COMPRESSED_RGBA_S3TC_DXT5_EXT
144848b8605Smrg
145848b8605Smrg    Accepted by the <pname> parameter of
146848b8605Smrg    GetFramebufferAttachmentParameterivEXT:
147848b8605Smrg
148848b8605Smrg        FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT          0x8CD4
149848b8605Smrg
150848b8605Smrg    (Note:  FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER is simply an alias for the
151848b8605Smrg    FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT token provided in
152848b8605Smrg    EXT_framebuffer_object.  This extension generalizes the notion of
153848b8605Smrg    "<zoffset>" to include layers of an array texture.)
154848b8605Smrg
155848b8605SmrgAdditions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation)
156848b8605Smrg
157848b8605Smrg    None
158848b8605Smrg
159848b8605SmrgAdditions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
160848b8605Smrg
161848b8605Smrg    -- Section 3.8.1 "Texture Image Specification"
162848b8605Smrg
163848b8605Smrg       Change the first paragraph (page 150) to say (spec changes identical to
164848b8605Smrg       EXT_texture_array):
165848b8605Smrg
166848b8605Smrg       "The command
167848b8605Smrg
168848b8605Smrg         void TexImage3D(enum target, int level, int internalformat,
169848b8605Smrg                         sizei width, sizei height, sizei depth, int border,
170848b8605Smrg                         enum format, enum type, void *data);
171848b8605Smrg
172848b8605Smrg       is used to specify a three-dimensional texture image. target must be one
173848b8605Smrg       one of TEXTURE_3D for a three-dimensional texture or
174848b8605Smrg       TEXTURE_2D_ARRAY_EXT for an two-dimensional array texture.
175848b8605Smrg       Additionally, target may be either PROXY_TEXTURE_3D for a
176848b8605Smrg       three-dimensional proxy texture, or PROXY_TEXTURE_2D_ARRAY_EXT for a
177848b8605Smrg       two-dimensional proxy array texture."
178848b8605Smrg
179848b8605Smrg       Change the fourth paragraph on page 151 to say (spec changes identical
180848b8605Smrg       to EXT_texture_array):
181848b8605Smrg
182848b8605Smrg       "Textures with a base internal format of DEPTH_COMPONENT are supported
183848b8605Smrg       by texture image specification commands only if target is TEXTURE_1D,
184848b8605Smrg       TEXTURE_2D, TEXTURE_1D_ARRAY_EXT, TEXTURE_2D_ARRAY_EXT,
185848b8605Smrg       PROXY_TEXTURE_1D, PROXY_TEXTURE_2D, PROXY_TEXTURE_1D_ARRAY_EXT, or
186848b8605Smrg       PROXY_TEXTURE_2D_ARRAY_EXT. Using this format in conjunction with any
187848b8605Smrg       other target will result in an INVALID_OPERATION error."
188848b8605Smrg
189848b8605Smrg
190848b8605Smrg       Change the fourth paragraph on page 156 to say (spec changes identical
191848b8605Smrg       to EXT_texture_array):
192848b8605Smrg       
193848b8605Smrg       "The command
194848b8605Smrg
195848b8605Smrg         void TexImage2D(enum target, int level,
196848b8605Smrg                         int internalformat, sizei width, sizei height,
197848b8605Smrg                         int border, enum format, enum type, void *data);
198848b8605Smrg
199848b8605Smrg       is used to specify a two-dimensional texture image. target must be one
200848b8605Smrg       of TEXTURE_2D for a two-dimensional texture, TEXTURE_1D_ARRAY_EXT for a
201848b8605Smrg       one-dimensional array texture, or one of TEXTURE_CUBE_MAP_POSITIVE_X,
202848b8605Smrg       TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y,
203848b8605Smrg       TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or
204848b8605Smrg       TEXTURE_CUBE_MAP_NEGATIVE_Z for a cube map texture. Additionally,
205848b8605Smrg       target may be either PROXY_TEXTURE_2D for a two-dimensional proxy
206848b8605Smrg       texture, PROXY_TEXTURE_1D_ARRAY_EXT for a one-dimensional proxy array
207848b8605Smrg       texture, or PROXY TEXTURE_CUBE_MAP for a cube map proxy texture in the
208848b8605Smrg       special case discussed in section 3.8.11.  The other parameters match
209848b8605Smrg       the corresponding parameters of TexImage3D.
210848b8605Smrg
211848b8605Smrg       For the purposes of decoding the texture image, TexImage2D is
212848b8605Smrg       equivalent to calling TexImage3D with corresponding arguments and depth
213848b8605Smrg       of 1, except that
214848b8605Smrg
215848b8605Smrg         * The border depth, d_b, is zero, and the depth of the image is
216848b8605Smrg           always 1 regardless of the value of border. 
217848b8605Smrg
218848b8605Smrg         * The border height, h_b, is zero if <target> is
219848b8605Smrg           TEXTURE_1D_ARRAY_EXT, and <border> otherwise.
220848b8605Smrg
221848b8605Smrg         * Convolution will be performed on the image (possibly changing its
222848b8605Smrg           width and height) if SEPARABLE 2D or CONVOLUTION 2D is enabled.
223848b8605Smrg
224848b8605Smrg         * UNPACK SKIP IMAGES is ignored."
225848b8605Smrg
226848b8605Smrg    -- Section 3.8.2 "Alternate Texture Image Specification Commands"
227848b8605Smrg
228848b8605Smrg       Change the second paragraph (page 159) (spec changes identical
229848b8605Smrg       to EXT_texture_array):
230848b8605Smrg
231848b8605Smrg       "The command
232848b8605Smrg
233848b8605Smrg         void CopyTexImage2D(enum target, int level,
234848b8605Smrg                             enum internalformat, int x, int y, sizei width,
235848b8605Smrg                             sizei height, int border);
236848b8605Smrg
237848b8605Smrg       defines a two-dimensional texture image in exactly the manner of
238848b8605Smrg       TexImage2D, except that the image data are taken from the framebuffer
239848b8605Smrg       rather than from client memory. Currently, target must be one of
240848b8605Smrg       TEXTURE_2D, TEXTURE_1D_ARRAY_EXT, TEXTURE_CUBE_MAP_POSITIVE_X,
241848b8605Smrg       TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE MAP_POSITIVE_Y,
242848b8605Smrg       TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or
243848b8605Smrg       TEXTURE_CUBE_MAP_NEGATIVE_Z.
244848b8605Smrg
245848b8605Smrg
246848b8605Smrg       Change the last paragraph on page 160 to say (spec changes identical
247848b8605Smrg       to EXT_texture_array):
248848b8605Smrg
249848b8605Smrg       "Currently the target arguments of TexSubImage1D and CopyTexSubImage1D
250848b8605Smrg       must be TEXTURE_1D, the target arguments of TexSubImage2D and
251848b8605Smrg       CopyTexSubImage2D must be one of TEXTURE_2D, TEXTURE_1D_ARRAY_EXT,
252848b8605Smrg       TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X,
253848b8605Smrg       TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y,
254848b8605Smrg       TEXTURE_CUBE_MAP_POSITIVE_Z, or TEXTURE_CUBE_MAP_NEGATIVE_Z, and the
255848b8605Smrg       target arguments of TexSubImage3D and CopyTexSubImage3D must be
256848b8605Smrg       TEXTURE_3D or TEXTURE_2D_ARRAY_EXT. ..."
257848b8605Smrg
258848b8605Smrg
259848b8605Smrg    -- Section 3.8.4 "Texture Parameters"
260848b8605Smrg
261848b8605Smrg       Change the first paragraph (page 166) to say:
262848b8605Smrg
263848b8605Smrg       "Various parameters control how the texel array is treated when
264848b8605Smrg       specified or changed, and when applied to a fragment. Each parameter is
265848b8605Smrg       set by calling
266848b8605Smrg
267848b8605Smrg         void TexParameter{if}(enum target, enum pname, T param); 
268848b8605Smrg         void TexParameter{if}v(enum target, enum pname, T params);
269848b8605Smrg
270848b8605Smrg       target is the target, either TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
271848b8605Smrg       TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT."
272848b8605Smrg
273848b8605Smrg
274848b8605Smrg    -- Section 3.8.8 "Texture Minification" in the section "Scale Factor and Level of Detail"
275848b8605Smrg
276848b8605Smrg       Change the first paragraph (page 172) to say:
277848b8605Smrg
278848b8605Smrg       "Let s(x,y) be the function that associates an s texture coordinate
279848b8605Smrg       with each set of window coordinates (x,y) that lie within a primitive;
280848b8605Smrg       define t(x,y) and r(x,y) analogously.  Let u(x,y) = w_t * s(x,y),
281848b8605Smrg       v(x,y) = h_t * t(x,y), and w(x,y) = d_t * r(x,y), where w_t, h_t,
282848b8605Smrg       and d_t are as defined by equations 3.15, 3.16, and 3.17 with
283848b8605Smrg       w_s, h_s, and d_s equal to the width, height, and depth of the
284848b8605Smrg       image array whose level is level_base.  For a one-dimensional
285848b8605Smrg       texture or a one-dimensional array texture, define v(x,y) = 0 and
286848b8605Smrg       w(x,y) = 0; for a two-dimensional texture or a two-dimensional array
287848b8605Smrg       texture, define w(x,y) = 0..."
288848b8605Smrg
289848b8605Smrg    -- Section 3.8.8 "Texture Minification" in the section "Mipmapping"
290848b8605Smrg
291848b8605Smrg       Change the third paragraph (page 174) to say:
292848b8605Smrg       
293848b8605Smrg       "For a two-dimensional texture, two-dimensional array texture, or
294848b8605Smrg       cube map texture,"
295848b8605Smrg
296848b8605Smrg       Change the fourth paragraph (page 174) to say:
297848b8605Smrg
298848b8605Smrg       "And for a one-dimensional texture or a one-dimensional array texture,"
299848b8605Smrg
300848b8605Smrg       After the first paragraph (page 175) add:
301848b8605Smrg
302848b8605Smrg       "For one-dimensional array textures, h_b and d_b are treated as 1,
303848b8605Smrg       regardless of the actual values, when performing mipmap calculations.
304848b8605Smrg       For two-dimensional array textures, d_b is always treated as one,
305848b8605Smrg       regardless of the actual value, when performing mipmap calculations."
306848b8605Smrg
307848b8605Smrg    -- Section 3.8.8 "Automatic Mipmap Generation" in the section "Mipmapping"
308848b8605Smrg
309848b8605Smrg       Change the third paragraph (page 176) to say (spec changes identical
310848b8605Smrg       to EXT_texture_array):
311848b8605Smrg
312848b8605Smrg       "The contents of the derived arrays are computed by repeated, filtered
313848b8605Smrg       reduction of the level_base array.  For one- and two-dimensional array
314848b8605Smrg       textures, each layer is filtered independently.  ..."
315848b8605Smrg
316848b8605Smrg    -- Section 3.8.8 "Manual Mipmap Generation" in the section "Mipmapping"
317848b8605Smrg
318848b8605Smrg       Change first paragraph to say (spec changes identical to
319848b8605Smrg       EXT_texture_array):
320848b8605Smrg
321848b8605Smrg       "Mipmaps can be generated manually with the command
322848b8605Smrg
323848b8605Smrg         void GenerateMipmapEXT(enum target);
324848b8605Smrg
325848b8605Smrg       where <target> is one of TEXTURE_1D, TEXTURE_2D, TEXTURE_CUBE_MAP,
326848b8605Smrg       TEXTURE_3D, TEXTURE_1D_ARRAY, or TEXTURE_2D_ARRAY.  Mipmap generation
327848b8605Smrg       affects the texture image attached to <target>.  ..."
328848b8605Smrg
329848b8605Smrg    -- Section 3.8.10 "Texture Completeness"
330848b8605Smrg
331848b8605Smrg       Change the second paragraph (page 177) to say (spec changes identical
332848b8605Smrg       to EXT_texture_array):
333848b8605Smrg
334848b8605Smrg       "For one-, two-, or three-dimensional textures and one- or
335848b8605Smrg       two-dimensional array textures, a texture is complete if the following
336848b8605Smrg       conditions all hold true:"
337848b8605Smrg
338848b8605Smrg    -- Section 3.8.11 "Texture State and Proxy State"
339848b8605Smrg
340848b8605Smrg       Change the second and third paragraphs (page 179) to say (spec changes
341848b8605Smrg       identical to EXT_texture_array):
342848b8605Smrg
343848b8605Smrg       "In addition to image arrays for one-, two-, and three-dimensional
344848b8605Smrg       textures, one- and two-dimensional array textures, and the six image
345848b8605Smrg       arrays for the cube map texture, partially instantiated image arrays
346848b8605Smrg       are maintained for one-, two-, and three-dimensional textures and one-
347848b8605Smrg       and two-dimensional array textures.  Additionally, a single proxy image
348848b8605Smrg       array is maintained for the cube map texture.  Each proxy image array
349848b8605Smrg       includes width, height, depth, border width, and internal format state
350848b8605Smrg       values, as well as state for the red, green, blue, alpha, luminance,
351848b8605Smrg       and intensity component resolutions. Proxy image arrays do not include
352848b8605Smrg       image data, nor do they include texture properties. When TexImage3D is
353848b8605Smrg       executed with target specified as PROXY_TEXTURE_3D, the
354848b8605Smrg       three-dimensional proxy state values of the specified level-of-detail
355848b8605Smrg       are recomputed and updated. If the image array would not be supported
356848b8605Smrg       by TexImage3D called with target set to TEXTURE 3D, no error is
357848b8605Smrg       generated, but the proxy width, height, depth, border width, and
358848b8605Smrg       component resolutions are set to zero. If the image array would be
359848b8605Smrg       supported by such a call to TexImage3D, the proxy state values are set
360848b8605Smrg       exactly as though the actual image array were being specified. No pixel
361848b8605Smrg       data are transferred or processed in either case.
362848b8605Smrg
363848b8605Smrg       Proxy arrays for one- and two-dimensional textures and one- and
364848b8605Smrg       two-dimensional array textures are operated on in the same way when
365848b8605Smrg       TexImage1D is executed with target specified as PROXY_TEXTURE_1D,
366848b8605Smrg       TexImage2D is executed with target specified as PROXY_TEXTURE_2D or
367848b8605Smrg       PROXY_TEXTURE_1D_ARRAY_EXT, or TexImage3D is executed with target
368848b8605Smrg       specified as PROXY_TETXURE_2D_ARRAY_EXT."
369848b8605Smrg
370848b8605Smrg    -- Section 3.8.12 "Texture Objects"
371848b8605Smrg
372848b8605Smrg       Change section (page 180) to say (spec changes identical to 
373848b8605Smrg       EXT_texture_array):
374848b8605Smrg
375848b8605Smrg       "In addition to the default textures TEXTURE_1D, TEXTURE_2D,
376848b8605Smrg       TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, and TEXTURE_2D_EXT,
377848b8605Smrg       named one-, two-, and three-dimensional, cube map, and one- and
378848b8605Smrg       two-dimensional array texture objects can be created and operated upon.
379848b8605Smrg       The name space for texture objects is the unsigned integers, with zero
380848b8605Smrg       reserved by the GL.
381848b8605Smrg
382848b8605Smrg       A texture object is created by binding an unused name to TEXTURE_1D,
383848b8605Smrg       TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or
384848b8605Smrg       TEXTURE_2D_ARRAY_EXT. The binding is effected by calling
385848b8605Smrg
386848b8605Smrg         void BindTexture(enum target, uint texture);
387848b8605Smrg
388848b8605Smrg       with <target> set to the desired texture target and <texture> set to
389848b8605Smrg       the unused name.  The resulting texture object is a new state vector,
390848b8605Smrg       comprising all the state values listed in section 3.8.11, set to the
391848b8605Smrg       same initial values. If the new texture object is bound to TEXTURE_1D,
392848b8605Smrg       TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or
393848b8605Smrg       TEXTURE_2D_ARRAY_EXT, it is and remains a one-, two-,
394848b8605Smrg       three-dimensional, cube map, one- or two-dimensional array texture
395848b8605Smrg       respectively until it is deleted.
396848b8605Smrg
397848b8605Smrg       BindTexture may also be used to bind an existing texture object to
398848b8605Smrg       either TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP,
399848b8605Smrg       TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT. The error
400848b8605Smrg       INVALID_OPERATION is generated if an attempt is made to bind a texture
401848b8605Smrg       object of different dimensionality than the specified target. If the
402848b8605Smrg       bind is successful no change is made to the state of the bound texture
403848b8605Smrg       object, and any previous binding to target is broken.
404848b8605Smrg
405848b8605Smrg       While a texture object is bound, GL operations on the target to which
406848b8605Smrg       it is bound affect the bound object, and queries of the target to which
407848b8605Smrg       it is bound return state from the bound object. If texture mapping of
408848b8605Smrg       the dimensionality of the target to which a texture object is bound is
409848b8605Smrg       enabled, the state of the bound texture object directs the texturing
410848b8605Smrg       operation.
411848b8605Smrg
412848b8605Smrg       In the initial state, TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
413848b8605Smrg       TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, and TEXTURE_2D_ARRAY_EXT have
414848b8605Smrg       one-, two-, three-dimensional, cube map, and one- and two-dimensional
415848b8605Smrg       array texture state vectors respectively associated with them. In order
416848b8605Smrg       that access to these initial textures not be lost, they are treated as
417848b8605Smrg       texture objects all of whose names are 0. The initial one-, two-,
418848b8605Smrg       three-dimensional, cube map, one- and two-dimensional array textures
419848b8605Smrg       are therefore operated upon, queried, and applied as TEXTURE_1D,
420848b8605Smrg       TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, and
421848b8605Smrg       TEXTURE_2D_ARRAY_EXT respectively while 0 is bound to the corresponding
422848b8605Smrg       targets.
423848b8605Smrg
424848b8605Smrg       Change second paragraph on page 181 to say (spec changes identical to 
425848b8605Smrg       EXT_texture_array):
426848b8605Smrg       
427848b8605Smrg       "...  If a texture that is currently bound to one of the targets
428848b8605Smrg       TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP,
429848b8605Smrg       TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT is deleted, it is as
430848b8605Smrg       though BindTexture had been executed with the same target and texture
431848b8605Smrg       zero. ..."
432848b8605Smrg
433848b8605Smrg       Change second paragraph on page 182 to say (spec changes identical to 
434848b8605Smrg       EXT_texture_array):
435848b8605Smrg       
436848b8605Smrg       "The texture object name space, including the initial one-, two-, and
437848b8605Smrg       three dimensional, cube map, and one- and two-dimensional array texture
438848b8605Smrg       objects, is shared among all texture units. ..."
439848b8605Smrg
440848b8605Smrg
441848b8605Smrg    -- Section 3.8.14 "Depth Texture Comparison Modes" in "Texture Comparison Modes"
442848b8605Smrg
443848b8605Smrg       Change second through fourth paragraphs (page 188) to say:
444848b8605Smrg
445848b8605Smrg       "Let D_t be the depth texture value, in the range [0, 1].  For
446848b8605Smrg       texture lookups from one- and two-dimensional, rectangle, and
447848b8605Smrg       one-dimensional array targets, let R be the interpolated <r>
448848b8605Smrg       texture coordinate, clamped to the range [0, 1].  For texture lookups
449848b8605Smrg       from two-dimensional array texture targets, let R be the interpolated
450848b8605Smrg       <q> texture coordinate, clamped to the range [0, 1].  Then the
451848b8605Smrg       effective texture value L_t, I_t, or A_t is computed as follows:
452848b8605Smrg
453848b8605Smrg       If the value of TEXTURE_COMPARE_MODE is NONE, then
454848b8605Smrg
455848b8605Smrg          r = Dt
456848b8605Smrg
457848b8605Smrg       If the value of TEXTURE_COMPARE_MODE is
458848b8605Smrg       COMPARE_REF_DEPTH_TO_TEXTURE_EXT), then r depends on the texture
459848b8605Smrg       comparison function as shown in table 3.27."
460848b8605Smrg
461848b8605Smrg    -- Section 3.8.15 "Texture Application"
462848b8605Smrg
463848b8605Smrg       Change the first paragraph (page 189) to say:
464848b8605Smrg
465848b8605Smrg       "Texturing is enabled or disabled using the generic Enable and Disable
466848b8605Smrg       commands, respectively, with the symbolic constants TEXTURE_1D,
467848b8605Smrg       TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or
468848b8605Smrg       TEXTURE_2D_ARRAY_EXT to enable one-, two-, three-dimensional, cube
469848b8605Smrg       map, one-dimensional array, or two-dimensional array texture,
470848b8605Smrg       respectively.  If both two- and one-dimensional textures are enabled,
471848b8605Smrg       the two-dimensional texture is used.  If the three-dimensional and
472848b8605Smrg       either of the two- or one-dimensional textures is enabled, the
473848b8605Smrg       three-dimensional texture is used.  If the cube map texture and any of
474848b8605Smrg       the three-, two-, or one-dimensional textures is enabled, then cube map
475848b8605Smrg       texturing is used.  If one-dimensional array texture is enabled and any
476848b8605Smrg       of cube map, three-, two-, or one-dimensional textures is enabled, 
477848b8605Smrg       one-dimensional array texturing is used.  If two-dimensional array
478848b8605Smrg       texture is enabled and any of cube map, three-, two-, one-dimensional
479848b8605Smrg       textures or one-dimensional array texture is enabled, two-dimensional
480848b8605Smrg       array texturing is used..."
481848b8605Smrg
482848b8605Smrg    -- Section 3.11.2 of ARB_fragment_program (Fragment Program Grammar and Restrictions):
483848b8605Smrg
484848b8605Smrg       (mostly add to existing grammar rules)
485848b8605Smrg
486848b8605Smrg       <optionName>           ::= "MESA_texture_array"
487848b8605Smrg
488848b8605Smrg       <texTarget>            ::= "1D"
489848b8605Smrg                               | "2D"
490848b8605Smrg                               | "3D"
491848b8605Smrg                               | "CUBE"
492848b8605Smrg                               | "RECT"
493848b8605Smrg                               | <arrayTarget> (if program option is present)
494848b8605Smrg                               | <shadowTarget> (if program option is present)
495848b8605Smrg
496848b8605Smrg       <arrayTarget>          ::= "ARRAY1D"
497848b8605Smrg                               | "ARRAY2D"
498848b8605Smrg
499848b8605Smrg       <shadowTarget>         ::= "SHADOW1D"
500848b8605Smrg                               | "SHADOW2D"
501848b8605Smrg                               | "SHADOWRECT"
502848b8605Smrg                               | <shadowArrayTarget> (if program option is present)
503848b8605Smrg
504848b8605Smrg       <shadowArrayTarget>    ::= "SHADOWARRAY1D"
505848b8605Smrg                               | "SHADOWARRAY2D"
506848b8605Smrg
507848b8605Smrg
508848b8605Smrg    -- Add Section 3.11.4.5.4 "Texture Stack Option"
509848b8605Smrg
510848b8605Smrg       "If a fragment program specifies the "MESA_texture_array" program
511848b8605Smrg       option, the <texTarget> rule is modified to add the texture targets
512848b8605Smrg       ARRAY1D and ARRAY2D (See Section 3.11.2)."
513848b8605Smrg
514848b8605Smrg    -- Section 3.11.6 "Fragment Program Texture Instruction Set"
515848b8605Smrg
516848b8605Smrg       (replace 1st and 2nd paragraphs with the following paragraphs)
517848b8605Smrg
518848b8605Smrg       "The first three texture instructions described below specify the
519848b8605Smrg       mapping of 4-tuple input vectors to 4-tuple output vectors.
520848b8605Smrg       The sampling of the texture works as described in section 3.8,
521848b8605Smrg       except that texture environments and texture functions are not
522848b8605Smrg       applicable, and the texture enables hierarchy is replaced by explicit
523848b8605Smrg       references to the desired texture target (i.e., 1D, 2D, 3D, cube map,
524848b8605Smrg       rectangle, ARRAY1D, ARRAY2D).  These texture instructions specify
525848b8605Smrg       how the 4-tuple is mapped into the coordinates used for sampling.  The
526848b8605Smrg       following function is used to describe the texture sampling in the
527848b8605Smrg       descriptions below: 
528848b8605Smrg
529848b8605Smrg         vec4 TextureSample(vec4 coord, float lodBias, int texImageUnit,
530848b8605Smrg                            enum texTarget);
531848b8605Smrg
532848b8605Smrg       Note that not all four components of the texture coordinates <coord>
533848b8605Smrg       are used by all texture targets.  Component usage for each <texTarget>
534848b8605Smrg       is defined in table X.
535848b8605Smrg
536848b8605Smrg                                                        coordinates used
537848b8605Smrg         texTarget          Texture Type               s t r  layer  shadow
538848b8605Smrg         ----------------   ---------------------      -----  -----  ------
539848b8605Smrg         1D                 TEXTURE_1D                 x - -    -      -
540848b8605Smrg         2D                 TEXTURE_2D                 x y -    -      -
541848b8605Smrg         3D                 TEXTURE_3D                 x y z    -      -
542848b8605Smrg         CUBE               TEXTURE_CUBE_MAP           x y z    -      -
543848b8605Smrg         RECT               TEXTURE_RECTANGLE_ARB      x y -    -      -
544848b8605Smrg         ARRAY1D            TEXTURE_1D_ARRAY_EXT       x - -    y      -
545848b8605Smrg         ARRAY2D            TEXTURE_2D_ARRAY_EXT       x y -    z      -
546848b8605Smrg         SHADOW1D           TEXTURE_1D                 x - -    -      z
547848b8605Smrg         SHADOW2D           TEXTURE_2D                 x y -    -      z
548848b8605Smrg         SHADOWRECT         TEXTURE_RECTANGLE_ARB      x y -    -      z
549848b8605Smrg         SHADOWARRAY1D      TEXTURE_1D_ARRAY_EXT       x - -    y      z
550848b8605Smrg         SHADOWARRAY2D      TEXTURE_2D_ARRAY_EXT       x y -    z      w
551848b8605Smrg
552848b8605Smrg         Table X:  Texture types accessed for each of the <texTarget>, and
553848b8605Smrg         coordinate mappings.  The "coordinates used" column indicate the
554848b8605Smrg         input values used for each coordinate of the texture lookup, the
555848b8605Smrg         layer selector for array textures, and the reference value for
556848b8605Smrg         texture comparisons."
557848b8605Smrg
558848b8605Smrg    -- Section 3.11.6.2 "TXP: Project coordinate and map to color"
559848b8605Smrg    
560848b8605Smrg       Add to the end of the section:
561848b8605Smrg       
562848b8605Smrg       "A program will fail to load if the TXP instruction is used in
563848b8605Smrg       conjunction with the SHADOWARRAY2D target."
564848b8605Smrg
565848b8605SmrgAdditions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment Operations)
566848b8605Smrg
567848b8605Smrg    -- Section 4.4.2.3 "Attaching Texture Images to a Framebuffer"
568848b8605Smrg
569848b8605Smrg       Add to the end of the section (spec changes identical to
570848b8605Smrg       EXT_texture_array):
571848b8605Smrg
572848b8605Smrg       "The command
573848b8605Smrg
574848b8605Smrg         void FramebufferTextureLayerEXT(enum target, enum attachment,
575848b8605Smrg                                         uint texture, int level, int layer);
576848b8605Smrg
577848b8605Smrg       operates identically to FramebufferTexture3DEXT, except that it
578848b8605Smrg       attaches a single layer of a three-dimensional texture or a one- or
579848b8605Smrg       two-dimensional array texture.  <layer> is an integer indicating the
580848b8605Smrg       layer number, and is treated identically to the <zoffset> parameter in
581848b8605Smrg       FramebufferTexture3DEXT.  The error INVALID_VALUE is generated if
582848b8605Smrg       <layer> is negative.  The error INVALID_OPERATION is generated if
583848b8605Smrg       <texture> is non-zero and is not the name of a three dimensional
584848b8605Smrg       texture or one- or two-dimensional array texture.  Unlike
585848b8605Smrg       FramebufferTexture3D, no <textarget> parameter is accepted.
586848b8605Smrg
587848b8605Smrg       If <texture> is non-zero and the command does not result in an error,
588848b8605Smrg       the framebuffer attachment state corresponding to <attachment> is
589848b8605Smrg       updated as in the other FramebufferTexture commands, except that
590848b8605Smrg       FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT is set to <layer>."
591848b8605Smrg
592848b8605Smrg    -- Section 4.4.4.1 "Framebuffer Attachment Completeness"
593848b8605Smrg
594848b8605Smrg      Add to the end of the list of completeness rules (spec changes
595848b8605Smrg      identical to EXT_texture_array):
596848b8605Smrg
597848b8605Smrg        "* If FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is TEXTURE and
598848b8605Smrg           FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT names a one- or 
599848b8605Smrg           two-dimensional array texture, then
600848b8605Smrg           FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT must be smaller than the
601848b8605Smrg           number of layers in the texture."
602848b8605Smrg
603848b8605SmrgAdditions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions)
604848b8605Smrg
605848b8605Smrg    -- Section 5.4 "Display Lists"
606848b8605Smrg
607848b8605Smrg       Change the first paragraph on page 242 to say (spec changes
608848b8605Smrg       identical to EXT_texture_array):
609848b8605Smrg
610848b8605Smrg       "TexImage3D, TexImage2D, TexImage1D, Histogram, and ColorTable are
611848b8605Smrg       executed immediately when called with the corresponding proxy arguments
612848b8605Smrg       PROXY_TEXTURE_3D or PROXY_TEXTURE_2D_ARRAY_EXT; PROXY_TEXTURE_2D,
613848b8605Smrg       PROXY_TEXTURE_CUBE_MAP, or PROXY_TEXTURE_1D_ARRAY_EXT;
614848b8605Smrg       PROXY_TEXTURE_1D; PROXY_HISTOGRAM; and PROXY_COLOR_TABLE,
615848b8605Smrg       PROXY_POST_CONVOLUTION_COLOR_TABLE, or
616848b8605Smrg       PROXY_POST_COLOR_MATRIX_COLOR_TABLE."
617848b8605Smrg
618848b8605SmrgAdditions to Chapter 6 of the OpenGL 2.0 Specification (State and State Requests)
619848b8605Smrg
620848b8605Smrg    -- Section 6.1.3 "Enumerated Queries"
621848b8605Smrg
622848b8605Smrg       Add after the line beginning "If the value of
623848b8605Smrg       FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is TEXTURE" (spec changes
624848b8605Smrg       identical to EXT_texture_array):
625848b8605Smrg
626848b8605Smrg       "If <pname> is FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT and the
627848b8605Smrg       texture object named FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT is a
628848b8605Smrg       three-dimensional texture or a one- or two-dimensional array texture,
629848b8605Smrg       then <params> will contain the number of texture layer attached to the
630848b8605Smrg       attachment point.  Otherwise, <params> will contain the value zero."
631848b8605Smrg
632848b8605Smrg    -- Section 6.1.4 "Texture Queries"
633848b8605Smrg    
634848b8605Smrg       Change the first three paragraphs (page 248) to say (spec changes
635848b8605Smrg       identical to EXT_texture_array):
636848b8605Smrg
637848b8605Smrg       "The command
638848b8605Smrg
639848b8605Smrg         void GetTexImage(enum tex, int lod, enum format,
640848b8605Smrg                          enum type, void *img);
641848b8605Smrg
642848b8605Smrg       is used to obtain texture images. It is somewhat different from the
643848b8605Smrg       other get commands; tex is a symbolic value indicating which texture
644848b8605Smrg       (or texture face in the case of a cube map texture target name) is to
645848b8605Smrg       be obtained.  TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_1D_ARRAY_EXT,
646848b8605Smrg       and TEXTURE_2D_ARRAY_EXT indicate a one-, two-, or three-dimensional
647848b8605Smrg       texture, or one- or two-dimensional array texture, respectively.
648848b8605Smrg       TEXTURE_CUBE_MAP_POSITIVE_X, ...
649848b8605Smrg
650848b8605Smrg       GetTexImage obtains... from the first image to the last for
651848b8605Smrg       three-dimensional textures.  One- and two-dimensional array textures
652848b8605Smrg       are treated as two- and three-dimensional images, respectively, where
653848b8605Smrg       the layers are treated as rows or images.  These groups are then...
654848b8605Smrg
655848b8605Smrg       For three-dimensional and two-dimensional array textures, pixel storage
656848b8605Smrg       operations are applied as if the image were two-dimensional, except
657848b8605Smrg       that the additional pixel storage state values PACK_IMAGE_HEIGHT and
658848b8605Smrg       PACK_SKIP_IMAGES are applied. ..."
659848b8605Smrg
660848b8605SmrgAdditions to Appendix A of the OpenGL 2.0 Specification (Invariance)
661848b8605Smrg
662848b8605Smrg    None
663848b8605Smrg
664848b8605SmrgAdditions to the AGL/GLX/WGL Specifications
665848b8605Smrg
666848b8605Smrg    None
667848b8605Smrg
668848b8605SmrgGLX Protocol
669848b8605Smrg
670848b8605Smrg    None
671848b8605Smrg
672848b8605SmrgDependencies on ARB_fragment_program
673848b8605Smrg
674848b8605Smrg    If ARB_fragment_program is not supported, the changes to section 3.11
675848b8605Smrg    should be ignored.
676848b8605Smrg
677848b8605SmrgDependencies on EXT_framebuffer_object
678848b8605Smrg
679848b8605Smrg    If EXT_framebuffer_object is not supported, the changes to section
680848b8605Smrg    3.8.8 ("Manual Mipmap Generation"), 4.4.2.3, and 6.1.3 should be ignored.
681848b8605Smrg
682848b8605SmrgDependencies on EXT_texture_compression_s3tc and NV_texture_compression_vtc
683848b8605Smrg
684848b8605Smrg    (Identical dependency as EXT_texture_array.)
685848b8605Smrg
686848b8605Smrg    S3TC texture compression is supported for two-dimensional array textures.
687848b8605Smrg    When <target> is TEXTURE_2D_ARRAY_EXT, each layer is stored independently
688848b8605Smrg    as a compressed two-dimensional textures.  When specifying or querying
689848b8605Smrg    compressed images using one of the S3TC formats, the images are provided
690848b8605Smrg    and/or returned as a series of two-dimensional textures stored
691848b8605Smrg    consecutively in memory, with the layer closest to zero specified first.
692848b8605Smrg    For array textures, images are not arranged in 4x4x4 or 4x4x2 blocks as in
693848b8605Smrg    the three-dimensional compression format provided in the
694848b8605Smrg    EXT_texture_compression_vtc extension.  Pixel store parameters, including
695848b8605Smrg    those specific to three-dimensional images, are ignored when compressed
696848b8605Smrg    image data are provided or returned, as in the
697848b8605Smrg    EXT_texture_compression_s3tc extension.
698848b8605Smrg
699848b8605Smrg    S3TC compression is not supported for one-dimensional texture targets in
700848b8605Smrg    EXT_texture_compression_s3tc, and is not supported for one-dimensional
701848b8605Smrg    array textures in this extension.  If compressed one-dimensional arrays
702848b8605Smrg    are needed, use a two-dimensional texture with a height of one.
703848b8605Smrg
704848b8605Smrg    This extension allows the use of the four S3TC internal format types in
705848b8605Smrg    TexImage3D, CompressedTexImage3D, and CompressedTexSubImage3D calls.
706848b8605Smrg
707848b8605SmrgErrors
708848b8605Smrg
709848b8605Smrg    None
710848b8605Smrg
711848b8605SmrgNew State
712848b8605Smrg
713848b8605Smrg    (add to table 6.15, p. 276)
714848b8605Smrg
715848b8605Smrg                                                     Initial
716848b8605Smrg    Get Value                     Type   Get Command  Value Description           Sec.    Attribute
717848b8605Smrg    ----------------------------  -----  -----------  ----- --------------------  ------  ---------
718848b8605Smrg    TEXTURE_BINDING_1D_ARRAY_EXT  2*xZ+  GetIntegerv    0   texture object bound  3.8.12  texture
719848b8605Smrg                                                            to TEXTURE_1D_ARRAY
720848b8605Smrg    TEXTURE_BINDING_2D_ARRAY_EXT  2*xZ+  GetIntegerv    0   texture object bound  3.8.12  texture
721848b8605Smrg                                                            to TEXTURE_2D_ARRAY
722848b8605Smrg
723848b8605Smrg
724848b8605SmrgNew Implementation Dependent State
725848b8605Smrg
726848b8605Smrg    (add to Table 6.32, p. 293)
727848b8605Smrg
728848b8605Smrg                                                    Minimum
729848b8605Smrg    Get Value                     Type  Get Command  Value  Description         Sec.  Attribute
730848b8605Smrg    ----------------------------  ----  ----------- ------- ------------------  ----- ---------
731848b8605Smrg    MAX_TEXTURE_ARRAY_LAYERS_EXT   Z+   GetIntegerv   64    maximum number of   3.8.1     -
732848b8605Smrg                                                            layers for texture
733848b8605Smrg                                                            arrays
734848b8605Smrg
735848b8605SmrgIssues
736848b8605Smrg
737848b8605Smrg    (1) Is "texture stack" a good name for this functionality?
738848b8605Smrg
739848b8605Smrg        NO.  The name is changed to "array texture" to match the
740848b8605Smrg        nomenclature used by GL_EXT_texture_array.
741848b8605Smrg
742848b8605Smrg    (2) Should the R texture coordinate be treated as normalized or
743848b8605Smrg    un-normalized?  If it were un-normalized, floor(R) could be thought
744848b8605Smrg    of as a direct index into the array texture.  This may be more
745848b8605Smrg    convenient for applications.
746848b8605Smrg
747848b8605Smrg        RESOLVED.  All texture coordinates are normalized.  The issue of
748848b8605Smrg        un-normalized texture coordinates has been discussed in the ARB
749848b8605Smrg        before and should be left for a layered extension.
750848b8605Smrg
751848b8605Smrg        RE-RESOLVED.  The R coordinate is un-normalized.  Accessing an array
752848b8605Smrg        using [0, layers-1] coordinates is much more natural.
753848b8605Smrg
754848b8605Smrg    (3) How does LOD selection work for stacked textures?
755848b8605Smrg
756848b8605Smrg        RESOLVED.  For 2D array textures the R coordinate is ignored, and
757848b8605Smrg        the LOD selection equations for 2D textures are used.  For 1D
758848b8605Smrg        array textures the T coordinate is ignored, and the LOD selection
759848b8605Smrg        equations for 1D textures are used.  The expected usage is in a
760848b8605Smrg        fragment program with an explicit LOD selection.
761848b8605Smrg
762848b8605Smrg    (4) What is the maximum size of a 2D array texture?  Is it the same
763848b8605Smrg    as for a 3D texture, or should a new query be added?  How about for 1D
764848b8605Smrg    array textures?
765848b8605Smrg
766848b8605Smrg        RESOLVED.  A new query is added.
767848b8605Smrg
768848b8605Smrg    (5) How are array textures exposed in GLSL?
769848b8605Smrg    
770848b8605Smrg        RESOLVED.  Use GL_EXT_texture_array.
771848b8605Smrg        
772848b8605Smrg    (6) Should a 1D array texture also be exposed?
773848b8605Smrg
774848b8605Smrg        RESOLVED.  For orthogonality, yes.
775848b8605Smrg
776848b8605Smrg    (7) How are stacked textures attached to framebuffer objects?
777848b8605Smrg
778848b8605Smrg        RESOLVED.  Layers of both one- and two-dimensional array textures
779848b8605Smrg        are attached using FreambufferTextureLayerEXT.  Once attached, the
780848b8605Smrg        array texture layer behaves exactly as either a one- or
781848b8605Smrg        two-dimensional texture.
782848b8605Smrg
783848b8605Smrg    (8) How is this extension related to GL_EXT_texture_array?
784848b8605Smrg    
785848b8605Smrg        This extension adapats GL_MESAX_texture_stack to the notation,
786848b8605Smrg        indexing, and FBO access of GL_EXT_texture_array.  This extension
787848b8605Smrg        replaces the GLSL support of GL_EXT_texture_array with
788848b8605Smrg        GL_ARB_fragment_program support.
789848b8605Smrg
790848b8605Smrg        Assembly program support is also provided by GL_NV_gpu_program4.
791848b8605Smrg        GL_NV_gpu_program4 also adds support for other features that are
792848b8605Smrg        specific to Nvidia hardware, while this extension adds only support
793848b8605Smrg        for array textures.
794848b8605Smrg
795848b8605Smrg        Much of text of this extension that has changed since
796848b8605Smrg        GL_MESAX_texture_stack comes directly from either
797848b8605Smrg        GL_EXT_texture_array or GL_NV_gpu_program4.
798848b8605Smrg
799848b8605SmrgRevision History
800848b8605Smrg
801848b8605Smrg    ||2005/11/15||0.1||idr||Initial draft MESAX version.||
802848b8605Smrg    ||2005/12/07||0.2||idr||Added framebuffer object interactions.||
803848b8605Smrg    ||2005/12/12||0.3||idr||Updated fragment program interactions.||
804848b8605Smrg    ||2007/05/16||0.4||idr||Converted to MESA_texture_array.  Brought in line with EXT_texture_array and NV_gpu_program4.||
805