EXT_texture_compression_bptc
WebGL working group (public_webgl 'at' khronos.org)
Olli Etuaho, NVIDIA
Members of the WebGL working group
Last modified date: July 07, 2020
Revision: 6
WebGL extension #38
Written against the WebGL API 1.0 specification.
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.
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_RGBA_BPTC_UNORM_EXT
,
COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT
,
COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT
,
and COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_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.
If the internalformat
is one of the BPTC internal formats from this specification,
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.
The following format-specific restrictions must be enforced:
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_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; };
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
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
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
INVALID_OPERATION
is generated by compressedTexImage2D
and
compressedTexSubImage2D
if width << level
and
height << level
are not multiples of 4.
Revision 1, 2018/09/14
Revision 2, 2018/09/18
Revision 3, 2018/09/26
Revision 4, 2018/11/05
Revision 5, 2020/06/25
texImage2D
entry point.Revision 6, 2020/07/07