Fp64FlavorSignals
이 페이지에서

Fp64FlavorSignals

인터페이스, f64 에뮬레이션 분류

The device-identification signals recommendFp64Flavor and isAppleGpu read to pick the df64 flavour a device needs: 'integer' on Apple GPUs, where Metal runs underneath, and 'float' everywhere else.

import type { Fp64FlavorSignals } from 'typeshade'

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

구문

interface Fp64FlavorSignals {
readonly adapterInfo?: { readonly vendor?: string; readonly architecture?: string } | null;
readonly rendererString?: string | null;
readonly userAgent?: string | null;
}

설명

The library cannot see a GPU itself, so the caller collects whatever it has, a WebGPU adapter’s info, a WebGL2 UNMASKED_RENDERER_WEBGL string, navigator.userAgent, and passes it here. Every field is optional, and any single Apple-identifying signal is enough to select 'integer'. Passing none of them selects 'float', so an Apple device whose signals were never collected silently gets the wrong flavour: df64 still compiles and runs, but its extended precision collapses to plain f32 once the shader compiler reassociates the error terms the float flavour depends on.

인스턴스 속성

adapterInfo선택 사항읽기 전용 { readonly vendor?: string; readonly architecture?: string } | null

GPUAdapter.info (or any {vendor, architecture} shaped object). Apple reports vendor ‘apple’ (architecture like ‘apple’ / ‘metal-3’).

rendererString선택 사항읽기 전용 string | null

The WebGL UNMASKED_RENDERER_WEBGL (or RENDERER) string. Apple devices read like ‘ANGLE (Apple, ANGLE Metal Renderer: Apple M1, Unspecified Version)’ or ‘Apple GPU’.

userAgent선택 사항읽기 전용 string | null

navigator.userAgent, the fallback when the GPU strings are masked (iOS Safari always runs Metal underneath).

함께 보기

소스

src/core/fp64/flavor-select.ts, 38행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고