Pack
On this page

Pack

Interface in Reflection

The serialisable result of buildManifest: see there.

import type { Pack } from 'typeshade'
import type { Pack } from 'typeshade/runtime'

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

Syntax

interface Pack {
readonly schema: typeof PACK_SCHEMA;
readonly compiler: string;
readonly emit?: { readonly level?: 'O0' | 'O1' | 'O2'; readonly parens?: 'full' | 'minimal'; readonly fp64Flavor?: 'float' | 'integer'; };
readonly wgsl: string;
readonly glsl?: { readonly vertex: string; readonly fragment: string };
readonly bindings: readonly PackBinding[];
readonly vertexLayout?: GpuVertexLayout;
readonly entries: readonly PackEntry[];
readonly structs: readonly { readonly name: string; readonly fields: readonly { name: string; type: string }[]; }[];
readonly overrides: readonly PackOverride[];
readonly features: readonly string[];
readonly console?: PackConsole;
readonly ir?: PortableIr;
readonly gl?: { readonly draws: Readonly<Record<string, PackGlDraw | { readonly none: string }>>; };
}

Instance properties

schemaread only typeof PACK_SCHEMA

The manifest’s schema, which a reader checks first (Rule 11.10).

compilerread only string

The package version that wrote it.

emitoptionalread only { readonly level?: 'O0' | 'O1' | 'O2'; readonly parens?: 'full' | 'minimal'; readonly fp64Flavor?: 'float' | 'integer'; }

The options the program was emitted under, when the build gave any of the three a manifest can record (packModule(m, { emit }), its plugins apart, which it cannot): the optimization level, the parens and the fp64Flavor. One the build did not give is absent and stands for its default ('O2', 'full' and 'float'), and a manifest built with none has no emit. The load-time emitter emits the program again under them (Rule 11.10).

wgslread only string
glsloptionalread only { readonly vertex: string; readonly fragment: string }
bindingsread only readonly PackBinding[]
vertexLayoutoptionalread only GpuVertexLayout

The first vertex entry’s vertex buffer, as entries[].vertex gives each.

entriesread only readonly PackEntry[]
structsread only readonly { readonly name: string; readonly fields: readonly { name: string; type: string }[]; }[]
overridesread only readonly PackOverride[]
featuresread only readonly string[]

The GPUFeatureNames a device must have to create the program’s pipelines.

consoleoptionalread only PackConsole
iroptionalread only PortableIr

The program as portable IR, when the build asked for it: what repack() emits again. Only the package version that wrote it reads it.

gloptionalread only { readonly draws: Readonly<Record<string, PackGlDraw | { readonly none: string }>>; }

What the WebGL2 tier uses: each full-screen fragment entry’s draw, or why it has none.

Source

src/core/manifest-types.ts, line 161, at commit 26de7be8

Edit this page Report a problem