Program
On this page

Program

Interface in Runtime

A program loaded on a runtime: its manifest and its pipelines.

import type { Program } from 'typeshade/runtime'

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

Syntax

interface Program {
readonly manifest: Pack;
readonly recording: boolean;
compute(entry?: string, options?: { readonly constants?: Constants }): Promise<ComputePipeline>;
render(state?: RenderState): Promise<RenderPipeline>;
}

Instance properties

manifestread only Pack
recordingread only boolean

Whether its entries record their console.* calls.

Instance methods

compute (entry?: string, options?: { readonly constants?: Constants }): Promise<ComputePipeline>

The pipeline of a @compute entry, cached: the program’s only one when entry is omitted. options.constants sets the program’s overrides for this pipeline, as RenderState.constants does for a render pipeline (an override it leaves out takes its declared default), and two sets of values are two pipelines.

render (state?: RenderState): Promise<RenderPipeline>

The pipeline of a vertex entry and a fragment entry under state, cached. state defaults to {}: the program’s only vertex and fragment entry, and every other field at its default.

Source

src/runtime/program.ts, line 121, at commit 26de7be8

Edit this page Report a problem