WebGL
Khronos
 

WebGL EXT_texture_compression_bptc Extension Draft Specification

Name

EXT_texture_compression_bptc

Contact

WebGL working group (public_webgl 'at' khronos.org)

Contributors

Olli Etuaho, NVIDIA

Members of the WebGL working group

Version

Last modified date: September 26, 2018
Revision: 3

Number

WebGL extension #38

Dependencies

Written against the WebGL API 1.0 specification.

Overview

This extension exposes the compressed texture format defined in the EXT_texture_compression_bptc OpenGL ES extension to WebGL. Consult that extension specification for behavioral definitions, including error behaviors.

Sampling from textures in the COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT format performs a color space conversion as specified for SRGB textures in the EXT_sRGB OpenGL ES extension.

When this extension is enabled:

IDL

[NoInterfaceObject]
interface EXT_texture_compression_bptc {
    const GLenum COMPRESSED_RGBA_BPTC_UNORM_EXT = 0x8E8C;
    const GLenum COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 0x8E8D;
    const GLenum COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 0x8E8E;
    const GLenum COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 0x8E8F;
};
  

New Tokens

compressedTexImage2D(GLenum internalformat)
Accepted by the internalformat parameter: COMPRESSED_RGBA_BPTC_UNORM_EXT, COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT, COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT
compressedTexSubImage2D(GLenum internalformat)
Accepted by the internalformat parameter: COMPRESSED_RGBA_BPTC_UNORM_EXT, COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT, COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT

Errors

The error INVALID_VALUE is generated by compressedTexImage2D and compressedTexSubImage2D if the internalformat parameter is one of the BPTC internal formats from this extension and the byteLength of the ArrayBufferView is not:
ceil(width / 4) * ceil(height / 4) * 16

Revision History

Revision 1, 2018/09/14

Revision 2, 2018/09/18

Revision 3, 2018/09/26