textureNumLayers
이 페이지에서

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>): u32
declare function textureNumLayers(tex: texture_depth_cube_array): u32
declare function textureNumLayers(tex: texture_depth_2d_array): u32
declare function textureNumLayers<E extends TextureElem = f32>(tex: texture_2d_array<E>): u32
declare function textureNumLayers<F extends StorageFormat, A extends StorageAccess>(
tex: texture_storage_2d_array<F, A>,
): u32

시그니처에는 앰비언트 파일이 스스로 쓰려고 선언한 타입이 나올 수 있습니다. 아래가 그 선언입니다.

TextureElem
type TextureElem = f32 | i32 | u32
StorageFormat
type StorageFormat = 'rgba8unorm' | 'rgba8snorm' | 'rgba8uint' | 'rgba8sint' | 'rgba16uint' | 'rgba16sint' | 'rgba16float' | 'r32uint' | 'r32sint' | 'r32float' | 'rg32uint' | 'rg32sint' | 'rg32float' | 'rgba32uint' | 'rgba32sint' | 'rgba32float' | 'bgra8unorm'
StorageAccess
type StorageAccess = 'write' | 'read' | 'read_write'

매개변수

반환값

u32

설명

A texture with no layers is refused.

대상별 출력

WGSL
textureNumLayers(a)
GLSL ES 3.00
uint(textureSize(a, 0).z)

예제

함께 보기

이 페이지 편집 문제 보고