WebGL
Khronos
 

WebGL EXT_texture_compression_rgtc Extension Draft Specification

Name

EXT_texture_compression_rgtc

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: 2

Number

WebGL extension #39

Dependencies

Written against the WebGL API 1.0 specification.

Overview

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

Updates of partial tiles detailed in the "Implementation Note" section of the EXT_texture_compression_rgtc specification must be supported in an implementation of this WebGL extension.

When this extension is enabled:

IDL

[NoInterfaceObject]
interface EXT_texture_compression_rgtc {
    const GLenum COMPRESSED_RED_RGTC1_EXT = 0x8DBB;
    const GLenum COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC;
    const GLenum COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8DBD;
    const GLenum COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8DBE;
};
  

New Tokens

compressedTexImage2D(GLenum internalformat)
Accepted by the internalformat parameter: COMPRESSED_RED_RGTC1_EXT, COMPRESSED_SIGNED_RED_RGTC1_EXT, COMPRESSED_RED_GREEN_RGTC2_EXT, COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT
compressedTexSubImage2D(GLenum internalformat)
Accepted by the internalformat parameter: COMPRESSED_RED_RGTC1_EXT, COMPRESSED_SIGNED_RED_RGTC1_EXT, COMPRESSED_RED_GREEN_RGTC2_EXT, COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT

Errors

The error INVALID_VALUE is generated by compressedTexImage2D and compressedTexSubImage2D if the internalformat parameter is COMPRESSED_RED_RGTC1_EXT or COMPRESSED_SIGNED_RED_RGTC1_EXT and the byteLength of the ArrayBufferView is not:
ceil(width / 4) * ceil(height / 4) * 8
The error INVALID_VALUE is generated by compressedTexImage2D and compressedTexSubImage2D if the internalformat parameter is COMPRESSED_RED_GREEN_RGTC2_EXT or COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT and the byteLength of the ArrayBufferView is not:
ceil(width / 4) * ceil(height / 4) * 16

Revision History

Revision 1, 2018/09/26

Revision 2, 2018/09/26