Skip to content

Texture ​

Methods ​

assignFromHandle ​

Wrap a GPUTexture this object does not own.

ArgumentTypeRequiredDescription
deviceYesThe device the texture belongs to.
handleYesThe texture to wrap.
optionsIWebGPUTextureCreateOptionsYesThe extent and format of the given texture.

create ​

Allocate the GPUTexture.

ArgumentTypeRequiredDescription
deviceYesThe device to allocate on.
optionsIWebGPUTextureCreateOptionsYesThe extent, format and usage.

createView ​

Create a view of this texture. A missing view dimension is derived from the texture dimension and depth.

ArgumentTypeRequiredDescription
labelYesThe WGSL name of the view.
optionsGPUTextureViewDescriptorNo(default: {})

destroy ​

Destroy the GPU texture, clear its handle and mark it as not ready.

extend ​

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

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

generateMipmaps ​

Regenerate the mipmaps of a texture with more than one mip level.

getDevice ​

Get the device the texture belongs to.

getDimension ​

Get the dimension the texture was allocated with.

getDimensionality ​

The number of extents larger than one texel.

getFormat ​

Get the format the texture was allocated with.

getHandle ​

Get the GPUTexture.

getLabel ​

Get the debug label of the texture.

getMipLevel ​

Get the highest allocated mip level.

getNumberOfComponents ​

The number of components a texel of this texture's format holds.

getReady ​

Whether image data has been uploaded into the texture.

getSampleCount ​

Get the number of samples per texel.

getScale ​

The factor a value read back from this texture must be multiplied by to recover the original source value. 1.0 for the half float formats and 255.0 for normalized byte formats, 65535.0 for 16 bit unorm formats, and 32767.0 for 16 bit snorm formats.

getUsage ​

Get the usage flags the texture was allocated with.

newInstance ​

Method used to create a new instance of vtkWebGPUTexture.

ArgumentTypeRequiredDescription
initialValuesIWebGPUTextureInitialValuesNofor pre-setting some of its content

resize ​

Reallocate the texture when the given extent differs from the current one.

ArgumentTypeRequiredDescription
widthYes
heightYes
depthNumberNo(default: 1)

resizeToMatch ​

Reallocate the texture when its extent differs from the given texture's.

ArgumentTypeRequiredDescription
texYesThe texture to match.

setDevice ​

Set the device the texture belongs to.

setLabel ​

Set the debug label of the texture.

writeImageData ​

Upload a full image into the texture, repacking and half float converting the data as the format requires, and regenerating the mipmaps of a 2d texture that has them.

ArgumentTypeRequiredDescription
reqIWebGPUTextureImageRequestYesThe upload.

writeSubImageData ​

Upload into a sub region of the texture.

ArgumentTypeRequiredDescription
reqIWebGPUTextureSubImageRequestYesThe upload.