Skip to content

@tmrw-realityos/charmDocs


@tmrw-realityos/charm / WebGPUBuffer

Class: WebGPUBuffer

Constructors

new WebGPUBuffer()

new WebGPUBuffer(device, name?): WebGPUBuffer

Parameters

device: GPUDevice

name?: string

Returns

WebGPUBuffer

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:36

Properties

data?

optional data: TypedArray | ArrayBuffer

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:31


device

device: GPUDevice

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:34


name?

optional name: string

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:32

Accessors

buffer

get buffer(): GPUBuffer

Returns

GPUBuffer

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:146

Methods

allocateBuffer()

allocateBuffer(sizeInBytes, usage): GPUBuffer

Parameters

sizeInBytes: number

usage: number

Returns

GPUBuffer

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:55


allocateBufferFromData()

allocateBufferFromData(data, usage): GPUBuffer

Parameters

data: TypedArray

usage: number

Returns

GPUBuffer

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:68


allocateElementBufferFromData()

allocateElementBufferFromData(data, isStatic): void

Parameters

data: TypedArray

isStatic: boolean = false

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:125


allocateStagingBuffer()

allocateStagingBuffer(byteLength): void

Parameters

byteLength: number

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:109


allocateStorageBuffer()

allocateStorageBuffer(sizeInBytes): void

Parameters

sizeInBytes: number

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:100


allocateStorageBufferFromData()

allocateStorageBufferFromData(data, isStatic): void

Parameters

data: TypedArray

isStatic: boolean = false

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:139


allocateUniformBuffer()

allocateUniformBuffer(sizeInBytes): void

Parameters

sizeInBytes: number

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:86


allocateUniformBufferFromData()

allocateUniformBufferFromData(data): void

Parameters

data: TypedArray

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:132


allocateVertexBuffer()

allocateVertexBuffer(sizeInBytes): void

Parameters

sizeInBytes: number

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:93


allocateVertexBufferFromData()

allocateVertexBufferFromData(data, isStatic): void

Parameters

data: TypedArray

isStatic: boolean = false

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:118


destroy()

destroy(): void

Destroy the underlying GPUBuffer resource.

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:47


getSizeInBytes()

getSizeInBytes(): number

Returns

number

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:154


mapBuffer()

mapBuffer(mode): Promise<undefined | ArrayBuffer>

Parameters

mode: number

Returns

Promise<undefined | ArrayBuffer>

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:171


unmapBuffer()

unmapBuffer(): void

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:176


updateBufferData()

updateBufferData(data): void

Parameters

data: TypedArray

Returns

void

Defined in

packages/charm/src/graphics/WebGPU/WebGPUBuffer.ts:158