For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Interface 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.

MDN Reference

interface GPUTexture {
    depthOrArrayLayers: number;
    dimension: GPUTextureDimension;
    format: GPUTextureFormat;
    height: number;
    label: string;
    mipLevelCount: number;
    sampleCount: number;
    usage: number;
    width: number;
    createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
    destroy(): void;
}

Hierarchy (View Summary)

Index
depthOrArrayLayers: number

The depthOrArrayLayers read-only property of the GPUTexture interface represents the depth or layer count of the GPUTexture.

MDN Reference

The dimension read-only property of the GPUTexture interface represents the dimension of the set of texels for each GPUTexture subresource.

MDN Reference

The format read-only property of the GPUTexture interface represents the format of the GPUTexture.

MDN Reference

height: number

The height read-only property of the GPUTexture interface represents the height of the GPUTexture.

MDN Reference

label: string
mipLevelCount: number

The mipLevelCount read-only property of the GPUTexture interface represents the number of mip levels of the GPUTexture.

MDN Reference

sampleCount: number

The sampleCount read-only property of the GPUTexture interface represents the sample count of the GPUTexture.

MDN Reference

usage: number

The usage read-only property of the GPUTexture interface is the bitwise flags representing the allowed usages of the GPUTexture.

MDN Reference

width: number

The width read-only property of the GPUTexture interface represents the width of the GPUTexture.

MDN Reference

  • The destroy() method of the GPUTexture interface destroys the GPUTexture.

    MDN Reference

    Returns void

Was this helpful?