@carbonenginejs/runtime-resource 0.12.0 → 0.12.1
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/dist/CjsResMan.js +4 -4
- package/dist/CjsResMan.js.map +1 -1
- package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -4
- package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/dist/format/CjsByteReader.js +310 -0
- package/dist/format/CjsByteReader.js.map +1 -0
- package/dist/format/CjsByteWriter.js +242 -0
- package/dist/format/CjsByteWriter.js.map +1 -0
- package/dist/format/CjsFormatError.js +41 -0
- package/dist/format/CjsFormatError.js.map +1 -0
- package/dist/format/CjsStringTable.js +268 -0
- package/dist/format/CjsStringTable.js.map +1 -0
- package/dist/format/carbonEffect/CjsCarbonEffectReader.js +361 -0
- package/dist/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -0
- package/dist/format/carbonEffect/CjsCarbonEffectWriter.js +373 -0
- package/dist/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -0
- package/dist/format/carbonEffect/carbonDescriptionFromPortable.js +372 -0
- package/dist/format/carbonEffect/carbonDescriptionFromPortable.js.map +1 -0
- package/dist/format/carbonEffect/carbonEffectBackendBlock.js +427 -0
- package/dist/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -0
- package/dist/format/carbonEffect/carbonEffectRecords.js +955 -0
- package/dist/format/carbonEffect/carbonEffectRecords.js.map +1 -0
- package/dist/format/compareUtf8.js +36 -0
- package/dist/format/compareUtf8.js.map +1 -0
- package/dist/format/index.js +11 -0
- package/dist/format/index.js.map +1 -0
- package/dist/formats/bnk/CjsBnkFormat.js +10 -4
- package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/formats/bnk/core/eventAction.js +305 -0
- package/dist/formats/bnk/core/eventAction.js.map +1 -0
- package/dist/formats/bnk/core/helpers.js +11 -2
- package/dist/formats/bnk/core/helpers.js.map +1 -1
- package/dist/formats/bnk/core/nodeBase.js +532 -0
- package/dist/formats/bnk/core/nodeBase.js.map +1 -0
- package/dist/formats/bnk/core/sfxNodes.js +252 -152
- package/dist/formats/bnk/core/sfxNodes.js.map +1 -1
- package/dist/formats/hlsl/core/HlslReader.js +7 -257
- package/dist/formats/hlsl/core/HlslReader.js.map +1 -1
- package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js +781 -0
- package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +21 -1
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -1
- package/dist/formats/index.js +1 -1
- package/dist/formats/webgl/core/cewg/CewgPackage.js +2 -1
- package/dist/formats/webgl/core/cewg/CewgPackage.js.map +1 -1
- package/dist/formats/webgl/core/cewg/binary.js +11 -93
- package/dist/formats/webgl/core/cewg/binary.js.map +1 -1
- package/dist/formats/webgl/core/effectPackage.js +1 -1
- package/dist/formats/webgpu/CjsWebgpuFormat.js +4 -23
- package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
- package/dist/formats/webgpu/core/buildCarbonEffectContainer.js +197 -0
- package/dist/formats/webgpu/core/buildCarbonEffectContainer.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js +368 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/containerViews.js +355 -0
- package/dist/formats/webgpu/core/cewgpu/containerViews.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/validateContainer.js +90 -0
- package/dist/formats/webgpu/core/cewgpu/validateContainer.js.map +1 -0
- package/dist/formats/webgpu/core/effectBackendBodySet.js +21 -20
- package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -1
- package/dist/formats/webgpu/core/helpers.js +87 -92
- package/dist/formats/webgpu/core/helpers.js.map +1 -1
- package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +14 -13
- package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js.map +1 -1
- package/dist/formats/webgpu/core/ir/inferValueTypes.js +10 -8
- package/dist/formats/webgpu/core/ir/inferValueTypes.js.map +1 -1
- package/dist/formats/webgpu/core/packageEffect.js +94 -9
- package/dist/formats/webgpu/core/packageEffect.js.map +1 -1
- package/dist/formats/webgpu/core/packageMetadata.js +10 -1
- package/dist/formats/webgpu/core/packageMetadata.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +17 -15
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +13 -12
- package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +9 -8
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +23 -22
- package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/selectionPlans.js +46 -44
- package/dist/formats/webgpu/core/wgsl/selectionPlans.js.map +1 -1
- package/dist/resource/CjsResource.js +700 -684
- package/dist/resource/CjsResource.js.map +1 -1
- package/dist/resource/Tr2LightProfileRes.js +18 -27
- package/dist/resource/Tr2LightProfileRes.js.map +1 -1
- package/dist/resource/audio/CjsAudioBufferRes.js +2 -2
- package/dist/resource/audio/CjsAudioBufferRes.js.map +1 -1
- package/dist/resource/audio/CjsAudioRes.js +2 -2
- package/dist/resource/audio/CjsAudioRes.js.map +1 -1
- package/dist/resource/geometry/TriGeometryRes.js +605 -586
- package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js +21 -30
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -1
- package/dist/resource/geometry/granny/TriGrannyRes.js +21 -30
- package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -1
- package/dist/resource/shader/Tr2EffectRes.js +9 -7
- package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
- package/dist/resource/shader/Tr2MaterialArea.js +5 -3
- package/dist/resource/shader/Tr2MaterialArea.js.map +1 -1
- package/dist/resource/shader/Tr2MaterialMesh.js +4 -2
- package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -1
- package/dist/resource/shader/Tr2MaterialRes.js +5 -3
- package/dist/resource/shader/Tr2MaterialRes.js.map +1 -1
- package/dist/resource/shader/Tr2Shader.js +26 -21
- package/dist/resource/shader/Tr2Shader.js.map +1 -1
- package/dist/resource/shader/Tr2ShaderPermutation.js +8 -6
- package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectDefine.js +5 -3
- package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectDescription.js +5 -3
- package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js +17 -15
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +11 -9
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectResource.js +8 -6
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js +15 -13
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js +7 -5
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2Pass.js +11 -9
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js +8 -6
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
- package/dist/resource/texture/CjsTextureArrayRes.js +400 -411
- package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
- package/dist/resource/texture/Tr2ImageRes.js +99 -95
- package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
- package/dist/resource/texture/TriTextureRes.js +312 -273
- package/dist/resource/texture/TriTextureRes.js.map +1 -1
- package/docs/README.md +13 -1
- package/docs/architecture.md +3 -3
- package/docs/concepts/resource-lifecycle.md +9 -2
- package/docs/concepts/shader-resource-model.md +114 -0
- package/docs/concepts/writing-an-engine-adapter.md +115 -0
- package/docs/formats/README.md +24 -1
- package/docs/formats/carbon-effect-container.md +452 -0
- package/docs/formats/dxbc/reference/classes/README.md +5 -72
- package/docs/formats/hlsl/reference/api.md +5 -4
- package/docs/formats/hlsl/reference/classes/README.md +6 -11
- package/docs/formats/provenance.md +23 -13
- package/docs/formats/webgl/reference/classes/README.md +5 -92
- package/docs/formats/webgpu/README.md +19 -16
- package/docs/formats/webgpu/architecture.md +15 -12
- package/docs/formats/webgpu/formats/cewgpu.md +175 -438
- package/docs/formats/webgpu/guides/effect-packaging.md +132 -140
- package/docs/formats/webgpu/reference/api.md +131 -131
- package/docs/formats/webgpu/reference/classes/README.md +5 -62
- package/docs/formats/webgpu/reference/wgsl-compatibility.md +146 -45
- package/docs/formats/wwise.md +34 -8
- package/docs/reference/classes/core.md +80 -0
- package/docs/reference/classes/formats.md +18 -28
- package/docs/reference/events.md +25 -0
- package/docs/reference/motherlode-cache.md +22 -8
- package/docs/reference/workers.md +5 -5
- package/docs/roadmap.md +61 -41
- package/package.json +2 -1
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js +0 -415
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js +0 -100
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/binary.js +0 -93
- package/dist/formats/webgpu/core/cewgpu/binary.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/tags.js +0 -17
- package/dist/formats/webgpu/core/cewgpu/tags.js.map +0 -1
- package/dist/formats/webgpu/core/effectPackageValidation.js +0 -1078
- package/dist/formats/webgpu/core/effectPackageValidation.js.map +0 -1
- package/docs/formats/hlsl/reference/classes/carbon-compatibility.md +0 -66
- package/docs/formats/hlsl/reference/classes/public-api.md +0 -26
- package/docs/formats/hlsl/reference/classes/tr2-effect-model.md +0 -150
|
@@ -3,30 +3,18 @@
|
|
|
3
3
|
Status: Evolving
|
|
4
4
|
Scope: `@carbonenginejs/runtime-resource/formats/webgpu`
|
|
5
5
|
Audience: Shader-tool authors and engine integrators
|
|
6
|
-
Summary: Shows how to
|
|
6
|
+
Summary: Shows how to translate version-15 compiled effects into Carbon-record CEWGPU bytes.
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
9
|
|
|
10
|
-
Use `buildEffect` when
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
assembly, and structural qualification.
|
|
10
|
+
Use `buildEffect` when a caller already has version-15 compiled-effect bytes
|
|
11
|
+
and needs a WebGPU-targeted effect container. The operation parses the complete
|
|
12
|
+
input, resolves a permutation, lowers supported DXBC, allocates pass-global
|
|
13
|
+
bindings, emits WGSL, writes a Carbon v15 container, and validates the result.
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
The method is byte-oriented and does not open files or resource paths.
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
- An exact technique, pass index, and complete stage list when deterministic
|
|
20
|
-
selection matters.
|
|
21
|
-
- Permutation assertions for every axis whose value must not depend on effect
|
|
22
|
-
defaults.
|
|
23
|
-
- A complete, internally consistent source permutation header: every ordered
|
|
24
|
-
axis must have valid names/options/defaults, and every Cartesian permutation
|
|
25
|
-
must have one correctly indexed, in-bounds body record. PGRF construction
|
|
26
|
-
validates the whole header even though only one body is translated. The
|
|
27
|
-
synchronous builder accepts at most 65,536 Cartesian permutations.
|
|
28
|
-
|
|
29
|
-
## Build one pass
|
|
17
|
+
## Build selected passes
|
|
30
18
|
|
|
31
19
|
```js
|
|
32
20
|
import { CjsWebgpuFormat } from "@carbonenginejs/runtime-resource/formats/webgpu";
|
|
@@ -48,119 +36,111 @@ const packageBytes = result.bytes;
|
|
|
48
36
|
const emittedShaders = result.wgsl;
|
|
49
37
|
```
|
|
50
38
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
##
|
|
80
|
-
|
|
81
|
-
|
|
39
|
+
`source` is a caller-owned diagnostic label. An optional `sourceIdentity`
|
|
40
|
+
records build provenance in the returned result; it does not change the wire
|
|
41
|
+
identity, which belongs to the resource path used to load the emitted bytes.
|
|
42
|
+
When `sourceIdentity.sha256` is supplied, the build checks it against the exact
|
|
43
|
+
input bytes.
|
|
44
|
+
|
|
45
|
+
## What the bytes contain
|
|
46
|
+
|
|
47
|
+
The emitted bytes are a stock Carbon v15 effect container:
|
|
48
|
+
|
|
49
|
+
- every source permutation remains in the dense offset table;
|
|
50
|
+
- each distinct emitted description body is stored once, based on exact emitted
|
|
51
|
+
bytes rather than the source alias partition;
|
|
52
|
+
- representable non-program description/reflection fields remain in the Carbon
|
|
53
|
+
tree; non-dynamic sampler names are unrecoverable and stage order is
|
|
54
|
+
canonicalized;
|
|
55
|
+
- translated stage program slots contain UTF-8 WGSL;
|
|
56
|
+
- untranslated or unsupported stage program slots have zero length; and
|
|
57
|
+
- translated passes may carry a WebGPU backend block with bind-group layouts
|
|
58
|
+
and resource transforms.
|
|
59
|
+
|
|
60
|
+
Source-stage DXBC and the original source hash are not stored in CEWGPU bytes.
|
|
61
|
+
Full portable source reflection remains available only in the in-memory
|
|
62
|
+
`BuildEffect` result.
|
|
63
|
+
|
|
64
|
+
There are no stored `INFO`, `META`, `PGRF`, `RFLX`, `ANLS`, `WGSL`, or `WGSB`
|
|
65
|
+
chunks. The read API derives compatible JSON views from the Carbon records.
|
|
66
|
+
|
|
67
|
+
## Translation modes
|
|
68
|
+
|
|
69
|
+
### Selected
|
|
70
|
+
|
|
71
|
+
`mode: "selected"` is the default. It translates the resolved body's requested
|
|
72
|
+
complete passes. Every permutation row and representable non-program
|
|
73
|
+
description fields remain in the container, but untranslated program slots are
|
|
74
|
+
empty.
|
|
75
|
+
|
|
76
|
+
Selected mode does not discard permutations. It narrows backend translation.
|
|
77
|
+
|
|
78
|
+
### All
|
|
79
|
+
|
|
80
|
+
`mode: "all"` first lowers the resolved selection; an unsupported resolved body
|
|
81
|
+
aborts the build. Once that precondition succeeds, later bodies that lower
|
|
82
|
+
successfully carry WGSL and backend blocks. A later body outside the compiler's
|
|
83
|
+
current boundary remains present with non-program description fields and empty
|
|
84
|
+
program slots. The in-memory body-set view records its reason; a reread can
|
|
85
|
+
report only that it carries no translated programs.
|
|
86
|
+
|
|
87
|
+
Passes, rather than individual stages, are the translation unit because a pass
|
|
88
|
+
owns one binding plan and resource-transform plan.
|
|
89
|
+
|
|
90
|
+
The compatibility option `allPermutations: true` selects all mode.
|
|
91
|
+
`allPermutations: false` selects the requested `mode` or the selected default.
|
|
92
|
+
|
|
93
|
+
## Build result
|
|
94
|
+
|
|
95
|
+
The returned record contains build-time evidence in addition to `bytes`:
|
|
82
96
|
|
|
83
97
|
| Field | Purpose |
|
|
84
98
|
| --- | --- |
|
|
85
|
-
| `bytes` |
|
|
86
|
-
| `info` |
|
|
87
|
-
| `metadata` |
|
|
88
|
-
| `permutationGraph` | Complete source permutation
|
|
89
|
-
| `reflection` | Complete
|
|
90
|
-
| `reflectionBlobs` | Exact
|
|
91
|
-
| `analysis` |
|
|
92
|
-
| `wgsl` |
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
`
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
index. Engines still own prepared pipelines and GPU realization.
|
|
107
|
-
|
|
108
|
-
`mode: "all"` additionally packages translated programs, layouts, and resource
|
|
109
|
-
transforms for every unique body in a `WGSB` chunk, and
|
|
110
|
-
`GetBackendBodyPrograms(permutationIndex)` resolves any permutation to them.
|
|
111
|
-
Because one pass of one body is the translation unit, bodies whose pass is
|
|
112
|
-
byte-identical share a single stored unit rather than duplicating its WGSL.
|
|
113
|
-
Bodies the compiler cannot lower stay in the package as explicitly unsupported
|
|
114
|
-
records with a reason, and never remove that body's source reflection.
|
|
115
|
-
|
|
116
|
-
JSON `Read` output exposes `reflection` with byte references and
|
|
117
|
-
`reflectionBlobByteLength`. Consumers that need exact defaults or source
|
|
118
|
-
program bytes use `Read(bytes, { emit: "raw" })`, then call
|
|
119
|
-
`GetPortableEffectReflection(permutationIndex)`. Omit the index to use
|
|
120
|
-
`META.bodyIndex`. For individual payload access,
|
|
121
|
-
`GetReflectionBlob(referenceOrKey)` returns an owned `Uint8Array`; an object
|
|
122
|
-
reference must exactly match its RFLX inventory entry.
|
|
123
|
-
|
|
124
|
-
Raw stage bytecode, decoded DXBC instruction trees, and compiler IR are
|
|
125
|
-
transient build inputs and are not embedded in `ANLS`. Use `AnalyzeEffect`
|
|
126
|
-
when return-only DXBC/IR diagnostics are required.
|
|
127
|
-
|
|
128
|
-
The qualification record distinguishes structural package validity from
|
|
129
|
-
broader completeness. `packageValid` means only that the selected CEWGPU
|
|
130
|
-
container passed required-chunk, schema, cross-document, key, layout, and
|
|
131
|
-
selection reconciliation. Version-15 INFO v3 reports `sourceComplete: true`
|
|
132
|
-
because PGRF plus RFLX/RBLB cover every unique body's portable reflection and
|
|
133
|
-
immutable exact defaults for that exact input file. This does not embed raw
|
|
134
|
-
body records or make CEWGPU an archive of the original `.sm_*` bytes.
|
|
135
|
-
`backendComplete` would additionally require every required translated
|
|
136
|
-
program, layout, and transform. `runtimeComplete` would require
|
|
137
|
-
complete-resource hydration and selection. None of these fields is
|
|
138
|
-
prepared-pipeline or rendered evidence. The same four booleans are retained
|
|
139
|
-
under `INFO.completeness` in the package.
|
|
140
|
-
|
|
141
|
-
Shader-tier and permutation evidence remain orthogonal to source reflection.
|
|
142
|
-
High is `.sm_depth`; Medium is `.sm_hi`; Low is `.sm_lo`. Source completeness
|
|
143
|
-
applies only to the exact input tier. For unpacked Quad ship gates, explicitly
|
|
144
|
-
select `SPACE_OBJECT_PPT_ENABLED=SOPPT_ENABLED`: an all-unique RFLX does not
|
|
145
|
-
turn a PPT-disabled selected WGSL body into PPT-on backend evidence.
|
|
146
|
-
|
|
147
|
-
When exact semantic metadata and shader use prove an allowed physical resource
|
|
148
|
-
coalescing, the returned WGSL document is a `CJS_WGSL_SET` version 3 record.
|
|
149
|
-
Its `resourceTransforms` recipes are required runtime work, not optional
|
|
150
|
-
diagnostics: the consumer must build the described resource and bind it through
|
|
151
|
-
the matching transformed layout entry. See the package-format contract before
|
|
152
|
-
passing version 3 output to an engine. Packages without transforms remain WGSL
|
|
153
|
-
set version 2.
|
|
99
|
+
| `bytes` | Carbon v15 CEWGPU bytes. |
|
|
100
|
+
| `info` | Producer, source, translation-scope, and completeness evidence. |
|
|
101
|
+
| `metadata` | Resolved selection and caller provenance. |
|
|
102
|
+
| `permutationGraph` | Complete source permutation and body-alias view. |
|
|
103
|
+
| `reflection` | Complete portable source reflection used while building. |
|
|
104
|
+
| `reflectionBlobs` | Exact portable-reflection payload bytes. |
|
|
105
|
+
| `analysis` | Selected-body diagnostic analysis. |
|
|
106
|
+
| `wgsl` | Emitted shaders, layouts, and transforms. |
|
|
107
|
+
| `backendBodySet` | All-body translation result, or `null` in selected mode. |
|
|
108
|
+
| `inspection` | Summary obtained by rereading the emitted bytes. |
|
|
109
|
+
| `qualification` | Structural build outcome and translation counts. |
|
|
110
|
+
|
|
111
|
+
These fields are returned data. They are not separate documents stored beside
|
|
112
|
+
the Carbon records.
|
|
113
|
+
|
|
114
|
+
`qualification.packageValid` means the emitted container passed structural
|
|
115
|
+
validation. It is not prepared-pipeline or rendered evidence.
|
|
116
|
+
`backendComplete` and `runtimeComplete` remain false until the broader compiler,
|
|
117
|
+
resource-hydration, selection, and execution gates are satisfied.
|
|
118
|
+
|
|
119
|
+
## Read the result
|
|
154
120
|
|
|
155
|
-
|
|
121
|
+
```js
|
|
122
|
+
const summary = CjsWebgpuFormat.inspect(packageBytes, {
|
|
123
|
+
source: "res:/graphics/effect.webgpu/example.sm_hi"
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const data = CjsWebgpuFormat.read(packageBytes, {
|
|
127
|
+
source: "res:/graphics/effect.webgpu/example.sm_hi"
|
|
128
|
+
});
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The JSON read derives `info`, `metadata`, `permutationGraph`, `analysis`,
|
|
132
|
+
`wgsl`, and `backendBodySet` views from the one record tree. It also exposes
|
|
133
|
+
convenience `stages`, `shaders`, and `layouts` arrays.
|
|
156
134
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
135
|
+
Raw reads return the internal container reader. That surface is useful for
|
|
136
|
+
current package integration but is not a second artifact and should not be
|
|
137
|
+
persisted as a replacement wire format.
|
|
138
|
+
|
|
139
|
+
## Binding scope
|
|
161
140
|
|
|
162
|
-
|
|
163
|
-
|
|
141
|
+
A D3D resource tuple is stage-local unless authoritative metadata proves that
|
|
142
|
+
the vertex and fragment declarations name one compatible resource. Build one
|
|
143
|
+
binding plan from the complete stage set.
|
|
164
144
|
|
|
165
145
|
```js
|
|
166
146
|
const plan = CjsWebgpuFormat.buildWgslBindingPlan(
|
|
@@ -169,31 +149,43 @@ const plan = CjsWebgpuFormat.buildWgslBindingPlan(
|
|
|
169
149
|
);
|
|
170
150
|
```
|
|
171
151
|
|
|
172
|
-
Unshared identities receive
|
|
173
|
-
numeric
|
|
152
|
+
Unshared identities receive separate `@vertex` or `@fragment`
|
|
153
|
+
`scopeIdentity` values and numeric slots. Shared identities retain one bare
|
|
154
|
+
scope with combined visibility.
|
|
155
|
+
|
|
156
|
+
## Resource transforms
|
|
157
|
+
|
|
158
|
+
When semantic metadata proves that several logical textures may be represented
|
|
159
|
+
by one physical array texture, the derived WGSL set uses version 3 and carries
|
|
160
|
+
a `texture-2d-array` transform recipe.
|
|
161
|
+
|
|
162
|
+
The consumer must assemble the named layers, match size/mips/sample
|
|
163
|
+
type/format, and bind the resulting array through the transformed layout.
|
|
164
|
+
Missing layers fail closed. A version-3 document is not executable evidence by
|
|
165
|
+
itself.
|
|
174
166
|
|
|
175
167
|
## Errors
|
|
176
168
|
|
|
177
169
|
Conversion fails explicitly when:
|
|
178
170
|
|
|
171
|
+
- the source is not a version-15 compiled effect;
|
|
179
172
|
- a permutation assertion is unknown or unresolved;
|
|
180
|
-
-
|
|
181
|
-
permutation header is malformed, out of bounds, partially overlapping, or
|
|
182
|
-
inconsistent, even when the selected body itself is translatable;
|
|
183
|
-
- the Cartesian permutation product exceeds the 65,536-entry synchronous-build
|
|
184
|
-
limit;
|
|
173
|
+
- the permutation table is sparse, misordered, out of bounds, or malformed;
|
|
185
174
|
- the technique, pass, or requested stage does not exist;
|
|
186
|
-
- the requested stage list is
|
|
175
|
+
- the requested stage list is duplicated or incomplete;
|
|
187
176
|
- the selected shader uses unsupported semantics;
|
|
188
|
-
- resource declarations cannot form one unambiguous pass layout;
|
|
189
|
-
-
|
|
177
|
+
- resource declarations cannot form one unambiguous pass layout;
|
|
178
|
+
- a lowerer emits an entry point other than `main`; or
|
|
179
|
+
- the emitted Carbon records or backend block fail structural validation.
|
|
190
180
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
181
|
+
Unsupported selected programs abort selected-mode packaging and also abort the
|
|
182
|
+
initial selection gate in all mode. After that gate succeeds, an unsupported
|
|
183
|
+
later body remains represented with empty program slots and an explicit
|
|
184
|
+
in-memory derived status.
|
|
194
185
|
|
|
195
186
|
## Related documentation
|
|
196
187
|
|
|
188
|
+
- [CEWGPU effect container](../formats/cewgpu.md)
|
|
197
189
|
- [Public API reference](../reference/api.md)
|
|
198
|
-
- [CEWGPU package format](../formats/cewgpu.md)
|
|
199
190
|
- [WGSL compatibility](../reference/wgsl-compatibility.md)
|
|
191
|
+
- [Carbon compiled-effect container](../../carbon-effect-container.md)
|