u32()
함수, 값 분류
A u32 literal node.
import { u32 } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
function u32(v: number): Node<'u32'>;function u32(x: ReadonlyNode<ScalarCastSource>): Node<'u32'>;매개변수
vnumber
반환값
Node<'u32'>
예외
설명
Use it over the f32 default wherever WGSL demands an unsigned scalar:
buffer strides, vertex and instance indices, bit-flag masks used with .bitAnd and .bitOr.
A Node argument is a cast instead: u32(x) converts, the free-function twin of x.u32().
It builds what toU32 builds, and its operand is bounded to a scalar.
예제
예제
import { u32 } from 'typeshade'
const flags = u32(4) // Node<'u32'>대상별 지원
| 대상 | 지원 | 비고 |
|---|---|---|
| WGSL (WebGPU) | 지원 |
|
| GLSL ES 3.00 (WebGL2) | 지원 |
|
| CPU 오라클 | 지원 | Evaluated in f64 by the oracle. |
관련 가이드
함께 보기
소스
src/core/ir/node.ts, 1019행, 커밋 c66579bf 기준