Skip to content

@tmrw-realityos/charm


@tmrw-realityos/charm / createTextureFromImage

Function: createTextureFromImage()

createTextureFromImage(device, image, existingTexture?): WebGPUTexture

Defined in: packages/charm/src/graphics/WebGPU/WebGPUTextureTools.ts:15

Create WebGPU texture from HTML image

Parameters

device

GPUDevice

GPU device

image

HTMLImageElement

Image

existingTexture?

WebGPUTexture

Existing target texture to load data into. If undefined, a new WebGPUTexture instance is returned.

Returns

WebGPUTexture

WebGPU texture in rgba8unorm format