BufferManager
Methods
extend
Method used to decorate a given object (publicAPI+model) with vtkWebGPUBufferManager characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IWebGPUBufferManagerInitialValues | No | (default: {}) |
getBuffer
Get or create the buffer described by the request. When the request has a hash, the buffer is looked up in and stored into the device object cache.
| Argument | Type | Required | Description |
|---|---|---|---|
req | IWebGPUBufferRequest | Yes | The buffer request. |
getBufferForCellArray
Get or create a vertex buffer holding the cell data of the given array, expanded through the flat ids of the index buffer.
| Argument | Type | Required | Description |
|---|---|---|---|
dataArray | Yes | The cell data array. | |
indexBuffer | Yes | The index buffer providing the flat id mapping. | |
cellOffset | Number | No | (default: 0) |
getBufferForPointArray
Get or create a vertex buffer holding the point data of the given array, expanded through the flat ids of the index buffer.
| Argument | Type | Required | Description |
|---|---|---|---|
dataArray | Yes | The point data array. | |
indexBuffer | Yes | The index buffer providing the flat id mapping. |
getDevice
Get the device the created buffers belong to.
getFullScreenQuadBuffer
Get the shared six vertex buffer covering the whole screen.
getStorageBuffer
Get a cached read only storage buffer. The array is created only when the device cache does not contain the hash.
getStorageBufferForCellNormals
Get generated cell normals, one snorm8x4 value per cell, as a storage buffer.
hasBuffer
Get the buffer cached on the device under the given hash, if any.
| Argument | Type | Required | Description |
|---|---|---|---|
hash | Yes | The buffer hash. |
newInstance
Method used to create a new instance of vtkWebGPUBufferManager.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IWebGPUBufferManagerInitialValues | No | for pre-setting some of its content |
setDevice
Set the device the created buffers belong to.