Interface GPUTextureDescriptor
interface GPUTextureDescriptor {
dimension?: GPUTextureDimension;
format: GPUTextureFormat;
label?: string;
mipLevelCount?: number;
sampleCount?: number;
size: GPUExtent3DStrict;
usage: number;
viewFormats?: Iterable<GPUTextureFormat, any, any>;
}
dimension?: GPUTextureDimension;
format: GPUTextureFormat;
label?: string;
mipLevelCount?: number;
sampleCount?: number;
size: GPUExtent3DStrict;
usage: number;
viewFormats?: Iterable<GPUTextureFormat, any, any>;
}
Hierarchy
- GPUObjectDescriptorBase
- GPUTextureDescriptor (view full)
Index
Properties
Optional
dimension
format
The format of the texture.
Optional
label
label?: string
The initial value of GPUObjectBase.label.
Optional
mipLevelCount
mipLevelCount ?: number
The number of mip levels the texture will contain.
Optional
sampleCount
sampleCount ?: number
The sample count of the texture. A GPUTextureDescriptor#sampleCount > 1
indicates
a multisampled texture.
size
The width, height, and depth or layer count of the texture.
usage
usage: number
The allowed usages for the texture.
Optional
viewFormats
Specifies what view GPUTextureViewDescriptor#format values will be allowed when calling GPUTexture#createView on this texture (in addition to the texture's actual GPUTextureDescriptor#format).
Adding a format to this list may have a significant performance impact, so it is best
to avoid adding formats unnecessarily.
The actual performance impact is highly dependent on the target system; developers must
test various systems to find out the impact on their particular application.
For example, on some systems any texture with a GPUTextureDescriptor#format or
GPUTextureDescriptor#viewFormats entry including
GPUTextureFormat#"rgba8unorm-srgb" will perform less optimally than a
GPUTextureFormat#"rgba8unorm" texture which does not.
Similar caveats exist for other formats and pairs of formats on other systems.
Formats in this list must be texture view format compatible with the texture format.
Two GPUTextureFormats `format` and `viewFormat` are texture view format compatible if:
- `format` equals `viewFormat`, or
- `format` and `viewFormat` differ only in whether they are `srgb` formats (have the `-srgb` suffix).
Whether the texture is one-dimensional, an array of two-dimensional layers, or three-dimensional.