Runtime
Interface in Runtime
The program runtime: a device, and everything a program needs on it.
import type { Runtime } from 'typeshade/runtime'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
interface Runtime<D extends object = object> { readonly device: D; load(program: Pack, options?: LoadOptions): Program; texture(options: TextureOptions | object): Texture; sampler(options?: SamplerOptions | object): Sampler; frame(): Frame; submit(...encoders: readonly object[]): ReturnType<Frame['submit']>; destroy(): void;}Instance properties
deviceread onlyDThe
GPUDevice: the host’s, or the one the runtime requested.
Instance methods
load(program: Pack, options?: LoadOptions): Programtexture(options: TextureOptions | object): Texturesampler(options?: SamplerOptions | object): Samplerframe(): Framesubmit(...encoders: readonly object[]): ReturnType<Frame['submit']>Submit the host’s own encoders, after copying back the console buffers of the dispatches and draws recorded since the last submit; resolves once the lines are delivered, to what those buffers held, as
Frame.submit()does: the queue is given the encoders before the promise is returned.destroy(): voidRelease what the runtime made. The host’s device is left as it is.
Source
src/runtime/runtime.ts, line 132, at commit 26de7be8