• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    OES_texture_view
4
5Name Strings
6
7    GL_OES_texture_view
8
9Contact
10
11    Jon Leech (oddhack 'at' sonic.net)
12    Daniel Koch, NVIDIA (dkoch 'at' nvidia.com)
13
14Contributors
15
16    Jeff Bolz, NVIDIA Corporation (jbolz 'at' nvidia.com)
17    Pat Brown, NVIDIA
18    Slawomir Grajewski, Intel
19    Jon Leech
20
21Notice
22
23    Copyright (c) 2012-2013 The Khronos Group Inc. Copyright terms at
24        http://www.khronos.org/registry/speccopyright.html
25
26Specification Update Policy
27
28    Khronos-approved extension specifications are updated in response to
29    issues and bugs prioritized by the Khronos OpenGL ES Working Group. For
30    extensions which have been promoted to a core Specification, fixes will
31    first appear in the latest version of that core Specification, and will
32    eventually be backported to the extension document. This policy is
33    described in more detail at
34        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
35
36    Portions Copyright (c) 2013-2014 NVIDIA Corporation.
37
38Status
39
40    Approved by the OpenGL ES Working Group
41    Ratified by the Khronos Board of Promoters on November 7, 2014
42
43Version
44
45    Last Modified Date: June 18, 2014
46    Revision: 1
47
48Number
49
50    OpenGL ES Extension #218
51
52Dependencies
53
54    OpenGL ES 3.1 and OpenGL ES Shading Language 3.10 are required.
55
56    This specification is written against the OpenGL ES 3.1 (March 17,
57    2014) and OpenGL ES 3.10 Shading Language (March 17, 2014)
58    Specifications.
59
60    OES_texture_buffer and EXT_texture_buffer affect the definition of this
61    extension.
62
63    OES_texture_cube_map_array and EXT_texture_cube_map_array affects the
64    definition of this extension.
65
66    OES_texture_storage_multisample_2d_array interacts with this extension.
67
68    EXT_texture_compression_s3tc interacts with this extension.
69
70    EXT_texture_compression_rgtc interacts with this extension.
71
72    EXT_texture_compression_bptc interacts with this extension.
73
74    KHR_texture_compression_astc_ldr interacts with this extension.
75
76    KHR_texture_compression_astc_hdr interacts with this extension.
77
78    OES_texture_compression_astc interacts with this extension.
79
80Overview
81
82    This extension allows a texture's data store to be "viewed" in multiple
83    ways, either reinterpreting the data format/type as a different format/
84    type with the same element size, or by clamping the mipmap level range
85    or array slice range.
86
87    The goals of this extension are to avoid having these alternate views
88    become shared mutable containers of shared mutable objects, and to add
89    the views to the API in a minimally invasive way.
90
91    No new object types are added. Conceptually, a texture object is split
92    into the following parts:
93
94        - A data store holding texel data.
95        - State describing which portions of the data store to use, and how
96          to interpret the data elements.
97        - An embedded sampler object.
98        - Various other texture parameters.
99
100    With this extension, multiple textures can share a data store and have
101    different state describing which portions of the data store to use and
102    how to interpret the data elements. The data store is refcounted and not
103    destroyed until the last texture sharing it is deleted.
104
105    This extension leverages the concept of an "immutable texture".
106    Views can only be created of textures created with TexStorage*.
107
108
109New Procedures and Functions
110
111    void TextureViewOES(uint texture, enum target, uint origtexture,
112                        enum internalformat,
113                        uint minlevel, uint numlevels,
114                        uint minlayer, uint numlayers);
115
116New Tokens
117
118    Accepted by the <pname> parameters of GetTexParameterfv and
119    GetTexParameteriv:
120
121        TEXTURE_VIEW_MIN_LEVEL_OES                      0x82DB
122        TEXTURE_VIEW_NUM_LEVELS_OES                     0x82DC
123        TEXTURE_VIEW_MIN_LAYER_OES                      0x82DD
124        TEXTURE_VIEW_NUM_LAYERS_OES                     0x82DE
125        TEXTURE_IMMUTABLE_LEVELS                        0x82DF
126
127    Used as compatibility class names in table 8.X.2:
128
129        VIEW_CLASS_128_BITS
130        VIEW_CLASS_96_BITS
131        VIEW_CLASS_64_BITS
132        VIEW_CLASS_48_BITS
133        VIEW_CLASS_32_BITS
134        VIEW_CLASS_24_BITS
135        VIEW_CLASS_16_BITS
136        VIEW_CLASS_8_BITS
137        VIEW_CLASS_RGTC1_RED
138        VIEW_CLASS_RGTC2_RG
139        VIEW_CLASS_BPTC_UNORM
140        VIEW_CLASS_BPTC_FLOAT
141        VIEW_CLASS_S3TC_DXT1_RGB
142        VIEW_CLASS_S3TC_DXT1_RGBA
143        VIEW_CLASS_S3TC_DXT3_RGBA
144        VIEW_CLASS_S3TC_DXT5_RGBA
145        VIEW_CLASS_EAC_R11
146        VIEW_CLASS_EAC_RG11
147        VIEW_CLASS_ETC2_RGB
148        VIEW_CLASS_ETC2_RGBA
149        VIEW_CLASS_ETC2_EAC_RGBA
150        VIEW_CLASS_ASTC_4x4_RGBA
151        VIEW_CLASS_ASTC_5x4_RGBA
152        VIEW_CLASS_ASTC_5x5_RGBA
153        VIEW_CLASS_ASTC_6x5_RGBA
154        VIEW_CLASS_ASTC_6x6_RGBA
155        VIEW_CLASS_ASTC_8x5_RGBA
156        VIEW_CLASS_ASTC_8x6_RGBA
157        VIEW_CLASS_ASTC_8x8_RGBA
158        VIEW_CLASS_ASTC_10x5_RGBA
159        VIEW_CLASS_ASTC_10x6_RGBA
160        VIEW_CLASS_ASTC_10x8_RGBA
161        VIEW_CLASS_ASTC_10x10_RGBA
162        VIEW_CLASS_ASTC_12x10_RGBA
163        VIEW_CLASS_ASTC_12x12_RGBA
164        VIEW_CLASS_ASTC_3x3x3_RGBA
165        VIEW_CLASS_ASTC_4x3x3_RGBA
166        VIEW_CLASS_ASTC_4x4x3_RGBA
167        VIEW_CLASS_ASTC_4x4x4_RGBA
168        VIEW_CLASS_ASTC_5x4x4_RGBA
169        VIEW_CLASS_ASTC_5x5x4_RGBA
170        VIEW_CLASS_ASTC_5x5x5_RGBA
171        VIEW_CLASS_ASTC_6x5x5_RGBA
172        VIEW_CLASS_ASTC_6x6x5_RGBA
173        VIEW_CLASS_ASTC_6x6x6_RGBA
174    (The VIEW_CLASS_* tokens used as compatibility class names in table
175    8.X.2 are the same tokens returned by the VIEW_COMPATIBILITY_CLASS query
176    in ARB_internalformat_query2. In this extension they are simply a
177    labelling mechanism and serve no functional purpose in the API, so their
178    numeric values are not specified.)
179
180Additions to the OpenGL ES 3.1 Specification
181
182    Modify section 5.3, "Propagating Changes to Objects"
183
184    Add to the paragraph starting "When <T> is a texture, the contents ..."
185    on p. 44:
186
187    When <T> is a texture, the contents of <T> are construed to include the
188    contents of the data store of <T>, even if <T>'s data store was modified
189    via a different view of the data store.
190
191
192    Modify subsection 8.9, "Texture Parameters"
193
194    Add the following to the end of the paragraph on p. 171 starting
195    "In the remainder of chapter 8, denote by lod_min...":
196
197    If the texture was created with TextureViewOES, then the
198    TEXTURE_BASE_LEVEL and TEXTURE_MAX_LEVEL parameters are interpreted
199    relative to the view and not relative to the original data store.
200
201
202    Modify section 8.10.2, "Texture Parameter Queries"
203
204    Add to the list of legal <pname>s in the description of GetTexParameter
205    on p. 172:
206
207    ... <pname> must be IMAGE_FORMAT_COMPATIBILITY_TYPE,
208    TEXTURE_IMMUTABLE_FORMAT, TEXTURE_IMMUTABLE_LEVELS,
209    TEXTURE_VIEW_MIN_LEVEL_OES, TEXTURE_VIEW_NUM_LEVELS_OES,
210    TEXTURE_VIEW_MIN_LAYER_OES, TEXTURE_VIEW_NUM_LAYERS_OES, or one of the
211    symbolic values in table 8.20.
212
213
214    Add a new subsection 8.16view following section 8.16, "Texture Completeness"
215
216    8.16view Texture Views
217
218    A texture can be created which references the data store of another
219    texture and interprets the data with a different format, and/or selects
220    a subset of the levels and/or layers of the other texture. The data
221    store for such a texture is shared with the data store of the original
222    texture. Updating the shared data store using the original texture
223    affects texture values read using the new texture, and vice versa. A
224    texture data store remains in existence until all textures that
225    reference it are deleted.
226
227    The command:
228
229        void TextureViewOES(uint texture, enum target, uint origtexture,
230                         enum internalformat,
231                         uint minlevel, uint numlevels,
232                         uint minlayer, uint numlayers);
233
234    initializes the texture named <texture> to the target specified by
235    <target>. <texture>'s data store is inherited from the texture named
236    <origtexture>, but elements of the data store are interpreted according
237    to the internal format specified by <internalformat>. Additionally, if the
238    original texture is an array or has multiple mipmap levels, the parameters
239    <minlayer>, <numlayers>, <minlevel>, and <numlevels> control which of those
240    slices and levels are considered part of the texture.
241
242    The <minlevel> and <minlayer> parameters are relative to the view of the
243    original texture. If <numlayers> or <numlevels> extend beyond the
244    original texture, they are clamped to the max extent of the original
245    texture.
246
247    If the command is successful, the texture parameters in <texture> are
248    updated as follows:
249
250     - TEXTURE_IMMUTABLE_FORMAT is set to TRUE.
251
252     - TEXTURE_IMMUTABLE_LEVELS is set to the value of
253       TEXTURE_IMMUTABLE_LEVELS for <origtexture>.
254
255     - TEXTURE_VIEW_MIN_LEVEL_OES is set to <minlevel> plus the value of
256       TEXTURE_VIEW_MIN_LEVEL_OES for <origtexture>.
257
258     - TEXTURE_VIEW_MIN_LAYER_OES is set to <minlayer> plus the value of
259       TEXTURE_VIEW_MIN_LAYER_OES for <origtexture>.
260
261     - TEXTURE_VIEW_NUM_LEVELS_OES is set to the lesser of <numlevels> and
262       the value of TEXTURE_VIEW_NUM_LEVELS_OES for <origtexture> minus
263       <minlevels>.
264
265     - TEXTURE_VIEW_NUM_LAYERS_OES is set to the lesser of <numlayers> and
266       the value of TEXTURE_VIEW_NUM_LAYERS_OES for <origtexture> minus
267       <minlayer>.
268
269    The new texture's target must be <compatible> with the target of
270    <origtexture>, as defined by table 8.X.1.
271
272    Numerous constraints on <numlayers> and the texture dimensions depend on
273    <target> and the target of <origtexture>. These constraints are
274    summarized below in the errors section.
275
276        --------------------------------------------------------------------------------------------
277        | Original target             |  Valid new targets                                         |
278        |------------------------------------------------------------------------------------------|
279        | TEXTURE_2D                  |  TEXTURE_2D, TEXTURE_2D_ARRAY                              |
280        |------------------------------------------------------------------------------------------|
281        | TEXTURE_3D                  |  TEXTURE_3D                                                |
282        |------------------------------------------------------------------------------------------|
283        | TEXTURE_CUBE_MAP            |  TEXTURE_CUBE_MAP, TEXTURE_2D, TEXTURE_2D_ARRAY,           |
284        |                             |  TEXTURE_CUBE_MAP_ARRAY_OES                                |
285        |------------------------------------------------------------------------------------------|
286        | TEXTURE_BUFFER_OES          |  <none>                                                    |
287        |------------------------------------------------------------------------------------------|
288        | TEXTURE_2D_ARRAY            |  TEXTURE_2D_ARRAY, TEXTURE_2D, TEXTURE_CUBE_MAP,           |
289        |                             |  TEXTURE_CUBE_MAP_ARRAY_OES                                |
290        |------------------------------------------------------------------------------------------|
291        | TEXTURE_CUBE_MAP_ARRAY      |  TEXTURE_CUBE_MAP_ARRAY_OES, TEXTURE_2D_ARRAY, TEXTURE_2D, |
292        |                             |  TEXTURE_CUBE_MAP                                          |
293        |------------------------------------------------------------------------------------------|
294        | TEXTURE_2D_MULTISAMPLE      |  TEXTURE_2D_MULTISAMPLE, TEXTURE_2D_MULTISAMPLE_ARRAY_OES  |
295        |------------------------------------------------------------------------------------------|
296        | TEXTURE_2D_MULTISAMPLE_ARRAY_OES|TEXTURE_2D_MULTISAMPLE, TEXTURE_2D_MULTISAMPLE_ARRAY_OES|
297        --------------------------------------------------------------------------------------------
298
299        Table 8.X.1: Legal texture targets for TextureViewOES.
300
301    When <origtexture>'s target is TEXTURE_CUBE_MAP, the layer parameters
302    are interpreted in the same order as if it were a
303    TEXTURE_CUBE_MAP_ARRAY_OES with 6 layer-faces.
304
305    The two textures' internal formats must be compatible according to Table
306    8.X.2 (Compatible internal formats for TextureViewOES) if the internal
307    format exists in that table. The internal formats must be identical if
308    not in that table.
309
310    --------------------------------------------------------------------------
311    | Class                      | Internal formats                          |
312    --------------------------------------------------------------------------
313    | VIEW_CLASS_128_BITS        | RGBA32F, RGBA32UI, RGBA32I                |
314    --------------------------------------------------------------------------
315    | VIEW_CLASS_96_BITS         | RGB32F, RGB32UI, RGB32I                   |
316    --------------------------------------------------------------------------
317    | VIEW_CLASS_64_BITS         | RGBA16F, RG32F, RGBA16UI, RG32UI,         |
318    |                            | RGBA16I, RG32I                            |
319    --------------------------------------------------------------------------
320    | VIEW_CLASS_48_BITS         | RGB16F, RGB16UI, RGB16I                   |
321    --------------------------------------------------------------------------
322    | VIEW_CLASS_32_BITS         | RG16F, R11F_G11F_B10F, R32F,              |
323    |                            | RGB10_A2UI, RGBA8UI, RG16UI, R32UI,       |
324    |                            | RGBA8I, RG16I, R32I, RGB10_A2, RGBA8,     |
325    |                            | RGBA8_SNORM, SRGB8_ALPHA8, RGB9_E5        |
326    -------------------------------------------------------------------------
327    | VIEW_CLASS_24_BITS         | RGB8, RGB8_SNORM, SRGB8, RGB8UI, RGB8I    |
328    --------------------------------------------------------------------------
329    | VIEW_CLASS_16_BITS         | R16F, RG8UI, R16UI, RG8I, R16I, RG8,      |
330    |                            | RG8_SNORM                                 |
331    --------------------------------------------------------------------------
332    | VIEW_CLASS_8_BITS          | R8UI, R8I, R8, R8_SNORM                   |
333    --------------------------------------------------------------------------
334    | VIEW_CLASS_RGTC1_RED       | COMPRESSED_RED_RGTC1_EXT,                 |
335    |                            | COMPRESSED_SIGNED_RED_RGTC1_EXT           |
336    --------------------------------------------------------------------------
337    | VIEW_CLASS_RGTC2_RG        | COMPRESSED_RG_RGTC2_EXT,                  |
338    |                            | COMPRESSED_SIGNED_RG_RGTC2_EXT            |
339    --------------------------------------------------------------------------
340    | VIEW_CLASS_BPTC_UNORM      | COMPRESSED_RGBA_BPTC_UNORM_EXT,           |
341    |                            | COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT      |
342    --------------------------------------------------------------------------
343    | VIEW_CLASS_BPTC_FLOAT      | COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,     |
344    |                            | COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT    |
345    --------------------------------------------------------------------------
346    | VIEW_CLASS_S3TC_DXT1_RGB   | COMPRESSED_RGB_S3TC_DXT1_EXT,             |
347    |                            | COMPRESSED_SRGB_S3TC_DXT1_EXT             |
348    --------------------------------------------------------------------------
349    | VIEW_CLASS_S3TC_DXT1_RGBA  | COMPRESSED_RGBA_S3TC_DXT1_EXT,            |
350    |                            | COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT       |
351    --------------------------------------------------------------------------
352    | VIEW_CLASS_S3TC_DXT3_RGBA  | COMPRESSED_RGBA_S3TC_DXT3_EXT,            |
353    |                            | COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT       |
354    --------------------------------------------------------------------------
355    | VIEW_CLASS_S3TC_DXT5_RGBA  | COMPRESSED_RGBA_S3TC_DXT5_EXT,            |
356    |                            | COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT       |
357    --------------------------------------------------------------------------
358    | VIEW_CLASS_EAC_R11         | COMPRESSED_R11_EAC,                       |
359    |                            | COMPRESSED_SIGNED_R11_EAC                 |
360    --------------------------------------------------------------------------
361    | VIEW_CLASS_EAC_RG11        | COMPRESSED_RG11_EAC,                      |
362    |                            | COMPRESSED_SIGNED_RG11_EAC                |
363    --------------------------------------------------------------------------
364    | VIEW_CLASS_ETC2_RGB        | COMPRESSED_RGB8_ETC2,                     |
365    |                            | COMPRESSED_SRGB8_ETC2                     |
366    --------------------------------------------------------------------------
367    | VIEW_CLASS_ETC2_RGBA       | COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, |
368    |                            | COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 |
369    --------------------------------------------------------------------------
370    | VIEW_CLASS_ETC2_EAC_RGBA   | COMPRESSED_RGBA8_ETC2_EAC,                |
371    |                            | COMPRESSED_SRGB8_ALPHA8_ETC2_EAC          |
372    --------------------------------------------------------------------------
373    | VIEW_CLASS_ASTC_4x4_RGBA   | COMPRESSED_RGBA_ASTC_4x4_KHR,             |
374    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR      |
375    --------------------------------------------------------------------------
376    | VIEW_CLASS_ASTC_5x4_RGBA   | COMPRESSED_RGBA_ASTC_5x4_KHR,             |
377    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR      |
378    --------------------------------------------------------------------------
379    | VIEW_CLASS_ASTC_5x5_RGBA   | COMPRESSED_RGBA_ASTC_5x5_KHR,             |
380    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR      |
381    --------------------------------------------------------------------------
382    | VIEW_CLASS_ASTC_6x5_RGBA   | COMPRESSED_RGBA_ASTC_6x5_KHR,             |
383    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR      |
384    --------------------------------------------------------------------------
385    | VIEW_CLASS_ASTC_6x6_RGBA   | COMPRESSED_RGBA_ASTC_6x6_KHR,             |
386    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR      |
387    --------------------------------------------------------------------------
388    | VIEW_CLASS_ASTC_8x5_RGBA   | COMPRESSED_RGBA_ASTC_8x5_KHR,             |
389    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR      |
390    --------------------------------------------------------------------------
391    | VIEW_CLASS_ASTC_8x6_RGBA   | COMPRESSED_RGBA_ASTC_8x6_KHR,             |
392    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR      |
393    --------------------------------------------------------------------------
394    | VIEW_CLASS_ASTC_8x8_RGBA   | COMPRESSED_RGBA_ASTC_8x8_KHR,             |
395    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR      |
396    --------------------------------------------------------------------------
397    | VIEW_CLASS_ASTC_10x5_RGBA  | COMPRESSED_RGBA_ASTC_10x5_KHR,            |
398    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR     |
399    --------------------------------------------------------------------------
400    | VIEW_CLASS_ASTC_10x6_RGBA  | COMPRESSED_RGBA_ASTC_10x6_KHR,            |
401    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR     |
402    --------------------------------------------------------------------------
403    | VIEW_CLASS_ASTC_10x8_RGBA  | COMPRESSED_RGBA_ASTC_10x8_KHR,            |
404    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR     |
405    --------------------------------------------------------------------------
406    | VIEW_CLASS_ASTC_10x10_RGBA | COMPRESSED_RGBA_ASTC_10x10_KHR,           |
407    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR    |
408    --------------------------------------------------------------------------
409    | VIEW_CLASS_ASTC_12x10_RGBA | COMPRESSED_RGBA_ASTC_12x10_KHR,           |
410    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR    |
411    --------------------------------------------------------------------------
412    | VIEW_CLASS_ASTC_12x12_RGBA | COMPRESSED_RGBA_ASTC_12x12_KHR,           |
413    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR    |
414    --------------------------------------------------------------------------
415    | VIEW_CLASS_ASTC_3x3x3_RGBA | COMPRESSED_RGBA_ASTC_3x3x3_OES,           |
416    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES    |
417    --------------------------------------------------------------------------
418    | VIEW_CLASS_ASTC_4x3x3_RGBA | COMPRESSED_RGBA_ASTC_4x3x3_OES,           |
419    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES    |
420    --------------------------------------------------------------------------
421    | VIEW_CLASS_ASTC_4x4x3_RGBA | COMPRESSED_RGBA_ASTC_4x4x3_OES,           |
422    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES    |
423    --------------------------------------------------------------------------
424    | VIEW_CLASS_ASTC_4x4x4_RGBA | COMPRESSED_RGBA_ASTC_4x4x4_OES,           |
425    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES    |
426    --------------------------------------------------------------------------
427    | VIEW_CLASS_ASTC_5x4x4_RGBA | COMPRESSED_RGBA_ASTC_5x4x4_OES,           |
428    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES    |
429    --------------------------------------------------------------------------
430    | VIEW_CLASS_ASTC_5x5x4_RGBA | COMPRESSED_RGBA_ASTC_5x5x4_OES,           |
431    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES    |
432    --------------------------------------------------------------------------
433    | VIEW_CLASS_ASTC_5x5x5_RGBA | COMPRESSED_RGBA_ASTC_5x5x5_OES,           |
434    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES    |
435    --------------------------------------------------------------------------
436    | VIEW_CLASS_ASTC_6x5x5_RGBA | COMPRESSED_RGBA_ASTC_6x5x5_OES,           |
437    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES    |
438    --------------------------------------------------------------------------
439    | VIEW_CLASS_ASTC_6x6x5_RGBA | COMPRESSED_RGBA_ASTC_6x6x5_OES,           |
440    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES    |
441    --------------------------------------------------------------------------
442    | VIEW_CLASS_ASTC_6x6x6_RGBA | COMPRESSED_RGBA_ASTC_6x6x6_OES,           |
443    |                            | COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES    |
444    --------------------------------------------------------------------------
445
446        Table 8.X.2: Compatible internal formats for TextureViewOES. Formats
447        in the same entry may be cast to each other.
448
449    If the internal format does not exactly match the internal format of the
450    original texture, the contents of the memory are reinterpreted in the
451    same manner as for image bindings described in section 8.22.
452
453    Texture commands that take a <level> or <layer> parameter, such as
454    TexSubImage2D, interpret that parameter to be relative to the view of
455    the texture. i.e. the mipmap level of the data store that would be
456    updated via TexSubImage2D would be the sum of <level> and the value of
457    TEXTURE_VIEW_MIN_LEVEL_OES.
458
459
460    Errors
461
462    An INVALID_VALUE error is generated if <texture> is zero.
463
464    An INVALID_OPERATION error is generated by TextureViewOES if <texture>
465    is not a valid name returned by GenTextures, or if <texture> has already
466    been bound and given a target.
467
468    An INVALID_VALUE error is generated if <origtexture> is not the name of
469    a texture.
470
471    An INVALID_OPERATION error is generated if the value of
472    TEXTURE_IMMUTABLE_FORMAT for <origtexture> is not TRUE.
473
474    An INVALID_OPERATION error is generated if <target> is not compatible
475    with the target of <origtexture>, as defined by table 8.X.1.
476
477    An INVALID_OPERATION error is generated if the internal format of
478    <origtexture> exists in table 8.X.2 and is not compatible with
479    <internalformat>, as described in that table.
480
481    An INVALID_OPERATION error is generated if the internal format of
482    <origtexture> does not exist in table 8.X.2, and is not identical to
483    <internalformat>.
484
485    An INVALID_VALUE error is generated if <minlevel> or <minlayer> are
486    larger than the greatest level or layer, respectively, of <origtexture>.
487
488    An INVALID_VALUE error is generated if <target> is TEXTURE_CUBE_MAP and
489    the clamped <numlayers> is not 6.
490
491    An INVALID_VALUE error is generated if <target> is
492    TEXTURE_CUBE_MAP_ARRAY_OES and the clamped <numlayers> is not a multiple
493    of 6. In this case <numlayers> counts layer-faces rather than layers.
494
495    An INVALID_VALUE error is generated if <target> is TEXTURE_2D,
496    TEXTURE_3D, or TEXTURE_2D_MULTISAMPLE and <numlayers> does not equal 1.
497
498    An INVALID_OPERATION error is generated if <target> is
499    TEXTURE_CUBE_MAP or TEXTURE_CUBE_MAP_ARRAY_OES, and the width and height
500    of <origtexture>'s levels are not equal.
501
502    An INVALID_OPERATION error is generated if any dimension of
503    <origtexture> is larger than the maximum supported corresponding
504    dimension of the new target. For example, if <origtexture> has a
505    TEXTURE_2D_ARRAY target and <target> is TEXTURE_CUBE_MAP, its width must
506    be no greater than the value of MAX_CUBE_MAP_TEXTURE_SIZE.
507
508
509    Modify section 8.17, "Immutable-Format Texture Images"
510
511    Modify the third bullet on p. 188, starting "If the command is
512    successful, TEXTURE_IMMUTABLE_FORMAT...":
513
514    If the command is successful, TEXTURE_IMMUTABLE_FORMAT becomes TRUE,
515    TEXTURE_IMMUTABLE_LEVELS and TEXTURE_VIEW_NUM_LEVELS_OES become
516    <levels>. If the texture target is TEXTURE_2D_ARRAY,
517    TEXTURE_CUBE_MAP_ARRAY, or TEXTURE_2D_MULTISAMPLE_ARRAY_OES then
518    TEXTURE_VIEW_NUM_LAYERS_OES becomes <depth>. If the texture target is
519    TEXTURE_CUBE_MAP, then TEXTURE_VIEW_NUM_LAYERS_OES becomes 6. For any
520    other texture target, TEXTURE_VIEW_NUM_LAYERS_OES becomes 1.
521
522
523    Modify section 8.18, "Texture State"
524
525    Add to the fourth paragraph on the section on p. 191, starting "Next,
526    there are the":
527
528    "... swizzle modes (see section 14.2.1), and four integers describing
529    the texture view base level, number of levels, minimum array layer, and
530    number of layers."
531
532    Add to the following paragraph starting "In the initial state":
533
534    "... and ALPHA, respectively. The values of TEXTURE_VIEW_MIN_LEVEL_OES,
535    TEXTURE_VIEW_NUM_LEVELS_OES, TEXTURE_VIEW_MIN_LAYER_OES,
536    TEXTURE_VIEW_NUM_LAYERS_OES are each zero."
537
538
539Dependencies on OES_texture_buffer or EXT_texture_buffer
540
541    If OES_texture_buffer or EXT_texture_buffer is not supported, remove
542    TEXTURE_BUFFER_OES from the list of targets in table 8.X.1.
543
544Dependencies on OES_texture_cube_map_array or EXT_texture_cube_map_array
545
546    If OES_texture_cube_map_array or EXT_texture_cube_map_array is not
547    supported, remove all references to TEXTURE_CUBE_MAP_ARRAY_OES.
548
549Dependencies on OES_texture_storage_multisample_2d_array
550
551    If OES_texture_storage_multisample_2d_array is not supported, remove all
552    references to TEXTURE_2D_MULTISAMPLE_ARRAY_OES
553
554Dependencies on EXT_texture_compression_s3tc
555
556    If EXT_texture_compression_s3tc is not supported, remove any
557    references to S3TC compressed texture formats.
558
559Dependencies on EXT_texture_compression_rgtc
560
561    If EXT_texture_compression_rgtc is not supported, remove any
562    references to the RGTC compressed texture formats.
563
564Dependencies on EXT_texture_compression_bptc
565
566    If EXT_texture_compression_bptc is not supported, remove any
567    references to the BPTC compressed texture formats.
568
569Dependencies on KHR_texture_compression_astc_ldr
570
571    If KHR_texture_compression_astc_ldr is not supported, remove any
572    references to the ASTC LDR compressed texture formats.
573
574Dependencies on KHR_texture_compression_astc_hdr
575
576    If KHR_texture_compression_astc_hdr is not supported, remove any
577    references to the ASTC HDR compressed texture formats.
578
579Dependencies on OES_texture_compression_astc
580
581    If OES_texture_compression_astc is not supported, remove any
582    references to the ASTC 3D compressed texture formats.
583
584New State
585
586    Add to table 20.9, Textures (state per texture object)
587
588                                                         Initial
589    Get Value                    Type   Get Command      Value    Description                   Sec.
590    ---------------------------  ----   -----------      -------  ----------------------------- ------
591    TEXTURE_VIEW_MIN_LEVEL_OES    Z+    GetTexParameter  0        view base texture level       8.16view
592    TEXTURE_VIEW_NUM_LEVELS_OES   Z+    GetTexParameter  0        view number of texture levels 8.16view
593    TEXTURE_VIEW_MIN_LAYER_OES    Z+    GetTexParameter  0        view min array layer          8.16view
594    TEXTURE_VIEW_NUM_LAYERS_OES   Z+    GetTexParameter  0        view number of array layers   8.16view
595
596New Implementation Dependent State
597
598    None.
599
600Examples
601
602    TODO
603
604Issues
605
606    Note: These issues apply specifically to the definition of the
607    OES_texture_view specification, which is based on the OpenGL
608    extension ARB_texture_view. Resolved issues from ARB_texture_view
609    have been removed, but remain largely applicable to this extension.
610    ARB_texture_view can be found in the OpenGL Registry.
611
612    (1) What functionality was removed from ARB_texture_view?
613
614      - Texture targets TEXTURE_1D_ARRAY and TEXTURE_RECTANGLE.
615      - View classes VIEW_CLASS_RGTC1_RED, VIEW_CLASS_RGTC2_RG,
616        VIEW_CLASS_BPTC_UNORM, and VIEW_CLASS_BPTC_FLOAT, corresponding
617        to GL-only RGTC and BPTC compressed texture formats.
618      - Base and internal formats R16, R16_SNORM, RG16, RG16_SNORM, RGB16,
619        RGB16_SNORM, RGBA16, and RGBA16_SNORM (see bug 11366).
620
621    (2) Should there be ETC2/EAC view classes added corresponding to
622    those texture formats?
623
624    RESOLVED. Yes. These view classes don't exist in OpenGL 4.4 or any GL
625    extension, even though ETC2/EAC compressed formats are part of 4.4.
626    However as these formats are likely to be more important in an
627    OpenGL ES environment and thus support is added.  Support is also
628    included for ASTC and RGTC and BPTC in case those texture formats
629    are also supported.
630
631Revision History
632
633    Rev.    Date    Author    Changes
634    ----  --------  --------- -------------------------------------------------
635     1    06/18/2014   dkoch     Initial OES version based on EXT.
636                                 No functional changes.
637