Device
Methods
afterNextSubmit
Run a callback after the next command encoder is submitted. Resources released there remain valid for commands recorded before the submission.
createCommandEncoder
Create a new command encoder on the underlying device.
createPipeline
Initialize the given pipeline and store it under the given hash.
| Argument | Type | Required | Description |
|---|---|---|---|
hash | Yes | The pipeline hash. | |
pipeline | Yes | The vtkWebGPUPipeline to initialize. |
deleteValue
Remove every entry whose weak reference resolves to the given value.
extend
Method used to decorate a given object (publicAPI+model) with vtkWebGPUDevice 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 | IWebGPUDeviceInitialValues | No | (default: {}) |
getBindGroupLayout
Get a bind group layout matching the given description, creating and caching it when it is not already known. Missing binding and visibility entries are filled in with defaults.
| Argument | Type | Required | Description |
|---|---|---|---|
val | Yes | The bind group layout descriptor. |
getBindGroupLayoutDescription
Get the stringified descriptor a cached bind group layout was built from.
| Argument | Type | Required | Description |
|---|---|---|---|
layout | Yes | A layout previously returned by getBindGroupLayout. |
getBufferManager
Get the buffer manager owned by this device.
getGeneration
Get the generation of the currently initialized device handle.
getHandle
Get the GPUDevice this object wraps.
getPipeline
Get a previously created pipeline by hash.
| Argument | Type | Required | Description |
|---|---|---|---|
hash | Yes | The pipeline hash. |
getShaderCache
Get the shader cache owned by this device.
getShaderModule
Get a shader module from the shader cache for the given shader description.
| Argument | Type | Required | Description |
|---|---|---|---|
sd | Yes | The vtkWebGPUShaderDescription to compile. |
getTextureManager
Get the texture manager owned by this device.
getValue
Dereference the entry stored under the given key.
hasCachedObject
Get the cached object stored under the given hash, if it is still alive.
| Argument | Type | Required | Description |
|---|---|---|---|
hash | Yes | The object hash. |
hasFeature
Whether the wrapped device exposes the feature.
initialize
Set the GPUDevice this object wraps.
| Argument | Type | Required | Description |
|---|---|---|---|
handle | Yes | The WebGPU device. |
newInstance
Method used to create a new instance of vtkWebGPUDevice.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IWebGPUDeviceInitialValues | No | for pre-setting some of its content |
onSubmittedWorkDone
Resolves once all work submitted to the device queue has completed.
removeCachedObject
Remove every cache entry referring to this object.
setHandle
Set the GPUDevice this object wraps.
setValue
Store a weak reference to the given value. Non objects are not stored.
submitCommandEncoder
Finish the given command encoder and submit it to the device queue.
| Argument | Type | Required | Description |
|---|---|---|---|
commandEncoder | Yes | The encoder to finish and submit. |