Skip to content

GPUTextureViewDescriptor

Describes the format, dimension, mip levels, array layers, and aspect of a GPUTextureView.

Properties

arrayLayerCount

How many array layers, starting with baseArrayLayer, are accessible to the texture view.

aspect

abstract val aspect: GPUTextureAspect
Which aspect(s) of the texture are accessible to the texture view.

baseArrayLayer

The index of the first array layer accessible to the texture view.

baseMipLevel

The first (most detailed) mipmap level accessible to the texture view.

dimension

The dimension to view the texture as. See [GPUTextureViewDescriptor.dimension in the WebGPU specification](https://www.w3.org/TR/webgpu/#dom-gputextureviewdescriptor-dimension).

format

abstract val format: GPUTextureFormat?
The format of the texture view. Must be either the format of the texture or one of the viewFormats specified during its creation.

label

abstract val label: String
The initial value of GPUObjectBase.label. See [GPUObjectDescriptorBase.label in the WebGPU specification](https://www.w3.org/TR/webgpu/#dom-gpuobjectdescriptorbase-label).

mipLevelCount

How many mipmap levels, starting with baseMipLevel, are accessible to the texture view.

swizzle

abstract val swizzle: GPUTextureSwizzle
A string of length four, with each character mapping to the texture view’s red/green/blue/alpha channels, respectively. "r": Take its value from the red channel of the texture.

usage

abstract val usage: GPUTextureUsage
The allowed usage(s) for the texture view. Must be a subset of the usage flags of the texture. If 0, defaults to the full set of usage flags of the texture. Note: If the view’s format doesn’t support all of the texture’s usages, the default will fail, and the view’s usage must be specified explicitly.