GPUTexture
The GPUTexture interface of the WebGPU API represents a container used to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.
Available only in secure contexts.
Extends
Methods
createView()
createView(descriptor?): GPUTextureView;
The createView() method of the GPUTexture interface creates a GPUTextureView representing a specific view of the GPUTexture.
Parameters
| Parameter | Type |
|---|---|
descriptor? | GPUTextureViewDescriptor |
Returns
destroy()
destroy(): void;
The destroy() method of the GPUTexture interface destroys the GPUTexture.
Returns
void
Properties
depthOrArrayLayers
readonly depthOrArrayLayers: number;
The depthOrArrayLayers read-only property of the GPUTexture interface represents the depth or layer count of the GPUTexture.
dimension
readonly dimension: GPUTextureDimension;
The dimension read-only property of the GPUTexture interface represents the dimension of the set of texels for each GPUTexture subresource.
format
readonly format: GPUTextureFormat;
The format read-only property of the GPUTexture interface represents the format of the GPUTexture.
height
readonly height: number;
The height read-only property of the GPUTexture interface represents the height of the GPUTexture.
label
label: string;
Inherited from
mipLevelCount
readonly mipLevelCount: number;
The mipLevelCount read-only property of the GPUTexture interface represents the number of mip levels of the GPUTexture.
sampleCount
readonly sampleCount: number;
The sampleCount read-only property of the GPUTexture interface represents the sample count of the GPUTexture.
usage
readonly usage: number;
The usage read-only property of the GPUTexture interface is the bitwise flags representing the allowed usages of the GPUTexture.
width
readonly width: number;
The width read-only property of the GPUTexture interface represents the width of the GPUTexture.