@vcollab/shader-library 0.0.0-stage → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +92 -0
- package/LICENSE +8 -0
- package/README.md +111 -2
- package/dist/bind.d.ts +53 -0
- package/dist/blocks.d.ts +73 -0
- package/dist/bundled.cjs +272 -0
- package/dist/bundled.cjs.map +1 -0
- package/dist/bundled.d.ts +6 -0
- package/dist/bundled.js +22 -0
- package/dist/bundled.js.map +1 -0
- package/dist/chunk-A73KYX6T.js +298 -0
- package/dist/chunk-A73KYX6T.js.map +1 -0
- package/dist/derived/dispatch.d.ts +80 -0
- package/dist/derived/errors.d.ts +4 -0
- package/dist/derived/index.cjs +451 -0
- package/dist/derived/index.cjs.map +1 -0
- package/dist/derived/index.d.ts +62 -0
- package/dist/derived/index.js +417 -0
- package/dist/derived/index.js.map +1 -0
- package/dist/derived/kernels.d.ts +73 -0
- package/dist/encoding.d.ts +39 -0
- package/dist/index.cjs +736 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +418 -0
- package/dist/index.js.map +1 -0
- package/dist/load.d.ts +60 -0
- package/dist/manifest.d.ts +213 -0
- package/dist/pack.d.ts +69 -0
- package/dist/pick.d.ts +89 -0
- package/dist/select.d.ts +47 -0
- package/dist/version.d.ts +2 -0
- package/package.json +70 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/encoding.ts","../src/manifest.ts","../src/load.ts","../src/bundled.ts"],"names":["REGISTRY","ENVELOPE_LOADERS"],"mappings":";;;;;;;AAkCA,IAAM,QAAA,GAAgE;AAAA,EACpE,KAAA,EAAO,EAAE,IAAA,EAAM,OAAA,EAAS,OAAO,CAAA,EAAE;AAAA,EACjC,GAAA,EAAK,EAAE,IAAA,EAAM,KAAA,EAAO,OAAO,CAAA,EAAE;AAAA,EAC7B,IAAA,EAAM,EAAE,IAAA,EAAM,MAA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AAO,IAAA,EAAK;AAAA,IACd;AAAA,GACF;AACF;AAGO,SAAS,cAAA,GAAqC;AACnD,EAAA,OAAO,SAAA,CAAU,IAAA,CAAK,aAAA,EAAe,CAAA;AACvC","file":"bundled.cjs","sourcesContent":["// Copyright Visual Collaboration Technologies Inc. All Rights Reserved.\n// See LICENSE for details.\n\n/**\n * The uniform encodings the packer can write, and the check that a reflected\n * layout fits them.\n *\n * Internal: {@link UniformBlock} and {@link ShaderSet} share it, so an envelope\n * the set accepts is one the packer can write, and the two cannot disagree\n * about what an encoding is.\n *\n * Nothing here computes a std140 offset or size. The layout is the build's;\n * what is checked is only that the packer's own writes — `width` four-byte\n * components at the member's offset, or `order` sixteen-byte rows for a matrix,\n * or one element per `elementStride` for an array — land inside the extent the\n * build recorded for that member, and inside the block.\n */\n\nimport type { UniformLayout } from \"./manifest.js\";\n\n/** How a scalar component is stored. */\nexport type Kind = \"float\" | \"int\" | \"uint\";\n\n/** What one encoding means to the packer. */\nexport interface Encoding {\n readonly kind: Kind;\n /** Components per element: 1 for a scalar, 2–4 for a vector, order² for a matrix. */\n readonly width: number;\n /** The matrix order, for a matrix. */\n readonly order?: number;\n /** Whether the member is an array of these. */\n readonly isArray: boolean;\n}\n\nconst ELEMENTS: Readonly<Record<string, Omit<Encoding, \"isArray\">>> = {\n float: { kind: \"float\", width: 1 },\n int: { kind: \"int\", width: 1 },\n uint: { kind: \"uint\", width: 1 },\n vec2: { kind: \"float\", width: 2 },\n vec3: { kind: \"float\", width: 3 },\n vec4: { kind: \"float\", width: 4 },\n ivec2: { kind: \"int\", width: 2 },\n ivec3: { kind: \"int\", width: 3 },\n ivec4: { kind: \"int\", width: 4 },\n uvec2: { kind: \"uint\", width: 2 },\n uvec3: { kind: \"uint\", width: 3 },\n uvec4: { kind: \"uint\", width: 4 },\n mat2: { kind: \"float\", width: 4, order: 2 },\n mat3: { kind: \"float\", width: 9, order: 3 },\n mat4: { kind: \"float\", width: 16, order: 4 },\n};\n\nconst ARRAY_SUFFIX = \"[]\";\n\n/** The encodings the packer writes, each also as an array. */\nexport const KNOWN_ENCODINGS: readonly string[] = Object.keys(ELEMENTS);\n\n/** What `encoding` means, or `undefined` if the packer does not know it. */\nexport function describeEncoding(encoding: string): Encoding | undefined {\n const isArray = encoding.endsWith(ARRAY_SUFFIX);\n const element = isArray ? encoding.slice(0, -ARRAY_SUFFIX.length) : encoding;\n // An own-property lookup: `in` would accept `toString` as an encoding.\n if (!Object.hasOwn(ELEMENTS, element)) return undefined;\n return { ...(ELEMENTS[element] as Omit<Encoding, \"isArray\">), isArray };\n}\n\nconst isWhole = (value: unknown): value is number =>\n typeof value === \"number\" && Number.isInteger(value);\n\n/**\n * Why `layout` cannot be written into a block of `blockSize` bytes, or\n * `undefined` if it can.\n *\n * A member with a `null` encoding passes: it is part of the block and counts\n * towards its size, and the packer refuses only a write to it.\n */\nexport function layoutProblem(\n name: string,\n layout: UniformLayout,\n blockSize: number,\n): string | undefined {\n if (typeof layout !== \"object\" || layout === null) {\n return `${name} has no layout record.`;\n }\n const { offset, size, elementStride, encoding } = layout;\n if (!isWhole(offset) || offset < 0 || offset % 4 !== 0) {\n return `${name} is at offset ${String(offset)}, which is not a non-negative multiple of 4.`;\n }\n if (!isWhole(size) || size <= 0 || offset + size > blockSize) {\n return (\n `${name} occupies ${String(size)} byte(s) at offset ${offset}, which does not lie ` +\n `within the ${blockSize}-byte block.`\n );\n }\n if (encoding === null) return undefined;\n if (typeof encoding !== \"string\") {\n return `${name} has the encoding ${String(encoding)}, which is not a name.`;\n }\n const described = describeEncoding(encoding);\n if (described === undefined) {\n return (\n `${name} has the encoding ${encoding}, which the packer does not know; it writes ` +\n `${KNOWN_ENCODINGS.join(\", \")}, and arrays of them.`\n );\n }\n // How far the packer's writes reach for one element, from the element's\n // start: a matrix is `order` rows, each at a sixteen-byte slot.\n const reach =\n described.order === undefined\n ? described.width * 4\n : (described.order - 1) * 16 + described.order * 4;\n if (described.isArray) {\n if (!isWhole(elementStride) || elementStride <= 0 || elementStride % 4 !== 0) {\n return (\n `${name} is ${encoding}, but the build reports an element stride of ` +\n `${String(elementStride)}.`\n );\n }\n if (reach > elementStride || elementStride > size) {\n return `${name} is ${encoding} with ${size} byte(s) at a ${elementStride}-byte stride, which does not hold one element.`;\n }\n return undefined;\n }\n if (reach > size) {\n return `${name} is ${encoding}, which writes ${reach} byte(s), but the build gives it ${size}.`;\n }\n return undefined;\n}\n","// Copyright Visual Collaboration Technologies Inc. All Rights Reserved.\n// See LICENSE for details.\n\n/**\n * The artifact set's documents, as types.\n *\n * These mirror what `vcti-shader-foundry` emits — `registry.json` and one\n * envelope per pipeline — field for field. The foundry is the only thing that\n * produces them; nothing here re-declares a contract or invents a field. When\n * the emitted shape changes, {@link SCHEMA_VERSION} changes with it and a set\n * carrying an unknown version is refused rather than misread.\n */\n\n/** The emitted document shape this package understands. */\nexport const SCHEMA_VERSION = 3;\n\n/** A shader language an artifact set can carry. Only `glsl` is emitted today. */\nexport type ShaderLanguage = \"glsl\" | \"wgsl\";\n\n/** A stage of a pipeline. */\nexport type ShaderStage = \"vertex\" | \"fragment\";\n\n/** One vertex attribute the pipeline reads. */\nexport interface AttributeSpec {\n /** The name the attribute is declared under. */\n readonly name: string;\n /** Its GL type, e.g. `vec3`, `int`. */\n readonly type: string;\n /** What the attribute means — how a consumer matches its own buffer to it. */\n readonly semantic: string;\n}\n\n/** One uniform block member the pipeline reads. */\nexport interface UniformSpec {\n readonly name: string;\n /** Its GL type, e.g. `vec3`, `mat4`, `int`. */\n readonly type: string;\n /**\n * Named states for an integer selector, e.g. `u_colorSource`. The numbers\n * are append-only across releases (see the foundry's stability rules).\n */\n readonly namedValues?: Readonly<Record<string, number>>;\n}\n\n/** One fragment output. Its index in `outputs` is its location. */\nexport interface OutputSpec {\n readonly name: string;\n readonly type: string;\n /**\n * The attachment format the output requires, or `null` for no exact\n * requirement. `null` is a claim, not an omission.\n */\n readonly format: string | null;\n}\n\n/** A texture read at exact integer coordinates — a lookup table, not an image. */\nexport interface TableSpec {\n readonly name: string;\n readonly type: string;\n readonly format: string;\n readonly semantic: string;\n}\n\n/** An image sampled between texels. */\nexport interface TextureSpec {\n readonly name: string;\n readonly semantic: string;\n readonly kind: string;\n readonly component: string;\n readonly format: string;\n readonly requiresMipChain: boolean;\n /** The name of a sampler this contract declares. */\n readonly sampler: string;\n /** The semantic of a uv attribute this contract carries. */\n readonly uv: string;\n readonly selection: string;\n readonly neutral: readonly number[] | null;\n}\n\n/** Sampler state a texture is read through. */\nexport interface SamplerSpec {\n readonly name: string;\n readonly magFilter: string;\n readonly minFilter: string;\n readonly mipmapFilter: string;\n readonly wrapS: string;\n readonly wrapT: string;\n}\n\n/**\n * A pipeline's binding surface: everything a caller must match.\n *\n * Order is significant. A uniform block's member order determines its byte\n * offsets, which is why {@link RegistryEntry.contractSha256} is computed over\n * this document with its sequences left unsorted.\n */\nexport interface PipelineContract {\n readonly id: string;\n readonly capabilities: readonly string[];\n readonly inputs: readonly AttributeSpec[];\n readonly uniforms: readonly UniformSpec[];\n readonly outputs: readonly OutputSpec[];\n readonly tables: readonly TableSpec[];\n readonly textures: readonly TextureSpec[];\n readonly samplers: readonly SamplerSpec[];\n}\n\n/** Versions of the three executables that compiled a set. `null` where unread. */\nexport interface ToolchainInfo {\n readonly slangc: string | null;\n readonly spirvCross: string | null;\n readonly glslang: string | null;\n}\n\n/** What produced a set, and with what. */\nexport interface GeneratorInfo {\n readonly name: string;\n readonly version: string;\n readonly toolchain: ToolchainInfo | null;\n}\n\n/**\n * One index entry: enough to choose this pipeline, and where to go next.\n *\n * Not the contract. `contractSha256` names the envelope's content without\n * repeating it, so a fetched envelope can be checked against the entry that\n * pointed at it.\n */\nexport interface RegistryEntry {\n readonly id: string;\n readonly description: string;\n readonly capabilities: readonly string[];\n readonly contractSha256: string;\n /** The envelope's path within the set, relative and POSIX. */\n readonly envelope: string;\n}\n\n/** `registry.json`: the index a consumer selects from. */\nexport interface Registry {\n readonly schemaVersion: number;\n readonly generator: GeneratorInfo;\n /** The closed set of tags any pipeline in this set may declare. */\n readonly capabilityVocabulary: readonly string[];\n readonly pipelines: readonly RegistryEntry[];\n}\n\n/**\n * Where std140 placed one uniform block member.\n *\n * Read rather than recomputed: a second implementation of the padding rules is\n * a second thing to be wrong, and it would diverge silently — on one pipeline,\n * in one case, such as the sixteen-byte stride std140 gives the eight-byte\n * elements of a `vec2[72]`.\n */\nexport interface UniformLayout {\n /** Byte offset from the start of the block. */\n readonly offset: number;\n /** Total byte size, including any array padding. */\n readonly size: number;\n /**\n * Bytes between array elements. For a member that is not an array it is\n * what the reflection reports for its components: `4` for a vector, `0` for\n * a scalar or a matrix. The packer reads it only for an array.\n */\n readonly elementStride: number;\n /** The element type — `float`, `vec3`, `mat4`, `ivec2`. */\n readonly encoding: string | null;\n /** `row` or `column`, present only for a matrix. */\n readonly majorness?: \"row\" | \"column\";\n}\n\n/**\n * One emitted sampler uniform, and the resource it was built from.\n *\n * The seam the declared names do not cross: GLSL ES 3.00 has no binding\n * qualifier for samplers, so the cross-compiler pairs each texture with a\n * sampler and names the combination itself. A consumer binds by\n * {@link semantic}, then uses {@link uniform} and {@link unit}.\n */\nexport interface BindingRecord {\n /** The semantic of the table or texture this was built from. */\n readonly semantic: string;\n /** The declared name of that resource. It does not reach the program. */\n readonly texture: string;\n /**\n * The declared name of the sampler it was paired with, or `null` where the\n * contract declares none — a table read at exact texel coordinates is paired\n * with the cross-compiler's dummy sampler, which the contract never names.\n */\n readonly sampler: string | null;\n /** The uniform the emitted program actually declares. */\n readonly uniform: string;\n readonly component: string;\n readonly stage: ShaderStage;\n /** The texture unit to bind to, assigned deterministically at build. */\n readonly unit: number;\n}\n\n/** One stage's emitted source and its hash. */\nexport interface StageSource {\n readonly source: string;\n readonly sha256: string;\n}\n\n/** Everything about one pipeline in one language. */\nexport interface LanguageBlock {\n /**\n * The reflected size of the whole uniform block, which is larger than the\n * contract: the compiler emits its entire global block whatever entry point\n * is compiled, so an undeformed pipeline's GLSL still carries deform members\n * its contract does not list. Allocate this many bytes.\n */\n readonly blockSize: number;\n /** Placement of every member the block holds, by name. */\n readonly layout: Readonly<Record<string, UniformLayout>>;\n readonly bindings: readonly BindingRecord[];\n readonly stages: Readonly<Partial<Record<ShaderStage, StageSource>>>;\n}\n\n/**\n * One pipeline as a self-contained document: contract plus its shaders.\n *\n * The second projection of the manifest, for consumption rather than\n * selection. Fetching one is a single request that cannot arrive half-stale.\n */\nexport interface Envelope {\n readonly schemaVersion: number;\n readonly generator: GeneratorInfo;\n /** The contract, with the pipeline's description alongside it. */\n readonly pipeline: PipelineContract & { readonly description: string };\n readonly contractSha256: string;\n readonly languages: Readonly<Partial<Record<ShaderLanguage, LanguageBlock>>>;\n}\n","// Copyright Visual Collaboration Technologies Inc. All Rights Reserved.\n// See LICENSE for details.\n\n/**\n * Reading an artifact set: where the documents come from, and what is checked.\n *\n * The set is two projections of one build. The index is fetched once, to list\n * what can be drawn; an envelope is fetched to draw one pipeline. {@link\n * ShaderSet} keeps that shape — the index eagerly, envelopes on demand and\n * cached — and makes the one check the split exists to enable: the envelope it\n * received carries the `contractSha256` the index entry that pointed at it\n * recorded.\n *\n * Where the bytes come from is a {@link ArtifactSource}, so the same set works\n * bundled, served over HTTP, or read from a directory on disk.\n */\n\nimport { layoutProblem } from \"./encoding.js\";\nimport type {\n Envelope,\n LanguageBlock,\n Registry,\n RegistryEntry,\n ShaderLanguage,\n} from \"./manifest.js\";\nimport { SCHEMA_VERSION } from \"./manifest.js\";\n\n/** Raised for any artifact set this package will not read. */\nexport class ShaderSetError extends Error {\n override readonly name = \"ShaderSetError\";\n}\n\n/**\n * Where an artifact set's documents come from.\n *\n * Two methods, because there are two documents. `readEnvelope` receives the\n * whole index entry rather than an id: the entry carries the envelope's path\n * within the set, which is the set's business and not the caller's to\n * reconstruct.\n */\nexport interface ArtifactSource {\n /** The parsed `registry.json`. */\n readRegistry(): Promise<unknown>;\n /** The parsed envelope the entry points at. */\n readEnvelope(entry: RegistryEntry): Promise<unknown>;\n}\n\n/**\n * What is wrong with a path inside the set, or `undefined` when nothing is.\n *\n * The rule the foundry's `check_relative_posix` and this repository's importer\n * apply: a plain relative POSIX path — no `..`, no `.`, no empty segment, no\n * leading slash, no backslash, no colon and no control character. Anything\n * else could name a file outside the set's directory, or, resolved against a\n * base URL, another path or another origin — which would also be sent the\n * caller's request headers. The colon refuses a scheme and a drive letter\n * alike, and the leading slash a protocol-relative `//host`.\n */\nfunction pathProblem(path: string): string | undefined {\n if (path.length === 0) return \"is empty\";\n // biome-ignore lint/suspicious/noControlCharactersInRegex: control characters are what this refuses\n if (/[\\u0000-\\u001f\\u007f-\\u009f\\\\:]/.test(path)) {\n return \"holds a backslash, a colon or a control character\";\n }\n if (path.startsWith(\"/\")) return \"is absolute\";\n if (path.split(\"/\").some((part) => part === \"\" || part === \".\" || part === \"..\")) {\n return 'has an empty, \".\" or \"..\" segment';\n }\n return undefined;\n}\n\n/** Refuse a path that could reach outside the set. */\nfunction assertPath(path: string, what: string): void {\n const problem = pathProblem(path);\n if (problem !== undefined) {\n throw new ShaderSetError(\n `${what} ${JSON.stringify(path)} ${problem}; a path inside the set is plain and relative.`,\n );\n }\n}\n\n/**\n * The base URL as an absolute URL.\n *\n * A relative base such as `/shaders/` is what a page naturally writes, and\n * `new URL` alone refuses it. In a browser it is resolved against the page's\n * own location, as a link would be; where there is no location there is\n * nothing to resolve it against, and guessing one would fetch from somewhere\n * the caller did not name.\n */\nfunction absoluteBase(baseUrl: string | URL): URL {\n if (baseUrl instanceof URL) return new URL(baseUrl.href);\n if (URL.canParse(baseUrl)) return new URL(baseUrl);\n const here = (globalThis as { location?: { href?: unknown } }).location?.href;\n if (typeof here === \"string\" && URL.canParse(baseUrl, here)) return new URL(baseUrl, here);\n throw new ShaderSetError(\n `${JSON.stringify(baseUrl)} is not an absolute URL, and there is no page location to ` +\n \"resolve it against. Outside a browser, pass an absolute URL such as \" +\n \"https://host/shaders/.\",\n );\n}\n\n/**\n * Reads a set served over HTTP under one base URL.\n *\n * A relative `baseUrl` is resolved against `location.href` where there is one\n * — in a browser — and refused elsewhere.\n *\n * @throws {ShaderSetError} for a relative `baseUrl` with no page location.\n */\nexport function fetchSource(baseUrl: string | URL, init?: RequestInit): ArtifactSource {\n const base = absoluteBase(baseUrl);\n // A base URL naming a directory must end in a slash or the last segment is\n // replaced rather than appended to.\n if (!base.pathname.endsWith(\"/\")) base.pathname += \"/\";\n\n const read = async (path: string): Promise<unknown> => {\n assertPath(path, \"the set path\");\n const url = new URL(path, base);\n // The rule above already keeps a path under the base; this states the\n // property it exists for, so the request and its headers go nowhere else.\n if (url.origin !== base.origin || !url.pathname.startsWith(base.pathname)) {\n throw new ShaderSetError(`${url.href} is outside the set at ${base.href}.`);\n }\n const response = await fetch(url, init);\n if (!response.ok) {\n throw new ShaderSetError(\n `fetching ${url.href} failed: ${response.status} ${response.statusText}`,\n );\n }\n return response.json();\n };\n\n return {\n readRegistry: () => read(\"registry.json\"),\n readEnvelope: (entry) => read(entry.envelope),\n };\n}\n\n/**\n * Reads a set unpacked into a directory on disk.\n *\n * `node:fs` is imported when the source is first read rather than when this\n * module is loaded, so importing this package in a browser does not pull a\n * Node built-in into the bundle.\n */\nexport function fsSource(directory: string): ArtifactSource {\n const read = async (path: string): Promise<unknown> => {\n const [{ readFile }, { join }] = await Promise.all([\n import(\"node:fs/promises\"),\n import(\"node:path\"),\n ]);\n assertPath(path, \"the set path\");\n const full = join(directory, ...path.split(\"/\"));\n try {\n return JSON.parse(await readFile(full, \"utf8\"));\n } catch (cause) {\n throw new ShaderSetError(`reading ${full} failed: ${(cause as Error).message}`, { cause });\n }\n };\n\n return {\n readRegistry: () => read(\"registry.json\"),\n readEnvelope: (entry) => read(entry.envelope),\n };\n}\n\nfunction assertSchema(document: { schemaVersion?: unknown }, what: string): void {\n if (document.schemaVersion !== SCHEMA_VERSION) {\n throw new ShaderSetError(\n `${what} is schema version ${String(document.schemaVersion)}, and this package reads ` +\n `${SCHEMA_VERSION}. A document whose shape is not the one expected is refused rather ` +\n \"than read with its fields misinterpreted.\",\n );\n }\n}\n\nconst isObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n/**\n * Check a capability list is an array of distinct strings.\n *\n * A repeated tag is not harmless: the exact match compares sizes, and a list\n * of `a, a` has the length of `{a, b}`.\n */\nfunction assertTags(tags: unknown, what: string): void {\n if (!Array.isArray(tags) || !tags.every((tag) => typeof tag === \"string\")) {\n throw new ShaderSetError(`${what} is not an array of capability tags.`);\n }\n const repeated = tags.filter((tag, index) => tags.indexOf(tag) !== index);\n if (repeated.length > 0) {\n throw new ShaderSetError(`${what} repeats the tag(s) ${[...new Set(repeated)].join(\", \")}.`);\n }\n}\n\nfunction assertEntry(entry: unknown, index: number): void {\n if (!isObject(entry) || typeof entry.id !== \"string\") {\n throw new ShaderSetError(`registry.json pipeline ${index} has no id.`);\n }\n for (const field of [\"contractSha256\", \"envelope\"] as const) {\n if (typeof entry[field] !== \"string\") {\n throw new ShaderSetError(`registry.json entry ${entry.id} has no ${field}.`);\n }\n }\n assertPath(entry.envelope as string, `registry.json entry ${entry.id} has the envelope path`);\n assertTags(entry.capabilities, `the capabilities of registry.json entry ${entry.id}`);\n}\n\nfunction asRegistry(document: unknown): Registry {\n if (!isObject(document)) {\n throw new ShaderSetError(\"registry.json is not an object.\");\n }\n assertSchema(document, \"registry.json\");\n if (!Array.isArray(document.pipelines)) {\n throw new ShaderSetError(\"registry.json carries no pipelines array.\");\n }\n assertTags(document.capabilityVocabulary, \"the capabilityVocabulary of registry.json\");\n document.pipelines.forEach(assertEntry);\n // A tag outside the vocabulary could never be asked for by name, only\n // matched by accident, and says the index was not built as one piece.\n const vocabulary = new Set(document.capabilityVocabulary as string[]);\n for (const entry of document.pipelines as RegistryEntry[]) {\n const unknown = entry.capabilities.filter((tag) => !vocabulary.has(tag));\n if (unknown.length > 0) {\n throw new ShaderSetError(\n `registry.json entry ${entry.id} carries ${unknown.join(\", \")}, which ` +\n \"capabilityVocabulary does not declare.\",\n );\n }\n }\n const ids = (document.pipelines as RegistryEntry[]).map((entry) => entry.id);\n const repeated = ids.filter((id, index) => ids.indexOf(id) !== index);\n if (repeated.length > 0) {\n throw new ShaderSetError(`registry.json lists ${repeated.join(\", \")} more than once.`);\n }\n return document as unknown as Registry;\n}\n\n/**\n * Check one language block is something the packer and binder can use.\n *\n * The layout is checked against itself, not recomputed: each member must sit\n * at a four-byte-aligned offset, its recorded extent must lie inside the\n * recorded block size, and its encoding must be one the packer writes.\n */\nfunction assertLanguage(id: string, language: string, block: unknown): void {\n const where = `the ${language} block of the envelope for ${id}`;\n if (!isObject(block)) throw new ShaderSetError(`${where} is not an object.`);\n const { blockSize, layout, bindings, stages } = block;\n if (typeof blockSize !== \"number\" || !Number.isInteger(blockSize) || blockSize <= 0) {\n throw new ShaderSetError(`${where} reports a block size of ${String(blockSize)}.`);\n }\n if (!isObject(layout)) throw new ShaderSetError(`${where} carries no layout.`);\n for (const [name, member] of Object.entries(layout)) {\n const problem = layoutProblem(name, member as never, blockSize);\n if (problem !== undefined) throw new ShaderSetError(`in ${where}, ${problem}`);\n }\n if (!Array.isArray(bindings)) throw new ShaderSetError(`${where} carries no bindings.`);\n if (!isObject(stages)) throw new ShaderSetError(`${where} carries no stages.`);\n}\n\nfunction asEnvelope(document: unknown, entry: RegistryEntry): Envelope {\n if (typeof document !== \"object\" || document === null) {\n throw new ShaderSetError(`the envelope for ${entry.id} is not an object.`);\n }\n const envelope = document as Envelope;\n assertSchema(envelope, `the envelope for ${entry.id}`);\n if (envelope.pipeline?.id !== entry.id) {\n throw new ShaderSetError(\n `${entry.envelope} describes pipeline ${String(envelope.pipeline?.id)}, but the index ` +\n `points at it for ${entry.id}.`,\n );\n }\n // The whole reason the index carries a hash instead of the contract: an\n // envelope that is not the one the index sent us to would bind at the wrong\n // offsets and draw a wrong picture with no error anywhere.\n if (envelope.contractSha256 !== entry.contractSha256) {\n throw new ShaderSetError(\n `the envelope for ${entry.id} carries contract ${envelope.contractSha256}, but the index ` +\n `entry that pointed at it records ${entry.contractSha256}. The set is mixed: the index ` +\n \"and this envelope are from different builds.\",\n );\n }\n assertTags(envelope.pipeline.capabilities, `the capabilities in the envelope for ${entry.id}`);\n // The pipeline was chosen by the index entry's capabilities; the contract\n // handed to the renderer must be for that same set. The carried hash is\n // compared as a string, not recomputed, so it does not show this.\n const selected = new Set(entry.capabilities);\n const carried = new Set(envelope.pipeline.capabilities);\n if (selected.size !== carried.size || [...carried].some((tag) => !selected.has(tag))) {\n throw new ShaderSetError(\n `the envelope for ${entry.id} declares the capabilities ` +\n `[${[...carried].sort().join(\", \")}], but the index entry that selected it records ` +\n `[${[...selected].sort().join(\", \")}].`,\n );\n }\n if (!isObject(envelope.languages)) {\n throw new ShaderSetError(`the envelope for ${entry.id} carries no languages.`);\n }\n for (const [language, block] of Object.entries(envelope.languages)) {\n assertLanguage(entry.id, language, block);\n }\n return envelope;\n}\n\n/**\n * One artifact set, opened.\n *\n * Holds the index and caches each envelope it has been asked for. Every\n * envelope it hands out has been checked against the entry that pointed at it.\n */\nexport class ShaderSet {\n readonly #source: ArtifactSource;\n readonly #entries: ReadonlyMap<string, RegistryEntry>;\n readonly #envelopes = new Map<string, Promise<Envelope>>();\n\n /** The index, as read. */\n readonly registry: Registry;\n\n private constructor(source: ArtifactSource, registry: Registry) {\n this.#source = source;\n this.registry = registry;\n this.#entries = new Map(registry.pipelines.map((entry) => [entry.id, entry]));\n }\n\n /** Read the index and open the set. */\n static async open(source: ArtifactSource): Promise<ShaderSet> {\n return new ShaderSet(source, asRegistry(await source.readRegistry()));\n }\n\n /** Every pipeline the set holds, in the order the index lists them. */\n get pipelines(): readonly RegistryEntry[] {\n return this.registry.pipelines;\n }\n\n /** The closed set of capability tags any pipeline here may declare. */\n get capabilityVocabulary(): readonly string[] {\n return this.registry.capabilityVocabulary;\n }\n\n /** The index entry for `id`. */\n entry(id: string): RegistryEntry {\n const entry = this.#entries.get(id);\n if (entry === undefined) {\n throw new ShaderSetError(`no pipeline ${id} in this set; it holds ${this.#entries.size}.`);\n }\n return entry;\n }\n\n /** The envelope for `id`, fetched once and cached. */\n async envelope(id: string): Promise<Envelope> {\n const entry = this.entry(id);\n let pending = this.#envelopes.get(id);\n if (pending === undefined) {\n pending = this.#source.readEnvelope(entry).then((document) => asEnvelope(document, entry));\n // A failed read must not be cached, or one network blip poisons the id\n // for the lifetime of the set.\n pending.catch(() => this.#envelopes.delete(id));\n this.#envelopes.set(id, pending);\n }\n return pending;\n }\n\n /** The envelope's block for one language; `glsl` unless asked otherwise. */\n static language(envelope: Envelope, language: ShaderLanguage = \"glsl\"): LanguageBlock {\n const block = Object.hasOwn(envelope.languages, language)\n ? envelope.languages[language]\n : undefined;\n if (block === undefined) {\n const carried = Object.keys(envelope.languages).join(\", \") || \"none\";\n throw new ShaderSetError(\n `the envelope for ${envelope.pipeline.id} carries no ${language}; it carries ${carried}.`,\n );\n }\n return block;\n }\n}\n","// Copyright Visual Collaboration Technologies Inc. All Rights Reserved.\n// See LICENSE for details.\n\n/**\n * The artifact set that ships with this library.\n *\n * A separate entry point (`@vcollab/shader-library/bundled`) on purpose: it is\n * the only module that reaches `@vcollab/shader-artifacts`, so a consumer\n * serving its own set over HTTP imports the root entry and carries none of the\n * set's 1.7 MB. Envelopes are loaded one at a time, through the per-id dynamic\n * imports the artifacts package generates, so a bundler can split them.\n */\n\nimport { ENVELOPE_LOADERS, REGISTRY } from \"@vcollab/shader-artifacts\";\nimport type { ArtifactSource } from \"./load.js\";\nimport { ShaderSet, ShaderSetError } from \"./load.js\";\n\n/** An {@link ArtifactSource} over the set bundled with this library. */\nexport function bundledSource(): ArtifactSource {\n return {\n readRegistry: async () => REGISTRY,\n readEnvelope: async (entry) => {\n const load = Object.hasOwn(ENVELOPE_LOADERS, entry.id)\n ? ENVELOPE_LOADERS[entry.id]\n : undefined;\n if (load === undefined) {\n throw new ShaderSetError(`the bundled set carries no envelope for ${entry.id}.`);\n }\n return load();\n },\n };\n}\n\n/** Open the set bundled with this library. */\nexport function openBundledSet(): Promise<ShaderSet> {\n return ShaderSet.open(bundledSource());\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ArtifactSource } from "./load.js";
|
|
2
|
+
import { ShaderSet } from "./load.js";
|
|
3
|
+
/** An {@link ArtifactSource} over the set bundled with this library. */
|
|
4
|
+
export declare function bundledSource(): ArtifactSource;
|
|
5
|
+
/** Open the set bundled with this library. */
|
|
6
|
+
export declare function openBundledSet(): Promise<ShaderSet>;
|
package/dist/bundled.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ShaderSetError, ShaderSet } from './chunk-A73KYX6T.js';
|
|
2
|
+
import { REGISTRY, ENVELOPE_LOADERS } from '@vcollab/shader-artifacts';
|
|
3
|
+
|
|
4
|
+
function bundledSource() {
|
|
5
|
+
return {
|
|
6
|
+
readRegistry: async () => REGISTRY,
|
|
7
|
+
readEnvelope: async (entry) => {
|
|
8
|
+
const load = Object.hasOwn(ENVELOPE_LOADERS, entry.id) ? ENVELOPE_LOADERS[entry.id] : void 0;
|
|
9
|
+
if (load === void 0) {
|
|
10
|
+
throw new ShaderSetError(`the bundled set carries no envelope for ${entry.id}.`);
|
|
11
|
+
}
|
|
12
|
+
return load();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function openBundledSet() {
|
|
17
|
+
return ShaderSet.open(bundledSource());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { bundledSource, openBundledSet };
|
|
21
|
+
//# sourceMappingURL=bundled.js.map
|
|
22
|
+
//# sourceMappingURL=bundled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/bundled.ts"],"names":[],"mappings":";;;AAkBO,SAAS,aAAA,GAAgC;AAC9C,EAAA,OAAO;AAAA,IACL,cAAc,YAAY,QAAA;AAAA,IAC1B,YAAA,EAAc,OAAO,KAAA,KAAU;AAC7B,MAAA,MAAM,IAAA,GAAO,MAAA,CAAO,MAAA,CAAO,gBAAA,EAAkB,KAAA,CAAM,EAAE,CAAA,GACjD,gBAAA,CAAiB,KAAA,CAAM,EAAE,CAAA,GACzB,MAAA;AACJ,MAAA,IAAI,SAAS,MAAA,EAAW;AACtB,QAAA,MAAM,IAAI,cAAA,CAAe,CAAA,wCAAA,EAA2C,KAAA,CAAM,EAAE,CAAA,CAAA,CAAG,CAAA;AAAA,MACjF;AACA,MAAA,OAAO,IAAA,EAAK;AAAA,IACd;AAAA,GACF;AACF;AAGO,SAAS,cAAA,GAAqC;AACnD,EAAA,OAAO,SAAA,CAAU,IAAA,CAAK,aAAA,EAAe,CAAA;AACvC","file":"bundled.js","sourcesContent":["// Copyright Visual Collaboration Technologies Inc. All Rights Reserved.\n// See LICENSE for details.\n\n/**\n * The artifact set that ships with this library.\n *\n * A separate entry point (`@vcollab/shader-library/bundled`) on purpose: it is\n * the only module that reaches `@vcollab/shader-artifacts`, so a consumer\n * serving its own set over HTTP imports the root entry and carries none of the\n * set's 1.7 MB. Envelopes are loaded one at a time, through the per-id dynamic\n * imports the artifacts package generates, so a bundler can split them.\n */\n\nimport { ENVELOPE_LOADERS, REGISTRY } from \"@vcollab/shader-artifacts\";\nimport type { ArtifactSource } from \"./load.js\";\nimport { ShaderSet, ShaderSetError } from \"./load.js\";\n\n/** An {@link ArtifactSource} over the set bundled with this library. */\nexport function bundledSource(): ArtifactSource {\n return {\n readRegistry: async () => REGISTRY,\n readEnvelope: async (entry) => {\n const load = Object.hasOwn(ENVELOPE_LOADERS, entry.id)\n ? ENVELOPE_LOADERS[entry.id]\n : undefined;\n if (load === undefined) {\n throw new ShaderSetError(`the bundled set carries no envelope for ${entry.id}.`);\n }\n return load();\n },\n };\n}\n\n/** Open the set bundled with this library. */\nexport function openBundledSet(): Promise<ShaderSet> {\n return ShaderSet.open(bundledSource());\n}\n"]}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
// src/manifest.ts
|
|
2
|
+
var SCHEMA_VERSION = 3;
|
|
3
|
+
|
|
4
|
+
// src/encoding.ts
|
|
5
|
+
var ELEMENTS = {
|
|
6
|
+
float: { kind: "float", width: 1 },
|
|
7
|
+
int: { kind: "int", width: 1 },
|
|
8
|
+
uint: { kind: "uint", width: 1 },
|
|
9
|
+
vec2: { kind: "float", width: 2 },
|
|
10
|
+
vec3: { kind: "float", width: 3 },
|
|
11
|
+
vec4: { kind: "float", width: 4 },
|
|
12
|
+
ivec2: { kind: "int", width: 2 },
|
|
13
|
+
ivec3: { kind: "int", width: 3 },
|
|
14
|
+
ivec4: { kind: "int", width: 4 },
|
|
15
|
+
uvec2: { kind: "uint", width: 2 },
|
|
16
|
+
uvec3: { kind: "uint", width: 3 },
|
|
17
|
+
uvec4: { kind: "uint", width: 4 },
|
|
18
|
+
mat2: { kind: "float", width: 4, order: 2 },
|
|
19
|
+
mat3: { kind: "float", width: 9, order: 3 },
|
|
20
|
+
mat4: { kind: "float", width: 16, order: 4 }
|
|
21
|
+
};
|
|
22
|
+
var ARRAY_SUFFIX = "[]";
|
|
23
|
+
var KNOWN_ENCODINGS = Object.keys(ELEMENTS);
|
|
24
|
+
function describeEncoding(encoding) {
|
|
25
|
+
const isArray = encoding.endsWith(ARRAY_SUFFIX);
|
|
26
|
+
const element = isArray ? encoding.slice(0, -ARRAY_SUFFIX.length) : encoding;
|
|
27
|
+
if (!Object.hasOwn(ELEMENTS, element)) return void 0;
|
|
28
|
+
return { ...ELEMENTS[element], isArray };
|
|
29
|
+
}
|
|
30
|
+
var isWhole = (value) => typeof value === "number" && Number.isInteger(value);
|
|
31
|
+
function layoutProblem(name, layout, blockSize) {
|
|
32
|
+
if (typeof layout !== "object" || layout === null) {
|
|
33
|
+
return `${name} has no layout record.`;
|
|
34
|
+
}
|
|
35
|
+
const { offset, size, elementStride, encoding } = layout;
|
|
36
|
+
if (!isWhole(offset) || offset < 0 || offset % 4 !== 0) {
|
|
37
|
+
return `${name} is at offset ${String(offset)}, which is not a non-negative multiple of 4.`;
|
|
38
|
+
}
|
|
39
|
+
if (!isWhole(size) || size <= 0 || offset + size > blockSize) {
|
|
40
|
+
return `${name} occupies ${String(size)} byte(s) at offset ${offset}, which does not lie within the ${blockSize}-byte block.`;
|
|
41
|
+
}
|
|
42
|
+
if (encoding === null) return void 0;
|
|
43
|
+
if (typeof encoding !== "string") {
|
|
44
|
+
return `${name} has the encoding ${String(encoding)}, which is not a name.`;
|
|
45
|
+
}
|
|
46
|
+
const described = describeEncoding(encoding);
|
|
47
|
+
if (described === void 0) {
|
|
48
|
+
return `${name} has the encoding ${encoding}, which the packer does not know; it writes ${KNOWN_ENCODINGS.join(", ")}, and arrays of them.`;
|
|
49
|
+
}
|
|
50
|
+
const reach = described.order === void 0 ? described.width * 4 : (described.order - 1) * 16 + described.order * 4;
|
|
51
|
+
if (described.isArray) {
|
|
52
|
+
if (!isWhole(elementStride) || elementStride <= 0 || elementStride % 4 !== 0) {
|
|
53
|
+
return `${name} is ${encoding}, but the build reports an element stride of ${String(elementStride)}.`;
|
|
54
|
+
}
|
|
55
|
+
if (reach > elementStride || elementStride > size) {
|
|
56
|
+
return `${name} is ${encoding} with ${size} byte(s) at a ${elementStride}-byte stride, which does not hold one element.`;
|
|
57
|
+
}
|
|
58
|
+
return void 0;
|
|
59
|
+
}
|
|
60
|
+
if (reach > size) {
|
|
61
|
+
return `${name} is ${encoding}, which writes ${reach} byte(s), but the build gives it ${size}.`;
|
|
62
|
+
}
|
|
63
|
+
return void 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// src/load.ts
|
|
67
|
+
var ShaderSetError = class extends Error {
|
|
68
|
+
name = "ShaderSetError";
|
|
69
|
+
};
|
|
70
|
+
function pathProblem(path) {
|
|
71
|
+
if (path.length === 0) return "is empty";
|
|
72
|
+
if (/[\u0000-\u001f\u007f-\u009f\\:]/.test(path)) {
|
|
73
|
+
return "holds a backslash, a colon or a control character";
|
|
74
|
+
}
|
|
75
|
+
if (path.startsWith("/")) return "is absolute";
|
|
76
|
+
if (path.split("/").some((part) => part === "" || part === "." || part === "..")) {
|
|
77
|
+
return 'has an empty, "." or ".." segment';
|
|
78
|
+
}
|
|
79
|
+
return void 0;
|
|
80
|
+
}
|
|
81
|
+
function assertPath(path, what) {
|
|
82
|
+
const problem = pathProblem(path);
|
|
83
|
+
if (problem !== void 0) {
|
|
84
|
+
throw new ShaderSetError(
|
|
85
|
+
`${what} ${JSON.stringify(path)} ${problem}; a path inside the set is plain and relative.`
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function absoluteBase(baseUrl) {
|
|
90
|
+
if (baseUrl instanceof URL) return new URL(baseUrl.href);
|
|
91
|
+
if (URL.canParse(baseUrl)) return new URL(baseUrl);
|
|
92
|
+
const here = globalThis.location?.href;
|
|
93
|
+
if (typeof here === "string" && URL.canParse(baseUrl, here)) return new URL(baseUrl, here);
|
|
94
|
+
throw new ShaderSetError(
|
|
95
|
+
`${JSON.stringify(baseUrl)} is not an absolute URL, and there is no page location to resolve it against. Outside a browser, pass an absolute URL such as https://host/shaders/.`
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function fetchSource(baseUrl, init) {
|
|
99
|
+
const base = absoluteBase(baseUrl);
|
|
100
|
+
if (!base.pathname.endsWith("/")) base.pathname += "/";
|
|
101
|
+
const read = async (path) => {
|
|
102
|
+
assertPath(path, "the set path");
|
|
103
|
+
const url = new URL(path, base);
|
|
104
|
+
if (url.origin !== base.origin || !url.pathname.startsWith(base.pathname)) {
|
|
105
|
+
throw new ShaderSetError(`${url.href} is outside the set at ${base.href}.`);
|
|
106
|
+
}
|
|
107
|
+
const response = await fetch(url, init);
|
|
108
|
+
if (!response.ok) {
|
|
109
|
+
throw new ShaderSetError(
|
|
110
|
+
`fetching ${url.href} failed: ${response.status} ${response.statusText}`
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
return response.json();
|
|
114
|
+
};
|
|
115
|
+
return {
|
|
116
|
+
readRegistry: () => read("registry.json"),
|
|
117
|
+
readEnvelope: (entry) => read(entry.envelope)
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function fsSource(directory) {
|
|
121
|
+
const read = async (path) => {
|
|
122
|
+
const [{ readFile }, { join }] = await Promise.all([
|
|
123
|
+
import('fs/promises'),
|
|
124
|
+
import('path')
|
|
125
|
+
]);
|
|
126
|
+
assertPath(path, "the set path");
|
|
127
|
+
const full = join(directory, ...path.split("/"));
|
|
128
|
+
try {
|
|
129
|
+
return JSON.parse(await readFile(full, "utf8"));
|
|
130
|
+
} catch (cause) {
|
|
131
|
+
throw new ShaderSetError(`reading ${full} failed: ${cause.message}`, { cause });
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
return {
|
|
135
|
+
readRegistry: () => read("registry.json"),
|
|
136
|
+
readEnvelope: (entry) => read(entry.envelope)
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function assertSchema(document, what) {
|
|
140
|
+
if (document.schemaVersion !== SCHEMA_VERSION) {
|
|
141
|
+
throw new ShaderSetError(
|
|
142
|
+
`${what} is schema version ${String(document.schemaVersion)}, and this package reads ${SCHEMA_VERSION}. A document whose shape is not the one expected is refused rather than read with its fields misinterpreted.`
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
147
|
+
function assertTags(tags, what) {
|
|
148
|
+
if (!Array.isArray(tags) || !tags.every((tag) => typeof tag === "string")) {
|
|
149
|
+
throw new ShaderSetError(`${what} is not an array of capability tags.`);
|
|
150
|
+
}
|
|
151
|
+
const repeated = tags.filter((tag, index) => tags.indexOf(tag) !== index);
|
|
152
|
+
if (repeated.length > 0) {
|
|
153
|
+
throw new ShaderSetError(`${what} repeats the tag(s) ${[...new Set(repeated)].join(", ")}.`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function assertEntry(entry, index) {
|
|
157
|
+
if (!isObject(entry) || typeof entry.id !== "string") {
|
|
158
|
+
throw new ShaderSetError(`registry.json pipeline ${index} has no id.`);
|
|
159
|
+
}
|
|
160
|
+
for (const field of ["contractSha256", "envelope"]) {
|
|
161
|
+
if (typeof entry[field] !== "string") {
|
|
162
|
+
throw new ShaderSetError(`registry.json entry ${entry.id} has no ${field}.`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
assertPath(entry.envelope, `registry.json entry ${entry.id} has the envelope path`);
|
|
166
|
+
assertTags(entry.capabilities, `the capabilities of registry.json entry ${entry.id}`);
|
|
167
|
+
}
|
|
168
|
+
function asRegistry(document) {
|
|
169
|
+
if (!isObject(document)) {
|
|
170
|
+
throw new ShaderSetError("registry.json is not an object.");
|
|
171
|
+
}
|
|
172
|
+
assertSchema(document, "registry.json");
|
|
173
|
+
if (!Array.isArray(document.pipelines)) {
|
|
174
|
+
throw new ShaderSetError("registry.json carries no pipelines array.");
|
|
175
|
+
}
|
|
176
|
+
assertTags(document.capabilityVocabulary, "the capabilityVocabulary of registry.json");
|
|
177
|
+
document.pipelines.forEach(assertEntry);
|
|
178
|
+
const vocabulary = new Set(document.capabilityVocabulary);
|
|
179
|
+
for (const entry of document.pipelines) {
|
|
180
|
+
const unknown = entry.capabilities.filter((tag) => !vocabulary.has(tag));
|
|
181
|
+
if (unknown.length > 0) {
|
|
182
|
+
throw new ShaderSetError(
|
|
183
|
+
`registry.json entry ${entry.id} carries ${unknown.join(", ")}, which capabilityVocabulary does not declare.`
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
const ids = document.pipelines.map((entry) => entry.id);
|
|
188
|
+
const repeated = ids.filter((id, index) => ids.indexOf(id) !== index);
|
|
189
|
+
if (repeated.length > 0) {
|
|
190
|
+
throw new ShaderSetError(`registry.json lists ${repeated.join(", ")} more than once.`);
|
|
191
|
+
}
|
|
192
|
+
return document;
|
|
193
|
+
}
|
|
194
|
+
function assertLanguage(id, language, block) {
|
|
195
|
+
const where = `the ${language} block of the envelope for ${id}`;
|
|
196
|
+
if (!isObject(block)) throw new ShaderSetError(`${where} is not an object.`);
|
|
197
|
+
const { blockSize, layout, bindings, stages } = block;
|
|
198
|
+
if (typeof blockSize !== "number" || !Number.isInteger(blockSize) || blockSize <= 0) {
|
|
199
|
+
throw new ShaderSetError(`${where} reports a block size of ${String(blockSize)}.`);
|
|
200
|
+
}
|
|
201
|
+
if (!isObject(layout)) throw new ShaderSetError(`${where} carries no layout.`);
|
|
202
|
+
for (const [name, member] of Object.entries(layout)) {
|
|
203
|
+
const problem = layoutProblem(name, member, blockSize);
|
|
204
|
+
if (problem !== void 0) throw new ShaderSetError(`in ${where}, ${problem}`);
|
|
205
|
+
}
|
|
206
|
+
if (!Array.isArray(bindings)) throw new ShaderSetError(`${where} carries no bindings.`);
|
|
207
|
+
if (!isObject(stages)) throw new ShaderSetError(`${where} carries no stages.`);
|
|
208
|
+
}
|
|
209
|
+
function asEnvelope(document, entry) {
|
|
210
|
+
if (typeof document !== "object" || document === null) {
|
|
211
|
+
throw new ShaderSetError(`the envelope for ${entry.id} is not an object.`);
|
|
212
|
+
}
|
|
213
|
+
const envelope = document;
|
|
214
|
+
assertSchema(envelope, `the envelope for ${entry.id}`);
|
|
215
|
+
if (envelope.pipeline?.id !== entry.id) {
|
|
216
|
+
throw new ShaderSetError(
|
|
217
|
+
`${entry.envelope} describes pipeline ${String(envelope.pipeline?.id)}, but the index points at it for ${entry.id}.`
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
if (envelope.contractSha256 !== entry.contractSha256) {
|
|
221
|
+
throw new ShaderSetError(
|
|
222
|
+
`the envelope for ${entry.id} carries contract ${envelope.contractSha256}, but the index entry that pointed at it records ${entry.contractSha256}. The set is mixed: the index and this envelope are from different builds.`
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
assertTags(envelope.pipeline.capabilities, `the capabilities in the envelope for ${entry.id}`);
|
|
226
|
+
const selected = new Set(entry.capabilities);
|
|
227
|
+
const carried = new Set(envelope.pipeline.capabilities);
|
|
228
|
+
if (selected.size !== carried.size || [...carried].some((tag) => !selected.has(tag))) {
|
|
229
|
+
throw new ShaderSetError(
|
|
230
|
+
`the envelope for ${entry.id} declares the capabilities [${[...carried].sort().join(", ")}], but the index entry that selected it records [${[...selected].sort().join(", ")}].`
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
if (!isObject(envelope.languages)) {
|
|
234
|
+
throw new ShaderSetError(`the envelope for ${entry.id} carries no languages.`);
|
|
235
|
+
}
|
|
236
|
+
for (const [language, block] of Object.entries(envelope.languages)) {
|
|
237
|
+
assertLanguage(entry.id, language, block);
|
|
238
|
+
}
|
|
239
|
+
return envelope;
|
|
240
|
+
}
|
|
241
|
+
var ShaderSet = class _ShaderSet {
|
|
242
|
+
#source;
|
|
243
|
+
#entries;
|
|
244
|
+
#envelopes = /* @__PURE__ */ new Map();
|
|
245
|
+
/** The index, as read. */
|
|
246
|
+
registry;
|
|
247
|
+
constructor(source, registry) {
|
|
248
|
+
this.#source = source;
|
|
249
|
+
this.registry = registry;
|
|
250
|
+
this.#entries = new Map(registry.pipelines.map((entry) => [entry.id, entry]));
|
|
251
|
+
}
|
|
252
|
+
/** Read the index and open the set. */
|
|
253
|
+
static async open(source) {
|
|
254
|
+
return new _ShaderSet(source, asRegistry(await source.readRegistry()));
|
|
255
|
+
}
|
|
256
|
+
/** Every pipeline the set holds, in the order the index lists them. */
|
|
257
|
+
get pipelines() {
|
|
258
|
+
return this.registry.pipelines;
|
|
259
|
+
}
|
|
260
|
+
/** The closed set of capability tags any pipeline here may declare. */
|
|
261
|
+
get capabilityVocabulary() {
|
|
262
|
+
return this.registry.capabilityVocabulary;
|
|
263
|
+
}
|
|
264
|
+
/** The index entry for `id`. */
|
|
265
|
+
entry(id) {
|
|
266
|
+
const entry = this.#entries.get(id);
|
|
267
|
+
if (entry === void 0) {
|
|
268
|
+
throw new ShaderSetError(`no pipeline ${id} in this set; it holds ${this.#entries.size}.`);
|
|
269
|
+
}
|
|
270
|
+
return entry;
|
|
271
|
+
}
|
|
272
|
+
/** The envelope for `id`, fetched once and cached. */
|
|
273
|
+
async envelope(id) {
|
|
274
|
+
const entry = this.entry(id);
|
|
275
|
+
let pending = this.#envelopes.get(id);
|
|
276
|
+
if (pending === void 0) {
|
|
277
|
+
pending = this.#source.readEnvelope(entry).then((document) => asEnvelope(document, entry));
|
|
278
|
+
pending.catch(() => this.#envelopes.delete(id));
|
|
279
|
+
this.#envelopes.set(id, pending);
|
|
280
|
+
}
|
|
281
|
+
return pending;
|
|
282
|
+
}
|
|
283
|
+
/** The envelope's block for one language; `glsl` unless asked otherwise. */
|
|
284
|
+
static language(envelope, language = "glsl") {
|
|
285
|
+
const block = Object.hasOwn(envelope.languages, language) ? envelope.languages[language] : void 0;
|
|
286
|
+
if (block === void 0) {
|
|
287
|
+
const carried = Object.keys(envelope.languages).join(", ") || "none";
|
|
288
|
+
throw new ShaderSetError(
|
|
289
|
+
`the envelope for ${envelope.pipeline.id} carries no ${language}; it carries ${carried}.`
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
return block;
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
export { SCHEMA_VERSION, ShaderSet, ShaderSetError, describeEncoding, fetchSource, fsSource, layoutProblem };
|
|
297
|
+
//# sourceMappingURL=chunk-A73KYX6T.js.map
|
|
298
|
+
//# sourceMappingURL=chunk-A73KYX6T.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/manifest.ts","../src/encoding.ts","../src/load.ts"],"names":[],"mappings":";AAcO,IAAM,cAAA,GAAiB;;;ACoB9B,IAAM,QAAA,GAAgE;AAAA,EACpE,KAAA,EAAO,EAAE,IAAA,EAAM,OAAA,EAAS,OAAO,CAAA,EAAE;AAAA,EACjC,GAAA,EAAK,EAAE,IAAA,EAAM,KAAA,EAAO,OAAO,CAAA,EAA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EAAU,KAAK,CAAC,CAAA;AAGzF,MAAA,OAAA,CAAQ,MAAM,MAAM,IAAA,CAAK,UAAA,CAAW,MAAA,CAAO,EAAE,CAAC,CAAA;AAC9C,MAAA,IAAA,CAAK,UAAA,CAAW,GAAA,CAAI,EAAA,EAAI,OAAO,CAAA;AAAA,IACjC;AACA,IAAA,OAAO,OAAA;AAAA,EACT;AAAA;AAAA,EAGA,OAAO,QAAA,CAAS,QAAA,EAAoB,QAAA,GAA2B,MAAA,EAAuB;AACpF,IAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,MAAA,CAAO,QAAA,CAAS,SAAA,EAAW,QAAQ,CAAA,GACpD,QAAA,CAAS,SAAA,CAAU,QAAQ,CAAA,GAC3B,MAAA;AACJ,IAAA,IAAI,UAAU,MAAA,EAAW;AACvB,MAAA,MAAM,OAAA,GAAU,OAAO,IAAA,CAAK,QAAA,CAAS,SAAS,CAAA,CAAE,IAAA,CAAK,IAAI,CAAA,IAAK,MAAA;AAC9D,MAAA,MAAM,IAAI,cAAA;AAAA,QACR,oBAAoB,QAAA,CAAS,QAAA,CAAS,EAAE,CAAA,YAAA,EAAe,QAAQ,gBAAgB,OAAO,CAAA,CAAA;AAAA,OACxF;AAAA,IACF;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AACF","file":"chunk-A73KYX6T.js","sourcesContent":["// Copyright Visual Collaboration Technologies Inc. All Rights Reserved.\n// See LICENSE for details.\n\n/**\n * The artifact set's documents, as types.\n *\n * These mirror what `vcti-shader-foundry` emits — `registry.json` and one\n * envelope per pipeline — field for field. The foundry is the only thing that\n * produces them; nothing here re-declares a contract or invents a field. When\n * the emitted shape changes, {@link SCHEMA_VERSION} changes with it and a set\n * carrying an unknown version is refused rather than misread.\n */\n\n/** The emitted document shape this package understands. */\nexport const SCHEMA_VERSION = 3;\n\n/** A shader language an artifact set can carry. Only `glsl` is emitted today. */\nexport type ShaderLanguage = \"glsl\" | \"wgsl\";\n\n/** A stage of a pipeline. */\nexport type ShaderStage = \"vertex\" | \"fragment\";\n\n/** One vertex attribute the pipeline reads. */\nexport interface AttributeSpec {\n /** The name the attribute is declared under. */\n readonly name: string;\n /** Its GL type, e.g. `vec3`, `int`. */\n readonly type: string;\n /** What the attribute means — how a consumer matches its own buffer to it. */\n readonly semantic: string;\n}\n\n/** One uniform block member the pipeline reads. */\nexport interface UniformSpec {\n readonly name: string;\n /** Its GL type, e.g. `vec3`, `mat4`, `int`. */\n readonly type: string;\n /**\n * Named states for an integer selector, e.g. `u_colorSource`. The numbers\n * are append-only across releases (see the foundry's stability rules).\n */\n readonly namedValues?: Readonly<Record<string, number>>;\n}\n\n/** One fragment output. Its index in `outputs` is its location. */\nexport interface OutputSpec {\n readonly name: string;\n readonly type: string;\n /**\n * The attachment format the output requires, or `null` for no exact\n * requirement. `null` is a claim, not an omission.\n */\n readonly format: string | null;\n}\n\n/** A texture read at exact integer coordinates — a lookup table, not an image. */\nexport interface TableSpec {\n readonly name: string;\n readonly type: string;\n readonly format: string;\n readonly semantic: string;\n}\n\n/** An image sampled between texels. */\nexport interface TextureSpec {\n readonly name: string;\n readonly semantic: string;\n readonly kind: string;\n readonly component: string;\n readonly format: string;\n readonly requiresMipChain: boolean;\n /** The name of a sampler this contract declares. */\n readonly sampler: string;\n /** The semantic of a uv attribute this contract carries. */\n readonly uv: string;\n readonly selection: string;\n readonly neutral: readonly number[] | null;\n}\n\n/** Sampler state a texture is read through. */\nexport interface SamplerSpec {\n readonly name: string;\n readonly magFilter: string;\n readonly minFilter: string;\n readonly mipmapFilter: string;\n readonly wrapS: string;\n readonly wrapT: string;\n}\n\n/**\n * A pipeline's binding surface: everything a caller must match.\n *\n * Order is significant. A uniform block's member order determines its byte\n * offsets, which is why {@link RegistryEntry.contractSha256} is computed over\n * this document with its sequences left unsorted.\n */\nexport interface PipelineContract {\n readonly id: string;\n readonly capabilities: readonly string[];\n readonly inputs: readonly AttributeSpec[];\n readonly uniforms: readonly UniformSpec[];\n readonly outputs: readonly OutputSpec[];\n readonly tables: readonly TableSpec[];\n readonly textures: readonly TextureSpec[];\n readonly samplers: readonly SamplerSpec[];\n}\n\n/** Versions of the three executables that compiled a set. `null` where unread. */\nexport interface ToolchainInfo {\n readonly slangc: string | null;\n readonly spirvCross: string | null;\n readonly glslang: string | null;\n}\n\n/** What produced a set, and with what. */\nexport interface GeneratorInfo {\n readonly name: string;\n readonly version: string;\n readonly toolchain: ToolchainInfo | null;\n}\n\n/**\n * One index entry: enough to choose this pipeline, and where to go next.\n *\n * Not the contract. `contractSha256` names the envelope's content without\n * repeating it, so a fetched envelope can be checked against the entry that\n * pointed at it.\n */\nexport interface RegistryEntry {\n readonly id: string;\n readonly description: string;\n readonly capabilities: readonly string[];\n readonly contractSha256: string;\n /** The envelope's path within the set, relative and POSIX. */\n readonly envelope: string;\n}\n\n/** `registry.json`: the index a consumer selects from. */\nexport interface Registry {\n readonly schemaVersion: number;\n readonly generator: GeneratorInfo;\n /** The closed set of tags any pipeline in this set may declare. */\n readonly capabilityVocabulary: readonly string[];\n readonly pipelines: readonly RegistryEntry[];\n}\n\n/**\n * Where std140 placed one uniform block member.\n *\n * Read rather than recomputed: a second implementation of the padding rules is\n * a second thing to be wrong, and it would diverge silently — on one pipeline,\n * in one case, such as the sixteen-byte stride std140 gives the eight-byte\n * elements of a `vec2[72]`.\n */\nexport interface UniformLayout {\n /** Byte offset from the start of the block. */\n readonly offset: number;\n /** Total byte size, including any array padding. */\n readonly size: number;\n /**\n * Bytes between array elements. For a member that is not an array it is\n * what the reflection reports for its components: `4` for a vector, `0` for\n * a scalar or a matrix. The packer reads it only for an array.\n */\n readonly elementStride: number;\n /** The element type — `float`, `vec3`, `mat4`, `ivec2`. */\n readonly encoding: string | null;\n /** `row` or `column`, present only for a matrix. */\n readonly majorness?: \"row\" | \"column\";\n}\n\n/**\n * One emitted sampler uniform, and the resource it was built from.\n *\n * The seam the declared names do not cross: GLSL ES 3.00 has no binding\n * qualifier for samplers, so the cross-compiler pairs each texture with a\n * sampler and names the combination itself. A consumer binds by\n * {@link semantic}, then uses {@link uniform} and {@link unit}.\n */\nexport interface BindingRecord {\n /** The semantic of the table or texture this was built from. */\n readonly semantic: string;\n /** The declared name of that resource. It does not reach the program. */\n readonly texture: string;\n /**\n * The declared name of the sampler it was paired with, or `null` where the\n * contract declares none — a table read at exact texel coordinates is paired\n * with the cross-compiler's dummy sampler, which the contract never names.\n */\n readonly sampler: string | null;\n /** The uniform the emitted program actually declares. */\n readonly uniform: string;\n readonly component: string;\n readonly stage: ShaderStage;\n /** The texture unit to bind to, assigned deterministically at build. */\n readonly unit: number;\n}\n\n/** One stage's emitted source and its hash. */\nexport interface StageSource {\n readonly source: string;\n readonly sha256: string;\n}\n\n/** Everything about one pipeline in one language. */\nexport interface LanguageBlock {\n /**\n * The reflected size of the whole uniform block, which is larger than the\n * contract: the compiler emits its entire global block whatever entry point\n * is compiled, so an undeformed pipeline's GLSL still carries deform members\n * its contract does not list. Allocate this many bytes.\n */\n readonly blockSize: number;\n /** Placement of every member the block holds, by name. */\n readonly layout: Readonly<Record<string, UniformLayout>>;\n readonly bindings: readonly BindingRecord[];\n readonly stages: Readonly<Partial<Record<ShaderStage, StageSource>>>;\n}\n\n/**\n * One pipeline as a self-contained document: contract plus its shaders.\n *\n * The second projection of the manifest, for consumption rather than\n * selection. Fetching one is a single request that cannot arrive half-stale.\n */\nexport interface Envelope {\n readonly schemaVersion: number;\n readonly generator: GeneratorInfo;\n /** The contract, with the pipeline's description alongside it. */\n readonly pipeline: PipelineContract & { readonly description: string };\n readonly contractSha256: string;\n readonly languages: Readonly<Partial<Record<ShaderLanguage, LanguageBlock>>>;\n}\n","// Copyright Visual Collaboration Technologies Inc. All Rights Reserved.\n// See LICENSE for details.\n\n/**\n * The uniform encodings the packer can write, and the check that a reflected\n * layout fits them.\n *\n * Internal: {@link UniformBlock} and {@link ShaderSet} share it, so an envelope\n * the set accepts is one the packer can write, and the two cannot disagree\n * about what an encoding is.\n *\n * Nothing here computes a std140 offset or size. The layout is the build's;\n * what is checked is only that the packer's own writes — `width` four-byte\n * components at the member's offset, or `order` sixteen-byte rows for a matrix,\n * or one element per `elementStride` for an array — land inside the extent the\n * build recorded for that member, and inside the block.\n */\n\nimport type { UniformLayout } from \"./manifest.js\";\n\n/** How a scalar component is stored. */\nexport type Kind = \"float\" | \"int\" | \"uint\";\n\n/** What one encoding means to the packer. */\nexport interface Encoding {\n readonly kind: Kind;\n /** Components per element: 1 for a scalar, 2–4 for a vector, order² for a matrix. */\n readonly width: number;\n /** The matrix order, for a matrix. */\n readonly order?: number;\n /** Whether the member is an array of these. */\n readonly isArray: boolean;\n}\n\nconst ELEMENTS: Readonly<Record<string, Omit<Encoding, \"isArray\">>> = {\n float: { kind: \"float\", width: 1 },\n int: { kind: \"int\", width: 1 },\n uint: { kind: \"uint\", width: 1 },\n vec2: { kind: \"float\", width: 2 },\n vec3: { kind: \"float\", width: 3 },\n vec4: { kind: \"float\", width: 4 },\n ivec2: { kind: \"int\", width: 2 },\n ivec3: { kind: \"int\", width: 3 },\n ivec4: { kind: \"int\", width: 4 },\n uvec2: { kind: \"uint\", width: 2 },\n uvec3: { kind: \"uint\", width: 3 },\n uvec4: { kind: \"uint\", width: 4 },\n mat2: { kind: \"float\", width: 4, order: 2 },\n mat3: { kind: \"float\", width: 9, order: 3 },\n mat4: { kind: \"float\", width: 16, order: 4 },\n};\n\nconst ARRAY_SUFFIX = \"[]\";\n\n/** The encodings the packer writes, each also as an array. */\nexport const KNOWN_ENCODINGS: readonly string[] = Object.keys(ELEMENTS);\n\n/** What `encoding` means, or `undefined` if the packer does not know it. */\nexport function describeEncoding(encoding: string): Encoding | undefined {\n const isArray = encoding.endsWith(ARRAY_SUFFIX);\n const element = isArray ? encoding.slice(0, -ARRAY_SUFFIX.length) : encoding;\n // An own-property lookup: `in` would accept `toString` as an encoding.\n if (!Object.hasOwn(ELEMENTS, element)) return undefined;\n return { ...(ELEMENTS[element] as Omit<Encoding, \"isArray\">), isArray };\n}\n\nconst isWhole = (value: unknown): value is number =>\n typeof value === \"number\" && Number.isInteger(value);\n\n/**\n * Why `layout` cannot be written into a block of `blockSize` bytes, or\n * `undefined` if it can.\n *\n * A member with a `null` encoding passes: it is part of the block and counts\n * towards its size, and the packer refuses only a write to it.\n */\nexport function layoutProblem(\n name: string,\n layout: UniformLayout,\n blockSize: number,\n): string | undefined {\n if (typeof layout !== \"object\" || layout === null) {\n return `${name} has no layout record.`;\n }\n const { offset, size, elementStride, encoding } = layout;\n if (!isWhole(offset) || offset < 0 || offset % 4 !== 0) {\n return `${name} is at offset ${String(offset)}, which is not a non-negative multiple of 4.`;\n }\n if (!isWhole(size) || size <= 0 || offset + size > blockSize) {\n return (\n `${name} occupies ${String(size)} byte(s) at offset ${offset}, which does not lie ` +\n `within the ${blockSize}-byte block.`\n );\n }\n if (encoding === null) return undefined;\n if (typeof encoding !== \"string\") {\n return `${name} has the encoding ${String(encoding)}, which is not a name.`;\n }\n const described = describeEncoding(encoding);\n if (described === undefined) {\n return (\n `${name} has the encoding ${encoding}, which the packer does not know; it writes ` +\n `${KNOWN_ENCODINGS.join(\", \")}, and arrays of them.`\n );\n }\n // How far the packer's writes reach for one element, from the element's\n // start: a matrix is `order` rows, each at a sixteen-byte slot.\n const reach =\n described.order === undefined\n ? described.width * 4\n : (described.order - 1) * 16 + described.order * 4;\n if (described.isArray) {\n if (!isWhole(elementStride) || elementStride <= 0 || elementStride % 4 !== 0) {\n return (\n `${name} is ${encoding}, but the build reports an element stride of ` +\n `${String(elementStride)}.`\n );\n }\n if (reach > elementStride || elementStride > size) {\n return `${name} is ${encoding} with ${size} byte(s) at a ${elementStride}-byte stride, which does not hold one element.`;\n }\n return undefined;\n }\n if (reach > size) {\n return `${name} is ${encoding}, which writes ${reach} byte(s), but the build gives it ${size}.`;\n }\n return undefined;\n}\n","// Copyright Visual Collaboration Technologies Inc. All Rights Reserved.\n// See LICENSE for details.\n\n/**\n * Reading an artifact set: where the documents come from, and what is checked.\n *\n * The set is two projections of one build. The index is fetched once, to list\n * what can be drawn; an envelope is fetched to draw one pipeline. {@link\n * ShaderSet} keeps that shape — the index eagerly, envelopes on demand and\n * cached — and makes the one check the split exists to enable: the envelope it\n * received carries the `contractSha256` the index entry that pointed at it\n * recorded.\n *\n * Where the bytes come from is a {@link ArtifactSource}, so the same set works\n * bundled, served over HTTP, or read from a directory on disk.\n */\n\nimport { layoutProblem } from \"./encoding.js\";\nimport type {\n Envelope,\n LanguageBlock,\n Registry,\n RegistryEntry,\n ShaderLanguage,\n} from \"./manifest.js\";\nimport { SCHEMA_VERSION } from \"./manifest.js\";\n\n/** Raised for any artifact set this package will not read. */\nexport class ShaderSetError extends Error {\n override readonly name = \"ShaderSetError\";\n}\n\n/**\n * Where an artifact set's documents come from.\n *\n * Two methods, because there are two documents. `readEnvelope` receives the\n * whole index entry rather than an id: the entry carries the envelope's path\n * within the set, which is the set's business and not the caller's to\n * reconstruct.\n */\nexport interface ArtifactSource {\n /** The parsed `registry.json`. */\n readRegistry(): Promise<unknown>;\n /** The parsed envelope the entry points at. */\n readEnvelope(entry: RegistryEntry): Promise<unknown>;\n}\n\n/**\n * What is wrong with a path inside the set, or `undefined` when nothing is.\n *\n * The rule the foundry's `check_relative_posix` and this repository's importer\n * apply: a plain relative POSIX path — no `..`, no `.`, no empty segment, no\n * leading slash, no backslash, no colon and no control character. Anything\n * else could name a file outside the set's directory, or, resolved against a\n * base URL, another path or another origin — which would also be sent the\n * caller's request headers. The colon refuses a scheme and a drive letter\n * alike, and the leading slash a protocol-relative `//host`.\n */\nfunction pathProblem(path: string): string | undefined {\n if (path.length === 0) return \"is empty\";\n // biome-ignore lint/suspicious/noControlCharactersInRegex: control characters are what this refuses\n if (/[\\u0000-\\u001f\\u007f-\\u009f\\\\:]/.test(path)) {\n return \"holds a backslash, a colon or a control character\";\n }\n if (path.startsWith(\"/\")) return \"is absolute\";\n if (path.split(\"/\").some((part) => part === \"\" || part === \".\" || part === \"..\")) {\n return 'has an empty, \".\" or \"..\" segment';\n }\n return undefined;\n}\n\n/** Refuse a path that could reach outside the set. */\nfunction assertPath(path: string, what: string): void {\n const problem = pathProblem(path);\n if (problem !== undefined) {\n throw new ShaderSetError(\n `${what} ${JSON.stringify(path)} ${problem}; a path inside the set is plain and relative.`,\n );\n }\n}\n\n/**\n * The base URL as an absolute URL.\n *\n * A relative base such as `/shaders/` is what a page naturally writes, and\n * `new URL` alone refuses it. In a browser it is resolved against the page's\n * own location, as a link would be; where there is no location there is\n * nothing to resolve it against, and guessing one would fetch from somewhere\n * the caller did not name.\n */\nfunction absoluteBase(baseUrl: string | URL): URL {\n if (baseUrl instanceof URL) return new URL(baseUrl.href);\n if (URL.canParse(baseUrl)) return new URL(baseUrl);\n const here = (globalThis as { location?: { href?: unknown } }).location?.href;\n if (typeof here === \"string\" && URL.canParse(baseUrl, here)) return new URL(baseUrl, here);\n throw new ShaderSetError(\n `${JSON.stringify(baseUrl)} is not an absolute URL, and there is no page location to ` +\n \"resolve it against. Outside a browser, pass an absolute URL such as \" +\n \"https://host/shaders/.\",\n );\n}\n\n/**\n * Reads a set served over HTTP under one base URL.\n *\n * A relative `baseUrl` is resolved against `location.href` where there is one\n * — in a browser — and refused elsewhere.\n *\n * @throws {ShaderSetError} for a relative `baseUrl` with no page location.\n */\nexport function fetchSource(baseUrl: string | URL, init?: RequestInit): ArtifactSource {\n const base = absoluteBase(baseUrl);\n // A base URL naming a directory must end in a slash or the last segment is\n // replaced rather than appended to.\n if (!base.pathname.endsWith(\"/\")) base.pathname += \"/\";\n\n const read = async (path: string): Promise<unknown> => {\n assertPath(path, \"the set path\");\n const url = new URL(path, base);\n // The rule above already keeps a path under the base; this states the\n // property it exists for, so the request and its headers go nowhere else.\n if (url.origin !== base.origin || !url.pathname.startsWith(base.pathname)) {\n throw new ShaderSetError(`${url.href} is outside the set at ${base.href}.`);\n }\n const response = await fetch(url, init);\n if (!response.ok) {\n throw new ShaderSetError(\n `fetching ${url.href} failed: ${response.status} ${response.statusText}`,\n );\n }\n return response.json();\n };\n\n return {\n readRegistry: () => read(\"registry.json\"),\n readEnvelope: (entry) => read(entry.envelope),\n };\n}\n\n/**\n * Reads a set unpacked into a directory on disk.\n *\n * `node:fs` is imported when the source is first read rather than when this\n * module is loaded, so importing this package in a browser does not pull a\n * Node built-in into the bundle.\n */\nexport function fsSource(directory: string): ArtifactSource {\n const read = async (path: string): Promise<unknown> => {\n const [{ readFile }, { join }] = await Promise.all([\n import(\"node:fs/promises\"),\n import(\"node:path\"),\n ]);\n assertPath(path, \"the set path\");\n const full = join(directory, ...path.split(\"/\"));\n try {\n return JSON.parse(await readFile(full, \"utf8\"));\n } catch (cause) {\n throw new ShaderSetError(`reading ${full} failed: ${(cause as Error).message}`, { cause });\n }\n };\n\n return {\n readRegistry: () => read(\"registry.json\"),\n readEnvelope: (entry) => read(entry.envelope),\n };\n}\n\nfunction assertSchema(document: { schemaVersion?: unknown }, what: string): void {\n if (document.schemaVersion !== SCHEMA_VERSION) {\n throw new ShaderSetError(\n `${what} is schema version ${String(document.schemaVersion)}, and this package reads ` +\n `${SCHEMA_VERSION}. A document whose shape is not the one expected is refused rather ` +\n \"than read with its fields misinterpreted.\",\n );\n }\n}\n\nconst isObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n/**\n * Check a capability list is an array of distinct strings.\n *\n * A repeated tag is not harmless: the exact match compares sizes, and a list\n * of `a, a` has the length of `{a, b}`.\n */\nfunction assertTags(tags: unknown, what: string): void {\n if (!Array.isArray(tags) || !tags.every((tag) => typeof tag === \"string\")) {\n throw new ShaderSetError(`${what} is not an array of capability tags.`);\n }\n const repeated = tags.filter((tag, index) => tags.indexOf(tag) !== index);\n if (repeated.length > 0) {\n throw new ShaderSetError(`${what} repeats the tag(s) ${[...new Set(repeated)].join(\", \")}.`);\n }\n}\n\nfunction assertEntry(entry: unknown, index: number): void {\n if (!isObject(entry) || typeof entry.id !== \"string\") {\n throw new ShaderSetError(`registry.json pipeline ${index} has no id.`);\n }\n for (const field of [\"contractSha256\", \"envelope\"] as const) {\n if (typeof entry[field] !== \"string\") {\n throw new ShaderSetError(`registry.json entry ${entry.id} has no ${field}.`);\n }\n }\n assertPath(entry.envelope as string, `registry.json entry ${entry.id} has the envelope path`);\n assertTags(entry.capabilities, `the capabilities of registry.json entry ${entry.id}`);\n}\n\nfunction asRegistry(document: unknown): Registry {\n if (!isObject(document)) {\n throw new ShaderSetError(\"registry.json is not an object.\");\n }\n assertSchema(document, \"registry.json\");\n if (!Array.isArray(document.pipelines)) {\n throw new ShaderSetError(\"registry.json carries no pipelines array.\");\n }\n assertTags(document.capabilityVocabulary, \"the capabilityVocabulary of registry.json\");\n document.pipelines.forEach(assertEntry);\n // A tag outside the vocabulary could never be asked for by name, only\n // matched by accident, and says the index was not built as one piece.\n const vocabulary = new Set(document.capabilityVocabulary as string[]);\n for (const entry of document.pipelines as RegistryEntry[]) {\n const unknown = entry.capabilities.filter((tag) => !vocabulary.has(tag));\n if (unknown.length > 0) {\n throw new ShaderSetError(\n `registry.json entry ${entry.id} carries ${unknown.join(\", \")}, which ` +\n \"capabilityVocabulary does not declare.\",\n );\n }\n }\n const ids = (document.pipelines as RegistryEntry[]).map((entry) => entry.id);\n const repeated = ids.filter((id, index) => ids.indexOf(id) !== index);\n if (repeated.length > 0) {\n throw new ShaderSetError(`registry.json lists ${repeated.join(\", \")} more than once.`);\n }\n return document as unknown as Registry;\n}\n\n/**\n * Check one language block is something the packer and binder can use.\n *\n * The layout is checked against itself, not recomputed: each member must sit\n * at a four-byte-aligned offset, its recorded extent must lie inside the\n * recorded block size, and its encoding must be one the packer writes.\n */\nfunction assertLanguage(id: string, language: string, block: unknown): void {\n const where = `the ${language} block of the envelope for ${id}`;\n if (!isObject(block)) throw new ShaderSetError(`${where} is not an object.`);\n const { blockSize, layout, bindings, stages } = block;\n if (typeof blockSize !== \"number\" || !Number.isInteger(blockSize) || blockSize <= 0) {\n throw new ShaderSetError(`${where} reports a block size of ${String(blockSize)}.`);\n }\n if (!isObject(layout)) throw new ShaderSetError(`${where} carries no layout.`);\n for (const [name, member] of Object.entries(layout)) {\n const problem = layoutProblem(name, member as never, blockSize);\n if (problem !== undefined) throw new ShaderSetError(`in ${where}, ${problem}`);\n }\n if (!Array.isArray(bindings)) throw new ShaderSetError(`${where} carries no bindings.`);\n if (!isObject(stages)) throw new ShaderSetError(`${where} carries no stages.`);\n}\n\nfunction asEnvelope(document: unknown, entry: RegistryEntry): Envelope {\n if (typeof document !== \"object\" || document === null) {\n throw new ShaderSetError(`the envelope for ${entry.id} is not an object.`);\n }\n const envelope = document as Envelope;\n assertSchema(envelope, `the envelope for ${entry.id}`);\n if (envelope.pipeline?.id !== entry.id) {\n throw new ShaderSetError(\n `${entry.envelope} describes pipeline ${String(envelope.pipeline?.id)}, but the index ` +\n `points at it for ${entry.id}.`,\n );\n }\n // The whole reason the index carries a hash instead of the contract: an\n // envelope that is not the one the index sent us to would bind at the wrong\n // offsets and draw a wrong picture with no error anywhere.\n if (envelope.contractSha256 !== entry.contractSha256) {\n throw new ShaderSetError(\n `the envelope for ${entry.id} carries contract ${envelope.contractSha256}, but the index ` +\n `entry that pointed at it records ${entry.contractSha256}. The set is mixed: the index ` +\n \"and this envelope are from different builds.\",\n );\n }\n assertTags(envelope.pipeline.capabilities, `the capabilities in the envelope for ${entry.id}`);\n // The pipeline was chosen by the index entry's capabilities; the contract\n // handed to the renderer must be for that same set. The carried hash is\n // compared as a string, not recomputed, so it does not show this.\n const selected = new Set(entry.capabilities);\n const carried = new Set(envelope.pipeline.capabilities);\n if (selected.size !== carried.size || [...carried].some((tag) => !selected.has(tag))) {\n throw new ShaderSetError(\n `the envelope for ${entry.id} declares the capabilities ` +\n `[${[...carried].sort().join(\", \")}], but the index entry that selected it records ` +\n `[${[...selected].sort().join(\", \")}].`,\n );\n }\n if (!isObject(envelope.languages)) {\n throw new ShaderSetError(`the envelope for ${entry.id} carries no languages.`);\n }\n for (const [language, block] of Object.entries(envelope.languages)) {\n assertLanguage(entry.id, language, block);\n }\n return envelope;\n}\n\n/**\n * One artifact set, opened.\n *\n * Holds the index and caches each envelope it has been asked for. Every\n * envelope it hands out has been checked against the entry that pointed at it.\n */\nexport class ShaderSet {\n readonly #source: ArtifactSource;\n readonly #entries: ReadonlyMap<string, RegistryEntry>;\n readonly #envelopes = new Map<string, Promise<Envelope>>();\n\n /** The index, as read. */\n readonly registry: Registry;\n\n private constructor(source: ArtifactSource, registry: Registry) {\n this.#source = source;\n this.registry = registry;\n this.#entries = new Map(registry.pipelines.map((entry) => [entry.id, entry]));\n }\n\n /** Read the index and open the set. */\n static async open(source: ArtifactSource): Promise<ShaderSet> {\n return new ShaderSet(source, asRegistry(await source.readRegistry()));\n }\n\n /** Every pipeline the set holds, in the order the index lists them. */\n get pipelines(): readonly RegistryEntry[] {\n return this.registry.pipelines;\n }\n\n /** The closed set of capability tags any pipeline here may declare. */\n get capabilityVocabulary(): readonly string[] {\n return this.registry.capabilityVocabulary;\n }\n\n /** The index entry for `id`. */\n entry(id: string): RegistryEntry {\n const entry = this.#entries.get(id);\n if (entry === undefined) {\n throw new ShaderSetError(`no pipeline ${id} in this set; it holds ${this.#entries.size}.`);\n }\n return entry;\n }\n\n /** The envelope for `id`, fetched once and cached. */\n async envelope(id: string): Promise<Envelope> {\n const entry = this.entry(id);\n let pending = this.#envelopes.get(id);\n if (pending === undefined) {\n pending = this.#source.readEnvelope(entry).then((document) => asEnvelope(document, entry));\n // A failed read must not be cached, or one network blip poisons the id\n // for the lifetime of the set.\n pending.catch(() => this.#envelopes.delete(id));\n this.#envelopes.set(id, pending);\n }\n return pending;\n }\n\n /** The envelope's block for one language; `glsl` unless asked otherwise. */\n static language(envelope: Envelope, language: ShaderLanguage = \"glsl\"): LanguageBlock {\n const block = Object.hasOwn(envelope.languages, language)\n ? envelope.languages[language]\n : undefined;\n if (block === undefined) {\n const carried = Object.keys(envelope.languages).join(\", \") || \"none\";\n throw new ShaderSetError(\n `the envelope for ${envelope.pipeline.id} carries no ${language}; it carries ${carried}.`,\n );\n }\n return block;\n }\n}\n"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/** A family of result data, by the shape of one datum. */
|
|
2
|
+
export type DerivedFamily = "scalar" | "vector" | "dof6" | "symtensor";
|
|
3
|
+
/** How many components one datum of each family carries. */
|
|
4
|
+
export declare const FAMILY_COMPONENTS: Readonly<Record<DerivedFamily, number>>;
|
|
5
|
+
/** Scalar-family dispatch integers. */
|
|
6
|
+
export declare const SCALAR_DISPATCH: {
|
|
7
|
+
readonly identity: 0;
|
|
8
|
+
readonly absolute: 1;
|
|
9
|
+
readonly affine: 2;
|
|
10
|
+
readonly celsius_to_kelvin: 3;
|
|
11
|
+
readonly kelvin_to_celsius: 4;
|
|
12
|
+
readonly fahrenheit_to_kelvin: 5;
|
|
13
|
+
readonly kelvin_to_fahrenheit: 6;
|
|
14
|
+
readonly fahrenheit_to_celsius: 7;
|
|
15
|
+
readonly celsius_to_fahrenheit: 8;
|
|
16
|
+
};
|
|
17
|
+
/** Vector-family dispatch integers. */
|
|
18
|
+
export declare const VECTOR_DISPATCH: {
|
|
19
|
+
readonly x: 0;
|
|
20
|
+
readonly y: 1;
|
|
21
|
+
readonly z: 2;
|
|
22
|
+
readonly magnitude: 3;
|
|
23
|
+
};
|
|
24
|
+
/** 6-DOF-family dispatch integers. */
|
|
25
|
+
export declare const DOF6_DISPATCH: {
|
|
26
|
+
readonly tx: 0;
|
|
27
|
+
readonly ty: 1;
|
|
28
|
+
readonly tz: 2;
|
|
29
|
+
readonly rx: 3;
|
|
30
|
+
readonly ry: 4;
|
|
31
|
+
readonly rz: 5;
|
|
32
|
+
readonly translation_magnitude: 6;
|
|
33
|
+
readonly rotation_magnitude: 7;
|
|
34
|
+
};
|
|
35
|
+
/** Symmetric-tensor-family dispatch integers. */
|
|
36
|
+
export declare const SYMTENSOR_DISPATCH: {
|
|
37
|
+
readonly xx: 0;
|
|
38
|
+
readonly yy: 1;
|
|
39
|
+
readonly zz: 2;
|
|
40
|
+
readonly xy: 3;
|
|
41
|
+
readonly yz: 4;
|
|
42
|
+
readonly xz: 5;
|
|
43
|
+
readonly mean: 6;
|
|
44
|
+
readonly von_mises: 7;
|
|
45
|
+
readonly equivalent_strain: 8;
|
|
46
|
+
readonly equivalent_strain_engineering: 9;
|
|
47
|
+
readonly octahedral: 10;
|
|
48
|
+
readonly max_shear: 11;
|
|
49
|
+
readonly equal_direct: 12;
|
|
50
|
+
readonly intensity: 13;
|
|
51
|
+
readonly abs_max_principal: 14;
|
|
52
|
+
readonly abs_max_principal_engineering: 15;
|
|
53
|
+
readonly determinant: 16;
|
|
54
|
+
readonly min_principal: 17;
|
|
55
|
+
readonly min_principal_engineering: 18;
|
|
56
|
+
readonly deviatoric_min_principal: 19;
|
|
57
|
+
readonly mid_principal: 20;
|
|
58
|
+
readonly mid_principal_engineering: 21;
|
|
59
|
+
readonly deviatoric_mid_principal: 22;
|
|
60
|
+
readonly max_principal: 23;
|
|
61
|
+
readonly max_principal_engineering: 24;
|
|
62
|
+
readonly deviatoric_max_principal: 25;
|
|
63
|
+
};
|
|
64
|
+
/** Every family's table, by family. */
|
|
65
|
+
export declare const DISPATCH: Readonly<Record<DerivedFamily, Readonly<Record<string, number>>>>;
|
|
66
|
+
/**
|
|
67
|
+
* The dispatch table of one family.
|
|
68
|
+
*
|
|
69
|
+
* Looked up as an own property, so a name such as `constructor` or
|
|
70
|
+
* `toString` is not mistaken for a family.
|
|
71
|
+
*
|
|
72
|
+
* @throws {DerivedError} if `family` is not one of the four.
|
|
73
|
+
*/
|
|
74
|
+
export declare function dispatchTable(family: DerivedFamily): Readonly<Record<string, number>>;
|
|
75
|
+
/** The derived type names a family offers, in dispatch order. */
|
|
76
|
+
export declare function derivedTypeNames(family: DerivedFamily): string[];
|
|
77
|
+
/** The dispatch integer for a name, or `undefined` if the family has no such type. */
|
|
78
|
+
export declare function dispatchId(family: DerivedFamily, name: string): number | undefined;
|
|
79
|
+
/** The name a dispatch integer stands for, or `undefined`. */
|
|
80
|
+
export declare function dispatchName(family: DerivedFamily, id: number): string | undefined;
|