EXT_texture_compression_rgtc
WebGL working group (public_webgl 'at' khronos.org)
Olli Etuaho, NVIDIA
Members of the WebGL working group
Last modified date: July 07, 2020
Revision: 5
WebGL extension #39
Written against the WebGL API 1.0 specification.
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.
Unlike the OpenGL ES extension, this WebGL extension does not extend texImage2D entry point.
For compatibility reasons, the width and the height of the top level mip map are required to be a multiple of 4.
When this extension is enabled:
COMPRESSED_RED_RGTC1_EXT,
COMPRESSED_SIGNED_RED_RGTC1_EXT,
COMPRESSED_RED_GREEN_RGTC2_EXT,
and COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT may be passed to
the compressedTexImage2D and compressedTexSubImage2D entry points.
getParameter with the argument COMPRESSED_TEXTURE_FORMATS
will include the formats from this specification.
The following format-specific restrictions must be enforced:
The byteLength of the ArrayBufferView, pixels, passed to
compressedTexImage2D or compressedTexSubImage2D must be equal to the following number of bytes:
ceil(width / 4) * ceil(height / 4) * 8
If it is not, an INVALID_VALUE error is generated.
width << level and height << level
must be a multiple of 4.
If they are not an INVALID_OPERATION error is generated.
The byteLength of the ArrayBufferView, pixels, passed to
compressedTexImage2D or compressedTexSubImage2D must be equal to the following number of bytes:
ceil(width / 4) * ceil(height / 4) * 16
If it is not, an INVALID_VALUE error is generated.
width << level and height << level
must be a multiple of 4.
If they are not an INVALID_OPERATION error is generated.
[Exposed=(Window,Worker), LegacyNoInterfaceObject]
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;
};
internalformat parameter:
COMPRESSED_RED_RGTC1_EXT,
COMPRESSED_SIGNED_RED_RGTC1_EXT,
COMPRESSED_RED_GREEN_RGTC2_EXT,
COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT
internalformat parameter:
COMPRESSED_RED_RGTC1_EXT,
COMPRESSED_SIGNED_RED_RGTC1_EXT,
COMPRESSED_RED_GREEN_RGTC2_EXT,
COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT
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
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
INVALID_OPERATION is generated by compressedTexImage2D and
compressedTexSubImage2D if the level parameter is
0 and the width or height is not a multiple of 4.
Revision 1, 2018/09/26
Revision 2, 2018/09/26
Revision 3, 2018/11/05
Revision 4, 2020/06/25
texImage2D entry point.Revision 5, 2020/07/07