pack4x8snorm
이 페이지에서

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): u32
declare function pack4x8snorm(e: vec4): u32

매개변수

반환값

u32

설명

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))

예제

함께 보기

이 페이지 편집 문제 보고