GPUTexture: depthOrArrayLayers property - Web APIs | MDN
Value
A number. This represents:
- The depth in pixels, in the case of textures with a
"3d"GPUTexture.dimension. - The number of layers, in the case of layered textures with a
"2d"GPUTexture.dimension.
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
- The WebGPU API