textureNumLayers
함수
Returns the number of layers of a texture_2d_array or a texture_cube_array as a u32.
이름마다 붙은 시그니처와 설명은 커밋 26de7be8의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
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>,): u32시그니처에는 앰비언트 파일이 스스로 쓰려고 선언한 타입이 나올 수 있습니다. 아래가 그 선언입니다.
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'
매개변수
반환값
설명
A texture with no layers is refused.
대상별 출력
- WGSL
-
textureNumLayers(a) - GLSL ES 3.00
-
uint(textureSize(a, 0).z)