Geometry
Interface in Runtime
What a draw draws: count vertices, instances times, from the vertex buffer the manifest lays out.
import type { Geometry } from 'typeshade/runtime'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
interface Geometry { readonly count: number; readonly instances?: number; readonly vertices?: ArrayBufferView | object; readonly indices?: Uint16Array | Uint32Array | { readonly buffer: object; readonly format: 'uint16' | 'uint32' };}Description
A typed array is uploaded at the draw; a GPUBuffer is bound as is.
Instance properties
countread onlynumberHow many vertices, or indices when
indicesis given.instancesoptionalread onlynumberHow many instances: 1 when omitted.
verticesoptionalread onlyArrayBufferView | objectThe vertex buffer, laid out as the manifest’s vertex entry reads it (its
@locationinputs, tightly packed): a typed array, uploaded at each draw, or the host’sGPUBuffer. Omitted for a vertex entry with no@locationinput, such as a full-screen triangle drawn fromvertex_index.indicesoptionalread onlyUint16Array | Uint32Array | { readonly buffer: object; readonly format: 'uint16' | 'uint32' }The index buffer: a
Uint16ArrayorUint32Array, uploaded at each draw, or{ buffer, format }, the host’sGPUBufferbound as it is.
Source
src/runtime/program.ts, line 104, at commit 26de7be8