Skip to content

UniformBuffer ​

Methods ​

addEntry ​

Append an entry to the struct.

ArgumentTypeRequiredDescription
nameYesThe WGSL member name.
typeYesThe WGSL type, e.g. vec4<f32>.

createView ​

Make sure a typed array view of the given type exists over the backing array buffer.

ArgumentTypeRequiredDescription
typeYesThe typed array constructor name, e.g. 'Float32Array'.

extend ​

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

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIWebGPUUniformBufferInitialValuesNo(default: {})

getBindGroupEntry ​

Get the bind group entry for this buffer, creating the GPU buffer if needed. The binding index is filled in by the bind group.

getBindGroupLayoutEntry ​

Get the bind group layout entry describing this buffer.

getBindGroupTime ​

Get the object whose modified time changes when the bind group entry becomes stale.

getBinding ​

Get the binding index.

getDevice ​

Get the device the buffer was last sent to.

getLabel ​

Get the WGSL name of the uniform buffer.

getSendTime ​

Get the time of the last sendIfNeeded call.

getShaderCode ​

Get the WGSL declaration of this uniform buffer.

ArgumentTypeRequiredDescription
bindingYesThe binding index.
groupYesThe bind group index.

getSizeInBytes ​

Get the size of the struct in bytes.

newInstance ​

Method used to create a new instance of vtkWebGPUUniformBuffer.

ArgumentTypeRequiredDescription
initialValuesIWebGPUUniformBufferInitialValuesNofor pre-setting some of its content

releaseGraphicsResources ​

Release the GPU buffer, forcing it to be recreated and resent on the next sendIfNeeded call.

sendIfNeeded ​

Create the GPU buffer if needed and write the contents when they changed.

ArgumentTypeRequiredDescription
deviceYesThe device to send the data to.

setArray ​

Set a vector or matrix entry.

ArgumentTypeRequiredDescription
nameYesThe entry name.
arrYesThe values to store.

setBindGroupLayoutEntry ​

Set the bind group layout entry describing this buffer.

setDevice ​

Set the device the buffer belongs to.

setLabel ​

Set the WGSL name of the uniform buffer.

setSizeInBytes ​

Set the size of the struct in bytes.

setValue ​

Set a scalar entry.

ArgumentTypeRequiredDescription
nameYesThe entry name.
valYesThe value to store.

sortBufferEntries ​

Reorder and pack the entries if they changed since the last sort, and recompute the size of the struct.