GPUTexture: depthOrArrayLayers property - Web APIs | MDN

Value

A number. This represents:

In cases where the GPUTexture does not have a depth or layers, the value is 1.

Examples

js

// …

const test = device.createTexture({
  size: [128],
  format: "r8uint",
  dimension: "1d",
  usage: GPUTextureUsage.COPY_SRC,
});

console.log(test.depthOrArrayLayers); // 1

Specifications

Specification
WebGPU
# dom-gputexture-depthorarraylayers

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.