Aller au contenu

GPUTextureDescriptor

Describes a GPUTexture's size, format, usage, and optional view formats.

Properties

dimension

Whether the texture is one-dimensional, an array of two-dimensional layers, or three-dimensional.

format

abstract val format: GPUTextureFormat
The format of the texture. See [GPUTextureDescriptor.format in the WebGPU specification](https://www.w3.org/TR/webgpu/#dom-gputexturedescriptor-format).

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

The number of mip levels the texture will contain. See [GPUTextureDescriptor.mipLevelCount in the WebGPU specification](https://www.w3.org/TR/webgpu/#dom-gputexturedescriptor-miplevelcount).

sampleCount

abstract val sampleCount: GPUSize32
The sample count of the texture. A sampleCount > 1 indicates a multisampled texture.

size

abstract val size: GPUExtent3D
The width, height, and depth or layer count of the texture.

textureBindingViewDimension

On devices with "core-features-and-limits", this is ignored, and there is no such restriction.

usage

abstract val usage: GPUTextureUsage
The allowed usages for the texture. See [GPUTextureDescriptor.usage in the WebGPU specification](https://www.w3.org/TR/webgpu/#dom-gputexturedescriptor-usage).

viewFormats

Specifies what view format values will be allowed when calling createView() on this texture (in addition to the texture’s actual format). Formats in this list must be texture view format compatible with the texture format.