decode
Decode a single KTX2 / Basis-Universal compressed texture into an RGBA8888 pixel buffer plus its dimensions.
Return
decoded image. The decoder transcodes to RGBA8888 (4 bytes per pixel, row- major from top-left) regardless of the encoded format; downstream texture upload then converts to whatever GL internal format the target platform prefers.
Parameters
ktx2Bytes
the bytes of the bufferView (or external image file) referenced by the KHR_texture_basisu extension's source index. Already sliced — byte 0 is the start of the KTX2 container.
Throws
for malformed KTX2 input. The layer translates this into a per-texture failure (the affected primitive renders untextured; other primitives in the same tile are unaffected).