Skip to content

BufferManager ​

Methods ​

extend ​

Method used to decorate a given object (publicAPI+model) with vtkWebGPUBufferManager characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIWebGPUBufferManagerInitialValuesNo(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.

ArgumentTypeRequiredDescription
reqIWebGPUBufferRequestYesThe 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.

ArgumentTypeRequiredDescription
dataArrayYesThe cell data array.
indexBufferYesThe index buffer providing the flat id mapping.
cellOffsetNumberNo(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.

ArgumentTypeRequiredDescription
dataArrayYesThe point data array.
indexBufferYesThe 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.

ArgumentTypeRequiredDescription
hashYesThe buffer hash.

newInstance ​

Method used to create a new instance of vtkWebGPUBufferManager.

ArgumentTypeRequiredDescription
initialValuesIWebGPUBufferManagerInitialValuesNofor pre-setting some of its content

setDevice ​

Set the device the created buffers belong to.