Skip to content

TextureManager ​

Methods ​

extend ​

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

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

getDevice ​

Get the device the textures are created on.

getTexture ​

Get the texture matching the request from the device cache, creating and caching it when it is missing. A request without a hash always creates a new texture.

ArgumentTypeRequiredDescription
reqIWebGPUTextureRequestYesThe texture request.

getTextureForImageData ​

Get the texture holding the point scalars of the given image data. The cache key covers both the image data and its scalar array modified times.

ArgumentTypeRequiredDescription
imgDataYesThe image data to upload.

getTextureForVTKTexture ​

Get the texture holding the contents of a vtkTexture, whichever of its image data, image, ImageData, ImageBitmap or canvas source is set.

ArgumentTypeRequiredDescription
srcTextureYesThe texture to upload.
labelStringNoThe WGSL name given to the created texture.

newInstance ​

Method used to create a new instance of vtkWebGPUTextureManager.

ArgumentTypeRequiredDescription
initialValuesIWebGPUTextureManagerInitialValuesNofor pre-setting some of its content

releaseTexture ​

Release the texture binding held by this owner. The texture is destroyed after the next submission when no owners still use it.

setDevice ​

Set the device the textures are created on.