Skip to content

@tmrw-realityos/charmDocs


@tmrw-realityos/charm / WebGPUTexture

Class: WebGPUTexture

Texture class

Extends

  • Texture

Constructors

new WebGPUTexture()

new WebGPUTexture(device): WebGPUTexture

Parameters

device: GPUDevice

Returns

WebGPUTexture

Overrides

Texture.constructor

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:26

Properties

arrayLayers_

protected arrayLayers_: number = 1

Inherited from

Texture.arrayLayers_

Defined in

packages/charm/src/graphics/texture.ts:11


height_

protected height_: number = 1

Inherited from

Texture.height_

Defined in

packages/charm/src/graphics/texture.ts:10


index

index: number

Inherited from

Texture.index

Defined in

packages/charm/src/graphics/texture.ts:6


loading

loading: boolean = false

Inherited from

Texture.loading

Defined in

packages/charm/src/graphics/texture.ts:7


mipLevelCount_

protected mipLevelCount_: number = 1

Inherited from

Texture.mipLevelCount_

Defined in

packages/charm/src/graphics/texture.ts:12


name

name: string = ""

Inherited from

Texture.name

Defined in

packages/charm/src/graphics/texture.ts:5


width_

protected width_: number = 1

Inherited from

Texture.width_

Defined in

packages/charm/src/graphics/texture.ts:9


lastIndex

static lastIndex: number = -1

Inherited from

Texture.lastIndex

Defined in

packages/charm/src/graphics/texture.ts:3

Methods

assignDefaultView()

assignDefaultView(type): void

Parameters

type: eTextureViewTypes

Assign the default view to use with this texture when view is omited

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:440


clearViewsCache()

clearViewsCache(): void

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:451


convertToHalf()

convertToHalf(): GPUTexture

Convert a texture to rgba16float format.

Returns

GPUTexture

Copy of inputTexture in float16 format

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:318


create()

create(): GPUTexture

Create the GPU resource

Returns

GPUTexture

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:61


createCubemapFromData()

createCubemapFromData(data, width, height, format, usage): GPUTexture

Parameters

data: ArrayBuffer[][]

width: number = 1

height: number = 1

format: GPUTextureFormat = "rgba16float"

usage: undefined | number = undefined

Returns

GPUTexture

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:246


createFromData()

createFromData(data, width, height, format): GPUTexture

Create texture from data

Parameters

data: ArrayBuffer

Source data

width: number = 1

Texture width

height: number = 1

Texture height

format: GPUTextureFormat = "rgba8unorm"

Texture format

Returns

GPUTexture

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:206


createFromDescriptor()

createFromDescriptor(descriptor): GPUTexture

Parameters

descriptor: GPUTextureDescriptor

Returns

GPUTexture

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:74


createFromImage()

createFromImage(image): GPUTexture

Create texture from image

Parameters

image: HTMLImageElement | HTMLCanvasElement | ImageBitmap | HTMLVideoElement | VideoFrame

Source image

Returns

GPUTexture

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:135


destroy()

destroy(): void

Destroy GPU resource

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:516


generateMipmap()

generateMipmap(): void

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:121


getDescriptor()

getDescriptor(): GPUTextureDescriptor

Returns

GPUTextureDescriptor

Texture descriptor for the current settings

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:41


getHandle()

getHandle(): undefined | GPUTexture

Get GPU handle

Returns

undefined | GPUTexture

WebGPU handle

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:432


getView()

getView(): undefined | GPUTextureView

Get GPU texture view

Returns

undefined | GPUTextureView

WebGPU view

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:509


getViewCube()

getViewCube(): undefined | GPUTextureView

Get GPU cube texture view

Returns

undefined | GPUTextureView

WebGPU view

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:496


getViewGamma()

getViewGamma(): undefined | GPUTextureView

Get GPU texture view in gamma space

Returns

undefined | GPUTextureView

WebGPU view

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:470


getViewLinear()

getViewLinear(): undefined | GPUTextureView

Get GPU texture view

Returns

undefined | GPUTextureView

WebGPU view

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:462


resize()

resize(width, height): void

Parameters

width: number

height: number

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:112


updateFromData()

updateFromData(data): void

Parameters

data: ArrayBuffer

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:234


updateFromExternalVideo()

updateFromExternalVideo(frame): void

Parameters

frame: VideoFrame

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:189


updateFromImage()

updateFromImage(image): void

Parameters

image: HTMLImageElement | HTMLCanvasElement | ImageBitmap | HTMLVideoElement | VideoFrame

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUTexture.ts:170