@carbonenginejs/runtime-resource 0.19.1 → 0.19.2
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.
|
@@ -243,7 +243,16 @@ function readGlslEffectContainer(input, values = {}) {
|
|
|
243
243
|
// match the ambient ones and total for one whose do
|
|
244
244
|
// not - an additive pass writing alpha 0 disappears
|
|
245
245
|
// completely under a src-alpha blend.
|
|
246
|
-
|
|
246
|
+
//
|
|
247
|
+
// `states`, not `renderStates`. Carbon's `Tr2Pass`
|
|
248
|
+
// reserves `renderStates` for the `unsigned int`
|
|
249
|
+
// handle `RegisterRenderStateSetup` hands back
|
|
250
|
+
// (Tr2EffectDescription.h:205), and calls the pairs
|
|
251
|
+
// themselves `states` - as do the WebGPU analysis
|
|
252
|
+
// passes and both of ccpwgl's legacy readers. This
|
|
253
|
+
// path never registers anything, so it carries the
|
|
254
|
+
// list and no handle rather than inventing a number.
|
|
255
|
+
states: pass.renderStates ?? [],
|
|
247
256
|
// The pass's transforms, so a rule can ask whether a
|
|
248
257
|
// description resource was merged away rather than lost.
|
|
249
258
|
transforms
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readGlslEffectContainer.js","sources":["../../../../../src/formats/webgl/core/readGlslEffectContainer.js"],"sourcesContent":["import { CjsCarbonEffectReader } from \"../../../format/carbonEffect/CjsCarbonEffectReader.js\";\nimport { readGlslBackendBlock } from \"./glslBackendBlock.js\";\nimport {\n CARBON_BACKEND_ENGINE_ID,\n peekBackendEngineId\n} from \"../../../format/carbonEffect/backendEngineId.js\";\nimport { hlslShaderStageName } from \"../../hlsl/core/tr2/HlslRenderContextEnum.js\";\nimport { runtimeDescriptionFromCarbon } from \"../../hlsl/core/carbonDescriptionToRuntime.js\";\nimport { HlslEffectBindingManifest } from \"../../hlsl/core/tr2/shader/HlslEffectBindingManifest.js\";\n\n/**\n * Decodes a WebGL effect container into the stage/shader records the\n * completeness rules consume.\n *\n * This exists so the rules run from container bytes alone. The alternative was\n * to hand them the in-memory translation, which works inside `buildEffectPackage`\n * and nowhere else — the validator reads a finished file and has no translation\n * in scope. That would have cost the validator its completeness check while\n * still requiring a decoder to produce the programs it compiles in a browser, so\n * it was strictly more work for strictly less checking.\n *\n * The vocabulary is deliberately the one the rules already speak — `stages` with\n * pass coordinates, `shaders` with source and a translation verdict. The rules\n * are about the translation, not about how it was stored, so retargeting them\n * meant changing where the records come from and nothing about what they mean.\n *\n * **What the wire cannot tell you.** `buildCarbonEffectContainer` stores a body\n * the translator could not lower as its full pass tree with zero-length\n * programs; the *reason* it failed stays in the in-memory build result and is\n * never written. So a shader decoded from bytes reports `ok: false` with\n * \"no program was stored\" and nothing more specific. That is the honest answer:\n * a file on disk does not know why a translation failed months ago. Callers that\n * do know — `buildEffectPackage`, at build time — keep their specific\n * diagnostics by feeding the rules their own records instead.\n */\n\n/** The verdict a stage carrying no stored program gets. */\nconst NO_PROGRAM_REASON = \"no program was stored\";\n\n/**\n * Derives the per-stage binding manifests for one body through the one\n * manifest builder the source path uses.\n *\n * This replaces a hand-built reshape of the wire records into the manifest\n * vocabulary. That copy had already diverged from the real manifest once —\n * `isAutoregister` was silently dropped, making every resource look\n * user-settable — which is the whole argument against a second producer: two\n * hand-maintained spellings of one reflection drift, and the drift is exactly\n * the kind of bug that draws, links and renders black without an error. The\n * record tree now flows through `runtimeDescriptionFromCarbon` — the\n * corpus-proven adapter the runtime read path uses — and\n * `HlslEffectBindingManifest`, so the container read and the build-time\n * package derive their manifests from the same code.\n *\n * No `bytecodeFor` is supplied: program text lives in the shader records this\n * reader emits, so the manifest's `shaderBytecode` stays null rather than\n * duplicating every program into the reflection.\n *\n * @param {object} description Decoded Carbon description record tree.\n * @param {number} version Container data version.\n * @param {string} source Source name for diagnostics.\n * @returns {Map<string, object>} Manifest stage records keyed by\n * `technique.passN.stageName`.\n */\nfunction bodyManifestStages(description, version, source)\n{\n const runtime = runtimeDescriptionFromCarbon(description, {\n effectName: source,\n version\n });\n const manifest = HlslEffectBindingManifest.fromEffectDescription(runtime).toJSON();\n return new Map(manifest.stages.map((stage) => [\n `${stage.techniqueName}.pass${stage.passIndex}.${stage.stageName}`,\n stage\n ]));\n}\n\n/**\n * Decodes one pass's backend block, tolerating a pass that has none.\n *\n * @param {object} pass Decoded pass record.\n * @param {string} passKey Enclosing pass key.\n * @param {string} source Source name for error details.\n * @returns {object} Per-stage backend data, keyed by stage name.\n */\nfunction backendStages(pass, passKey, source)\n{\n if (!pass.backendBlock?.size) return { stages: {}, transforms: [] };\n\n // A block belonging to another backend is not an error here. The container\n // is Carbon-shaped whatever it targets, and loading it must not depend on\n // being able to use its programs - a dx11 container loads and simply cannot\n // be executed by this library. Report no backend data and let prepare fail\n // where the backend actually matters.\n const engineId = peekBackendEngineId(pass.backendBlock.bytes);\n if (engineId !== CARBON_BACKEND_ENGINE_ID.webgl2)\n {\n return { stages: {}, transforms: [], foreignEngineId: engineId };\n }\n\n const block = readGlslBackendBlock(pass.backendBlock.bytes, { layoutKey: passKey, source });\n return { stages: block.stages ?? {}, transforms: block.transforms ?? [] };\n}\n\n/**\n * Decodes container bytes into stage and shader records.\n *\n * Bodies are decoded once each rather than once per permutation row: rows alias\n * onto shared bodies, and a rule that saw the same body 4,096 times would report\n * 4,096 identical incomplete passes.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container payload.\n * @param {object} [values] Read values.\n * @param {string} [values.source] Source name, for diagnostics.\n * @returns {{stages:object[], shaders:object[], recordCount:number, bodyCount:number}}\n * Stage graph in the completeness rules' vocabulary.\n */\nexport function readGlslEffectContainer(input, values = {})\n{\n const source = values.source ?? \"memory\";\n const reader = new CjsCarbonEffectReader(input, { source });\n\n const stages = [];\n const shaders = [];\n const bodyKeyByOffset = new Map();\n\n // Every permutation index that resolves to each body.\n //\n // This is the bridge a caller actually needs, and the only one that is\n // sound. `bodyKey` here is this reader's own ordinal spelling; the\n // permutation graph mints `body${N}` for the same body, and the two are not\n // merely spelled differently — the graph dedupes by content (SHA-256 plus\n // byte equality) while this reader dedupes by source-record offset. Those\n // partitions coincide only because the container writer aliases\n // byte-identical bodies onto one offset, which is a property of the writer\n // rather than a contract.\n //\n // So a consumer must never map between the two by string surgery on either\n // spelling, and must not assume the two ordinal sequences agree. It holds a\n // permutation index; this gives it the body directly.\n const permutationIndicesByOffset = new Map();\n\n for (let index = 0; index < reader.records.length; index += 1)\n {\n const { offset } = reader.records[index];\n const seen = permutationIndicesByOffset.get(offset);\n if (seen) seen.push(index);\n else permutationIndicesByOffset.set(offset, [ index ]);\n }\n\n // Distinct program texts share one shader record, so `shaders` counts unique\n // translations the way the chunk package's shader table did. Empty stages are\n // deliberately *not* pooled: each keeps its own record so a report can name\n // every pass that is missing a program rather than one shared \"absent\".\n //\n // The pool key is the program text *and* the backend reflection that came\n // with it, not the text alone. A pooled record carries the bindings and\n // stage inputs of whichever stage was seen first, and\n // `validateShaderRuntimeContract` judges the emitted GLSL against them — so\n // pooling on text alone would let two stages with identical source but\n // different reflection be checked against the wrong metadata, silently. It\n // is unlikely that identical GLSL ever carries different reflection, which\n // is exactly why it would not be noticed.\n const shaderKeyByIdentity = new Map();\n\n for (let index = 0; index < reader.records.length; index += 1)\n {\n const { offset } = reader.records[index];\n if (bodyKeyByOffset.has(offset)) continue;\n\n const bodyKey = `body_${bodyKeyByOffset.size}`;\n bodyKeyByOffset.set(offset, bodyKey);\n\n const description = reader.readDescription(index, { backend: true });\n const manifestStages = bodyManifestStages(description, reader.version, source);\n\n for (const technique of description.techniques)\n {\n const techniqueName = technique.name.value;\n for (const [ passIndex, pass ] of technique.passes.entries())\n {\n const passKey = `${techniqueName}.pass${passIndex}`;\n const { stages: backend, transforms } = backendStages(\n pass,\n passKey,\n source\n );\n\n for (const stage of pass.stages)\n {\n const name = hlslShaderStageName(stage.type);\n const stageKey = `${bodyKey}.${passKey}.${name}`;\n const stageBackend = backend[name] ?? {};\n\n let shaderKey;\n if (stage.shaderData?.size)\n {\n const code = new TextDecoder().decode(stage.shaderData.bytes);\n const identity = `${JSON.stringify([\n stageBackend.bindings ?? [],\n stageBackend.stageInputs ?? [],\n stageBackend.computeFragment ?? null\n ])} ${code}`;\n const pooled = shaderKeyByIdentity.get(identity);\n if (pooled)\n {\n shaderKey = pooled;\n }\n else\n {\n shaderKey = `shader_${shaderKeyByIdentity.size}`;\n shaderKeyByIdentity.set(identity, shaderKey);\n shaders.push({\n key: shaderKey,\n stageName: name,\n source: code,\n hlsl2webgl: { ok: true },\n bindings: stageBackend.bindings ?? [],\n stageInputs: stageBackend.stageInputs ?? [],\n ...(stageBackend.computeFragment\n ? { computeFragment: stageBackend.computeFragment }\n : {})\n });\n }\n }\n else\n {\n shaderKey = `${stageKey}.absent`;\n shaders.push({\n key: shaderKey,\n stageName: name,\n source: \"\",\n hlsl2webgl: { ok: false, reason: NO_PROGRAM_REASON },\n bindings: stageBackend.bindings ?? [],\n stageInputs: stageBackend.stageInputs ?? []\n });\n }\n\n stages.push({\n key: stageKey,\n bodyKey,\n techniqueName,\n passIndex,\n stageName: name,\n stageType: stage.type,\n shaderKey,\n manifest: manifestStages.get(`${passKey}.${name}`) ?? null,\n // The pass's D3D render states, verbatim from the\n // description. They are not reflection and nothing in\n // the GLSL implies them, so a consumer that only reads\n // programs and bindings renders every effect with\n // whatever state the previous draw happened to leave\n // set. That is invisible for an effect whose states\n // match the ambient ones and total for one whose do\n // not - an additive pass writing alpha 0 disappears\n // completely under a src-alpha blend.\n renderStates: pass.renderStates ?? [],\n // The pass's transforms, so a rule can ask whether a\n // description resource was merged away rather than lost.\n transforms\n });\n }\n }\n }\n }\n\n // Ordered by first appearance, matching `bodyKey`'s ordinal.\n const bodies = [];\n for (const [ offset, key ] of bodyKeyByOffset)\n {\n bodies.push({\n key,\n permutationIndices: Object.freeze(permutationIndicesByOffset.get(offset) ?? [])\n });\n }\n\n return {\n stages,\n shaders,\n bodies,\n recordCount: reader.records.length,\n bodyCount: bodyKeyByOffset.size\n };\n}\n\nexport default readGlslEffectContainer;\n"],"names":["NO_PROGRAM_REASON","bodyManifestStages","description","version","source","runtime","runtimeDescriptionFromCarbon","effectName","manifest","HlslEffectBindingManifest","fromEffectDescription","toJSON","Map","stages","map","stage","techniqueName","passIndex","stageName","backendStages","pass","passKey","backendBlock","size","transforms","engineId","peekBackendEngineId","bytes","CARBON_BACKEND_ENGINE_ID","webgl2","foreignEngineId","block","readGlslBackendBlock","layoutKey","readGlslEffectContainer","input","values","reader","CjsCarbonEffectReader","shaders","bodyKeyByOffset","permutationIndicesByOffset","index","records","length","offset","seen","get","push","set","shaderKeyByIdentity","has","bodyKey","readDescription","backend","manifestStages","technique","techniques","name","value","passes","entries","hlslShaderStageName","type","stageKey","stageBackend","shaderKey","shaderData","code","TextDecoder","decode","identity","JSON","stringify","bindings","stageInputs","computeFragment","pooled","key","hlsl2webgl","ok","reason","stageType","renderStates","bodies","permutationIndices","Object","freeze","recordCount","bodyCount"],"mappings":";;;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMA,iBAAiB,GAAG,uBAAuB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,kBAAkBA,CAACC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EACxD;AACI,EAAA,MAAMC,OAAO,GAAGC,4BAA4B,CAACJ,WAAW,EAAE;AACtDK,IAAAA,UAAU,EAAEH,MAAM;AAClBD,IAAAA;AACJ,GAAC,CAAC;EACF,MAAMK,QAAQ,GAAGC,yBAAyB,CAACC,qBAAqB,CAACL,OAAO,CAAC,CAACM,MAAM,EAAE;AAClF,EAAA,OAAO,IAAIC,GAAG,CAACJ,QAAQ,CAACK,MAAM,CAACC,GAAG,CAAEC,K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AAA,MAAM,EAAEjF;eAAmB;AACpD0E,cAAAA,QAAQ,EAAET,YAAY,CAACS,QAAQ,IAAI,EAAE;AACrCC,cAAAA,WAAW,EAAEV,YAAY,CAACU,WAAW,IAAI;AAC7C,aAAC,CAAC;AACN,UAAA;UAEA9D,MAAM,CAACmC,IAAI,CAAC;AACR8B,YAAAA,GAAG,EAAEd,QAAQ;YACbZ,OAAO;YACPpC,aAAa;YACbC,SAAS;AACTC,YAAAA,SAAS,EAAEwC,IAAI;YACfwB,SAAS,EAAEnE,KAAK,CAACgD,IAAI;YACrBG,SAAS;AACT1D,YAAAA,QAAQ,EAAE+C,cAAc,CAACR,GAAG,CAAC,CAAA,EAAG1B,OAAO,CAAA,CAAA,EAAIqC,IAAI,CAAA,CAAE,CAAC,IAAI,IAAI;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAyB,YAAAA,YAAY,EAAE/D,IAAI,CAAC+D,YAAY,IAAI,EAAE;AACrC;AACA;AACA3D,YAAAA;AACJ,WAAC,CAAC;AACN,QAAA;AACJ,MAAA;AACJ,IAAA;AACJ,EAAA;;AAEA;EACA,MAAM4D,MAAM,GAAG,EAAE;EACjB,KAAK,MAAM,CAAEvC,MAAM,EAAEiC,GAAG,CAAE,IAAItC,eAAe,EAC7C;IACI4C,MAAM,CAACpC,IAAI,CAAC;MACR8B,GAAG;AACHO,MAAAA,kBAAkB,EAAEC,MAAM,CAACC,MAAM,CAAC9C,0BAA0B,CAACM,GAAG,CAACF,MAAM,CAAC,IAAI,EAAE;AAClF,KAAC,CAAC;AACN,EAAA;EAEA,OAAO;IACHhC,MAAM;IACN0B,OAAO;IACP6C,MAAM;AACNI,IAAAA,WAAW,EAAEnD,MAAM,CAACM,OAAO,CAACC,MAAM;IAClC6C,SAAS,EAAEjD,eAAe,CAACjB;GAC9B;AACL;;;;"}
|
|
1
|
+
{"version":3,"file":"readGlslEffectContainer.js","sources":["../../../../../src/formats/webgl/core/readGlslEffectContainer.js"],"sourcesContent":["import { CjsCarbonEffectReader } from \"../../../format/carbonEffect/CjsCarbonEffectReader.js\";\nimport { readGlslBackendBlock } from \"./glslBackendBlock.js\";\nimport {\n CARBON_BACKEND_ENGINE_ID,\n peekBackendEngineId\n} from \"../../../format/carbonEffect/backendEngineId.js\";\nimport { hlslShaderStageName } from \"../../hlsl/core/tr2/HlslRenderContextEnum.js\";\nimport { runtimeDescriptionFromCarbon } from \"../../hlsl/core/carbonDescriptionToRuntime.js\";\nimport { HlslEffectBindingManifest } from \"../../hlsl/core/tr2/shader/HlslEffectBindingManifest.js\";\n\n/**\n * Decodes a WebGL effect container into the stage/shader records the\n * completeness rules consume.\n *\n * This exists so the rules run from container bytes alone. The alternative was\n * to hand them the in-memory translation, which works inside `buildEffectPackage`\n * and nowhere else — the validator reads a finished file and has no translation\n * in scope. That would have cost the validator its completeness check while\n * still requiring a decoder to produce the programs it compiles in a browser, so\n * it was strictly more work for strictly less checking.\n *\n * The vocabulary is deliberately the one the rules already speak — `stages` with\n * pass coordinates, `shaders` with source and a translation verdict. The rules\n * are about the translation, not about how it was stored, so retargeting them\n * meant changing where the records come from and nothing about what they mean.\n *\n * **What the wire cannot tell you.** `buildCarbonEffectContainer` stores a body\n * the translator could not lower as its full pass tree with zero-length\n * programs; the *reason* it failed stays in the in-memory build result and is\n * never written. So a shader decoded from bytes reports `ok: false` with\n * \"no program was stored\" and nothing more specific. That is the honest answer:\n * a file on disk does not know why a translation failed months ago. Callers that\n * do know — `buildEffectPackage`, at build time — keep their specific\n * diagnostics by feeding the rules their own records instead.\n */\n\n/** The verdict a stage carrying no stored program gets. */\nconst NO_PROGRAM_REASON = \"no program was stored\";\n\n/**\n * Derives the per-stage binding manifests for one body through the one\n * manifest builder the source path uses.\n *\n * This replaces a hand-built reshape of the wire records into the manifest\n * vocabulary. That copy had already diverged from the real manifest once —\n * `isAutoregister` was silently dropped, making every resource look\n * user-settable — which is the whole argument against a second producer: two\n * hand-maintained spellings of one reflection drift, and the drift is exactly\n * the kind of bug that draws, links and renders black without an error. The\n * record tree now flows through `runtimeDescriptionFromCarbon` — the\n * corpus-proven adapter the runtime read path uses — and\n * `HlslEffectBindingManifest`, so the container read and the build-time\n * package derive their manifests from the same code.\n *\n * No `bytecodeFor` is supplied: program text lives in the shader records this\n * reader emits, so the manifest's `shaderBytecode` stays null rather than\n * duplicating every program into the reflection.\n *\n * @param {object} description Decoded Carbon description record tree.\n * @param {number} version Container data version.\n * @param {string} source Source name for diagnostics.\n * @returns {Map<string, object>} Manifest stage records keyed by\n * `technique.passN.stageName`.\n */\nfunction bodyManifestStages(description, version, source)\n{\n const runtime = runtimeDescriptionFromCarbon(description, {\n effectName: source,\n version\n });\n const manifest = HlslEffectBindingManifest.fromEffectDescription(runtime).toJSON();\n return new Map(manifest.stages.map((stage) => [\n `${stage.techniqueName}.pass${stage.passIndex}.${stage.stageName}`,\n stage\n ]));\n}\n\n/**\n * Decodes one pass's backend block, tolerating a pass that has none.\n *\n * @param {object} pass Decoded pass record.\n * @param {string} passKey Enclosing pass key.\n * @param {string} source Source name for error details.\n * @returns {object} Per-stage backend data, keyed by stage name.\n */\nfunction backendStages(pass, passKey, source)\n{\n if (!pass.backendBlock?.size) return { stages: {}, transforms: [] };\n\n // A block belonging to another backend is not an error here. The container\n // is Carbon-shaped whatever it targets, and loading it must not depend on\n // being able to use its programs - a dx11 container loads and simply cannot\n // be executed by this library. Report no backend data and let prepare fail\n // where the backend actually matters.\n const engineId = peekBackendEngineId(pass.backendBlock.bytes);\n if (engineId !== CARBON_BACKEND_ENGINE_ID.webgl2)\n {\n return { stages: {}, transforms: [], foreignEngineId: engineId };\n }\n\n const block = readGlslBackendBlock(pass.backendBlock.bytes, { layoutKey: passKey, source });\n return { stages: block.stages ?? {}, transforms: block.transforms ?? [] };\n}\n\n/**\n * Decodes container bytes into stage and shader records.\n *\n * Bodies are decoded once each rather than once per permutation row: rows alias\n * onto shared bodies, and a rule that saw the same body 4,096 times would report\n * 4,096 identical incomplete passes.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container payload.\n * @param {object} [values] Read values.\n * @param {string} [values.source] Source name, for diagnostics.\n * @returns {{stages:object[], shaders:object[], recordCount:number, bodyCount:number}}\n * Stage graph in the completeness rules' vocabulary.\n */\nexport function readGlslEffectContainer(input, values = {})\n{\n const source = values.source ?? \"memory\";\n const reader = new CjsCarbonEffectReader(input, { source });\n\n const stages = [];\n const shaders = [];\n const bodyKeyByOffset = new Map();\n\n // Every permutation index that resolves to each body.\n //\n // This is the bridge a caller actually needs, and the only one that is\n // sound. `bodyKey` here is this reader's own ordinal spelling; the\n // permutation graph mints `body${N}` for the same body, and the two are not\n // merely spelled differently — the graph dedupes by content (SHA-256 plus\n // byte equality) while this reader dedupes by source-record offset. Those\n // partitions coincide only because the container writer aliases\n // byte-identical bodies onto one offset, which is a property of the writer\n // rather than a contract.\n //\n // So a consumer must never map between the two by string surgery on either\n // spelling, and must not assume the two ordinal sequences agree. It holds a\n // permutation index; this gives it the body directly.\n const permutationIndicesByOffset = new Map();\n\n for (let index = 0; index < reader.records.length; index += 1)\n {\n const { offset } = reader.records[index];\n const seen = permutationIndicesByOffset.get(offset);\n if (seen) seen.push(index);\n else permutationIndicesByOffset.set(offset, [ index ]);\n }\n\n // Distinct program texts share one shader record, so `shaders` counts unique\n // translations the way the chunk package's shader table did. Empty stages are\n // deliberately *not* pooled: each keeps its own record so a report can name\n // every pass that is missing a program rather than one shared \"absent\".\n //\n // The pool key is the program text *and* the backend reflection that came\n // with it, not the text alone. A pooled record carries the bindings and\n // stage inputs of whichever stage was seen first, and\n // `validateShaderRuntimeContract` judges the emitted GLSL against them — so\n // pooling on text alone would let two stages with identical source but\n // different reflection be checked against the wrong metadata, silently. It\n // is unlikely that identical GLSL ever carries different reflection, which\n // is exactly why it would not be noticed.\n const shaderKeyByIdentity = new Map();\n\n for (let index = 0; index < reader.records.length; index += 1)\n {\n const { offset } = reader.records[index];\n if (bodyKeyByOffset.has(offset)) continue;\n\n const bodyKey = `body_${bodyKeyByOffset.size}`;\n bodyKeyByOffset.set(offset, bodyKey);\n\n const description = reader.readDescription(index, { backend: true });\n const manifestStages = bodyManifestStages(description, reader.version, source);\n\n for (const technique of description.techniques)\n {\n const techniqueName = technique.name.value;\n for (const [ passIndex, pass ] of technique.passes.entries())\n {\n const passKey = `${techniqueName}.pass${passIndex}`;\n const { stages: backend, transforms } = backendStages(\n pass,\n passKey,\n source\n );\n\n for (const stage of pass.stages)\n {\n const name = hlslShaderStageName(stage.type);\n const stageKey = `${bodyKey}.${passKey}.${name}`;\n const stageBackend = backend[name] ?? {};\n\n let shaderKey;\n if (stage.shaderData?.size)\n {\n const code = new TextDecoder().decode(stage.shaderData.bytes);\n const identity = `${JSON.stringify([\n stageBackend.bindings ?? [],\n stageBackend.stageInputs ?? [],\n stageBackend.computeFragment ?? null\n ])} ${code}`;\n const pooled = shaderKeyByIdentity.get(identity);\n if (pooled)\n {\n shaderKey = pooled;\n }\n else\n {\n shaderKey = `shader_${shaderKeyByIdentity.size}`;\n shaderKeyByIdentity.set(identity, shaderKey);\n shaders.push({\n key: shaderKey,\n stageName: name,\n source: code,\n hlsl2webgl: { ok: true },\n bindings: stageBackend.bindings ?? [],\n stageInputs: stageBackend.stageInputs ?? [],\n ...(stageBackend.computeFragment\n ? { computeFragment: stageBackend.computeFragment }\n : {})\n });\n }\n }\n else\n {\n shaderKey = `${stageKey}.absent`;\n shaders.push({\n key: shaderKey,\n stageName: name,\n source: \"\",\n hlsl2webgl: { ok: false, reason: NO_PROGRAM_REASON },\n bindings: stageBackend.bindings ?? [],\n stageInputs: stageBackend.stageInputs ?? []\n });\n }\n\n stages.push({\n key: stageKey,\n bodyKey,\n techniqueName,\n passIndex,\n stageName: name,\n stageType: stage.type,\n shaderKey,\n manifest: manifestStages.get(`${passKey}.${name}`) ?? null,\n // The pass's D3D render states, verbatim from the\n // description. They are not reflection and nothing in\n // the GLSL implies them, so a consumer that only reads\n // programs and bindings renders every effect with\n // whatever state the previous draw happened to leave\n // set. That is invisible for an effect whose states\n // match the ambient ones and total for one whose do\n // not - an additive pass writing alpha 0 disappears\n // completely under a src-alpha blend.\n //\n // `states`, not `renderStates`. Carbon's `Tr2Pass`\n // reserves `renderStates` for the `unsigned int`\n // handle `RegisterRenderStateSetup` hands back\n // (Tr2EffectDescription.h:205), and calls the pairs\n // themselves `states` - as do the WebGPU analysis\n // passes and both of ccpwgl's legacy readers. This\n // path never registers anything, so it carries the\n // list and no handle rather than inventing a number.\n states: pass.renderStates ?? [],\n // The pass's transforms, so a rule can ask whether a\n // description resource was merged away rather than lost.\n transforms\n });\n }\n }\n }\n }\n\n // Ordered by first appearance, matching `bodyKey`'s ordinal.\n const bodies = [];\n for (const [ offset, key ] of bodyKeyByOffset)\n {\n bodies.push({\n key,\n permutationIndices: Object.freeze(permutationIndicesByOffset.get(offset) ?? [])\n });\n }\n\n return {\n stages,\n shaders,\n bodies,\n recordCount: reader.records.length,\n bodyCount: bodyKeyByOffset.size\n };\n}\n\nexport default readGlslEffectContainer;\n"],"names":["NO_PROGRAM_REASON","bodyManifestStages","description","version","source","runtime","runtimeDescriptionFromCarbon","effectName","manifest","HlslEffectBindingManifest","fromEffectDescription","toJSON","Map","stages","map","stage","techniqueName","passIndex","stageName","backendStages","pass","passKey","backendBlock","size","transforms","engineId","peekBackendEngineId","bytes","CARBON_BACKEND_ENGINE_ID","webgl2","foreignEngineId","block","readGlslBackendBlock","layoutKey","readGlslEffectContainer","input","values","reader","CjsCarbonEffectReader","shaders","bodyKeyByOffset","permutationIndicesByOffset","index","records","length","offset","seen","get","push","set","shaderKeyByIdentity","has","bodyKey","readDescription","backend","manifestStages","technique","techniques","name","value","passes","entries","hlslShaderStageName","type","stageKey","stageBackend","shaderKey","shaderData","code","TextDecoder","decode","identity","JSON","stringify","bindings","stageInputs","computeFragment","pooled","key","hlsl2webgl","ok","reason","stageType","states","renderStates","bodies","permutationIndices","Object","freeze","recordCount","bodyCount"],"mappings":";;;;;;;AA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