APPLE_texture_format_BGRA8888

Name

APPLE_texture_format_BGRA8888

Name Strings

GL_APPLE_texture_format_BGRA8888

Contact

Benj Lipchak, Apple (lipchak 'at' apple.com)

IP Status

No known IP issues.

Status

Complete.

Version

Last Modified Date: June 26, 2013
Revision: 3

Number

OpenGL ES Extension #79

Dependencies

Written based on the wording of the OpenGL ES 1.1 specification.
There are interactions with OpenGL ES 3.0 or EXT_texture_storage.

Overview

This extension introduces BGRA_EXT as an acceptable external format.  
This avoids byte swizzling when loading RGBA internal format
textures, which may be stored in BGRA order internally.

Issues

None.

New Procedures and Functions

None.

New Tokens

Accepted by the <format> parameters of TexImage2D and TexSubImage2D:

    GL_BGRA_EXT                                 0x80E1

Accepted by the <internalformat> parameters of TexStorage2D and 
TexStorage3D:

    GL_BGRA8_EXT                                0x93A1

Additions to Chapter 2 of the OpenGL ES 1.1 Specification (OpenGL ES Operation)

None

Additions to Chapter 3 of the OpenGL ES 1.1 Specification (Rasterization)

Section 3.6.2, add the following row to Table 3.3:

    Format Name    Element Meaning and Order    Target Buffer
    -----------    -------------------------    -------------
    BGRA_EXT       B, G, R, A                   Color

Section 3.6.2, add the following row to Table 3.4:

    Format      Type             Bytes per Pixel
    --------    -------------    ---------------
    BGRA_EXT    UNSIGNED_BYTE    4

Section 3.7.1, change the 4th paragraph to loosen the requirement that
<internalformat> must match <format> for the case of BGRA_EXT format, which
must have an RGBA internal format.  In this case we do not generate the
error INVALID_OPERATION.

Additions to Chapter 4 of the OpenGL ES 1.1 Specification (Per-Fragment Operations and the Framebuffer)

None

Additions to Chapter 5 of the OpenGL ES 1.1 Specification (Special Functions)

None

Additions to Chapter 6 of the OpenGL ES 1.1 Specification (State and State Requests)

None

Dependencies on OpenGL ES 3.0 or EXT_texture_storage

When the GL is OpenGL ES 3.0, the following table entry is added to
Table 3.2:

    Format    Type           External Bytes per Pixel  Internal Format
    --------  -------------  ------------------------  ---------------
    BGRA_EXT  UNSIGNED_BYTE  4                         BGRA8_EXT

When the GL is OpenGL ES 3.0, BGRA8_EXT is also added to the Texture-only 
color formats list in the Required Texture Formats subsection of section 
3.8.3.

If the GL is not OpenGL ES 3.0 and the EXT_texture_storage extension is not
present, omit references to BGRA8_EXT and TexStorage*.

Note that despite TexStorage* being defined in terms of TexImage*, 
BGRA8_EXT is not accepted as an <internalformat> parameter to TexImage* 
when the GL is OpenGL ES 3.0.

Details of how this extension interacts with EXT_texture_storage when the 
GL is a version of OpenGL earlier than 3.0 can be found in the 
EXT_texture_storage spec.

Errors

INVALID_ENUM is generated by TexImage2D if <internalformat> is BGRA_EXT.

INVALID_OPERATION is generated by TexImage2D if <format> is BGRA_EXT and
<internalformat> is not RGBA.

New State

None

New Implementation Dependent State

None

Revision History

#3  06/26/2013    Benj Lipchak     Add ES3 interactions
#2  10/27/2009    Benj Lipchak     Add EXT suffix to BGRA token
#1  05/14/2009    Benj Lipchak     First draft