Texture

A GPU texture object that can be used in a BindGroup.

Constructors

new Texture(options: TextureOptions): Texture

Properties

binding

binding: number

canvas

canvas: HTMLCanvasElement

canvasFormat

canvasFormat: GPUTextureFormat

context

cpuBuffer

cpuBuffer: Uint8ClampedArray & ArrayType

gpuTexture

gpuTexture: GPUTexture

label

label: string

textureFormat

textureFormat: GPUTextureFormat

textureHeight

textureHeight: number

textureUsage

textureUsage: number

textureWidth

textureWidth: number

visibility

visibility: number

Methods

generateMipMaps

generateMipMaps(): Promise<void>

getDevice

getDevice(): Promise<GPUDevice>

setCanvas

setCanvas(canvas: HTMLCanvasElement): void

setCpuBuffer

setCpuBuffer(buffer: Uint8ClampedArray): void

setCpuBuffer

setCpuBuffer(buffer: ArrayType): void

setDevice

setDevice(d: GPUDevice): void

setFromData

setFromData(data: ArrayType): Promise<void>

setFromImage

setFromImage(image: string | HTMLImageElement): Promise<void>

setLabel

setLabel(label: string): void

setTextureFormat

setTextureFormat(format: GPUTextureFormat): void

setTextureSize

setTextureSize(width: number, height: number): void

setTextureUsage

setTextureUsage(usage: number): void

updateTexture

updateTexture(): Promise<void>

You are viewing the beta docs. You may find the legacy docs more helpful.