ShaderCache
Introduction
Caches the shader modules of a device, keyed by shader type and hash.
Methods
extend
Method used to decorate a given object (publicAPI+model) with vtkWebGPUShaderCache 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 | IWebGPUShaderCacheInitialValues | No | (default: {}) |
getDevice
Get the device the cached modules are created on.
getShaderModule
Get the shader module for a description, creating and caching it when no module with the same type and hash was built yet.
| Argument | Type | Required | Description |
|---|---|---|---|
shaderDesc | vtkWebGPUShaderDescription | Yes |
getWindow
Get the render window this cache belongs to.
newInstance
Method used to create a new instance of vtkWebGPUShaderCache.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IWebGPUShaderCacheInitialValues | No | for pre-setting some of its content |
replace
Whether the searched pattern was present in the source.
result
The source with the substitution applied.
setDevice
Set the device the cached modules are created on.
| Argument | Type | Required | Description |
|---|---|---|---|
device | vtkWebGPUDevice | Yes |
setWindow
Set the render window this cache belongs to.
| Argument | Type | Required | Description |
|---|---|---|---|
window | vtkWebGPURenderWindow | Yes |