gizlang/ktx
KTX2 owns container parsing. GPU formats, reservations and uploads use the existing rendering contract.
import * as Ktx from "gizlang/ktx";Types
Container
type Container = { format: string; width: i64; height: i64; depth: i64; layers: i64; faces: i64; levels: Vec<Level>; metadata: Map<string, bytes>; }A decoded native-format KTX2 file: its format, size, array layers, cube faces, mips and metadata. Graph.texture uploads its levels; gizlang/image texture reads a 2D one as a meshdraw Texture. Basis payloads need an asset conversion first.
format:stringwidth:i64height:i64depth:i64layers:i64faces:i64levels:Vec<gizlang_render.Level>metadata:_gizlang_sdk_collections.Map<string, bytes>
Functions
load
function load(data: bytes, budget: i64 = 268435456): Container throws stringReads uncompressed, Zstandard or zlib KTX2 native blocks with bounded expansion and disjoint sections.
Effects: fail, alloc.