@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,11 +3,9 @@
|
|
|
3
3
|
Status: Evolving
|
|
4
4
|
Scope: `@carbonenginejs/runtime-resource/formats/webgpu`
|
|
5
5
|
Audience: Shader-tool authors and engine integrators
|
|
6
|
-
Summary: Lists the public
|
|
6
|
+
Summary: Lists the public WebGPU format profile, byte-oriented helpers, options, and output contracts.
|
|
7
7
|
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
The package root exports `CjsWebgpuFormat` as both a named and default export:
|
|
8
|
+
## Import
|
|
11
9
|
|
|
12
10
|
```js
|
|
13
11
|
import CjsWebgpuFormat, {
|
|
@@ -15,15 +13,19 @@ import CjsWebgpuFormat, {
|
|
|
15
13
|
} from "@carbonenginejs/runtime-resource/formats/webgpu";
|
|
16
14
|
```
|
|
17
15
|
|
|
16
|
+
The default and named exports refer to the same class.
|
|
17
|
+
|
|
18
18
|
## Reusable profile
|
|
19
19
|
|
|
20
|
-
Construct a profile when several operations share output, source,
|
|
21
|
-
|
|
20
|
+
Construct a profile when several operations share output, source, schema, or
|
|
21
|
+
class-registration options. `permutation` is also reusable by `AnalyzeEffect`
|
|
22
|
+
and `BuildEffect`; current `Read` and `Inspect` derive the translated body or
|
|
23
|
+
Carbon defaults and do not consume that profile field:
|
|
22
24
|
|
|
23
25
|
```js
|
|
24
26
|
const reader = new WebgpuFormat({
|
|
25
27
|
emit: "json",
|
|
26
|
-
source: "example.
|
|
28
|
+
source: "res:/graphics/effect.webgpu/example.sm_hi",
|
|
27
29
|
decodeInstructions: true,
|
|
28
30
|
permutation: null
|
|
29
31
|
});
|
|
@@ -32,166 +34,164 @@ const reader = new WebgpuFormat({
|
|
|
32
34
|
| Instance method | Purpose |
|
|
33
35
|
| --- | --- |
|
|
34
36
|
| `SetValues(options)` | Merges reusable profile defaults. |
|
|
35
|
-
| `GetValues(options?)` | Returns effective values with optional
|
|
37
|
+
| `GetValues(options?)` | Returns effective values with optional overrides. |
|
|
36
38
|
| `SetClasses(classes)` | Registers several package-shape constructors. |
|
|
37
39
|
| `SetClass(type, Class)` | Registers or removes one constructor. |
|
|
38
40
|
| `GetClass(type)` | Returns one registered constructor. |
|
|
39
41
|
| `HasClass(type)` | Reports whether a constructor is registered. |
|
|
40
|
-
| `Read(bytes, options?)` | Reads CEWGPU bytes
|
|
41
|
-
| `Inspect(bytes, options?)` | Returns a
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `BuildWgslBindingPlan(programs, options?)` | Allocates one binding layout across a complete pass. |
|
|
42
|
+
| `Read(bytes, options?)` | Reads Carbon-record CEWGPU bytes. |
|
|
43
|
+
| `Inspect(bytes, options?)` | Returns a compact container summary. |
|
|
44
|
+
| `AnalyzeEffect(bytes, options?)` | Analyzes compiled-effect bytes without packaging. |
|
|
45
|
+
| `BuildEffect(bytes, options?)` | Translates a version-15 effect to CEWGPU bytes. |
|
|
46
|
+
| `BuildShaderIr(input, options?)` | Builds validated shader IR from DXBC or decoded input. |
|
|
47
|
+
| `BuildWgsl(input, options?)` | Emits supported shader IR as WGSL. |
|
|
48
|
+
| `BuildWgslBindingPlan(programs, options?)` | Allocates one binding layout across a pass. |
|
|
48
49
|
| `BuildWgslSet(entries)` | Assembles emitted shaders and pass layouts. |
|
|
49
50
|
| `ToJSON(value)` | Converts format output to JSON-compatible data. |
|
|
50
51
|
|
|
51
|
-
`
|
|
52
|
-
|
|
53
|
-
Raw output is an internal zero-copy package view; callers must treat its chunk
|
|
54
|
-
bytes as immutable and reread/rebuild after any byte change.
|
|
52
|
+
There is no `Build(chunks)` method. The current wire is a Carbon record tree,
|
|
53
|
+
not a generic chunk container.
|
|
55
54
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
The static helpers use lower camel case and share the implementation of the
|
|
59
|
-
instance methods:
|
|
55
|
+
## Static helpers
|
|
60
56
|
|
|
61
57
|
| Static helper | Purpose |
|
|
62
58
|
| --- | --- |
|
|
63
|
-
| `isCewgpu(bytes)` |
|
|
64
|
-
| `read(bytes, options?)` | Reads one
|
|
65
|
-
| `inspect(bytes, options?)` | Inspects one
|
|
66
|
-
| `build(chunks)` | Builds one package. |
|
|
59
|
+
| `isCewgpu(bytes)` | Reports whether bytes have the Carbon-v15 shape. |
|
|
60
|
+
| `read(bytes, options?)` | Reads one container. |
|
|
61
|
+
| `inspect(bytes, options?)` | Inspects one container. |
|
|
67
62
|
| `analyzeEffect(bytes, options?)` | Analyzes one compiled effect. |
|
|
68
|
-
| `buildEffect(bytes, options?)` | Builds
|
|
63
|
+
| `buildEffect(bytes, options?)` | Builds CEWGPU bytes from a version-15 effect. |
|
|
69
64
|
| `buildShaderIr(input, options?)` | Builds shader IR. |
|
|
70
65
|
| `buildWgsl(input, options?)` | Emits WGSL. |
|
|
71
66
|
| `buildWgslBindingPlan(programs, options?)` | Allocates a pass binding plan. |
|
|
72
|
-
| `buildWgslSet(entries)` | Builds a portable
|
|
67
|
+
| `buildWgslSet(entries)` | Builds a portable WGSL set. |
|
|
73
68
|
| `toJSON(value)` | Converts output to JSON-compatible data. |
|
|
74
69
|
|
|
70
|
+
`isCewgpu` checks the first dword for Carbon version 15. CEWGPU has no private
|
|
71
|
+
magic or payload tag, so this is a shape check rather than backend identity.
|
|
72
|
+
Callers establish identity through the resource path that supplied the bytes.
|
|
73
|
+
|
|
75
74
|
## Profile options
|
|
76
75
|
|
|
77
76
|
| Option | Meaning |
|
|
78
77
|
| --- | --- |
|
|
79
|
-
| `emit` | `"json"` by default or `"raw"` for the internal
|
|
78
|
+
| `emit` | `"json"` by default or `"raw"` for the internal container reader. |
|
|
80
79
|
| `source` | Caller-owned diagnostic label; it is never opened. |
|
|
81
|
-
| `decodeInstructions` | Includes decoded instruction and
|
|
82
|
-
| `permutation` | Exact NAME=VALUE assertions
|
|
80
|
+
| `decodeInstructions` | Includes decoded instruction and IR detail during analysis. |
|
|
81
|
+
| `permutation` | Exact `NAME=VALUE` assertions for `AnalyzeEffect` and `BuildEffect`; ignored by current `Read` and `Inspect`. |
|
|
83
82
|
| `schema` | Optional caller schema record retained by the profile. |
|
|
84
83
|
| `classes` | Optional constructor registrations keyed by `CLASS_KEYS`. |
|
|
85
84
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
Class registrations are validated and stored for forward compatibility.
|
|
86
|
+
Current JSON reads return plain data rather than hydrated package classes.
|
|
87
|
+
|
|
88
|
+
Raw output is an internal reader over the same bytes. It is not a second wire
|
|
89
|
+
format and should not be persisted.
|
|
90
|
+
|
|
91
|
+
## Read result
|
|
92
|
+
|
|
93
|
+
JSON `Read` returns:
|
|
94
|
+
|
|
95
|
+
- `format`, Carbon `version`, and `sourcePath`;
|
|
96
|
+
- derived `info` and `metadata`;
|
|
97
|
+
- the complete derived `permutationGraph`;
|
|
98
|
+
- derived `analysis`, `wgsl`, and `backendBodySet`;
|
|
99
|
+
- convenience `stages`, `shaders`, and `layouts` arrays.
|
|
100
|
+
|
|
101
|
+
These records are computed from the Carbon header, descriptions, WGSL program
|
|
102
|
+
slots, and backend blocks. They are not stored chunks. The old `chunks` field
|
|
103
|
+
is intentionally absent.
|
|
104
|
+
|
|
105
|
+
`Inspect` reports the source label, Carbon version, compiler-version bytes,
|
|
106
|
+
permutation count, distinct-body count, and resolved stage/shader/layout
|
|
107
|
+
counts.
|
|
108
|
+
|
|
109
|
+
## Effect analysis
|
|
110
|
+
|
|
111
|
+
`AnalyzeEffect` accepts supported compiled-effect versions for diagnostic
|
|
112
|
+
analysis. It resolves exact permutation assertions and may include decoded
|
|
113
|
+
DXBC instructions and compiler IR.
|
|
114
|
+
|
|
115
|
+
`BuildEffect` is narrower: current packaging requires the version-15 record
|
|
116
|
+
layout. The wire retains every permutation row and non-program description
|
|
117
|
+
field that the mapping can represent; non-dynamic sampler names are
|
|
118
|
+
unrecoverable and stage order is canonicalized. Source-stage DXBC and the
|
|
119
|
+
caller's source hash are not retained in the wire. The build result retains
|
|
120
|
+
full portable source reflection, including source program bytes. Compiler IR
|
|
121
|
+
is transient and is neither stored in the wire nor returned by `BuildEffect`.
|
|
122
|
+
|
|
123
|
+
Unknown, duplicate, or unresolved permutation assertions fail closed.
|
|
92
124
|
|
|
93
125
|
## Effect-package options
|
|
94
126
|
|
|
95
|
-
`
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
`mode: "all"`
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
`
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
`
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
`
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
`CewgpuPackage.reflection`, `reflectionBlobBytes`, and
|
|
144
|
-
`GetReflectionBlob(referenceOrKey)`. Raw reads also expose
|
|
145
|
-
`GetPortableEffectReflection(permutationIndex)`: it performs the PGRF/RFLX
|
|
146
|
-
join, expands every referenced payload to fresh owned `Uint8Array` values, and
|
|
147
|
-
reruns the format-hlsl portable validator. Its optional index defaults to
|
|
148
|
-
`META.bodyIndex`; legacy selected-body RFLX v1 accepts only its selected
|
|
149
|
-
permutation. `GetReflectionBlob` remains the lower-level accessor and requires
|
|
150
|
-
an object reference to match its stored key, offset, byte length, and digest
|
|
151
|
-
exactly. `Inspect` reports reflection body/source-program/blob counts and blob
|
|
152
|
-
byte length. The body count covers every PGRF unique body. The selector joins
|
|
153
|
-
`META.bodyIndex -> PGRF.variants[index].bodyKey -> RFLX.bodies[].bodyKey`.
|
|
154
|
-
Earlier source versions omit both chunks.
|
|
155
|
-
|
|
156
|
-
The returned structural qualification separates preservation from execution.
|
|
157
|
-
`packageValid` reports successful container construction. Version-15 INFO v3
|
|
158
|
-
reports `sourceComplete: true` for the exact input's portable semantic graph
|
|
159
|
-
while `backendComplete` and `runtimeComplete` remain false. Versions 8-14
|
|
160
|
-
report all three completeness flags false. Source completeness does not embed
|
|
161
|
-
raw body records, translate every body, construct a live `Tr2EffectRes`, or
|
|
162
|
-
prove prepared pipelines/rendering. `GetPortableEffectReflection` reconstructs
|
|
163
|
-
and validates fresh owned plain portable data; `runtime-resource`
|
|
164
|
-
`Tr2EffectRes` performs canonical runtime-class hydration and selection. The
|
|
165
|
-
accessor does not construct renderer-owned handles, layouts, resource sets, or
|
|
166
|
-
stage programs.
|
|
127
|
+
`mode: "selected"` is the default. It translates the resolved body's
|
|
128
|
+
requested complete passes while keeping every permutation row and
|
|
129
|
+
representable non-program description fields in the container.
|
|
130
|
+
|
|
131
|
+
`mode: "all"` first lowers the resolved selection, so an unsupported resolved
|
|
132
|
+
body aborts the build. After that gate succeeds, unsupported later bodies
|
|
133
|
+
remain in the container with empty program slots and appear as unsupported in
|
|
134
|
+
the in-memory body-set view. `allPermutations: true` is a compatibility
|
|
135
|
+
spelling for all mode.
|
|
136
|
+
|
|
137
|
+
`selection` can name a technique, pass index, and complete stage list.
|
|
138
|
+
`bindingPolicy.sharedIdentities` may name compatible cross-stage resources
|
|
139
|
+
that are allowed to share one physical binding.
|
|
140
|
+
|
|
141
|
+
`source` remains a diagnostic label. `sourceIdentity` and `outputPath` are
|
|
142
|
+
returned build provenance; the wire's backend identity still comes from the
|
|
143
|
+
consumer's resource path.
|
|
144
|
+
|
|
145
|
+
## Build result and qualification
|
|
146
|
+
|
|
147
|
+
`BuildEffect` returns:
|
|
148
|
+
|
|
149
|
+
- `bytes`;
|
|
150
|
+
- build-time `info` and `metadata`;
|
|
151
|
+
- `permutationGraph`, portable `reflection`, and `reflectionBlobs`;
|
|
152
|
+
- selected `analysis` and `wgsl`;
|
|
153
|
+
- `backendBodySet` for all mode;
|
|
154
|
+
- an `inspection` obtained by rereading the emitted bytes; and
|
|
155
|
+
- `qualification`.
|
|
156
|
+
|
|
157
|
+
The richer fields are caller evidence and are not separately stored in the
|
|
158
|
+
container.
|
|
159
|
+
|
|
160
|
+
`qualification.packageValid` reports structural construction. It does not
|
|
161
|
+
claim that every body translated, that a pipeline was prepared, or that a
|
|
162
|
+
draw succeeded. `backendComplete` and `runtimeComplete` retain those broader
|
|
163
|
+
boundaries.
|
|
164
|
+
|
|
165
|
+
## Binding-plan and WGSL-set helpers
|
|
166
|
+
|
|
167
|
+
`BuildWgslBindingPlan` takes the complete program set for one pass.
|
|
168
|
+
Unshared D3D tuples receive stage-qualified `scopeIdentity` values. A tuple is
|
|
169
|
+
shared only when its base identity appears in `sharedIdentities` and the
|
|
170
|
+
declarations are compatible.
|
|
171
|
+
|
|
172
|
+
`BuildWgslSet` validates shader keys, layouts, numeric slots, and resource
|
|
173
|
+
transforms. Ordinary sets use version 2. A proven physical-resource
|
|
174
|
+
coalescing uses version 3 and carries an explicit transform recipe.
|
|
167
175
|
|
|
168
176
|
## Static metadata
|
|
169
177
|
|
|
170
|
-
The class exposes
|
|
171
|
-
|
|
172
|
-
and
|
|
178
|
+
The class exposes `OUTPUT_JSON`, `OUTPUT_RAW`, `CLASS_KEYS`, `type`,
|
|
179
|
+
`mediaTypes`, `inputTypes`, `outputTypes`, `debugOutputTypes`,
|
|
180
|
+
`implementationStatus`, `format`, `analysisFormat`, and `packageVersion`.
|
|
173
181
|
|
|
174
182
|
## Errors
|
|
175
183
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
PGRF pointers, exact INFO-v3 chunk digests, schemas, counts, variant tuples,
|
|
184
|
-
body references, and the selected index/options are reconciled as part of the
|
|
185
|
-
same gate. Optional
|
|
186
|
-
INFO/RFLX/RBLB reflection units additionally reconcile the exact RFLX digest,
|
|
187
|
-
every PGRF body and representative, portable closed schemas, exact blob
|
|
188
|
-
references/digests, and the selected body's ANLS pass/stage source identities.
|
|
189
|
-
Strict effect validation is activated by the `INFO.packageKind` marker;
|
|
190
|
-
effect-only consumers must require that marker because unmarked CEWGPU
|
|
191
|
-
containers intentionally remain generic.
|
|
184
|
+
Reads fail closed on malformed Carbon records, sparse or misordered
|
|
185
|
+
permutation tables, out-of-range arena references, trailing record bytes, or a
|
|
186
|
+
program-bearing stage WebGPU cannot express.
|
|
187
|
+
|
|
188
|
+
Builds additionally fail on unsupported source versions, invalid selection,
|
|
189
|
+
unsupported compiler semantics, ambiguous binding plans, non-`main` entry
|
|
190
|
+
points, and malformed backend blocks.
|
|
192
191
|
|
|
193
192
|
## Related documentation
|
|
194
193
|
|
|
195
194
|
- [Effect packaging guide](../guides/effect-packaging.md)
|
|
196
|
-
- [CEWGPU
|
|
195
|
+
- [CEWGPU effect container](../formats/cewgpu.md)
|
|
196
|
+
- [WGSL compatibility](wgsl-compatibility.md)
|
|
197
197
|
- [Class-purpose catalog](classes/README.md)
|
|
@@ -1,66 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# WebGPU class catalog
|
|
2
2
|
|
|
3
|
-
Status:
|
|
3
|
+
Status: Deprecated
|
|
4
4
|
Scope: `@carbonenginejs/runtime-resource/formats/webgpu` maintained classes
|
|
5
5
|
Audience: Users, maintainers, and automated readers
|
|
6
|
-
Summary:
|
|
6
|
+
Summary: Points to the canonical package-wide class catalog after format-package consolidation.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
CarbonEngineJS-facing format surface for `.cewgpu` WebGPU packages, plus an offline effect-analysis helper built on `format-hlsl` and `format-dxbc`.
|
|
12
|
-
|
|
13
|
-
- Export: `@carbonenginejs/runtime-resource/formats/webgpu`
|
|
14
|
-
- Source: `src/CjsWebgpuFormat.js`
|
|
15
|
-
- Visibility: Public
|
|
16
|
-
- Kind: CarbonEngineJS
|
|
17
|
-
|
|
18
|
-
<!-- class:CjsWebgpuReadError -->
|
|
19
|
-
## `CjsWebgpuReadError`
|
|
20
|
-
|
|
21
|
-
Error raised when a CEWGPU package or WebGPU analysis pass cannot be completed safely.
|
|
22
|
-
|
|
23
|
-
- Export: None
|
|
24
|
-
- Source: `src/core/errors.js`
|
|
25
|
-
- Visibility: Internal
|
|
26
|
-
- Kind: Internal implementation
|
|
27
|
-
|
|
28
|
-
<!-- class:CjsBinaryReader -->
|
|
29
|
-
## `CjsBinaryReader`
|
|
30
|
-
|
|
31
|
-
Minimal little-endian binary reader for the flat CEWGPU chunk container.
|
|
32
|
-
|
|
33
|
-
- Export: None
|
|
34
|
-
- Source: `src/core/cewgpu/binary.js`
|
|
35
|
-
- Visibility: Internal
|
|
36
|
-
- Kind: Internal implementation
|
|
37
|
-
|
|
38
|
-
<!-- class:CewgpuPackage -->
|
|
39
|
-
## `CewgpuPackage`
|
|
40
|
-
|
|
41
|
-
Reader for CarbonEngineJS CEWGPU shader packages.
|
|
42
|
-
|
|
43
|
-
- Export: None
|
|
44
|
-
- Source: `src/core/cewgpu/CewgpuPackage.js`
|
|
45
|
-
- Visibility: Internal
|
|
46
|
-
- Kind: Internal implementation
|
|
47
|
-
|
|
48
|
-
<!-- class:CewgpuPackageBuilder -->
|
|
49
|
-
## `CewgpuPackageBuilder`
|
|
50
|
-
|
|
51
|
-
Builds CarbonEngineJS CEWGPU package bytes.
|
|
52
|
-
|
|
53
|
-
- Export: None
|
|
54
|
-
- Source: `src/core/cewgpu/CewgpuPackageBuilder.js`
|
|
55
|
-
- Visibility: Internal
|
|
56
|
-
- Kind: Internal implementation
|
|
57
|
-
|
|
58
|
-
<!-- class:ReflectionBlobStore -->
|
|
59
|
-
## `ReflectionBlobStore`
|
|
60
|
-
|
|
61
|
-
Builds the deterministic deduplicated byte arena for complete source reflection.
|
|
62
|
-
|
|
63
|
-
- Export: None
|
|
64
|
-
- Source: `src/core/effectReflectionPackage.js`
|
|
65
|
-
- Visibility: Internal
|
|
66
|
-
- Kind: Internal implementation
|
|
8
|
+
The maintained WebGPU entries now live in the
|
|
9
|
+
[package-wide formats class catalog](../../../../reference/classes/formats.md#webgpu).
|