Skip to content

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.

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

ArgumentTypeRequiredDescription
shaderDescvtkWebGPUShaderDescriptionYes

getWindow ​

Get the render window this cache belongs to.

newInstance ​

Method used to create a new instance of vtkWebGPUShaderCache.

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

ArgumentTypeRequiredDescription
devicevtkWebGPUDeviceYes

setWindow ​

Set the render window this cache belongs to.

ArgumentTypeRequiredDescription
windowvtkWebGPURenderWindowYes