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