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 onlystringlayoutread only{ readonly width: number; readonly layerRows: number }The texture shape the program reads: a word
wis texel(w % width, (w / width) % layerRows)of layerw / (width × layerRows).vertexread onlystringThe pass program, GLSL ES 3.00: one vertex is one invocation, and transform feedback captures its record,
varyingsin order, interleaved.varyingsread onlyreadonly string[]workgroupSizeread onlyreadonly [number, number, number]rootsread onlyreadonly { 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
fixedis one workgroup’s words; for a storage root, the words before a runtime-sized array, whichstridewords follow per element.recordTexelsread onlynumberThe record each invocation writes per pass, in texels of four words, and how a draw slices it:
slicesdraws ofsliceTexelstexels.sliceTexelsread onlynumberslicesread onlynumberpcWordread onlynumberRecord 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 onlynumberrequestAtread onlynumberkeysAtread onlynumbervaluesAtread onlynumberinitread onlyreadonly (readonly [number, readonly number[]])[]Each private variable’s first record word and its initial words.
lengthWordsread onlyReadonly<Record<string, number>>Each length variable’s record word.
doneread onlynumberThe resume point of a finished invocation, and the cut each other resume point ends.
cutsread onlyReadonly<Record<number, 'barrier' | 'atomic' | 'log'>>barriersread onlyReadonly<Record<number, { readonly fn: string; readonly line: string }>>Each barrier cut’s builtin and line, for the message a divergent workgroup gets.
requestsread onlyReadonly< 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 onlyreadonly { 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 onlyreadonly { 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 (
nullwhen 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 onlyreadonly { 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,
vec4lanes in row order and layer after layer, which the executor reads in from the texture before the first pass and, unlessaccessisread, draws back into it after the last.texelis how its texels read,dimis absent for a 2D texture, andsizenames the uniform whosesis its width, height and layers. Absent when it reaches none.
Source
src/core/manifest-types.ts, line 18, at commit af54ddad5