Geometry
On this page

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 only number

How many vertices, or indices when indices is given.

instancesoptionalread only number

How many instances: 1 when omitted.

verticesoptionalread only ArrayBufferView | object

The vertex buffer, laid out as the manifest’s vertex entry reads it (its @location inputs, tightly packed): a typed array, uploaded at each draw, or the host’s GPUBuffer. Omitted for a vertex entry with no @location input, such as a full-screen triangle drawn from vertex_index.

indicesoptionalread only Uint16Array | Uint32Array | { readonly buffer: object; readonly format: 'uint16' | 'uint32' }

The index buffer: a Uint16Array or Uint32Array, uploaded at each draw, or { buffer, format }, the host’s GPUBuffer bound as it is.

Source

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

Edit this page Report a problem