SD0041
코어 코드
unsupported operation on f64 operands
레지스트리 설명과 컴파일러 메시지는 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.
프런트엔드에서
같은 실수를 한 "use typeshade" 파일은 이 검사까지 오지 않습니다. 프런트엔드가 자기 코드로 먼저 거부하기 때문입니다. 빌드할 때 컴파일한 아래 프로그램에는 다음 진단이 나옵니다.
"use typeshade"
class Uniforms { m: mat3<f64>}
declare const u: uniform<Uniforms>
@fragmentexport function main(@location(0) uv: vec2): vec4 { const k = u.m + u.m return vec4(uv, 0., 1.)}TS8003 error, 11행: Cannot + mat3x3<f64>: the fp64 pass lowers only * and transpose on a matrix of doubles. Declare the matrix mat3x3 where you need +.
고치는 법
레지스트리의 힌트: only + - * / compare, abs, min, max, sqrt, mix, floor, fract, round, sin, cos (and on vectors dot, length, distance, normalize) are emulated — narrow explicitly first: f32(x) on a scalar and vecN(v) on a vector in a "use typeshade" program, toF32(x) in the fn() EDSL
함께 보기
-
TS8003TYPE_MISMATCH - 연산자나 조건, 선언, 반환, 인자처럼 두 값이 만나는 자리에서 타입이 서로 맞지 않거나, 컴파일러가 접는 상수를 WGSL이 거부합니다. 31을 넘는 시프트 양, 0인 제수, 서로 엇갈린 clamp 경계, 범위를 넘는 f32 값이 그렇습니다.
소스
커밋 c66579bf에서 컴파일러가 이 코드를 내는 곳입니다. 파일마다 한 줄씩 적었습니다.