ReflectOptions
On this page

ReflectOptions

Interface in Reflection

Options for reflect.

import type { ReflectOptions } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

interface ReflectOptions {
readonly fp64Flavor?: Fp64Flavor;
readonly console?: 'cpu' | 'gpu';
}

Instance properties

fp64Flavoroptionalread only Fp64Flavor

The f64 emulation flavour the emit will use, the same Fp64Flavor the backend is given. It decides whether the module binds the _fp64 guard, a 1x1 texture the emulated-double helpers read so that a fast-math compiler cannot reassociate their arithmetic: the 'float' helpers (the default) read it and the 'integer' helpers do not. Pass the same value the emit will get; a host that builds a bind group from a reflection computed with a different flavour is describing a different program than the one it runs.

consoleoptionalread only 'cpu' | 'gpu'

Where a console call is recorded: 'gpu' reports the _console buffer the WGSL then binds (Rule 6.11, surface §66), as _fp64 is reported. Pass the same value compile() got. Defaults to 'cpu', which adds no binding.

See also

Source

src/core/reflect.ts, line 728, at commit 26de7be8

Edit this page Report a problem