pack4x8snorm
함수
Packs a vec4 of values in [-1, 1] into the four bytes of a u32 as signed bytes, component 0 in the low byte.
이름마다 붙은 시그니처와 설명은 커밋 26de7be8의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
declare function pack4x8snorm(a0: vec4): u32declare function pack4x8snorm(e: vec4): u32매개변수
-
evec4
반환값
설명
Hand-inlined on GLSL ES 3.00, which has no packSnorm4x8 (that is ES 3.10).
대상별 출력
- WGSL
-
pack4x8snorm(a) - GLSL ES 3.00
-
(uint(int(floor(0.5 + clamp(a.x, -1.0, 1.0) * 127.0)) & 0xFF) | (uint(int(floor(0.5 + clamp(a.y, -1.0, 1.0) * 127.0)) & 0xFF) << 8) | (uint(int(floor(0.5 + clamp(a.z, -1.0, 1.0) * 127.0)) & 0xFF) << 16) | (uint(int(floor(0.5 + clamp(a.w, -1.0, 1.0) * 127.0)) & 0xFF) << 24))