RuntimeOptions
On this page

RuntimeOptions

Interface in Runtime

How createRuntime() makes a runtime.

import type { RuntimeOptions } from 'typeshade/runtime'

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

Syntax

interface RuntimeOptions<D extends object = object> {
readonly device?: D;
readonly programs?: readonly Pack[];
readonly console?: 'print' | ConsoleSink;
readonly consoleBytes?: number;
readonly emit?: (manifest: Pack, options: { readonly console?: boolean }) => Pack;
}

Instance properties

deviceoptionalread only D

The host’s GPUDevice, which the runtime uses and never destroys. Omitted: the runtime requests one, with the features programs need.

programsoptionalread only readonly Pack[]

The programs the requested device must be able to run.

consoleoptionalread only 'print' | ConsoleSink

Where the events of an entry’s console.* calls go: printed to the host’s console, with a warning for the calls that did not fit the buffer ('print', the default), or handed to a sink, which takes the lines and the count and prints nothing. The count of each buffer’s lines and dropped calls is what submit() resolves to, either way.

consoleBytesoptionalread only number

The console buffer’s size for each dispatch and draw that records, in bytes. 1 MiB. A call the buffer has no room for is dropped whole, and counted in the dropped of submit()’s row for that dispatch or draw.

emitoptionalread only (manifest: Pack, options: { readonly console?: boolean }) => Pack

The load-time emitter, repack from typeshade/emit, which emits a manifest again from the portable IR it carries when a load asks for a variant the build did not write (load(m, { console: true })), under the options the manifest was packed under (packModule(m, { emit })). The runtime never imports it itself, so a host that does not pass it ships no emitter.

Source

src/runtime/runtime.ts, line 41, at commit 26de7be8

Edit this page Report a problem