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: {})

getCubeTextureForVTKTexture ​

Get the cube map texture of the six input ports of a vtkTexture. The texture has six 2D layers, and its createView() gives a 'cube' view. The result is null if a face is missing, a face is not square, or the faces do not have the same size and format.

ArgumentTypeRequiredDescription
srcTextureYesThe texture with the six faces +X, -X, +Y, -Y, +Z, -Z.
labelStringNoThe WGSL name given to the created texture.

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. If the texture is a cube map (see vtkTexture.useCubeMap) and options.allowCubeMap is true, the result is a cube map texture.

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

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.