---
title: "Bindings: type in Runtime, TypeShade API reference"
description: "Bindings, a type in Runtime. A draw or dispatch binds values by the names the source declares."
url: https://typeshade.dev/api/bindings/
language: en
---

# `Bindings`

Type in Runtime

A draw or dispatch binds values by the names the source declares.

`import type { Bindings } from 'typeshade/runtime'`

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

## Syntax

```ts
type Bindings = Readonly<Record<string, unknown>>;
```

## Description

Each is a `Texture`, a `Sampler`, a `Buffer` of scalars for a buffer binding, a plain host value ([Rule 8.21](https://typeshade.dev/reference/rules/8-21/)), or a host GPU object (below). A `Buffer` binds to any buffer binding, a uniform and a sized storage binding among them: deviation D-l, recorded on and open (change 0138, Amendment A11, Q3).

A plain value is packed by the binding’s layout into its own buffer at each draw and dispatch. Draws of one pass that bind different values of one binding each read their own. The buffers return to the runtime once the frame has run. A `Buffer` is one buffer every draw shares. A draw names only the bindings its entries reach. A name they do not reach is refused.

Escape hatch ([Rule 11.17](https://typeshade.dev/reference/rules/11-17/)): on WebGPU, a host `GPUBuffer`, `GPUSampler` or `GPUTextureView` is bound as it is, and a host `GPUTexture` through its default view. On WebGL2, a host `WebGLTexture` or `WebGLSampler` is bound as it is. A sampled `WebGLTexture` takes the sampler its binding names. A draw takes a `WebGLBuffer` as a uniform block.

## Source

[`src/runtime/program.ts`, line 71](https://github.com/typeshade/typeshade/blob/af54ddad5/src/runtime/program.ts#L71), at commit af54ddad5
