PackGlCompute
On this page

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

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

entryread only string
layoutread 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).

vertexread only string

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

varyingsread only readonly string[]
workgroupSizeread only readonly [number, number, number]
rootsread 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.

recordTexelsread 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.

sliceTexelsread only number
slicesread only number
pcWordread 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.

countWordread only number
requestAtread only number
keysAtread only number
valuesAtread only number
initread only readonly (readonly [number, readonly number[]])[]

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

lengthWordsread only Readonly<Record<string, number>>

Each length variable’s record word.

doneread only number

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

cutsread only Readonly<Record<number, 'barrier' | 'atomic' | 'log'>>
barriersread only Readonly<Record<number, { readonly fn: string; readonly line: string }>>

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

requestsread 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.

uniformsread 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.

texturesoptionalread 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.

storageTexturesoptionalread 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, at commit af54ddad5

Edit this page Report a problem