pub struct WEBGL_compressed_texture_etc(_);
Expand description
Extension
This extension exposes the compressed texture formats defined as core in the OpenGL ES 3.0 spec to WebGL. These include the ETC2 and EAC formats, where ETC2 is a superset of ETC1. ETC1 textures can be loaded using the ETC2 token value. All of these formats are in the ETC family.
Browsers should not advertise this extension when the WebGL implementation, or graphics driver, supports these formats by decompressing them. Compression formats COMPRESSED_R11_EAC, COMPRESSED_SIGNED_R11_EAC, COMPRESSED_RG11_EAC, COMPRESSED_SIGNED_RG11_EAC, COMPRESSED_RGB8_ETC2, COMPRESSED_SRGB8_ETC2, COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, COMPRESSED_RGBA8_ETC2_EAC, and COMPRESSED_SRGB8_ALPHA8_ETC2_EAC may be passed to the compressedTexImage2D and compressedTexSubImage2D entry points. In WebGL 2.0, they may also be passed to the compressedTexImage3D and compressedTexSubImage3D entry points with the TEXTURE_2D_ARRAY target. Calling getParameter with the argument COMPRESSED_TEXTURE_FORMATS will include the formats from this specification. For all of the formats, validatedSize (defined for each specific format below) is validated in the following ways:
- WebGL 1.0 and 2.0: if the variant of compressedTexImageD or compressedTexSubImageD taking ArrayBufferView pixels is called, then the byteLength of the view must be equal to validatedSize, or an INVALID_VALUE error is generated.
- WebGL 2.0: if the variant of compressedTexImageD or compressedTexSubImageD taking GLintptr offset is called, and offset + validatedSize is greater than the size of the bound PIXEL_UNPACK_BUFFER, an INVALID_OPERATION error is generated.
COMPRESSED_R11_EAC COMPRESSED_SIGNED_R11_EAC COMPRESSED_RGB8_ETC2 COMPRESSED_SRGB8_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
validatedSize is computed in the following way:
floor((width + 3) / 4) * floor((height + 3) / 4) * 8 COMPRESSED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
validatedSize is computed in the following way:
floor((width + 3) / 4) * floor((height + 3) / 4) * 16
Implementations
sourceimpl WEBGL_compressed_texture_etc
impl WEBGL_compressed_texture_etc
pub const COMPRESSED_R11_EAC: GLenum = 37_488u32
pub const COMPRESSED_RG11_EAC: GLenum = 37_490u32
pub const COMPRESSED_RGB8_ETC2: GLenum = 37_492u32
pub const COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum = 37_494u32
pub const COMPRESSED_RGBA8_ETC2_EAC: GLenum = 37_496u32
pub const COMPRESSED_SIGNED_R11_EAC: GLenum = 37_489u32
pub const COMPRESSED_SIGNED_RG11_EAC: GLenum = 37_491u32
pub const COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: GLenum = 37_497u32
pub const COMPRESSED_SRGB8_ETC2: GLenum = 37_493u32
pub const COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum = 37_495u32
Trait Implementations
sourceimpl AsRef<Reference> for WEBGL_compressed_texture_etc
impl AsRef<Reference> for WEBGL_compressed_texture_etc
sourceimpl Clone for WEBGL_compressed_texture_etc
impl Clone for WEBGL_compressed_texture_etc
sourcefn clone(&self) -> WEBGL_compressed_texture_etc
fn clone(&self) -> WEBGL_compressed_texture_etc
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for WEBGL_compressed_texture_etc
impl Debug for WEBGL_compressed_texture_etc
sourceimpl From<WEBGL_compressed_texture_etc> for Reference
impl From<WEBGL_compressed_texture_etc> for Reference
sourcefn from(value: WEBGL_compressed_texture_etc) -> Self
fn from(value: WEBGL_compressed_texture_etc) -> Self
sourceimpl InstanceOf for WEBGL_compressed_texture_etc
impl InstanceOf for WEBGL_compressed_texture_etc
sourcefn instance_of(_reference: &Reference) -> bool
fn instance_of(_reference: &Reference) -> bool
Self
.