• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    ARB_ES3_compatibility
4
5Name Strings
6
7    GL_ARB_ES3_compatibility
8
9Contact
10
11    Piers Daniell, NVIDIA Corporation (pdaniell 'at' nvidia.com)
12
13Contributors
14
15    Bruce Merry
16    Jeff Bolz, NVIDIA
17    John Kessenich
18    Jon Leech
19    Pat Brown, NVIDIA
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 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
36Status
37
38    Complete.
39    Approved by the ARB on 2012/06/12.
40
41Version
42
43    Last Modified Date:         October 18, 2013
44    Revision:                   10
45
46Number
47
48    ARB Extension #127
49
50Dependencies
51
52    OpenGL 3.3, ARB_ES2_compatibility, ARB_invalidate_subdata, and
53    ARB_texture_storage are required.
54
55    The ETC2 and EAC texture compression formats added to OpenGL-ES 3.0
56    OES_compressed_ETC2_RGB8_texture,
57    OES_compressed_ETC2_sRGB8_texture,
58    OES_compressed_ETC2_punchthroughA_RGBA8_texture,
59    OES_compressed_ETC2_punchthroughA_sRGB8_alpha_texture,
60    OES_compressed_ETC2_RGBA8_texture,
61    OES_compressed_ETC2_sRGB8_alpha8_texture,
62    OES_compressed_EAC_R11_unsigned_texture,
63    OES_compressed_EAC_R11_signed_texture,
64    OES_compressed_EAC_RG11_unsigned_texture and
65    OES_compressed_EAC_RG11_signed_texture are required.
66
67    This extension is written against The OpenGL 4.2 (Compatibility Profile)
68    specification.
69
70Overview
71
72    This extension adds support for features of OpenGL ES 3.0 that are
73    missing from OpenGL 3.x. Enabling these features will ease the process
74    of porting applications from OpenGL ES 3.0 to OpenGL. These features
75    include conservative boolean occlusion queries, primitive restart with a
76    fixed index, the OpenGL ES Shading Language 3.00 specification, and the
77    dependencies stated above.
78
79New Procedures and Functions
80
81    None
82
83New Tokens
84
85    Accepted by the <internalformat> parameter of CompressedTexImage2D
86        COMPRESSED_RGB8_ETC2                             0x9274
87        COMPRESSED_SRGB8_ETC2                            0x9275
88        COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2         0x9276
89        COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2        0x9277
90        COMPRESSED_RGBA8_ETC2_EAC                        0x9278
91        COMPRESSED_SRGB8_ALPHA8_ETC2_EAC                 0x9279
92        COMPRESSED_R11_EAC                               0x9270
93        COMPRESSED_SIGNED_R11_EAC                        0x9271
94        COMPRESSED_RG11_EAC                              0x9272
95        COMPRESSED_SIGNED_RG11_EAC                       0x9273
96
97    Accepted by the <target> parameter of Enable and Disable:
98
99        PRIMITIVE_RESTART_FIXED_INDEX                    0x8D69
100
101    Accepted by the <target> parameter of BeginQuery, EndQuery,
102    GetQueryIndexediv and GetQueryiv:
103
104        ANY_SAMPLES_PASSED_CONSERVATIVE                  0x8D6A
105
106    Accepted by the <value> parameter of the GetInteger* functions:
107
108        MAX_ELEMENT_INDEX                                0x8D6B
109
110    Accepted by the <pname> parameters of GetTexParameterfv and
111    GetTexParameteriv:
112
113        TEXTURE_IMMUTABLE_LEVELS                         0x82DF
114
115Additions to Chapter 2 of the OpenGL 4.2 (Compatibility Profile)
116Specification (OpenGL Operation)
117
118    Modify Section 1.7.1 (OpenGL Shading Language) to require the OpenGL
119    ES Shading Language specifications:
120
121    "This specification should be read together with a companion documents
122    titled The OpenGL Shading Language and The OpenGL ES Shading Language.
123    ..."
124
125    And later in this section:
126
127    "OpenGL 4.2 implementations are guaranteed to support version 4.20 of the
128    OpenGL Shading Language, version 1.00 of the OpenGL ES Shading Language
129    and version 3.00 of the OpenGL ES Shading Language, and the version
130    required by the application is specified in the shader source. ..."
131
132    Modify Section 2.8 (Vertex Arrays) on page 45 before the start of
133    Section 2.8.1:
134
135    "Primitive restart can also be enabled or disabled with a <target> of
136    PRIMITIVE_RESTART_FIXED_INDEX. In this case, the primitive restart index
137    is equal to 2^N-1, where N is 8, 16 or 32 if the type is UNSIGNED_BYTE,
138    UNSIGNED_SHORT, or UNSIGNED_INT, respectively, and the <index> value
139    specified by PrimitiveRestartIndex is ignored.
140
141    If both PRIMITIVE_RESTART and PRIMITIVE_RESTART_FIXED_INDEX are enabled,
142    the <index> value determined by PRIMITIVE_RESTART_FIXED_INDEX is used.
143    If PRIMITIVE_RESTART_FIXED_INDEX is enabled, primitive restart is not
144    performed for array elements transferred by any drawing command not
145    taking a <type> parameter, including ArrayElement or any of the Draw*
146    commands other than *DrawElements*."
147
148    Modify Section 2.18 (Asynchronous Queries) on page 195 to add
149    ANY_SAMPLES_PASSED_CONSERVATIVE as another <target> option:
150
151    "BeginQuery sets the active query object name for the query type given by
152    <target> to <id>. If BeginQuery is called with an id of zero, if the
153    active query object name for target is non-zero (for the targets
154    SAMPLES_PASSED, ANY_SAMPLES_PASSED, and ANY_SAMPLES_PASSED_CONSERVATIVE if
155    the active query for either target is non-zero), if <id> is the name of an
156    existing query object whose type does not match target, if <id> is the
157    active query object name for any query type, or if id is the active query
158    object  for condtional rendering (see section 2.19), the error
159    INVALID_OPERATION is generated."
160
161    Modify Section 2.19 (Conditional Rendering) on page 197 to add
162    ANY_SAMPLES_PASSED_CONSERVATIVE as another <mode> option:
163
164    "If the result (SAMPLES_PASSED) of the query is zero, or if the result
165    (ANY_SAMPLES_PASSED or ANY_SAMPLES_PASSED_CONSERVATIVE) is false, all
166    rendering comands between BeginConditionalRender and the corresponding
167    EndConditionalRender are discarded. ..."
168
169    And later in this paragraph:
170
171    "... If the result (SAMPLES_PASSED) of the query is non-zero, or if the
172    result (ANY_SAMPLES_PASSED or ANY_SAMPLES_PASSED_CONSERVATIVE) is true,
173    such commands are not discarded."
174
175    Again at the end of Section 2.19 (Conditional Rendering) on page 198:
176
177    "If <id> is the name of a query object with a target other than
178    SAMPLES_PASSED, ANY_SAMPLES_PASSED or ANY_SAMPLES_PASSED_CONSERVATIVE,
179    or if <id> is the name of a query currently in progress, the error
180    INVALID_OPERATION is generated."
181
182    Modify subsection 3.10.15 (Texture State and Proxy State):
183
184    Modify the end of the first paragraph on page 345
185
186    "... The value of TEXTURE_IMMUTABLE_FORMAT is FALSE. The value of
187    TEXTURE_IMMUTABLE_LEVELS is 0. The values of DEPTH_TEXTURE_MODE,
188    TEXTURE_COMPARE_MODE, and TEXTURE_COMPARE_FUNC are LUMINANCE,
189    NONE, and LEQUAL respectively. ..."
190
191    Modify subsection 3.10.16 (Immutable-Format Texture Images):
192
193    Modify the second to last bullet on page 347
194
195    "If the command is successful, TEXTURE_IMMUTABLE_FORMAT becomes
196    TRUE and TEXTURE_IMMUTABLE_LEVELS becomes <levels>."
197
198    Modify Section 4.1.7 (Occlusion Queries) to add
199    ANY_SAMPLES_PASSED_CONSERVATIVE as another <target> option:
200
201    "Occlusion queries use query objects to track the number of fragments or
202    samples that pass the depth test. An occlusion query can be started and
203    finished by calling BeginQuery and EndQuery, respectively, with a target
204    of SAMPLES_PASSED, ANY_SAMPLES_PASSED or ANY_SAMPLES_PASSED_CONSERVATIVE."
205
206    Modify last paragraph in Section 4.1.7:
207
208    "When an occlusion query is started with the target ANY_SAMPLES_PASSED,
209    the samples-boolean state maintained by the GL is set to FALSE. While that
210    occlusion query is active, the samples-boolean state is set to TRUE if any
211    fragment or sample passes the depth test. If the target of the query is
212    ANY_SAMPLES_PASSED_CONSERVATIVE, an implementation may choose to use a
213    less precise version of the test which can additionally set the
214    samples-boolean state to TRUE in some other implementation-dependent
215    cases. This may offer better performance on some implementations at the
216    expense of false positives. When the occlusion query finishes, the
217    samples-boolean state of FALSE or TRUE is written to the corresponding
218    query object as the query result value, and the query result for that
219    object is marked as available."
220
221    Modify the list of allowed <value> parameters to GetTexParameter* in
222    section 6.1.3 on page 478:
223
224    "<value> must be IMAGE_FORMAT_COMPATIBILITY_TYPE,
225    TEXTURE_IMMUTABLE_FORMAT, TEXTURE_IMMUTABLE_LEVELS, TEXTURE_RESIDENT,
226    or one of the symbolic values in table 3.22"
227
228    Modify the first paragraph of Section 6.1.13 (Asynchronous Queries) as
229    follows:
230
231    "... <target> identifies the query target, and must be one of
232    SAMPLES_PASSED, ANY_SAMPLES_PASSED or ANY_SAMPLES_PASSED_CONSERVATIVE
233    for occlusion queries, ..."
234
235    Modify the first paragraph of page 488 in Section 6.1.13:
236
237    "For occlusion queries with target ANY_SAMPLES_PASSED or
238    ANY_SAMPLES_PASSED_CONSERVATIVE, if the number of bits is non-zero, the
239    minimum number of bits is 1. ..."
240
241Additions to Chapter 3 of the OpenGL 4.2 (Compatibility Profile)
242Specification (Rasterization)
243
244    Add to Table 3.20: Generic and specific compressed internal formats on
245    page 303:
246
247    Compressed Internal Format                 Base Internal Format Type
248    ------------------------------------------ -------------------- ----------
249    COMPRESSED_RGB8_ETC2                       RGB                  Specific
250    COMPRESSED_SRGB8_ETC2                      RGBA                 Specific
251    COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2   RGB                  Specific
252    COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2  RGB                  Specific
253    COMPRESSED_RGBA8_ETC2_EAC                  RGBA                 Specific
254    COMPRESSED_SRGB8_ALPHA8_ETC2_EAC           RGBA                 Specific
255    COMPRESSED_R11_EAC                         RED                  Specific
256    COMPRESSED_SIGNED_R11_EAC                  RED                  Specific
257    COMPRESSED_RG11_EAC                        RG                   Specific
258    COMPRESSED_SIGNED_RG11_EAC                 RG                   Specific
259
260    Add the following text to the Table 3.20 key:
261
262    "The specific RGTC, BPTC, ETC2 and EAC formats are described in Appendix C."
263
264Additions to Chapter 4 of the OpenGL 4.2 (Compatibility Profile)
265Specification (Per-Fragment Operations and the Framebuffer)
266
267    Add to section 4.4.2 in the unnumbered "Required Renderbuffer Formats"
268    subsection, following the paragraph starting "Implementations are
269    required to support..."
270
271    "Implementations are also required to support STENCIL_INDEX8."
272
273    Modify section 4.4.2 in the unnumbered "Required Framebuffer Formats"
274    subsection, changing the third sentence to read
275
276   "The depth attachment may be in any of the required depth or combined
277    depth+stencil formats described in those sections, and the stencil
278    attachment may be in any of the required stencil or combined
279    depth+stencil formats."
280
281Additions to Appendix C of the OpenGL 4.20.6 Specification (Compressed Texture
282Image Formats)
283
284    Add a new section to Appendix C:
285
286    "C.3 ETC2/EAC Compressed Texture Image Formats
287
288    The following sub-sections describe the texture compression format for the
289    ETC2/EAC family of compression formats. It is not necessary for the
290    GL to implement these compression formats in hardware and is acceptable
291    for the decode to occur in software and be represented internally as
292    uncompressed images."
293
294    Then copy in the body of the OpenGL ES 3.0 Specification, Appendix C.1
295    "ETC Compressed Texture Image Formats", which describes the details of
296    the ETC2 and EAC formats required by this extension. Change "OpenGL ES
297    implementations" to "OpenGL implementations" when performing this
298    copying.
299
300Additions to Chapter 3 of the OpenGL Shading Language 4.20.6 Specification
301(Basics)
302
303    Modify the paragraph at the bottom of page 12 in Section 3.3
304    (Preprocessor) as follows:
305
306    "... Shaders that specify #version 100 will be treated as targeting
307    version 1.00 of the OpenGL ES Shading Language. Shaders that specify
308    #version 300 will be treated as targeting version 3.00 of the OpenGL
309    ES Shading Language. Shaders declaring 1.40, 1.50, ..."
310
311    Modify the second paragraph at the of page 13 in Section 3.3
312    (Preprocessor) as follows:
313
314    "If the optional <profile> argument is provided, it must be the name of
315    an OpenGL profile. Currently there are three choices:
316        core
317        compatibility
318        es
319
320    A <profile> argument can only be used with version 150 or greater. If no
321    profile argument is provided and the version is 150 or greater, the
322    default is <core>. If #version 300 is specified, the profile argument is
323    not optional and must be <es>, or a compile-time error results. The
324    Language Specification for the <es> profile is specified in  The OpenGL
325    ES Shading Language specification. Unless otherwise specified, this ..."
326
327Additions to the AGL/GLX/WGL Specifications
328
329    None
330
331Interactions with the OpenGL 4.2 Core Profile
332
333    In the core profile, remove ArrayElement from the list of drawing
334    commands for which primitive restart is not performed when
335    PRIMITIVE_RESTART_FIXED_INDEX is enabled.
336
337Errors
338
339    None
340
341New State
342
343    (add to table 6.13, p. 520 (Vertex Array Data (not in Vertex Array Objects)))
344
345                                                        Initial
346    Get Value                     Type  Get Command     Value     Description               Sec.    Attribute
347    ------------------------      ----  --------------- -------   ----------------------    -----   ------------
348    PRIMITIVE_RESTART_FIXED_INDEX  B    IsEnabled       FALSE     Primitive restart with    2.8     vertex-array
349                                                                  fixed index enable
350
351    (add to table 6.24, p. 531 (Textures (state per texture object)))
352
353                                                        Initial
354    Get Value                     Type  Get Command     Value     Description               Sec.    Attribute
355    ------------------------      ----  --------------- -------   ------------------------  ------- ---------
356    TEXTURE_IMMUTABLE_LEVELS       Z+   GetTexParameter 0         storage number of levels  3.10.15 texture
357
358New Implementation Dependent State
359
360    Get Value                     Type  Get Command     Value     Description               Sec.
361    -----------------             ----  -------------   --------  ---------------------     ----
362    MAX_ELEMENT_INDEX              Z+   GetInteger64v   2^32 - 1  Maximum element index     2.6
363
364Issues
365
366    1) OpenGL-ES 3.0 contains several features that have been deprecated from
367       the latest OpenGL Core specification. These were retained in OpenGL-ES
368       3.0 in order to provide backwards compatibility with OpenGL-ES 2.0. Those
369       features are:
370
371        * Wide lines - LineWidth values greater than 1.0 will generate an INVALID_-
372        VALUE error. The value ALIASED_LINE_WIDTH_RANGE is the max width supported.
373
374        * Global component limit query - the implementation-dependent values
375        MAX_VARYING_COMPONENTS and MAX_VARYING_FLOATS.
376
377        * Application-generated object names - the names of all object types, such as
378        buffer, query, and texture objects, must be generated using the corresponding
379        Gen* commands. Trying to bind an object name not returned by a Gen*
380        command will result in an INVALID_OPERATION error. This behavior is already
381        the case for framebuffer, renderbuffer, and vertex array objects. Object
382        types which have default objects (objects named zero), such as vertex array,
383        framebuffer, and texture objects, may also bind the default object, even
384        though it is not returned by Gen*.
385
386        * Client vertex and index arrays - all vertex array attribute and element array
387        index pointers must refer to buffer objects. The default vertex array object
388        (the name zero) is also deprecated. Calling VertexAttribPointer when no
389        buffer object or no vertex array object is bound will generate an INVALID_-
390        OPERATION error, as will calling any array drawing command when no vertex
391        array object is bound.
392
393        * Legacy pixel formats - all ALPHA, LUMINANCE, LUMINANCE_ALPHA
394
395        * Hints - GENERATE_MIPMAP_HINT targets to Hint (section 5.4).
396
397        * Unified extension string - EXTENSIONS target to GetString.
398
399       Should we bring these features back into the OpenGL 4.x Core specification
400       so that it is a complete super-set of OpenGL-ES 3.0?
401
402       RESOLVED: No, these will not be brought back into OpenGL 4.x Core. Apps
403       written for OpenGL-ES 3.0 that want to also be compatible with OpenGL
404       should make sure they don't use these features.
405
406    2) OpenGL ES 3.0 has some differences to OpenGL that may affect how the
407       application operates. For example, in OpenGL ES 3.0 cubemaps are
408       always seamless but with OpenGL this needs to be explicitly enabled.
409       Also sRGB is handled differently. In OpenGL ES 3.0 a surface is either
410       sRGB or not sRGB and this cannot be changed. With OpenGL a surface can
411       be sRGB capable and the mode can be toggled. How do we deal with
412       these differences?
413
414       RESOLVED: If the application needs a strict OpenGL ES 3.0
415       implementation, it should not attempt to use a desktop GL context
416       with the ES3_compatibility extension supported. Instead, use the
417       {GLX|WGL}_EXT_create_context_es_profile extensions to request an
418       actual OpenGL ES 3.0 context, which will not have these caveats.
419
420Revision History
421
422    Rev.    Date    Author    Changes
423    ----  --------  --------  -----------------------------------------------
424    10    10/18/13  Jon Leech Refer to OpenGL ES 3.0 specification appendix
425                              C.1 for ETC2/EAC formats, instead of to OES
426                              extensions (Bug 7522).
427
428    9     03/12/13  Jon Leech Update issue 2 resolution and fix typo.
429
430    8     11/10/12  pdaniell  Add the missing token TEXTURE_IMMUTABLE_LEVELS
431                              from ARB_texture_view, which is in ES 3.0, and
432                              add language describing its behavior; add
433                              PRIMITIVE_RESTART_FIXED_INDEX to state tables
434                              (Bug 9559).
435
436    7     09/16/12  Jon Leech Add language to chapter 4 requiring
437                              STENCIL_INDEX8 support (Bug 9418).
438
439    6     05/30/12  Jon Leech Add language specifying how the two types of
440                              primitive restart enable interact and that the
441                              fixed index form only applies to
442                              *DrawElements* commands taking a <type>
443                              parameter. Reorder ETC2/EAC formats to match
444                              Halti appendix.
445
446    5     04/27/12  pdaniell  Updates based on feedback from John Kessenich.
447
448    4     04/20/12  pdaniell  Resolve issue 2.
449
450    3     03/19/12  pdaniell  Remove references to RGB565, which are now fixed
451                              in ARB_ES2_compatibility and an updated OpenGL
452                              4.2 core spec. Make the ETC2/EAC compression
453                              formats compulsory and bring in the tokens.
454
455    2     01/31/12  pdaniell  Incorporated feedback from Bruce.
456
457    1     01/23/12  pdaniell  Initial version.
458