Class: ComputeGPUBuffer
Storage class buffer for calculating shaders Usage GPUBufferUsage.STORAGE & GPUBufferUsage.COPY_SRC & GPUBufferUsage.COPY_DST
Hierarchy
GPUBufferBase
↳
ComputeGPUBuffer
Constructors
Properties
Methods
- debug
- reset
- setBoolean
- readBoole
- setFloat
- getFloat
- setInt8
- getInt8
- setInt16
- getInt16
- setInt32
- getInt32
- setUint8
- getUint8
- setUint16
- getUint16
- setUint32
- getUint32
- setVector2
- getVector2
- setVector3
- getVector3
- setVector4
- getVector4
- setVector4Array
- setColor
- getColor
- setColorArray
- setMatrix
- setMatrixArray
- setArray
- setFloat32Array
- setInt32Array
- setUint32Array
- setStruct
- setStructArray
- clean
- apply
- mapAsyncWrite
- destroy
- resizeBuffer
- readBuffer
Constructors
constructor
• new ComputeGPUBuffer(size
, data?
): ComputeGPUBuffer
Parameters
Name | Type |
---|---|
size | number |
data? | Float32Array |
Returns
Overrides
GPUBufferBase.constructor
Defined in
src/gfx/graphics/webGpu/core/buffer/ComputeGPUBuffer.ts:10
Properties
bufferType
• bufferType: GPUBufferType
Inherited from
GPUBufferBase.bufferType
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:20
buffer
• buffer: GPUBuffer
Inherited from
GPUBufferBase.buffer
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:21
memory
• memory: MemoryDO
Inherited from
GPUBufferBase.memory
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:22
memoryNodes
• memoryNodes: Map
<string
| number
, MemoryInfo
>
Inherited from
GPUBufferBase.memoryNodes
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:23
seek
• seek: number
Inherited from
GPUBufferBase.seek
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:24
outFloat32Array
• outFloat32Array: Float32Array
Inherited from
GPUBufferBase.outFloat32Array
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:25
byteSize
• byteSize: number
Inherited from
GPUBufferBase.byteSize
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:26
usage
• usage: number
Inherited from
GPUBufferBase.usage
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:27
visibility
• visibility: number
Inherited from
GPUBufferBase.visibility
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:28
Methods
debug
▸ debug(): void
Returns
void
Inherited from
GPUBufferBase.debug
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:41
reset
▸ reset(clean?
, size?
, data?
): void
Parameters
Name | Type | Default value |
---|---|---|
clean | boolean | false |
size | number | 0 |
data? | Float32Array | undefined |
Returns
void
Inherited from
GPUBufferBase.reset
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:44
setBoolean
▸ setBoolean(name
, v
): void
Parameters
Name | Type |
---|---|
name | string |
v | boolean |
Returns
void
Inherited from
GPUBufferBase.setBoolean
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:52
readBoole
▸ readBoole(name
): boolean
Parameters
Name | Type |
---|---|
name | string |
Returns
boolean
Inherited from
GPUBufferBase.readBoole
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:62
setFloat
▸ setFloat(name
, v
): void
Parameters
Name | Type |
---|---|
name | string |
v | number |
Returns
void
Inherited from
GPUBufferBase.setFloat
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:70
getFloat
▸ getFloat(name
): number
Parameters
Name | Type |
---|---|
name | string |
Returns
number
Inherited from
GPUBufferBase.getFloat
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:79
setInt8
▸ setInt8(name
, v
): void
Parameters
Name | Type |
---|---|
name | string |
v | number |
Returns
void
Inherited from
GPUBufferBase.setInt8
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:87
getInt8
▸ getInt8(name
): number
Parameters
Name | Type |
---|---|
name | string |
Returns
number
Inherited from
GPUBufferBase.getInt8
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:96
setInt16
▸ setInt16(name
, v
): void
Parameters
Name | Type |
---|---|
name | string |
v | number |
Returns
void
Inherited from
GPUBufferBase.setInt16
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:104
getInt16
▸ getInt16(name
): number
Parameters
Name | Type |
---|---|
name | string |
Returns
number
Inherited from
GPUBufferBase.getInt16
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:113
setInt32
▸ setInt32(name
, v
): void
Parameters
Name | Type |
---|---|
name | string |
v | number |
Returns
void
Inherited from
GPUBufferBase.setInt32
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:121
getInt32
▸ getInt32(name
): number
Parameters
Name | Type |
---|---|
name | string |
Returns
number
Inherited from
GPUBufferBase.getInt32
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:130
setUint8
▸ setUint8(name
, v
): void
Parameters
Name | Type |
---|---|
name | string |
v | number |
Returns
void
Inherited from
GPUBufferBase.setUint8
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:138
getUint8
▸ getUint8(name
): number
Parameters
Name | Type |
---|---|
name | string |
Returns
number
Inherited from
GPUBufferBase.getUint8
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:147
setUint16
▸ setUint16(name
, v
): void
Parameters
Name | Type |
---|---|
name | string |
v | number |
Returns
void
Inherited from
GPUBufferBase.setUint16
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:156
getUint16
▸ getUint16(name
): number
Parameters
Name | Type |
---|---|
name | string |
Returns
number
Inherited from
GPUBufferBase.getUint16
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:165
setUint32
▸ setUint32(name
, v
): void
Parameters
Name | Type |
---|---|
name | string |
v | number |
Returns
void
Inherited from
GPUBufferBase.setUint32
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:173
getUint32
▸ getUint32(name
): number
Parameters
Name | Type |
---|---|
name | string |
Returns
number
Inherited from
GPUBufferBase.getUint32
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:182
setVector2
▸ setVector2(name
, v2
): void
Parameters
Name | Type |
---|---|
name | string |
v2 | Vector2 |
Returns
void
Inherited from
GPUBufferBase.setVector2
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:190
getVector2
▸ getVector2(name
): Vector2
Parameters
Name | Type |
---|---|
name | string |
Returns
Inherited from
GPUBufferBase.getVector2
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:199
setVector3
▸ setVector3(name
, v3
): void
Parameters
Name | Type |
---|---|
name | string |
v3 | Vector3 |
Returns
void
Inherited from
GPUBufferBase.setVector3
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:207
getVector3
▸ getVector3(name
): Vector3
Parameters
Name | Type |
---|---|
name | string |
Returns
Inherited from
GPUBufferBase.getVector3
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:216
setVector4
▸ setVector4(name
, v4
): void
Parameters
Name | Type |
---|---|
name | string |
v4 | Vector4 | Quaternion |
Returns
void
Inherited from
GPUBufferBase.setVector4
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:224
getVector4
▸ getVector4(name
): Vector4
Parameters
Name | Type |
---|---|
name | string |
Returns
Vector4
Inherited from
GPUBufferBase.getVector4
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:233
setVector4Array
▸ setVector4Array(name
, v4Array
): void
Parameters
Name | Type |
---|---|
name | string |
v4Array | Vector3 [] | Vector4 [] | Quaternion [] |
Returns
void
Inherited from
GPUBufferBase.setVector4Array
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:241
setColor
▸ setColor(name
, color
): void
Parameters
Name | Type |
---|---|
name | string |
color | Color |
Returns
void
Inherited from
GPUBufferBase.setColor
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:250
getColor
▸ getColor(name
): Color
Parameters
Name | Type |
---|---|
name | string |
Returns
Inherited from
GPUBufferBase.getColor
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:259
setColorArray
▸ setColorArray(name
, colorArray
): void
Parameters
Name | Type |
---|---|
name | string |
colorArray | Color [] |
Returns
void
Inherited from
GPUBufferBase.setColorArray
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:267
setMatrix
▸ setMatrix(name
, mat
): void
Parameters
Name | Type |
---|---|
name | string |
mat | Matrix4 |
Returns
void
Inherited from
GPUBufferBase.setMatrix
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:276
setMatrixArray
▸ setMatrixArray(name
, mats
): void
Parameters
Name | Type |
---|---|
name | string |
mats | Matrix4 [] |
Returns
void
Inherited from
GPUBufferBase.setMatrixArray
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:285
setArray
▸ setArray(name
, data
): void
Parameters
Name | Type |
---|---|
name | string |
data | number [] |
Returns
void
Inherited from
GPUBufferBase.setArray
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:297
setFloat32Array
▸ setFloat32Array(name
, data
): void
Parameters
Name | Type |
---|---|
name | string |
data | Float32Array |
Returns
void
Inherited from
GPUBufferBase.setFloat32Array
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:306
setInt32Array
▸ setInt32Array(name
, data
): void
Parameters
Name | Type |
---|---|
name | string |
data | Int32Array |
Returns
void
Inherited from
GPUBufferBase.setInt32Array
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:315
setUint32Array
▸ setUint32Array(name
, data
): void
Parameters
Name | Type |
---|---|
name | string |
data | Uint32Array |
Returns
void
Inherited from
GPUBufferBase.setUint32Array
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:325
setStruct
▸ setStruct<T
>(c
, index
, data
, property?
): void
Type parameters
Name | Type |
---|---|
T | extends Struct |
Parameters
Name | Type |
---|---|
c | () => T |
index | number |
data | any |
property? | string |
Returns
void
Inherited from
GPUBufferBase.setStruct
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:334
setStructArray
▸ setStructArray<T
>(c
, dataList
, property?
): void
Type parameters
Name | Type |
---|---|
T | extends Struct |
Parameters
Name | Type |
---|---|
c | () => T |
dataList | any [] |
property? | string |
Returns
void
Inherited from
GPUBufferBase.setStructArray
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:390
clean
▸ clean(): void
Returns
void
Inherited from
GPUBufferBase.clean
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:403
apply
▸ apply(): void
Returns
void
Inherited from
GPUBufferBase.apply
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:408
mapAsyncWrite
▸ mapAsyncWrite(mapAsyncArray
, len
): void
Parameters
Name | Type |
---|---|
mapAsyncArray | Float32Array |
len | number |
Returns
void
Inherited from
GPUBufferBase.mapAsyncWrite
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:413
destroy
▸ destroy(force?
): void
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void
Inherited from
GPUBufferBase.destroy
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:454
resizeBuffer
▸ resizeBuffer(size
, data?
): void
Parameters
Name | Type |
---|---|
size | number |
data? | ArrayBufferData |
Returns
void
Inherited from
GPUBufferBase.resizeBuffer
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:511
readBuffer
▸ readBuffer(): Float32Array
Returns
Float32Array
Inherited from
GPUBufferBase.readBuffer
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:558
▸ readBuffer(promise
): Float32Array
Parameters
Name | Type |
---|---|
promise | false |
Returns
Float32Array
Inherited from
GPUBufferBase.readBuffer
Defined in
src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts:559
▸ readBuffer(promise
): Promise
<Float32Array
>
Parameters
Name | Type |
---|---|
promise | true |
Returns
Promise
<Float32Array
>
Inherited from
GPUBufferBase.readBuffer