Buffer
Methods
create
Allocate the underlying GPU buffer without writing to it.
| Argument | Type | Required | Description |
|---|---|---|---|
sizeInBytes | Yes | The size of the buffer. | |
usage | Yes | The GPUBufferUsage flags of the buffer. |
createAndWrite
Allocate the GPU buffer, padded to a multiple of four bytes, and fill it.
| Argument | Type | Required | Description |
|---|---|---|---|
data | Yes | The data to write. | |
usage | Yes | The GPUBufferUsage flags of the buffer. |
extend
Method used to decorate a given object (publicAPI+model) with vtkWebGPUBuffer 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 | IWebGPUBufferInitialValues | No | (default: {}) |
getArrayInformation
Get the description of the attributes packed into this buffer.
getDevice
Get the device this buffer belongs to.
getHandle
Get the underlying GPUBuffer.
getLabel
Get the label used when creating the GPUBuffer.
getMappedRange
Forwarded to the underlying GPUBuffer.
getSizeInBytes
Get the size of the allocated buffer in bytes.
getSourceTime
Get the modified time of the data this buffer was built from.
getStrideInBytes
Get the stride, in bytes, between two consecutive vertices.
getUsage
Get the GPUBufferUsage flags the buffer was created with.
mapAsync
Forwarded to the underlying GPUBuffer.
newInstance
Method used to create a new instance of vtkWebGPUBuffer.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IWebGPUBufferInitialValues | No | for pre-setting some of its content |
setArrayInformation
Set the description of the attributes packed into this buffer.
setDevice
Set the device this buffer belongs to.
setLabel
Set the label used when creating the GPUBuffer.
setSourceTime
Set the modified time of the data this buffer was built from.
setStrideInBytes
Set the stride, in bytes, between two consecutive vertices.
unmap
Forwarded to the underlying GPUBuffer.
write
Copy data into the already created GPU buffer.
| Argument | Type | Required | Description |
|---|---|---|---|
data | Yes | The data to write, starting at offset zero. |