@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.
Files changed (170) hide show
  1. package/dist/CjsResMan.js +4 -4
  2. package/dist/CjsResMan.js.map +1 -1
  3. package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -4
  4. package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  5. package/dist/format/CjsByteReader.js +310 -0
  6. package/dist/format/CjsByteReader.js.map +1 -0
  7. package/dist/format/CjsByteWriter.js +242 -0
  8. package/dist/format/CjsByteWriter.js.map +1 -0
  9. package/dist/format/CjsFormatError.js +41 -0
  10. package/dist/format/CjsFormatError.js.map +1 -0
  11. package/dist/format/CjsStringTable.js +268 -0
  12. package/dist/format/CjsStringTable.js.map +1 -0
  13. package/dist/format/carbonEffect/CjsCarbonEffectReader.js +361 -0
  14. package/dist/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -0
  15. package/dist/format/carbonEffect/CjsCarbonEffectWriter.js +373 -0
  16. package/dist/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -0
  17. package/dist/format/carbonEffect/carbonDescriptionFromPortable.js +372 -0
  18. package/dist/format/carbonEffect/carbonDescriptionFromPortable.js.map +1 -0
  19. package/dist/format/carbonEffect/carbonEffectBackendBlock.js +427 -0
  20. package/dist/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -0
  21. package/dist/format/carbonEffect/carbonEffectRecords.js +955 -0
  22. package/dist/format/carbonEffect/carbonEffectRecords.js.map +1 -0
  23. package/dist/format/compareUtf8.js +36 -0
  24. package/dist/format/compareUtf8.js.map +1 -0
  25. package/dist/format/index.js +11 -0
  26. package/dist/format/index.js.map +1 -0
  27. package/dist/formats/bnk/CjsBnkFormat.js +10 -4
  28. package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
  29. package/dist/formats/bnk/core/eventAction.js +305 -0
  30. package/dist/formats/bnk/core/eventAction.js.map +1 -0
  31. package/dist/formats/bnk/core/helpers.js +11 -2
  32. package/dist/formats/bnk/core/helpers.js.map +1 -1
  33. package/dist/formats/bnk/core/nodeBase.js +532 -0
  34. package/dist/formats/bnk/core/nodeBase.js.map +1 -0
  35. package/dist/formats/bnk/core/sfxNodes.js +252 -152
  36. package/dist/formats/bnk/core/sfxNodes.js.map +1 -1
  37. package/dist/formats/hlsl/core/HlslReader.js +7 -257
  38. package/dist/formats/hlsl/core/HlslReader.js.map +1 -1
  39. package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js +781 -0
  40. package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -0
  41. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +21 -1
  42. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -1
  43. package/dist/formats/index.js +1 -1
  44. package/dist/formats/webgl/core/cewg/CewgPackage.js +2 -1
  45. package/dist/formats/webgl/core/cewg/CewgPackage.js.map +1 -1
  46. package/dist/formats/webgl/core/cewg/binary.js +11 -93
  47. package/dist/formats/webgl/core/cewg/binary.js.map +1 -1
  48. package/dist/formats/webgl/core/effectPackage.js +1 -1
  49. package/dist/formats/webgpu/CjsWebgpuFormat.js +4 -23
  50. package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  51. package/dist/formats/webgpu/core/buildCarbonEffectContainer.js +197 -0
  52. package/dist/formats/webgpu/core/buildCarbonEffectContainer.js.map +1 -0
  53. package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js +368 -0
  54. package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js.map +1 -0
  55. package/dist/formats/webgpu/core/cewgpu/containerViews.js +355 -0
  56. package/dist/formats/webgpu/core/cewgpu/containerViews.js.map +1 -0
  57. package/dist/formats/webgpu/core/cewgpu/validateContainer.js +90 -0
  58. package/dist/formats/webgpu/core/cewgpu/validateContainer.js.map +1 -0
  59. package/dist/formats/webgpu/core/effectBackendBodySet.js +21 -20
  60. package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -1
  61. package/dist/formats/webgpu/core/helpers.js +87 -92
  62. package/dist/formats/webgpu/core/helpers.js.map +1 -1
  63. package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +14 -13
  64. package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js.map +1 -1
  65. package/dist/formats/webgpu/core/ir/inferValueTypes.js +10 -8
  66. package/dist/formats/webgpu/core/ir/inferValueTypes.js.map +1 -1
  67. package/dist/formats/webgpu/core/packageEffect.js +94 -9
  68. package/dist/formats/webgpu/core/packageEffect.js.map +1 -1
  69. package/dist/formats/webgpu/core/packageMetadata.js +10 -1
  70. package/dist/formats/webgpu/core/packageMetadata.js.map +1 -1
  71. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +17 -15
  72. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -1
  73. package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +13 -12
  74. package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js.map +1 -1
  75. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +9 -8
  76. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
  77. package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +23 -22
  78. package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js.map +1 -1
  79. package/dist/formats/webgpu/core/wgsl/selectionPlans.js +46 -44
  80. package/dist/formats/webgpu/core/wgsl/selectionPlans.js.map +1 -1
  81. package/dist/resource/CjsResource.js +700 -684
  82. package/dist/resource/CjsResource.js.map +1 -1
  83. package/dist/resource/Tr2LightProfileRes.js +18 -27
  84. package/dist/resource/Tr2LightProfileRes.js.map +1 -1
  85. package/dist/resource/audio/CjsAudioBufferRes.js +2 -2
  86. package/dist/resource/audio/CjsAudioBufferRes.js.map +1 -1
  87. package/dist/resource/audio/CjsAudioRes.js +2 -2
  88. package/dist/resource/audio/CjsAudioRes.js.map +1 -1
  89. package/dist/resource/geometry/TriGeometryRes.js +605 -586
  90. package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
  91. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js +21 -30
  92. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -1
  93. package/dist/resource/geometry/granny/TriGrannyRes.js +21 -30
  94. package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -1
  95. package/dist/resource/shader/Tr2EffectRes.js +9 -7
  96. package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
  97. package/dist/resource/shader/Tr2MaterialArea.js +5 -3
  98. package/dist/resource/shader/Tr2MaterialArea.js.map +1 -1
  99. package/dist/resource/shader/Tr2MaterialMesh.js +4 -2
  100. package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -1
  101. package/dist/resource/shader/Tr2MaterialRes.js +5 -3
  102. package/dist/resource/shader/Tr2MaterialRes.js.map +1 -1
  103. package/dist/resource/shader/Tr2Shader.js +26 -21
  104. package/dist/resource/shader/Tr2Shader.js.map +1 -1
  105. package/dist/resource/shader/Tr2ShaderPermutation.js +8 -6
  106. package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -1
  107. package/dist/resource/shader/reflection/Tr2EffectDefine.js +5 -3
  108. package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -1
  109. package/dist/resource/shader/reflection/Tr2EffectDescription.js +5 -3
  110. package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
  111. package/dist/resource/shader/reflection/Tr2EffectLibrary.js +17 -15
  112. package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
  113. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +11 -9
  114. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
  115. package/dist/resource/shader/reflection/Tr2EffectResource.js +8 -6
  116. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
  117. package/dist/resource/shader/reflection/Tr2EffectStageInput.js +15 -13
  118. package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
  119. package/dist/resource/shader/reflection/Tr2EffectTechnique.js +7 -5
  120. package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
  121. package/dist/resource/shader/reflection/Tr2Pass.js +11 -9
  122. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
  123. package/dist/resource/shader/sampler/Tr2SamplerSetup.js +8 -6
  124. package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
  125. package/dist/resource/texture/CjsTextureArrayRes.js +400 -411
  126. package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
  127. package/dist/resource/texture/Tr2ImageRes.js +99 -95
  128. package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
  129. package/dist/resource/texture/TriTextureRes.js +312 -273
  130. package/dist/resource/texture/TriTextureRes.js.map +1 -1
  131. package/docs/README.md +13 -1
  132. package/docs/architecture.md +3 -3
  133. package/docs/concepts/resource-lifecycle.md +9 -2
  134. package/docs/concepts/shader-resource-model.md +114 -0
  135. package/docs/concepts/writing-an-engine-adapter.md +115 -0
  136. package/docs/formats/README.md +24 -1
  137. package/docs/formats/carbon-effect-container.md +452 -0
  138. package/docs/formats/dxbc/reference/classes/README.md +5 -72
  139. package/docs/formats/hlsl/reference/api.md +5 -4
  140. package/docs/formats/hlsl/reference/classes/README.md +6 -11
  141. package/docs/formats/provenance.md +23 -13
  142. package/docs/formats/webgl/reference/classes/README.md +5 -92
  143. package/docs/formats/webgpu/README.md +19 -16
  144. package/docs/formats/webgpu/architecture.md +15 -12
  145. package/docs/formats/webgpu/formats/cewgpu.md +175 -438
  146. package/docs/formats/webgpu/guides/effect-packaging.md +132 -140
  147. package/docs/formats/webgpu/reference/api.md +131 -131
  148. package/docs/formats/webgpu/reference/classes/README.md +5 -62
  149. package/docs/formats/webgpu/reference/wgsl-compatibility.md +146 -45
  150. package/docs/formats/wwise.md +34 -8
  151. package/docs/reference/classes/core.md +80 -0
  152. package/docs/reference/classes/formats.md +18 -28
  153. package/docs/reference/events.md +25 -0
  154. package/docs/reference/motherlode-cache.md +22 -8
  155. package/docs/reference/workers.md +5 -5
  156. package/docs/roadmap.md +61 -41
  157. package/package.json +2 -1
  158. package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js +0 -415
  159. package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js.map +0 -1
  160. package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js +0 -100
  161. package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js.map +0 -1
  162. package/dist/formats/webgpu/core/cewgpu/binary.js +0 -93
  163. package/dist/formats/webgpu/core/cewgpu/binary.js.map +0 -1
  164. package/dist/formats/webgpu/core/cewgpu/tags.js +0 -17
  165. package/dist/formats/webgpu/core/cewgpu/tags.js.map +0 -1
  166. package/dist/formats/webgpu/core/effectPackageValidation.js +0 -1078
  167. package/dist/formats/webgpu/core/effectPackageValidation.js.map +0 -1
  168. package/docs/formats/hlsl/reference/classes/carbon-compatibility.md +0 -66
  169. package/docs/formats/hlsl/reference/classes/public-api.md +0 -26
  170. package/docs/formats/hlsl/reference/classes/tr2-effect-model.md +0 -150
