Appearance
@tmrw-realityos/charm / createTextureFromKTX2Data
Function: createTextureFromKTX2Data()
createTextureFromKTX2Data(
device,data,existingLoader?,existingTexture?,onComplete?):WebGPUTexture
Defined in: packages/charm/src/graphics/WebGPU/WebGPUTextureTools.ts:34
Create a GPU texture in compressed or uncompressed format, depending on device features.
Parameters
device
GPUDevice
GPU device
data
Uint8Array
KTX data as arraybuffer
existingLoader?
Existing KTX2 texture loader.
existingTexture?
Existing target texture to load data into. If undefined, a new WebGPUTexture instance is returned.
onComplete?
(texture) => void
Callback when the texture data is decoded and written to the GPUTexture handle.
Returns
WebGPU texture in compressed format