API

Function uploadKtx2Texture2DArray

  • Decode an in-memory multi-layer KTX2 container and upload every layer of its mip chain to a Texture2DArray. The buffer counterpart to loadKtx2Texture2DArray — use it when the bytes are already in hand (an ArrayBuffer from a zip, an XHR, or a glTF binary chunk). Unlike the compatibility-oriented createTexture2DArrayFromKtx2, this native path preserves the decoder-selected GPU format and every authored mip instead of forcing RGBA8 and regenerating mips.

    Parameters

    • engine: EngineContext

      Engine context.

    • buffer: ArrayBuffer

      Raw .ktx2 file bytes with layerCount >= 1.

    • sRGB: boolean = false

      Select the *-srgb GPU format. Default false.

    Returns Promise<Texture2DArray>