CpuValue
이 페이지에서

CpuValue

타입, CPU 오라클 분류

A value as the CPU backends (compileModule and compileModuleJs) represent it: a plain JavaScript value, never a typed array or a GPU buffer.

import type { CpuValue } from 'typeshade'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

type CpuValue = number | boolean | number[] | boolean[] | CpuStruct;

설명

A scalar of any kind (f32, f64, i32, u32, bool) is a number or boolean, computed in double precision; CpuPrecision says how the arithmetic rounds. A vector or matrix is a flat number[], mutable and shared by reference: a field write such as p.x = … inside a shader function changes the caller’s array in place. A struct is a CpuStruct. This is the value type the functions of a CpuModule take and return, and the one its setBinding accepts.

함께 보기

소스

src/core/cpu-runtime.ts, 43행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고