PackOptions
On this page

PackOptions

Interface in Reflection

Everything packModule() adds on request.

import type { PackOptions } from 'typeshade'

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

Syntax

interface PackOptions {
readonly console?: boolean;
readonly ir?: boolean;
readonly emit?: EmitOptions & { readonly level?: OptLevel };
}

Instance properties

consoleoptionalread only boolean

Add the recorded variant, console: the WGSL that records the console.* calls.

iroptionalread only boolean

Add the program as portable IR, ir, which the load-time emitter (typeshade/emit) emits again without the front end. About three times the WGSL gzipped, so on request only.

emitoptionalread only EmitOptions & { readonly level?: OptLevel }

Emit the program under other options than the defaults: the WGSL writer’s own (EmitOptions: parens, fp64Flavor and plugins) and an optimization level, 'O0', 'O1' or 'O2' (the default; OptLevel says what each runs). The manifest’s wgsl, its recorded variant’s wgsl, its glsl (the WebGL2 tier’s programs included) and its bindings are the ones those options emit: fp64Flavor changes the bindings too, since the 'float' flavor binds the _fp64 guard and the 'integer' one binds none. parens, fp64Flavor and plugins reach the GLSL as they reach the WGSL; level is the WGSL’s alone, since the GLSL writer has no level and writes its own optimized program. The manifest records level, parens and fp64Flavor in its emit, which the load-time emitter emits the program again under. A plugin is a function, which a manifest cannot record, so ir: true with a plugin is a TypeError: the load-time emitter could not emit the program again. A word an option does not take is a TypeError too.

See also

Source

src/core/manifest.ts, line 70, at commit 26de7be8

Edit this page Report a problem