@@ -1,96 +1,9 @@
1
- # Class catalog
1
+ # WebGL class catalog
2
2
 
3
- Status: Evolving
3
+ Status: Deprecated
4
4
  Scope: `@carbonenginejs/runtime-resource/formats/webgl` maintained classes
5
5
  Audience: Users, maintainers, and automated readers
6
- Summary: Provides one-sentence purpose descriptors for every maintained class.
6
+ Summary: Points to the canonical package-wide class catalog after format-package consolidation.
7
7
 
8
- <!-- class:CjsWebglFormat -->
9
- ## `CjsWebglFormat`
10
-
11
- CarbonEngineJS-facing format surface for `.cewg` WebGL shader packages, and a DXBC -> GLSL ES 3.00 emitter for the WebGL2 vertex/pixel/map-style-compute stages ccpwgl targets.
12
-
13
- - Export: `@carbonenginejs/runtime-resource/formats/webgl`
14
- - Source: `src/CjsWebglFormat.js`
15
- - Visibility: Public
16
- - Kind: CarbonEngineJS
17
-
18
- <!-- class:CewgPackage -->
19
- ## `CewgPackage`
20
-
21
- Reader for CarbonEngineJS CEWG shader packages emitted by `hlsl2webgl`.
22
-
23
- - Export: None
24
- - Source: `src/core/cewg/CewgPackage.js`
25
- - Visibility: Internal
26
- - Kind: Internal implementation
27
-
28
- <!-- class:CewgPackageBuilder -->
29
- ## `CewgPackageBuilder`
30
-
31
- Builds CarbonEngineJS CEWG shader package bytes.
32
-
33
- - Export: None
34
- - Source: `src/core/cewg/CewgPackageBuilder.js`
35
- - Visibility: Internal
36
- - Kind: Internal implementation
37
-
38
- <!-- class:CjsBinaryReader -->
39
- ## `CjsBinaryReader`
40
-
41
- Minimal little-endian binary reader for the flat CEWG chunk container.
42
-
43
- - Export: None
44
- - Source: `src/core/cewg/binary.js`
45
- - Visibility: Internal
46
- - Kind: Internal implementation
47
-
48
- <!-- class:ReflectionBlobStore -->
49
- ## `ReflectionBlobStore`
50
-
51
- Builds a deterministic deduplicated byte arena for portable reflection.
52
-
53
- - Export: None
54
- - Source: `src/core/effectReflectionPackage.js`
55
- - Visibility: Internal
56
- - Kind: Internal implementation
57
-
58
- <!-- class:CjsWebglReadError -->
59
- ## `CjsWebglReadError`
60
-
61
- Error raised when a CEWG package or a DXBC-to-GLSL emission cannot be completed safely.
62
-
63
- - Export: None
64
- - Source: `src/core/errors.js`
65
- - Visibility: Internal
66
- - Kind: Internal implementation
67
-
68
- <!-- class:DxbcGlslEmitter -->
69
- ## `DxbcGlslEmitter`
70
-
71
- DXBC -> GLSL ES 3.00 emitter for vertex and pixel stages.
72
-
73
- - Export: None
74
- - Source: `src/core/glsl/DxbcGlslEmitter.js`
75
- - Visibility: Internal
76
- - Kind: Internal implementation
77
-
78
- <!-- class:DxbcGlslHelperRegistry -->
79
- ## `DxbcGlslHelperRegistry`
80
-
81
- Registry of GLSL helper functions the emitter can require per shader.
82
-
83
- - Export: None
84
- - Source: `src/core/glsl/DxbcGlslHelpers.js`
85
- - Visibility: Internal
86
- - Kind: Internal implementation
87
-
88
- <!-- class:DxbcGlslOperandFormatter -->
89
- ## `DxbcGlslOperandFormatter`
90
-
91
- Formats decoded DXBC operands as GLSL ES 3.00 expressions and assignments.
92
-
93
- - Export: None
94
- - Source: `src/core/glsl/DxbcGlslOperandFormatter.js`
95
- - Visibility: Internal
96
- - Kind: Internal implementation
8
+ The maintained WebGL entries now live in the
9
+ [package-wide formats class catalog](../../../../reference/classes/formats.md#webgl).
@@ -3,32 +3,35 @@
3
3
  Status: Evolving
4
4
  Scope: `@carbonenginejs/runtime-resource/formats/webgpu`
5
5
  Audience: Shader-tool authors, engine integrators, and maintainers
6
- Summary: Explains the CEWGPU package format, compiled-effect conversion API, and bounded DXBC-to-WGSL compiler.
6
+ Summary: Explains the Carbon-record CEWGPU format, compiled-effect conversion API, and bounded DXBC-to-WGSL compiler.
7
7
 
8
8
  ## Purpose
9
9
 
10
- `@carbonenginejs/runtime-resource/formats/webgpu` reads and builds CEWGPU shader packages and
11
- converts supported compiled effect stages into portable WGSL package data. It
10
+ `@carbonenginejs/runtime-resource/formats/webgpu` reads and builds WebGPU
11
+ effect containers and converts supported compiled-effect stages into WGSL. It
12
12
  owns effect analysis, DXBC-to-intermediate-representation lowering, WGSL
13
- emission, pass-global binding planning, and CEWGPU assembly.
13
+ emission, pass-global binding planning, and the WebGPU backend block carried by
14
+ Carbon version-15 records.
14
15
 
15
16
  Unsupported requested shader semantics fail explicitly instead of producing a
16
- partially translated selected pass. `BuildEffect` preserves complete source
17
- permutation topology in `PGRF` and, for version-15 effects, complete portable
18
- reflection for every unique body in RFLX v2/RBLB. ANLS/WGSL remain selected
19
- backend-body data, so backend and runtime completeness are still open.
17
+ partially translated selected pass. `BuildEffect` preserves every permutation
18
+ row and representable non-program description/reflection fields in the Carbon
19
+ container. Non-dynamic sampler names are unrecoverable and stage order is
20
+ canonicalized. Source-stage DXBC is replaced by WGSL or an empty program slot.
21
+ Selected mode writes WGSL only for the resolved body's requested passes; all
22
+ mode attempts every distinct body after the resolved body passes the initial
23
+ translation gate. Backend and runtime completeness remain broader gates.
20
24
 
21
25
  ## Use this package when
22
26
 
23
- Use `format-webgpu` when you need to:
27
+ Use the WebGPU format subpath when you need to:
24
28
 
25
29
  - inspect or build a `.cewgpu` package;
26
30
  - analyze caller-supplied compiled effect bytes;
27
31
  - lower supported DXBC vertex and fragment programs to WGSL;
28
32
  - build one collision-free WebGPU binding layout across a complete pass; or
29
- - convert one selected compiled-effect body/pass scope into a CEWGPU package while
30
- preserving its complete version-15 source permutation graph and all-unique
31
- portable reflection.
33
+ - translate selected or all distinct version-15 effect bodies while preserving
34
+ permutation topology and representable non-program reflection fields.
32
35
 
33
36
  Use `@carbonenginejs/runtime-resource/formats/hlsl` directly for effect metadata without WGSL
34
37
  conversion, and `@carbonenginejs/runtime-resource/formats/dxbc` directly for standalone DXBC
@@ -40,15 +43,15 @@ belong in `@carbonenginejs/engine-webgpu`.
40
43
  ```text
41
44
  compiled effect bytes
42
45
  |
43
- +---- format-hlsl ---- effect and binding metadata
46
+ +---- formats/hlsl ---- effect and binding metadata
44
47
  |
45
- +---- format-dxbc ---- decoded shader programs
48
+ +---- formats/dxbc ---- decoded shader programs
46
49
  | |
47
50
  +------------------------------+
48
51
  |
49
52
  v
50
- format-webgpu
51
- analysis + WGSL + CEWGPU
53
+ formats/webgpu
54
+ analysis + WGSL + Carbon records
52
55
  |
53
56
  v
54
57
  engine-webgpu
@@ -7,10 +7,10 @@ Summary: Defines the package's compiler, container, dependency, and engine bound
7
7
 
8
8
  ## Purpose
9
9
 
10
- `format-webgpu` is the transformation and package layer between compiled
11
- Carbon-style effects and WebGPU engine realization. It converts supported
12
- shader programs into portable WGSL descriptors without creating live GPU
13
- objects.
10
+ The WebGPU format subpath is the transformation and package layer between
11
+ compiled Carbon effects and WebGPU engine realization. It converts supported
12
+ shader programs into WGSL and writes Carbon version-15 effect records without
13
+ creating live GPU objects.
14
14
 
15
15
  ## Dependency direction
16
16
 
@@ -35,12 +35,15 @@ then package data to the engine.
35
35
 
36
36
  ## Owned responsibilities
37
37
 
38
- - Reading, inspecting, and building the CEWGPU v1 chunk container.
38
+ - Reading, inspecting, and building Carbon-record CEWGPU containers.
39
39
  - Resolving one compiled-effect permutation and complete pass.
40
- - Validating and preserving every source permutation index and raw-body alias
41
- in a backend-neutral identity-only graph.
42
- - Packing every unique version-15 body's complete shared portable reflection,
43
- with exact immutable byte vectors in one validated blob arena.
40
+ - Preserving every source permutation row and representable non-program
41
+ description field; non-dynamic sampler names are unrecoverable and stage
42
+ order is canonicalized.
43
+ Stored-body identity is exact emitted-description-byte identity; it does not
44
+ promise to retain the source alias partition after programs are replaced.
45
+ - Writing WGSL to program slots and bind-group/transform data to the optional
46
+ per-pass backend block.
44
47
  - Normalizing effect, stage, binding, and decoded DXBC analysis.
45
48
  - Building validated shader intermediate representation and structured control
46
49
  flow.
@@ -51,11 +54,11 @@ then package data to the engine.
51
54
 
52
55
  ## Ownership elsewhere
53
56
 
54
- - `format-hlsl` owns compiled-effect parsing, permutation resolution,
57
+ - `@carbonenginejs/runtime-resource/formats/hlsl` owns compiled-effect parsing, permutation resolution,
55
58
  unique-body enumeration, binding-manifest interpretation, and the shared
56
59
  body-local portable reflection schema/validator.
57
- - `format-dxbc` owns DXBC container and instruction decoding.
58
- - `engine-webgpu` owns `GPUDevice`, shader-module compilation, bind groups,
60
+ - `@carbonenginejs/runtime-resource/formats/dxbc` owns DXBC container and instruction decoding.
61
+ - `@carbonenginejs/engine-webgpu` owns `GPUDevice`, shader-module compilation, bind groups,
59
62
  pipelines, resource realization, device loss, and draw execution.
60
63
  - Node tooling owns indexed input acquisition, filesystem adapters, caching,
61
64
  build reports, and optional native comparison.