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

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Checks whenever a given Reference if of type Self.
Converts a given reference into a concrete reference-like wrapper. Doesn’t do any type checking; highly unsafe to use! Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.