textureNumLayers
Function
Returns the number of layers of a texture_2d_array or a texture_cube_array as a u32.
The signature and the sentence under each name are the compiler's own text at commit 26de7be8.
Syntax
declare function textureNumLayers<E extends TextureElem = f32>(tex: texture_cube_array<E>): u32declare function textureNumLayers(tex: texture_depth_cube_array): u32declare function textureNumLayers(tex: texture_depth_2d_array): u32declare function textureNumLayers<E extends TextureElem = f32>(tex: texture_2d_array<E>): u32declare function textureNumLayers<F extends StorageFormat, A extends StorageAccess>( tex: texture_storage_2d_array<F, A>,): u32A signature may name a type the ambient file declares for its own use. These are those declarations.
TextureElemtype TextureElem = f32 | i32 | u32StorageFormattype StorageFormat = 'rgba8unorm' | 'rgba8snorm' | 'rgba8uint' | 'rgba8sint' | 'rgba16uint' | 'rgba16sint' | 'rgba16float' | 'r32uint' | 'r32sint' | 'r32float' | 'rg32uint' | 'rg32sint' | 'rg32float' | 'rgba32uint' | 'rgba32sint' | 'rgba32float' | 'bgra8unorm'StorageAccesstype StorageAccess = 'write' | 'read' | 'read_write'
Parameters
Return value
Description
A texture with no layers is refused.
Targets
- WGSL
-
textureNumLayers(a) - GLSL ES 3.00
-
uint(textureSize(a, 0).z)