quantizeToF16
이 페이지에서

quantizeToF16

함수

Rounds e to what an IEEE-754 binary16 can hold and returns it as an f32, so a shader can see the precision an f16 pipeline would give it without the shader-f16 extension.

이름마다 붙은 시그니처와 설명은 커밋 26de7be8의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

declare function quantizeToF16(a0: f32): f32
declare function quantizeToF16<V extends vec2 | vec3 | vec4>(a0: V): V
declare function quantizeToF16(e: f32): f32
declare function quantizeToF16<T extends vec2 | vec3 | vec4>(e: T): T

매개변수

반환값

f32VT

설명

Takes an f32 or a float vector. GLSL ES 3.00 has no such builtin, so it is spelled as a packHalf2x16/unpackHalf2x16 round trip, whose rounding of an exact half that spec does not pin.

대상별 출력

WGSL
quantizeToF16(a)
GLSL ES 3.00
unpackHalf2x16(packHalf2x16(vec2(a, 0.0))).x

예제

함께 보기

이 페이지 편집 문제 보고