Frame
Interface in Runtime
One command encoder's work: dispatches and render passes, submitted together.
import type { Frame } from 'typeshade/runtime'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
interface Frame { readonly encoder: object; dispatch( pipeline: ComputePipeline, bindings: Bindings, workgroups: number | readonly number[], ): void; pass(targets: PassTargets, record: (pass: RenderPass) => void): void; submit(): Promise<{ readonly console: readonly { readonly entry: string; readonly lines: number; readonly dropped: number; }[]; }>;}Instance properties
encoderread onlyobjectThe
GPUCommandEncoder, for the host’s own commands between the frame’s.
Instance methods
dispatch(pipeline: ComputePipeline, bindings: Bindings, workgroups: number | readonly number[]): voidpass(targets: PassTargets, record: (pass: RenderPass) => void): voidsubmit(): Promise<{ readonly console: readonly { readonly entry: string; readonly lines: number; readonly dropped: number; }[]; }>Submit the frame. The queue is given its commands before
submit()returns its promise, so a texture read started right after it, while the promise is pending, reads the frame (Texture.read). It resolves once the queue has run the frame and the console lines of its entries are delivered, printed or handed to the runtime’s sink, to what their buffers held:{ console: [{ entry, lines, dropped }, …] }, a row for each dispatch and draw of the frame that recorded, in the order they were recorded, and none when nothing did.entrynames what the buffer recorded for (the compute entry, or the fragment entry of a draw),linestheconsole.*calls it kept, each printed or handed to the sink, anddroppedthe calls that had no room inconsoleBytes. A runtime that prints warns of the dropped calls; one given a sink prints nothing, so its host reads the count here. It rejects with the validation error the frame raised, if any.
Source
src/runtime/runtime.ts, line 99, at commit 26de7be8