---
title: "ComputePipeline: interface in Runtime, TypeShade API"
description: "ComputePipeline, an interface in Runtime. A compute pipeline: one entry, dispatched with bindings by name."
url: https://typeshade.dev/api/computepipeline/
language: en
---

# `ComputePipeline`

Interface in Runtime

A compute pipeline: one entry, dispatched with bindings by name.

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

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

## Syntax

```ts
interface ComputePipeline<B = Bindings> {
  readonly entry: string;
  readonly workgroupShape: readonly [number, number, number];
  dispatch(target: object, bindings: B, workgroups: number | readonly number[]): void;
}
```

## Description

`B` is the bindings the entry reaches (change 0030). `workgroupShape` is the resolved `[x, y, z]` shape for the constants used to create this pipeline, including any workgroup-size overrides.

## Instance properties

**`entry` read only `string`**

**`workgroupShape` read only `readonly [number, number, number]`**

The resolved `[x, y, z]` workgroup size this pipeline was created with.

## Instance methods

**`dispatch` `(target: object, bindings: B, workgroups: number | readonly number[]): void`**

Record a dispatch into the host’s encoder or compute pass, or a frame’s. Escape hatch ([Rule 11.17](https://typeshade.dev/reference/rules/11-17/)): the host’s `GPUCommandEncoder` or `GPUComputePassEncoder`, which the dispatch records into; WebGL2 takes a frame only.

## Source

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