---
title: "PackGlCompute: interface in Reflection, TypeShade API"
description: "PackGlCompute, an interface in Reflection. A compute entry as the WebGL2 executor runs it: its pass program…"
url: https://typeshade.dev/api/packglcompute/
language: en
---

# `PackGlCompute`

Interface in Reflection

A compute entry as the WebGL2 executor runs it: its pass program, a vertex stage whose records transform feedback captures, and what the executor needs to run it.

`import type { PackGlCompute } from 'typeshade'`

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

## Syntax

```ts
interface PackGlCompute {
  readonly entry: string;
  readonly layout: { readonly width: number; readonly layerRows: number };
  readonly vertex: string;
  readonly varyings: readonly string[];
  readonly workgroupSize: readonly [number, number, number];
  readonly roots: readonly { readonly name: string; readonly space: 'storage' | 'workgroup'; readonly fixed: number; readonly stride: number; readonly length?: string; }[];
  readonly recordTexels: number;
  readonly sliceTexels: number;
  readonly slices: number;
  readonly pcWord: number;
  readonly countWord: number;
  readonly requestAt: number;
  readonly keysAt: number;
  readonly valuesAt: number;
  readonly init: readonly (readonly [number, readonly number[]])[];
  readonly lengthWords: Readonly<Record<string, number>>;
  readonly done: number;
  readonly cuts: Readonly<Record<number, 'barrier' | 'atomic' | 'log'>>;
  readonly barriers: Readonly<Record<number, { readonly fn: string; readonly line: string }>>;
  readonly requests: Readonly< Record< number, { readonly fn: string; readonly root: number; readonly elem: 'i32' | 'u32'; readonly result?: number; readonly pair: boolean; } > >;
  readonly uniforms: readonly { readonly name: string; readonly block: string; readonly layout: PackLayout; }[];
  readonly textures?: readonly { readonly name: string; readonly sampler: string | null; readonly sample: 'float' | 'sint' | 'uint' | 'depth'; readonly dim?: '2d-array' | '3d' | 'cube'; }[];
  readonly storageTextures?: readonly { readonly name: string; readonly format: string; readonly access: 'read' | 'write' | 'read_write'; readonly dim?: '2d-array'; readonly texel: 'float' | 'sint' | 'uint'; readonly size: string; }[];
}
```

## Description

Plain data, built when the program is packed, so the runtime builds nothing.

## Instance properties

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

**`layout` read only `{ readonly width: number; readonly layerRows: number }`**

The texture shape the program reads: a word `w` is texel `(w % width, (w / width) % layerRows)` of layer `w / (width × layerRows)`.

**`vertex` read only `string`**

The pass program, GLSL ES 3.00: one vertex is one invocation, and transform feedback captures its record, `varyings` in order, interleaved.

**`varyings` read only `readonly string[]`**

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

**`roots` read only `readonly { readonly name: string; readonly space: 'storage' | 'workgroup'; readonly fixed: number; readonly stride: number; readonly length?: string; }[]`**

Each memory root: a storage binding or a workgroup variable, as words. For a workgroup root `fixed` is one workgroup’s words; for a storage root, the words before a runtime-sized array, which `stride` words follow per element.

**`recordTexels` read only `number`**

The record each invocation writes per pass, in texels of four words, and how a draw slices it: `slices` draws of `sliceTexels` texels.

**`sliceTexels` read only `number`**

**`slices` read only `number`**

**`pcWord` read only `number`**

Record words: the resume point, the log’s count, the request (three words), the first of the log’s keys, and the first of its values.

**`countWord` read only `number`**

**`requestAt` read only `number`**

**`keysAt` read only `number`**

**`valuesAt` read only `number`**

**`init` read only `readonly (readonly [number, readonly number[]])[]`**

Each private variable’s first record word and its initial words.

**`lengthWords` read only `Readonly<Record<string, number>>`**

Each length variable’s record word.

**`done` read only `number`**

The resume point of a finished invocation, and the cut each other resume point ends.

**`cuts` read only `Readonly<Record<number, 'barrier' | 'atomic' | 'log'>>`**

**`barriers` read only `Readonly<Record<number, { readonly fn: string; readonly line: string }>>`**

Each barrier cut’s builtin and line, for the message a divergent workgroup gets.

**`requests` read only `Readonly< Record< number, { readonly fn: string; readonly root: number; readonly elem: 'i32' | 'u32'; readonly result?: number; readonly pair: boolean; } > >`**

Each atomic cut’s request: the record word of the variable its value goes to, if any, and whether the value is `atomicCompareExchangeWeak`’s pair.

**`uniforms` read only `readonly { readonly name: string; readonly block: string; readonly layout: PackLayout; }[]`**

The uniform bindings it reads: each one’s name, the std140 block GLSL declares for it, and the layout its host value packs by.

**`textures` optional read only `readonly { readonly name: string; readonly sampler: string | null; readonly sample: 'float' | 'sint' | 'uint' | 'depth'; readonly dim?: '2d-array' | '3d' | 'cube'; }[]`**

The sampled textures it reads, each a sampler of its own name in the pass program: the sampler binding its calls pass it (`null` when it is only loaded or measured; a depth texture’s is its comparison sampler), how its texels read (`depth`: a shadow sampler), and its dimension, absent for a 2D texture. Absent when it reads none.

**`storageTextures` optional read only `readonly { readonly name: string; readonly format: string; readonly access: 'read' | 'write' | 'read_write'; readonly dim?: '2d-array'; readonly texel: 'float' | 'sint' | 'uint'; readonly size: string; }[]`**

The storage textures it reaches (change 0054, fifth amendment), each the memory root of its name: four words a texel, `vec4` lanes in row order and layer after layer, which the executor reads in from the texture before the first pass and, unless `access` is `read`, draws back into it after the last. `texel` is how its texels read, `dim` is absent for a 2D texture, and `size` names the uniform whose `s` is its width, height and layers. Absent when it reaches none.

## Source

[`src/core/manifest-types.ts`, line 18](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/manifest-types.ts#L18), at commit af54ddad5
