@carbonenginejs/runtime 0.1.0-alpha.4 → 0.1.0-alpha.5

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 (384) hide show
  1. package/dist/global/blue/BlueClasses.js +200 -0
  2. package/dist/global/blue/BlueClasses.js.map +1 -0
  3. package/dist/global/blue/IBlueClasses.js +79 -0
  4. package/dist/global/blue/IBlueClasses.js.map +1 -0
  5. package/dist/global/blue/IBlueDynamicResourceConstructor.js +16 -0
  6. package/dist/global/blue/IBlueDynamicResourceConstructor.js.map +1 -1
  7. package/dist/global/blue/blue.js +8 -2
  8. package/dist/global/blue/blue.js.map +1 -1
  9. package/dist/global/blue/index.js +2 -0
  10. package/dist/global/blue/index.js.map +1 -1
  11. package/dist/global/consts/index.js +0 -1
  12. package/dist/global/consts/index.js.map +1 -1
  13. package/dist/global/consts/renderContext/formats.js +26 -25
  14. package/dist/global/consts/renderContext/formats.js.map +1 -1
  15. package/dist/{trinityal/Tr2BitmapDimensions.js → global/imageio/BitmapDimensions.js} +19 -15
  16. package/dist/global/imageio/BitmapDimensions.js.map +1 -0
  17. package/dist/global/imageio/Cutout.js +28 -0
  18. package/dist/global/imageio/Cutout.js.map +1 -0
  19. package/dist/global/imageio/HostBitmap.js +1106 -0
  20. package/dist/global/imageio/HostBitmap.js.map +1 -0
  21. package/dist/global/imageio/ImageIOResult.js +99 -0
  22. package/dist/global/imageio/ImageIOResult.js.map +1 -0
  23. package/dist/global/imageio/ImageUtility.js +205 -0
  24. package/dist/global/imageio/ImageUtility.js.map +1 -0
  25. package/dist/global/imageio/LoadParameters.js +86 -0
  26. package/dist/global/imageio/LoadParameters.js.map +1 -0
  27. package/dist/global/imageio/Metadata.js +22 -0
  28. package/dist/global/imageio/Metadata.js.map +1 -0
  29. package/dist/global/imageio/index.js +8 -0
  30. package/dist/global/{consts/webgpu → imageio}/index.js.map +1 -1
  31. package/dist/global/index.js +2 -1
  32. package/dist/global/index.js.map +1 -1
  33. package/dist/global/math/color.js +1 -1
  34. package/dist/global/math/color.js.map +1 -1
  35. package/dist/global/schema/CjsSchema.js +8 -0
  36. package/dist/global/schema/CjsSchema.js.map +1 -1
  37. package/dist/index.js +12 -4
  38. package/dist/index.js.map +1 -1
  39. package/dist/resource/CjsResMan.js +47 -7
  40. package/dist/resource/CjsResMan.js.map +1 -1
  41. package/dist/resource/Tr2LightProfileRes.js +37 -0
  42. package/dist/resource/Tr2LightProfileRes.js.map +1 -1
  43. package/dist/resource/format/CjsByteWriter.js +46 -46
  44. package/dist/resource/format/CjsByteWriter.js.map +1 -1
  45. package/dist/resource/format/CjsFormat.js +7 -8
  46. package/dist/resource/format/CjsFormat.js.map +1 -1
  47. package/dist/resource/format/CjsFormatStore.js +8 -8
  48. package/dist/resource/format/CjsFormatStore.js.map +1 -1
  49. package/dist/resource/format/CjsGeometryFormat.js +114 -0
  50. package/dist/resource/format/CjsGeometryFormat.js.map +1 -0
  51. package/dist/resource/format/CjsImageFormat.js +282 -0
  52. package/dist/resource/format/CjsImageFormat.js.map +1 -0
  53. package/dist/resource/format/CjsResourceProbe.js +12 -48
  54. package/dist/resource/format/CjsResourceProbe.js.map +1 -1
  55. package/dist/resource/format/CjsStringTable.js +37 -37
  56. package/dist/resource/format/CjsStringTable.js.map +1 -1
  57. package/dist/resource/format/carbonEffect/CjsCarbonEffectReader.js +10 -10
  58. package/dist/resource/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -1
  59. package/dist/resource/format/carbonEffect/CjsCarbonEffectWriter.js +37 -37
  60. package/dist/resource/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -1
  61. package/dist/resource/format/carbonEffect/carbonEffectBackendBlock.js +35 -7
  62. package/dist/resource/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -1
  63. package/dist/resource/format/index.js +3 -1
  64. package/dist/resource/format/index.js.map +1 -1
  65. package/dist/resource/formats/black/CjsBlackFormat.js +130 -137
  66. package/dist/resource/formats/black/CjsBlackFormat.js.map +1 -1
  67. package/dist/resource/formats/bnk/CjsBnkFormat.js +12 -19
  68. package/dist/resource/formats/bnk/CjsBnkFormat.js.map +1 -1
  69. package/dist/resource/formats/bnk/core/helpers.js +1 -3
  70. package/dist/resource/formats/bnk/core/helpers.js.map +1 -1
  71. package/dist/resource/formats/cmf/CjsCmfFormat.js +19 -82
  72. package/dist/resource/formats/cmf/CjsCmfFormat.js.map +1 -1
  73. package/dist/resource/formats/cmf/core/constants.js +1 -2
  74. package/dist/resource/formats/cmf/core/constants.js.map +1 -1
  75. package/dist/resource/formats/{stl/core/targets.js → cmf/core/flatShared.js} +9 -8
  76. package/dist/resource/formats/cmf/core/flatShared.js.map +1 -0
  77. package/dist/resource/formats/cmf/core/helpers.js +13 -13
  78. package/dist/resource/formats/cmf/core/helpers.js.map +1 -1
  79. package/dist/resource/formats/cmf/core/writer.js +24 -24
  80. package/dist/resource/formats/cmf/core/writer.js.map +1 -1
  81. package/dist/resource/formats/dds/CjsDdsFormat.js +134 -17
  82. package/dist/resource/formats/dds/CjsDdsFormat.js.map +1 -1
  83. package/dist/resource/formats/dds/core/helpers.js +125 -40
  84. package/dist/resource/formats/dds/core/helpers.js.map +1 -1
  85. package/dist/resource/formats/dxbc/CjsDxbcFormat.js +14 -16
  86. package/dist/resource/formats/dxbc/CjsDxbcFormat.js.map +1 -1
  87. package/dist/resource/formats/dxbc/core/{container.js → DxbcContainer.js} +2 -2
  88. package/dist/resource/formats/dxbc/core/DxbcContainer.js.map +1 -0
  89. package/dist/resource/formats/dxbc/core/{errors.js → DxbcReadError.js} +1 -1
  90. package/dist/resource/formats/dxbc/core/DxbcReadError.js.map +1 -0
  91. package/dist/resource/formats/dxbc/core/DxbcReader.js +1 -1
  92. package/dist/resource/formats/dxbc/core/DxbcReader.js.map +1 -1
  93. package/dist/resource/formats/dxbc/core/{program.js → DxbcShaderProgram.js} +2 -2
  94. package/dist/resource/formats/dxbc/core/DxbcShaderProgram.js.map +1 -0
  95. package/dist/resource/formats/dxbc/core/{signature.js → DxbcSignatureChunk.js} +2 -2
  96. package/dist/resource/formats/dxbc/core/DxbcSignatureChunk.js.map +1 -0
  97. package/dist/resource/formats/dxbc/core/decoder.js +2 -2
  98. package/dist/resource/formats/dxbc/core/decoder.js.map +1 -1
  99. package/dist/resource/formats/dxbc/core/helpers.js +3 -3
  100. package/dist/resource/formats/dxbc/core/helpers.js.map +1 -1
  101. package/dist/resource/formats/fbx/CjsFbxFormat.js +18 -20
  102. package/dist/resource/formats/fbx/CjsFbxFormat.js.map +1 -1
  103. package/dist/resource/formats/flac/CjsFlacFormat.js +7 -13
  104. package/dist/resource/formats/flac/CjsFlacFormat.js.map +1 -1
  105. package/dist/resource/formats/fsd/32/CjsFsd32Format.js +29 -29
  106. package/dist/resource/formats/fsd/32/CjsFsd32Format.js.map +1 -1
  107. package/dist/resource/formats/fsd/64/CjsFsd64Format.js +3 -3
  108. package/dist/resource/formats/fsd/64/CjsFsd64Format.js.map +1 -1
  109. package/dist/resource/formats/fsd/64/core/CjsFsd64Binary.js +23 -23
  110. package/dist/resource/formats/fsd/64/core/CjsFsd64Binary.js.map +1 -1
  111. package/dist/resource/formats/fsd/64/core/CjsFsd64Reader.js +8 -8
  112. package/dist/resource/formats/fsd/64/core/CjsFsd64Reader.js.map +1 -1
  113. package/dist/resource/formats/fsd/CjsFsdFormat.js +23 -23
  114. package/dist/resource/formats/fsd/CjsFsdFormat.js.map +1 -1
  115. package/dist/resource/formats/gif/CjsGifFormat.js +24 -15
  116. package/dist/resource/formats/gif/CjsGifFormat.js.map +1 -1
  117. package/dist/resource/formats/gltf/CjsGltfFormat.js +33 -98
  118. package/dist/resource/formats/gltf/CjsGltfFormat.js.map +1 -1
  119. package/dist/resource/formats/gltf/core/helpers.js +3 -12
  120. package/dist/resource/formats/gltf/core/helpers.js.map +1 -1
  121. package/dist/resource/formats/gr2/CjsGr2Format.js +27 -91
  122. package/dist/resource/formats/gr2/CjsGr2Format.js.map +1 -1
  123. package/dist/resource/formats/hlsl/CjsHlslFormat.js +22 -25
  124. package/dist/resource/formats/hlsl/CjsHlslFormat.js.map +1 -1
  125. package/dist/resource/formats/hlsl/core/carbonDescriptionToRuntime.js +1 -1
  126. package/dist/resource/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -1
  127. package/dist/resource/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +3 -3
  128. package/dist/resource/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js.map +1 -1
  129. package/dist/resource/formats/ies/CjsIESFormat.js +29 -29
  130. package/dist/resource/formats/ies/CjsIESFormat.js.map +1 -1
  131. package/dist/resource/formats/jpeg/CjsJpegFormat.js +24 -15
  132. package/dist/resource/formats/jpeg/CjsJpegFormat.js.map +1 -1
  133. package/dist/resource/formats/jpeg/core/helpers.js +3 -5
  134. package/dist/resource/formats/jpeg/core/helpers.js.map +1 -1
  135. package/dist/resource/formats/jpeg/core/jpeg.js +58 -58
  136. package/dist/resource/formats/jpeg/core/jpeg.js.map +1 -1
  137. package/dist/resource/formats/jsonl/CjsJsonlFormat.js +3 -3
  138. package/dist/resource/formats/jsonl/CjsJsonlFormat.js.map +1 -1
  139. package/dist/resource/formats/mp3/CjsMp3Format.js +7 -14
  140. package/dist/resource/formats/mp3/CjsMp3Format.js.map +1 -1
  141. package/dist/resource/formats/mp3/core/helpers.js +3 -5
  142. package/dist/resource/formats/mp3/core/helpers.js.map +1 -1
  143. package/dist/resource/formats/mp4/CjsMp4Format.js +7 -13
  144. package/dist/resource/formats/mp4/CjsMp4Format.js.map +1 -1
  145. package/dist/resource/formats/mp4/core/helpers.js +3 -5
  146. package/dist/resource/formats/mp4/core/helpers.js.map +1 -1
  147. package/dist/resource/formats/obj/CjsObjFormat.js +92 -157
  148. package/dist/resource/formats/obj/CjsObjFormat.js.map +1 -1
  149. package/dist/resource/formats/obj/core/helpers.js +5 -113
  150. package/dist/resource/formats/obj/core/helpers.js.map +1 -1
  151. package/dist/resource/formats/ogg/CjsOggFormat.js +7 -14
  152. package/dist/resource/formats/ogg/CjsOggFormat.js.map +1 -1
  153. package/dist/resource/formats/pickle/CjsPickleFormat.js +7 -12
  154. package/dist/resource/formats/pickle/CjsPickleFormat.js.map +1 -1
  155. package/dist/resource/formats/pickle/core/CjsPickleProtocol0Reader.js +7 -7
  156. package/dist/resource/formats/pickle/core/CjsPickleProtocol0Reader.js.map +1 -1
  157. package/dist/resource/formats/pickle/core/CjsPickleProtocol4Reader.js +7 -7
  158. package/dist/resource/formats/pickle/core/CjsPickleProtocol4Reader.js.map +1 -1
  159. package/dist/resource/formats/png/CjsPngFormat.js +40 -15
  160. package/dist/resource/formats/png/CjsPngFormat.js.map +1 -1
  161. package/dist/resource/formats/png/core/helpers.js +4 -6
  162. package/dist/resource/formats/png/core/helpers.js.map +1 -1
  163. package/dist/resource/formats/red/CjsRedFormat.js +22 -28
  164. package/dist/resource/formats/red/CjsRedFormat.js.map +1 -1
  165. package/dist/resource/formats/schemabound/CjsSchemaBoundFormat.js +3 -7
  166. package/dist/resource/formats/schemabound/CjsSchemaBoundFormat.js.map +1 -1
  167. package/dist/resource/formats/schemabound/core/schemaBoundValues.js +5 -0
  168. package/dist/resource/formats/schemabound/core/schemaBoundValues.js.map +1 -1
  169. package/dist/resource/formats/sqlite/CjsSqliteFormat.js +4 -9
  170. package/dist/resource/formats/sqlite/CjsSqliteFormat.js.map +1 -1
  171. package/dist/resource/formats/static/CjsStaticFormat.js +4 -4
  172. package/dist/resource/formats/static/CjsStaticFormat.js.map +1 -1
  173. package/dist/resource/formats/stl/CjsStlFormat.js +39 -104
  174. package/dist/resource/formats/stl/CjsStlFormat.js.map +1 -1
  175. package/dist/resource/formats/stl/core/helpers.js +5 -19
  176. package/dist/resource/formats/stl/core/helpers.js.map +1 -1
  177. package/dist/resource/formats/tga/CjsTgaFormat.js +26 -15
  178. package/dist/resource/formats/tga/CjsTgaFormat.js.map +1 -1
  179. package/dist/resource/formats/tga/core/helpers.js +3 -5
  180. package/dist/resource/formats/tga/core/helpers.js.map +1 -1
  181. package/dist/resource/formats/vta/CjsVtaFormat.js +8 -15
  182. package/dist/resource/formats/vta/CjsVtaFormat.js.map +1 -1
  183. package/dist/resource/formats/wav/CjsWavFormat.js +7 -14
  184. package/dist/resource/formats/wav/CjsWavFormat.js.map +1 -1
  185. package/dist/resource/formats/wav/core/helpers.js +3 -5
  186. package/dist/resource/formats/wav/core/helpers.js.map +1 -1
  187. package/dist/resource/formats/webgl/CjsWebglFormat.js +103 -105
  188. package/dist/resource/formats/webgl/CjsWebglFormat.js.map +1 -1
  189. package/dist/resource/formats/webgl/core/{errors.js → WebglReadError.js} +1 -1
  190. package/dist/resource/formats/webgl/core/WebglReadError.js.map +1 -0
  191. package/dist/resource/formats/webgl/core/effectPackage.js +1 -1
  192. package/dist/resource/formats/webgl/core/effectPackage.js.map +1 -1
  193. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +3 -3
  194. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  195. package/dist/resource/formats/webgl/core/glsl/{DxbcGlslHelpers.js → DxbcGlslHelperRegistry.js} +2 -2
  196. package/dist/resource/formats/webgl/core/glsl/DxbcGlslHelperRegistry.js.map +1 -0
  197. package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +1 -1
  198. package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -1
  199. package/dist/resource/formats/webgl/core/glslBackendBlock.js +1 -1
  200. package/dist/resource/formats/webgl/core/glslBackendBlock.js.map +1 -1
  201. package/dist/resource/formats/webgl/core/helpers.js.map +1 -1
  202. package/dist/resource/formats/webgpu/CjsWebgpuFormat.js +28 -29
  203. package/dist/resource/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  204. package/dist/resource/formats/webgpu/core/{errors.js → WebgpuReadError.js} +1 -1
  205. package/dist/resource/formats/webgpu/core/WebgpuReadError.js.map +1 -0
  206. package/dist/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js +1 -1
  207. package/dist/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js.map +1 -1
  208. package/dist/resource/formats/webgpu/core/helpers.js +1 -1
  209. package/dist/resource/formats/webgpu/core/helpers.js.map +1 -1
  210. package/dist/resource/formats/webgpu/core/ir/lowerDxbcToIr.js +1 -1
  211. package/dist/resource/formats/webgpu/core/ir/lowerDxbcToIr.js.map +1 -1
  212. package/dist/resource/formats/webgpu/core/wgsl/buildWgslSet.js +18 -6
  213. package/dist/resource/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
  214. package/dist/resource/formats/webgpu/core/wgsl/lowerBindingLayout.js +39 -13
  215. package/dist/resource/formats/webgpu/core/wgsl/lowerBindingLayout.js.map +1 -1
  216. package/dist/resource/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +16 -14
  217. package/dist/resource/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js.map +1 -1
  218. package/dist/resource/formats/webm/CjsWebmFormat.js +8 -13
  219. package/dist/resource/formats/webm/CjsWebmFormat.js.map +1 -1
  220. package/dist/resource/formats/webm/core/helpers.js +3 -5
  221. package/dist/resource/formats/webm/core/helpers.js.map +1 -1
  222. package/dist/resource/formats/webp/CjsWebpFormat.js +8 -12
  223. package/dist/resource/formats/webp/CjsWebpFormat.js.map +1 -1
  224. package/dist/resource/formats/wem/CjsWemFormat.js +9 -17
  225. package/dist/resource/formats/wem/CjsWemFormat.js.map +1 -1
  226. package/dist/resource/formats/wem/core/bitStream.js +35 -35
  227. package/dist/resource/formats/wem/core/bitStream.js.map +1 -1
  228. package/dist/resource/formats/wem/core/helpers.js +1 -3
  229. package/dist/resource/formats/wem/core/helpers.js.map +1 -1
  230. package/dist/resource/formats/yaml/CjsYamlFormat.js +28 -37
  231. package/dist/resource/formats/yaml/CjsYamlFormat.js.map +1 -1
  232. package/dist/resource/imageio/ImageIO.js +142 -0
  233. package/dist/resource/imageio/ImageIO.js.map +1 -0
  234. package/dist/resource/imageio/index.js +17 -0
  235. package/dist/resource/imageio/index.js.map +1 -0
  236. package/dist/resource/index.js +7 -0
  237. package/dist/resource/index.js.map +1 -1
  238. package/dist/resource/shader/reflection/Tr2EffectResource.js +24 -2
  239. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
  240. package/dist/resource/shader/reflection/Tr2Pass.js +76 -5
  241. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
  242. package/dist/resource/texture/CjsTextureArrayConstructor.js +97 -0
  243. package/dist/resource/texture/CjsTextureArrayConstructor.js.map +1 -0
  244. package/dist/resource/texture/CjsTexturePackConstructor.js +160 -0
  245. package/dist/resource/texture/CjsTexturePackConstructor.js.map +1 -0
  246. package/dist/resource/texture/CjsTexturePipelineStepArray.js +72 -0
  247. package/dist/resource/texture/CjsTexturePipelineStepArray.js.map +1 -0
  248. package/dist/resource/texture/CjsTexturePipelineStepConvert.js +73 -0
  249. package/dist/resource/texture/CjsTexturePipelineStepConvert.js.map +1 -0
  250. package/dist/resource/texture/CjsTexturePipelineStepPack.js +71 -0
  251. package/dist/resource/texture/CjsTexturePipelineStepPack.js.map +1 -0
  252. package/dist/resource/texture/CjsTexturePipelineStepResize.js +123 -0
  253. package/dist/resource/texture/CjsTexturePipelineStepResize.js.map +1 -0
  254. package/dist/resource/texture/SolidColorTextureConstructor.js +11 -1
  255. package/dist/resource/texture/SolidColorTextureConstructor.js.map +1 -1
  256. package/dist/resource/texture/Tr2ImageRes.js +100 -68
  257. package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
  258. package/dist/resource/texture/Tr2TexturePipeline.js +45 -25
  259. package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -1
  260. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +34 -1
  261. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -1
  262. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +30 -3
  263. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -1
  264. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +81 -1
  265. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -1
  266. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +36 -1
  267. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -1
  268. package/dist/resource/texture/Tr2TexturePipelineStepPack.js +146 -24
  269. package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -1
  270. package/dist/resource/texture/TriTextureRes.js +151 -29
  271. package/dist/resource/texture/TriTextureRes.js.map +1 -1
  272. package/dist/resource/texture/index.js +7 -0
  273. package/dist/resource/texture/index.js.map +1 -1
  274. package/dist/resource/texture/registerTextureResources.js +83 -0
  275. package/dist/resource/texture/registerTextureResources.js.map +1 -0
  276. package/dist/resource/texture/solidColorTexture.js +10 -19
  277. package/dist/resource/texture/solidColorTexture.js.map +1 -1
  278. package/dist/sof/EveSOF.js +39 -7
  279. package/dist/sof/EveSOF.js.map +1 -1
  280. package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js +2 -2
  281. package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js.map +1 -1
  282. package/dist/trinity/core/Tr2ImageIOHelpers.js +80 -17
  283. package/dist/trinity/core/Tr2ImageIOHelpers.js.map +1 -1
  284. package/dist/trinity/core/Tr2RenderUtils.js +1 -1
  285. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js +49 -62
  286. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js.map +1 -1
  287. package/dist/trinity/core/Tr2TextureReference.js +114 -0
  288. package/dist/trinity/core/Tr2TextureReference.js.map +1 -0
  289. package/dist/trinity/core/device/Tr2DepthStencil.js +2 -2
  290. package/dist/trinity/core/device/Tr2DepthStencil.js.map +1 -1
  291. package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBuffer.js +1 -1
  292. package/dist/trinity/core/index.js +1 -0
  293. package/dist/trinity/core/index.js.map +1 -1
  294. package/dist/trinity/core/lighting/Tr2LightManager.js +5 -4
  295. package/dist/trinity/core/lighting/Tr2LightManager.js.map +1 -1
  296. package/dist/trinity/core/procedural/GradientTextureConstructor.js +5 -4
  297. package/dist/trinity/core/procedural/GradientTextureConstructor.js.map +1 -1
  298. package/dist/trinity/core/procedural/gradientTexture.js +10 -13
  299. package/dist/trinity/core/procedural/gradientTexture.js.map +1 -1
  300. package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js +1 -1
  301. package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js.map +1 -1
  302. package/dist/trinity/eve/EveImpactOverlay.js +102 -50
  303. package/dist/trinity/eve/EveImpactOverlay.js.map +1 -1
  304. package/dist/trinity/eve/EveModularObjectModifier.js +9 -18
  305. package/dist/trinity/eve/EveModularObjectModifier.js.map +1 -1
  306. package/dist/trinity/eve/attachment/turrets/EveTurretSet.js +175 -157
  307. package/dist/trinity/eve/attachment/turrets/EveTurretSet.js.map +1 -1
  308. package/dist/trinity/eve/attachment/turrets/EveTurretTarget.js +100 -83
  309. package/dist/trinity/eve/attachment/turrets/EveTurretTarget.js.map +1 -1
  310. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js +26 -20
  311. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js.map +1 -1
  312. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js +368 -179
  313. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js.map +1 -1
  314. package/dist/trinity/eve/child/EveChildMesh.js +242 -234
  315. package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
  316. package/dist/trinity/eve/child/EveChildTurret.js +57 -16
  317. package/dist/trinity/eve/child/EveChildTurret.js.map +1 -1
  318. package/dist/trinity/eve/child/EveSpaceObjectChild.js +28 -1
  319. package/dist/trinity/eve/child/EveSpaceObjectChild.js.map +1 -1
  320. package/dist/trinity/eve/index.js +2 -2
  321. package/dist/trinity/eve/overlays/EveDamageOverlay.js +5 -1
  322. package/dist/trinity/eve/overlays/EveDamageOverlay.js.map +1 -1
  323. package/dist/trinity/eve/scene/EveSpaceScene.js +234 -233
  324. package/dist/trinity/eve/scene/EveSpaceScene.js.map +1 -1
  325. package/dist/trinity/eve/scene/EveSpaceSceneRenderDriver.js +2 -0
  326. package/dist/trinity/eve/scene/EveSpaceSceneRenderDriver.js.map +1 -1
  327. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +492 -437
  328. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js.map +1 -1
  329. package/dist/trinity/generated/index.js +0 -1
  330. package/dist/trinity/generated/index.js.map +1 -1
  331. package/dist/trinity/generated/trinityCore/index.js +0 -1
  332. package/dist/trinity/generated/trinityCore/index.js.map +1 -1
  333. package/dist/trinity/index.js +3 -3
  334. package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js +10 -1
  335. package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js.map +1 -1
  336. package/dist/trinity/shader/Tr2DataTextureManager.js +152 -66
  337. package/dist/trinity/shader/Tr2DataTextureManager.js.map +1 -1
  338. package/dist/trinity/shader/Tr2Material.js +1 -1
  339. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js +5 -5
  340. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js.map +1 -1
  341. package/dist/trinityal/index.js +1 -1
  342. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js +2 -2
  343. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js.map +1 -1
  344. package/dist/trinityal/stub/Tr2SwapChainALStub.js +45 -45
  345. package/dist/trinityal/stub/Tr2SwapChainALStub.js.map +1 -1
  346. package/dist/trinityal/stub/Tr2TextureALStub.js +170 -170
  347. package/dist/trinityal/stub/Tr2TextureALStub.js.map +1 -1
  348. package/dist/trinityal/webgpu/CjsWebgpuDevice.js +234 -164
  349. package/dist/trinityal/webgpu/CjsWebgpuDevice.js.map +1 -1
  350. package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js +7 -0
  351. package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js.map +1 -1
  352. package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js +78 -14
  353. package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js.map +1 -1
  354. package/dist/trinityal/webgpu/core/CjsWebgpuUtils.js +94 -0
  355. package/dist/trinityal/webgpu/core/CjsWebgpuUtils.js.map +1 -0
  356. package/dist/trinityal/webgpu/internal.js +1 -0
  357. package/dist/trinityal/webgpu/internal.js.map +1 -1
  358. package/docs/global/reference/classes/README.md +90 -0
  359. package/docs/resource/concepts/format-capabilities.md +3 -3
  360. package/docs/resource/formats/README.md +1 -1
  361. package/docs/resource/reference/classes/core.md +31 -1
  362. package/docs/resource/reference/classes/formats.md +7 -7
  363. package/docs/resource/reference/classes/resources.md +76 -16
  364. package/docs/trinity/reference/classes/generated.md +0 -10
  365. package/docs/trinity/reference/classes/trinity-core.md +1692 -1682
  366. package/docs/trinityal/reference/classes/README.md +0 -10
  367. package/docs/trinityal/webgpu/reference/classes/README.md +276 -266
  368. package/package.json +4 -3
  369. package/dist/global/consts/webgpu/index.js +0 -2
  370. package/dist/global/consts/webgpu/textureFormats.js +0 -180
  371. package/dist/global/consts/webgpu/textureFormats.js.map +0 -1
  372. package/dist/resource/formats/dxbc/core/container.js.map +0 -1
  373. package/dist/resource/formats/dxbc/core/errors.js.map +0 -1
  374. package/dist/resource/formats/dxbc/core/program.js.map +0 -1
  375. package/dist/resource/formats/dxbc/core/signature.js.map +0 -1
  376. package/dist/resource/formats/stl/core/targets.js.map +0 -1
  377. package/dist/resource/formats/webgl/core/errors.js.map +0 -1
  378. package/dist/resource/formats/webgl/core/glsl/DxbcGlslHelpers.js.map +0 -1
  379. package/dist/resource/formats/webgpu/core/errors.js.map +0 -1
  380. package/dist/resource/texture/texturePipelineBehavior.js +0 -332
  381. package/dist/resource/texture/texturePipelineBehavior.js.map +0 -1
  382. package/dist/trinity/generated/trinityCore/Tr2TextureReference.js +0 -40
  383. package/dist/trinity/generated/trinityCore/Tr2TextureReference.js.map +0 -1
  384. package/dist/trinityal/Tr2BitmapDimensions.js.map +0 -1
@@ -6,14 +6,14 @@ import { buildWgslBindingPlan } from './core/wgsl/buildWgslBindingPlan.js';
6
6
  import { buildWgslSet } from './core/wgsl/buildWgslSet.js';
7
7
  import { buildEffectPackage } from './core/packageEffect.js';
8
8
  import { FORMAT_WEBGPU_PACKAGE_VERSION } from './core/packageMetadata.js';
9
- import { DEFAULT_VALUES, normalizeValues, validateClassKey, validateClass, readWithValues, inspectWithValues, analyzeEffectWithValues, isCarbonWebgpu, OUTPUT_JSON, CARBON_WEBGPU_FORMAT, CARBON_WEBGPU_ANALYSIS_FORMAT } from './core/helpers.js';
9
+ import { DEFAULT_VALUES, normalizeValues, validateClassKey, validateClass, readWithValues, inspectWithValues, analyzeEffectWithValues, isCarbonWebgpu, CARBON_WEBGPU_FORMAT, CARBON_WEBGPU_ANALYSIS_FORMAT } from './core/helpers.js';
10
10
  import { toJsonWithCollections } from '../../format/jsonPolicies.js';
11
11
 
12
12
  const FORMAT_NAME = "CjsWebgpuFormat";
13
13
 
14
14
  /**
15
15
  * CarbonEngineJS-facing format surface for `.carbonwebgpu` WebGPU packages, plus an
16
- * offline effect-analysis helper built on the runtime resource HLSL and DXBC
16
+ * offline effect-analysis helper built on the runtime resource HLSL and DXBC
17
17
  * format subpaths.
18
18
  *
19
19
  * The package owns read/build, normalized shader analysis, and the current
@@ -21,12 +21,12 @@ const FORMAT_NAME = "CjsWebgpuFormat";
21
21
  * explicit qualification ladder.
22
22
  */
23
23
  class CjsWebgpuFormat extends CjsFormat {
24
- #emit = DEFAULT_VALUES.emit;
25
- #source = DEFAULT_VALUES.source;
26
- #decodeInstructions = DEFAULT_VALUES.decodeInstructions;
27
- #permutation = DEFAULT_VALUES.permutation;
28
- #schema = DEFAULT_VALUES.schema;
29
- #classes = {};
24
+ _emit = DEFAULT_VALUES.emit;
25
+ _source = DEFAULT_VALUES.source;
26
+ _decodeInstructions = DEFAULT_VALUES.decodeInstructions;
27
+ _permutation = DEFAULT_VALUES.permutation;
28
+ _schema = DEFAULT_VALUES.schema;
29
+ _classes = {};
30
30
 
31
31
  /**
32
32
  * Create a reusable format profile.
@@ -46,12 +46,12 @@ class CjsWebgpuFormat extends CjsFormat {
46
46
  */
47
47
  SetValues(options = {}) {
48
48
  const values = normalizeValues(this.GetValues(), options, CLASS_KEYS, FORMAT_NAME);
49
- this.#emit = values.emit;
50
- this.#source = values.source;
51
- this.#decodeInstructions = values.decodeInstructions;
52
- this.#permutation = values.permutation;
53
- this.#schema = values.schema;
54
- this.#classes = values.classes;
49
+ this._emit = values.emit;
50
+ this._source = values.source;
51
+ this._decodeInstructions = values.decodeInstructions;
52
+ this._permutation = values.permutation;
53
+ this._schema = values.schema;
54
+ this._classes = values.classes;
55
55
  return this;
56
56
  }
57
57
 
@@ -63,12 +63,12 @@ class CjsWebgpuFormat extends CjsFormat {
63
63
  */
64
64
  GetValues(options = {}) {
65
65
  return normalizeValues({
66
- emit: this.#emit,
67
- source: this.#source,
68
- decodeInstructions: this.#decodeInstructions,
69
- permutation: this.#permutation,
70
- schema: this.#schema,
71
- classes: this.#classes
66
+ emit: this._emit,
67
+ source: this._source,
68
+ decodeInstructions: this._decodeInstructions,
69
+ permutation: this._permutation,
70
+ schema: this._schema,
71
+ classes: this._classes
72
72
  }, options, CLASS_KEYS, FORMAT_NAME);
73
73
  }
74
74
 
@@ -94,12 +94,12 @@ class CjsWebgpuFormat extends CjsFormat {
94
94
  SetClass(type, Class) {
95
95
  validateClassKey(CLASS_KEYS, type, FORMAT_NAME);
96
96
  if (Class === null || Class === undefined) {
97
- delete this.#classes[type];
97
+ delete this._classes[type];
98
98
  return this;
99
99
  }
100
100
  validateClass(CLASS_KEYS, type, Class, FORMAT_NAME);
101
- this.#classes = {
102
- ...this.#classes,
101
+ this._classes = {
102
+ ...this._classes,
103
103
  [type]: Class
104
104
  };
105
105
  return this;
@@ -113,7 +113,7 @@ class CjsWebgpuFormat extends CjsFormat {
113
113
  */
114
114
  GetClass(type) {
115
115
  validateClassKey(CLASS_KEYS, type, FORMAT_NAME);
116
- return this.#classes[type];
116
+ return this._classes[type];
117
117
  }
118
118
 
119
119
  /**
@@ -342,17 +342,16 @@ class CjsWebgpuFormat extends CjsFormat {
342
342
  static toJSON(value) {
343
343
  return toJsonWithCollections(value);
344
344
  }
345
- static OUTPUT_JSON = OUTPUT_JSON;
346
- static CLASS_KEYS = CLASS_KEYS;
347
- static id = "webgpu";
348
- static mediaTypes = Object.freeze(["shader"]);
345
+ static classKeys = CLASS_KEYS;
346
+ static id = "CjsWebgpuFormat";
347
+ static mediaTypes = ["shader"];
349
348
  static outputs = CjsFormat.defineOutputs({
350
349
  json: {
351
350
  default: true,
352
351
  decoded: true
353
352
  }
354
353
  });
355
- static extensions = Object.freeze([".carbonwebgpu"]);
354
+ static extensions = [".carbonwebgpu"];
356
355
  static format = CARBON_WEBGPU_FORMAT;
357
356
  static analysisFormat = CARBON_WEBGPU_ANALYSIS_FORMAT;
358
357
  static packageVersion = FORMAT_WEBGPU_PACKAGE_VERSION;
@@ -1 +1 @@
1
- {"version":3,"file":"CjsWebgpuFormat.js","sources":["../../../../../src/resource/formats/webgpu/CjsWebgpuFormat.js"],"sourcesContent":["import { CjsFormat } from \"../../format/CjsFormat.js\";\r\nimport { CLASS_KEYS } from \"./core/schema.js\";\r\nimport { lowerDxbcToIr } from \"./core/ir/lowerDxbcToIr.js\";\r\nimport { buildWgsl } from \"./core/wgsl/emitWgsl.js\";\r\nimport { buildWgslBindingPlan } from \"./core/wgsl/buildWgslBindingPlan.js\";\r\nimport { buildWgslSet } from \"./core/wgsl/buildWgslSet.js\";\r\nimport { buildEffectPackage } from \"./core/packageEffect.js\";\r\nimport { FORMAT_WEBGPU_PACKAGE_VERSION } from \"./core/packageMetadata.js\";\r\nimport {\r\n CARBON_WEBGPU_ANALYSIS_FORMAT,\r\n CARBON_WEBGPU_FORMAT,\r\n DEFAULT_VALUES,\r\n OUTPUT_JSON,\r\n analyzeEffectWithValues,\r\n inspectWithValues,\r\n isCarbonWebgpu,\r\n normalizeValues,\r\n readWithValues,\r\n toJsonValue,\r\n validateClass,\r\n validateClassKey\r\n} from \"./core/helpers.js\";\r\n\r\nconst FORMAT_NAME = \"CjsWebgpuFormat\";\r\n\r\n/**\r\n * CarbonEngineJS-facing format surface for `.carbonwebgpu` WebGPU packages, plus an\r\n * offline effect-analysis helper built on the runtime resource HLSL and DXBC\n * format subpaths.\r\n *\r\n * The package owns read/build, normalized shader analysis, and the current\r\n * bounded DXBC-to-WGSL profiles. Broader shader-semantic coverage remains an\r\n * explicit qualification ladder.\r\n */\r\nexport class CjsWebgpuFormat extends CjsFormat\r\n{\r\n #emit = DEFAULT_VALUES.emit;\r\n #source = DEFAULT_VALUES.source;\r\n #decodeInstructions = DEFAULT_VALUES.decodeInstructions;\r\n #permutation = DEFAULT_VALUES.permutation;\r\n #schema = DEFAULT_VALUES.schema;\r\n #classes = {};\r\n\r\n /**\r\n * Create a reusable format profile.\r\n *\r\n * @param {object} [options] Default format values.\r\n */\r\n constructor(options = {})\r\n {\r\n super();\r\n this.SetValues(options);\r\n }\r\n\r\n /**\r\n * Set format values for this reusable profile.\r\n *\r\n * @param {object} [options] Values to merge into the profile.\r\n * @returns {CjsWebgpuFormat} This format profile.\r\n */\r\n SetValues(options = {})\r\n {\r\n const values = normalizeValues(this.GetValues(), options, CLASS_KEYS, FORMAT_NAME);\r\n this.#emit = values.emit;\r\n this.#source = values.source;\r\n this.#decodeInstructions = values.decodeInstructions;\r\n this.#permutation = values.permutation;\r\n this.#schema = values.schema;\r\n this.#classes = values.classes;\r\n return this;\r\n }\r\n\r\n /**\r\n * Get this profile's current values, optionally with per-call overrides.\r\n *\r\n * @param {object} [options] Optional values to merge into a copy.\r\n * @returns {object} A copy of the effective values.\r\n */\r\n GetValues(options = {})\r\n {\r\n return normalizeValues({\r\n emit: this.#emit,\r\n source: this.#source,\r\n decodeInstructions: this.#decodeInstructions,\r\n permutation: this.#permutation,\r\n schema: this.#schema,\r\n classes: this.#classes\r\n }, options, CLASS_KEYS, FORMAT_NAME);\r\n }\r\n\r\n /**\r\n * Set multiple node-class constructors for this profile.\r\n *\r\n * @param {object} [classes] Map of node class keys to constructors.\r\n * @returns {CjsWebgpuFormat} This format profile.\r\n */\r\n SetClasses(classes = {})\r\n {\r\n return this.SetValues({ classes });\r\n }\r\n\r\n /**\r\n * Set one node-class constructor for this profile.\r\n *\r\n * @param {string} type Node class key.\r\n * @param {Function|null|undefined} Class constructor to use, or nullish to delete.\r\n * @returns {CjsWebgpuFormat} This format profile.\r\n */\r\n SetClass(type, Class)\r\n {\r\n validateClassKey(CLASS_KEYS, type, FORMAT_NAME);\r\n if (Class === null || Class === undefined)\r\n {\r\n delete this.#classes[type];\r\n return this;\r\n }\r\n\r\n validateClass(CLASS_KEYS, type, Class, FORMAT_NAME);\r\n this.#classes = { ...this.#classes, [type]: Class };\r\n return this;\r\n }\r\n\r\n /**\r\n * Get a configured node-class constructor.\r\n *\r\n * @param {string} type Node class key.\r\n * @returns {Function|undefined} The registered constructor, if any.\r\n */\r\n GetClass(type)\r\n {\r\n validateClassKey(CLASS_KEYS, type, FORMAT_NAME);\r\n return this.#classes[type];\r\n }\r\n\r\n /**\r\n * Whether this format profile has a constructor registered for a node key.\r\n *\r\n * @param {string} type Node class key.\r\n * @returns {boolean} True when a constructor is registered.\r\n */\r\n HasClass(type)\r\n {\r\n return !!this.GetClass(type);\r\n }\r\n\r\n /**\r\n * Read a Carbon WebGPU package with this profile's values.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain JSON data: the container-backed views plus the complete backend body set.\r\n */\r\n Read(input, options = {})\r\n {\r\n return readWithValues(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Inspect a Carbon WebGPU package without building the full JSON shape.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain summary data.\r\n */\r\n Inspect(input, options = {})\r\n {\r\n return inspectWithValues(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Analyzes one compiled effect payload into a normalized WebGPU-facing\r\n * document using the current profile's values.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Tr2 effect bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain JSON-compatible analysis data.\r\n */\r\n AnalyzeEffect(input, options = {})\r\n {\r\n return analyzeEffectWithValues(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Builds a Carbon WebGPU package with complete version-15 source reflection and\r\n * selected-body WebGPU output from compiled Tr2 effect bytes.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\r\n * @param {object} [options] Source, body-mode, permutation, and stage-selection policy.\r\n * @returns {object} Package bytes plus inspection and provenance documents.\r\n */\r\n BuildEffect(input, options = {})\r\n {\r\n const values = this.GetValues();\r\n\r\n return buildEffectPackage(input, {\r\n source: values.source,\r\n permutation: values.permutation,\r\n ...options\r\n });\r\n }\r\n\r\n /**\r\n * Lowers DXBC bytes or decoded instructions into the front-end shader IR.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC input.\r\n * @param {object} [options] IR provenance options.\r\n * @returns {object} Frozen shader IR program.\r\n */\r\n BuildShaderIr(input, options = {})\r\n {\r\n return lowerDxbcToIr(input, options);\r\n }\r\n\r\n /**\r\n * Emits WGSL for the currently supported typed shader slice.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC or shader IR.\r\n * @param {object} [options] Source/provenance options.\r\n * @returns {object} Frozen WGSL shader descriptor.\r\n */\r\n BuildWgsl(input, options = {})\r\n {\r\n return buildWgsl(input, options);\r\n }\r\n\r\n /**\r\n * Assign one canonical numeric binding layout across shader stages in a pass.\r\n * Unshared D3D tuples remain stage-scoped unless shared explicitly.\r\n *\r\n * @param {object[]} programs Complete CJS shader IR stage set for one pass.\r\n * @param {object} [options] Pass-level binding policy.\r\n * @param {string[]} [options.sharedIdentities] Compatible D3D identities\r\n * confirmed to represent one resource across stages.\r\n * @returns {object} Frozen CJS_WGSL_BINDING_PLAN document.\r\n */\r\n BuildWgslBindingPlan(programs, options = {})\r\n {\r\n return buildWgslBindingPlan(programs, options);\r\n }\r\n\r\n /**\r\n * Assembles emitted shader descriptors into a portable WGSL set.\r\n *\r\n * @param {object[]} entries Canonically keyed emitted shader descriptors.\r\n * @returns {object} Frozen CJS_WGSL_SET document.\r\n */\r\n BuildWgslSet(entries)\r\n {\r\n return buildWgslSet(entries);\r\n }\r\n\r\n /**\r\n * Convert format output to JSON-compatible data.\r\n *\r\n * @param {any} value Format output to convert.\r\n * @returns {any} Plain JSON-compatible data.\r\n */\r\n ToJSON(value)\r\n {\r\n return toJsonValue(value);\r\n }\r\n\r\n /**\r\n * Static payload sniff. Static methods use camelCase by convention.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.\r\n * @returns {boolean} True when the payload has Carbon's version-15 shape.\r\n */\r\n static isCarbonWebgpu(input)\r\n {\r\n return isCarbonWebgpu(input);\r\n }\r\n\r\n /**\r\n * Static one-shot read.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain JSON data: the container-backed views plus the complete backend body set.\r\n */\r\n static read(input, options = {})\r\n {\r\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, options, CLASS_KEYS, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static one-shot inspection.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain summary data.\r\n */\r\n static inspect(input, options = {})\r\n {\r\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, options, CLASS_KEYS, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static one-shot effect analysis.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Tr2 effect bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain JSON-compatible analysis data.\r\n */\r\n static analyzeEffect(input, options = {})\r\n {\r\n return analyzeEffectWithValues(input, normalizeValues(DEFAULT_VALUES, options, CLASS_KEYS, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static selected-body Carbon WebGPU builder.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\r\n * @param {object} [options] Source, body-mode, permutation, and stage-selection policy.\r\n * @returns {object} Package bytes plus inspection and provenance documents.\r\n */\r\n static buildEffect(input, options = {})\r\n {\r\n return buildEffectPackage(input, options);\r\n }\r\n\r\n /**\r\n * Static DXBC-to-front-end-IR helper.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC input.\r\n * @param {object} [options] IR provenance options.\r\n * @returns {object} Frozen shader IR program.\r\n */\r\n static buildShaderIr(input, options = {})\r\n {\r\n return lowerDxbcToIr(input, options);\r\n }\r\n\r\n /**\r\n * Static WGSL emission helper for the currently supported typed slice.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC or shader IR.\r\n * @param {object} [options] Source/provenance options.\r\n * @returns {object} Frozen WGSL shader descriptor.\r\n */\r\n static buildWgsl(input, options = {})\r\n {\r\n return buildWgsl(input, options);\r\n }\r\n\r\n /**\r\n * Static pass-global WGSL binding-plan helper. Unshared D3D tuples remain\r\n * stage-scoped unless listed in options.sharedIdentities.\r\n *\r\n * @param {object[]} programs Complete CJS shader IR stage set for one pass.\r\n * @param {object} [options] Pass-level binding policy.\r\n * @param {string[]} [options.sharedIdentities] Compatible D3D identities\r\n * confirmed to represent one resource across stages.\r\n * @returns {object} Frozen CJS_WGSL_BINDING_PLAN document.\r\n */\r\n static buildWgslBindingPlan(programs, options = {})\r\n {\r\n return buildWgslBindingPlan(programs, options);\r\n }\r\n\r\n /**\r\n * Static WGSL-set assembly helper.\r\n *\r\n * @param {object[]} entries Canonically keyed emitted shader descriptors.\r\n * @returns {object} Frozen CJS_WGSL_SET document.\r\n */\r\n static buildWgslSet(entries)\r\n {\r\n return buildWgslSet(entries);\r\n }\r\n\r\n /**\r\n * Static JSON-compatible conversion.\r\n *\r\n * @param {any} value Format output to convert.\r\n * @returns {any} Plain JSON-compatible data.\r\n */\r\n static toJSON(value)\r\n {\r\n return toJsonValue(value);\r\n }\r\n\r\n static OUTPUT_JSON = OUTPUT_JSON;\r\n static CLASS_KEYS = CLASS_KEYS;\r\n static id = \"webgpu\";\r\n static mediaTypes = Object.freeze([ \"shader\" ]);\r\n static outputs = CjsFormat.defineOutputs({\r\n json: { default: true, decoded: true }\r\n });\r\n static extensions = Object.freeze([ \".carbonwebgpu\" ]);\r\n static format = CARBON_WEBGPU_FORMAT;\r\n static analysisFormat = CARBON_WEBGPU_ANALYSIS_FORMAT;\r\n static packageVersion = FORMAT_WEBGPU_PACKAGE_VERSION;\r\n}\r\n\r\nexport default CjsWebgpuFormat;\r\n"],"names":["FORMAT_NAME","CjsWebgpuFormat","CjsFormat","DEFAULT_VALUES","emit","source","decodeInstructions","permutation","schema","constructor","options","SetValues","values","normalizeValues","GetValues","CLASS_KEYS","classes","SetClasses","SetClass","type","Class","validateClassKey","undefined","validateClass","GetClass","HasClass","Read","input","readWithValues","Inspect","inspectWithValues","AnalyzeEffect","analyzeEffectWithValues","BuildEffect","buildEffectPackage","BuildShaderIr","lowerDxbcToIr","BuildWgsl","buildWgsl","BuildWgslBindingPlan","programs","buildWgslBindingPlan","BuildWgslSet","entries","buildWgslSet","ToJSON","value","toJsonValue","isCarbonWebgpu","read","inspect","analyzeEffect","buildEffect","buildShaderIr","toJSON","OUTPUT_JSON","id","mediaTypes","Object","freeze","outputs","defineOutputs","json","default","decoded","extensions","format","CARBON_WEBGPU_FORMAT","analysisFormat","CARBON_WEBGPU_ANALYSIS_FORMAT","packageVersion","FORMAT_WEBGPU_PACKAGE_VERSION"],"mappings":";;;;;;;;;;;AAuBA,MAAMA,WAAW,GAAG,iBAAiB;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,SAASC,SAAS,CAC9C;AACI,EAAA,KAAK,GAAGC,cAAc,CAACC,IAAI;AAC3B,EAAA,OAAO,GAAGD,cAAc,CAACE,MAAM;AAC/B,EAAA,mBAAmB,GAAGF,cAAc,CAACG,kBAAkB;AACvD,EAAA,YAAY,GAAGH,cAAc,CAACI,WAAW;AACzC,EAAA,OAAO,GAAGJ,cAAc,CAACK,MAAM;EAC/B,QAAQ,GAAG,EAAE;;AAEb;AACJ;AACA;AACA;AACA;AACIC,EAAAA,WAAWA,CAACC,OAAO,GAAG,EAAE,EACxB;AACI,IAAA,KAAK,EAAE;AACP,IAAA,IAAI,CAACC,SAAS,CAACD,OAAO,CAAC;AAC3B,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACIC,EAAAA,SAASA,CAACD,OAAO,GAAG,EAAE,EACtB;AACI,IAAA,MAAME,MAAM,GAAGC,eAAe,CAAC,IAAI,CAACC,SAAS,EAAE,EAAEJ,OAAO,EAAEK,UAAU,EAAEf,WAAW,CAAC;AAClF,IAAA,IAAI,CAAC,KAAK,GAAGY,MAAM,CAACR,IAAI;AACxB,IAAA,IAAI,CAAC,OAAO,GAAGQ,MAAM,CAACP,MAAM;AAC5B,IAAA,IAAI,CAAC,mBAAmB,GAAGO,MAAM,CAACN,kBAAkB;AACpD,IAAA,IAAI,CAAC,YAAY,GAAGM,MAAM,CAACL,WAAW;AACtC,IAAA,IAAI,CAAC,OAAO,GA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CAAC;AAChC,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;EACI,OAAOW,MAAMA,CAACR,KAAK,EACnB;IACI,OAAOC,qBAAW,CAACD,KAAK,CAAC;AAC7B,EAAA;EAEA,OAAOS,WAAW,GAAGA,WAAW;EAChC,OAAOxC,UAAU,GAAGA,UAAU;EAC9B,OAAOyC,EAAE,GAAG,QAAQ;EACpB,OAAOC,UAAU,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAE,QAAQ,CAAE,CAAC;AAC/C,EAAA,OAAOC,OAAO,GAAG1D,SAAS,CAAC2D,aAAa,CAAC;AACrCC,IAAAA,IAAI,EAAE;AAAEC,MAAAA,OAAO,EAAE,IAAI;AAAEC,MAAAA,OAAO,EAAE;AAAK;AACzC,GAAC,CAAC;EACF,OAAOC,UAAU,GAAGP,MAAM,CAACC,MAAM,CAAC,CAAE,eAAe,CAAE,CAAC;EACtD,OAAOO,MAAM,GAAGC,oBAAoB;EACpC,OAAOC,cAAc,GAAGC,6BAA6B;EACrD,OAAOC,cAAc,GAAGC,6BAA6B;AACzD;;;;"}
1
+ {"version":3,"file":"CjsWebgpuFormat.js","sources":["../../../../../src/resource/formats/webgpu/CjsWebgpuFormat.js"],"sourcesContent":["import { CjsFormat } from \"../../format/CjsFormat.js\";\r\nimport { CLASS_KEYS } from \"./core/schema.js\";\r\nimport { lowerDxbcToIr } from \"./core/ir/lowerDxbcToIr.js\";\r\nimport { buildWgsl } from \"./core/wgsl/emitWgsl.js\";\r\nimport { buildWgslBindingPlan } from \"./core/wgsl/buildWgslBindingPlan.js\";\r\nimport { buildWgslSet } from \"./core/wgsl/buildWgslSet.js\";\r\nimport { buildEffectPackage } from \"./core/packageEffect.js\";\r\nimport { FORMAT_WEBGPU_PACKAGE_VERSION } from \"./core/packageMetadata.js\";\r\nimport {\r\n CARBON_WEBGPU_ANALYSIS_FORMAT,\r\n CARBON_WEBGPU_FORMAT,\r\n DEFAULT_VALUES,\r\n OUTPUT_JSON,\r\n analyzeEffectWithValues,\r\n inspectWithValues,\r\n isCarbonWebgpu,\r\n normalizeValues,\r\n readWithValues,\r\n toJsonValue,\r\n validateClass,\r\n validateClassKey\r\n} from \"./core/helpers.js\";\r\n\r\nconst FORMAT_NAME = \"CjsWebgpuFormat\";\r\n\r\n/**\r\n * CarbonEngineJS-facing format surface for `.carbonwebgpu` WebGPU packages, plus an\r\n * offline effect-analysis helper built on the runtime resource HLSL and DXBC\r\n * format subpaths.\r\n *\r\n * The package owns read/build, normalized shader analysis, and the current\r\n * bounded DXBC-to-WGSL profiles. Broader shader-semantic coverage remains an\r\n * explicit qualification ladder.\r\n */\r\nexport class CjsWebgpuFormat extends CjsFormat\r\n{\r\n _emit = DEFAULT_VALUES.emit;\r\n _source = DEFAULT_VALUES.source;\r\n _decodeInstructions = DEFAULT_VALUES.decodeInstructions;\r\n _permutation = DEFAULT_VALUES.permutation;\r\n _schema = DEFAULT_VALUES.schema;\r\n _classes = {};\r\n\r\n /**\r\n * Create a reusable format profile.\r\n *\r\n * @param {object} [options] Default format values.\r\n */\r\n constructor(options = {})\r\n {\r\n super();\r\n this.SetValues(options);\r\n }\r\n\r\n /**\r\n * Set format values for this reusable profile.\r\n *\r\n * @param {object} [options] Values to merge into the profile.\r\n * @returns {CjsWebgpuFormat} This format profile.\r\n */\r\n SetValues(options = {})\r\n {\r\n const values = normalizeValues(this.GetValues(), options, CLASS_KEYS, FORMAT_NAME);\r\n this._emit = values.emit;\r\n this._source = values.source;\r\n this._decodeInstructions = values.decodeInstructions;\r\n this._permutation = values.permutation;\r\n this._schema = values.schema;\r\n this._classes = values.classes;\r\n return this;\r\n }\r\n\r\n /**\r\n * Get this profile's current values, optionally with per-call overrides.\r\n *\r\n * @param {object} [options] Optional values to merge into a copy.\r\n * @returns {object} A copy of the effective values.\r\n */\r\n GetValues(options = {})\r\n {\r\n return normalizeValues({\r\n emit: this._emit,\r\n source: this._source,\r\n decodeInstructions: this._decodeInstructions,\r\n permutation: this._permutation,\r\n schema: this._schema,\r\n classes: this._classes\r\n }, options, CLASS_KEYS, FORMAT_NAME);\r\n }\r\n\r\n /**\r\n * Set multiple node-class constructors for this profile.\r\n *\r\n * @param {object} [classes] Map of node class keys to constructors.\r\n * @returns {CjsWebgpuFormat} This format profile.\r\n */\r\n SetClasses(classes = {})\r\n {\r\n return this.SetValues({ classes });\r\n }\r\n\r\n /**\r\n * Set one node-class constructor for this profile.\r\n *\r\n * @param {string} type Node class key.\r\n * @param {Function|null|undefined} Class constructor to use, or nullish to delete.\r\n * @returns {CjsWebgpuFormat} This format profile.\r\n */\r\n SetClass(type, Class)\r\n {\r\n validateClassKey(CLASS_KEYS, type, FORMAT_NAME);\r\n if (Class === null || Class === undefined)\r\n {\r\n delete this._classes[type];\r\n return this;\r\n }\r\n\r\n validateClass(CLASS_KEYS, type, Class, FORMAT_NAME);\r\n this._classes = { ...this._classes, [type]: Class };\r\n return this;\r\n }\r\n\r\n /**\r\n * Get a configured node-class constructor.\r\n *\r\n * @param {string} type Node class key.\r\n * @returns {Function|undefined} The registered constructor, if any.\r\n */\r\n GetClass(type)\r\n {\r\n validateClassKey(CLASS_KEYS, type, FORMAT_NAME);\r\n return this._classes[type];\r\n }\r\n\r\n /**\r\n * Whether this format profile has a constructor registered for a node key.\r\n *\r\n * @param {string} type Node class key.\r\n * @returns {boolean} True when a constructor is registered.\r\n */\r\n HasClass(type)\r\n {\r\n return !!this.GetClass(type);\r\n }\r\n\r\n /**\r\n * Read a Carbon WebGPU package with this profile's values.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain JSON data: the container-backed views plus the complete backend body set.\r\n */\r\n Read(input, options = {})\r\n {\r\n return readWithValues(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Inspect a Carbon WebGPU package without building the full JSON shape.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain summary data.\r\n */\r\n Inspect(input, options = {})\r\n {\r\n return inspectWithValues(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Analyzes one compiled effect payload into a normalized WebGPU-facing\r\n * document using the current profile's values.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Tr2 effect bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain JSON-compatible analysis data.\r\n */\r\n AnalyzeEffect(input, options = {})\r\n {\r\n return analyzeEffectWithValues(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Builds a Carbon WebGPU package with complete version-15 source reflection and\r\n * selected-body WebGPU output from compiled Tr2 effect bytes.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\r\n * @param {object} [options] Source, body-mode, permutation, and stage-selection policy.\r\n * @returns {object} Package bytes plus inspection and provenance documents.\r\n */\r\n BuildEffect(input, options = {})\r\n {\r\n const values = this.GetValues();\r\n\r\n return buildEffectPackage(input, {\r\n source: values.source,\r\n permutation: values.permutation,\r\n ...options\r\n });\r\n }\r\n\r\n /**\r\n * Lowers DXBC bytes or decoded instructions into the front-end shader IR.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC input.\r\n * @param {object} [options] IR provenance options.\r\n * @returns {object} Frozen shader IR program.\r\n */\r\n BuildShaderIr(input, options = {})\r\n {\r\n return lowerDxbcToIr(input, options);\r\n }\r\n\r\n /**\r\n * Emits WGSL for the currently supported typed shader slice.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC or shader IR.\r\n * @param {object} [options] Source/provenance options.\r\n * @returns {object} Frozen WGSL shader descriptor.\r\n */\r\n BuildWgsl(input, options = {})\r\n {\r\n return buildWgsl(input, options);\r\n }\r\n\r\n /**\r\n * Assign one canonical numeric binding layout across shader stages in a pass.\r\n * Unshared D3D tuples remain stage-scoped unless shared explicitly.\r\n *\r\n * @param {object[]} programs Complete CJS shader IR stage set for one pass.\r\n * @param {object} [options] Pass-level binding policy.\r\n * @param {string[]} [options.sharedIdentities] Compatible D3D identities\r\n * confirmed to represent one resource across stages.\r\n * @returns {object} Frozen CJS_WGSL_BINDING_PLAN document.\r\n */\r\n BuildWgslBindingPlan(programs, options = {})\r\n {\r\n return buildWgslBindingPlan(programs, options);\r\n }\r\n\r\n /**\r\n * Assembles emitted shader descriptors into a portable WGSL set.\r\n *\r\n * @param {object[]} entries Canonically keyed emitted shader descriptors.\r\n * @returns {object} Frozen CJS_WGSL_SET document.\r\n */\r\n BuildWgslSet(entries)\r\n {\r\n return buildWgslSet(entries);\r\n }\r\n\r\n /**\r\n * Convert format output to JSON-compatible data.\r\n *\r\n * @param {any} value Format output to convert.\r\n * @returns {any} Plain JSON-compatible data.\r\n */\r\n ToJSON(value)\r\n {\r\n return toJsonValue(value);\r\n }\r\n\r\n /**\r\n * Static payload sniff. Static methods use camelCase by convention.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.\r\n * @returns {boolean} True when the payload has Carbon's version-15 shape.\r\n */\r\n static isCarbonWebgpu(input)\r\n {\r\n return isCarbonWebgpu(input);\r\n }\r\n\r\n /**\r\n * Static one-shot read.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain JSON data: the container-backed views plus the complete backend body set.\r\n */\r\n static read(input, options = {})\r\n {\r\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, options, CLASS_KEYS, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static one-shot inspection.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain summary data.\r\n */\r\n static inspect(input, options = {})\r\n {\r\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, options, CLASS_KEYS, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static one-shot effect analysis.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Tr2 effect bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain JSON-compatible analysis data.\r\n */\r\n static analyzeEffect(input, options = {})\r\n {\r\n return analyzeEffectWithValues(input, normalizeValues(DEFAULT_VALUES, options, CLASS_KEYS, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static selected-body Carbon WebGPU builder.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\r\n * @param {object} [options] Source, body-mode, permutation, and stage-selection policy.\r\n * @returns {object} Package bytes plus inspection and provenance documents.\r\n */\r\n static buildEffect(input, options = {})\r\n {\r\n return buildEffectPackage(input, options);\r\n }\r\n\r\n /**\r\n * Static DXBC-to-front-end-IR helper.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC input.\r\n * @param {object} [options] IR provenance options.\r\n * @returns {object} Frozen shader IR program.\r\n */\r\n static buildShaderIr(input, options = {})\r\n {\r\n return lowerDxbcToIr(input, options);\r\n }\r\n\r\n /**\r\n * Static WGSL emission helper for the currently supported typed slice.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC or shader IR.\r\n * @param {object} [options] Source/provenance options.\r\n * @returns {object} Frozen WGSL shader descriptor.\r\n */\r\n static buildWgsl(input, options = {})\r\n {\r\n return buildWgsl(input, options);\r\n }\r\n\r\n /**\r\n * Static pass-global WGSL binding-plan helper. Unshared D3D tuples remain\r\n * stage-scoped unless listed in options.sharedIdentities.\r\n *\r\n * @param {object[]} programs Complete CJS shader IR stage set for one pass.\r\n * @param {object} [options] Pass-level binding policy.\r\n * @param {string[]} [options.sharedIdentities] Compatible D3D identities\r\n * confirmed to represent one resource across stages.\r\n * @returns {object} Frozen CJS_WGSL_BINDING_PLAN document.\r\n */\r\n static buildWgslBindingPlan(programs, options = {})\r\n {\r\n return buildWgslBindingPlan(programs, options);\r\n }\r\n\r\n /**\r\n * Static WGSL-set assembly helper.\r\n *\r\n * @param {object[]} entries Canonically keyed emitted shader descriptors.\r\n * @returns {object} Frozen CJS_WGSL_SET document.\r\n */\r\n static buildWgslSet(entries)\r\n {\r\n return buildWgslSet(entries);\r\n }\r\n\r\n /**\r\n * Static JSON-compatible conversion.\r\n *\r\n * @param {any} value Format output to convert.\r\n * @returns {any} Plain JSON-compatible data.\r\n */\r\n static toJSON(value)\r\n {\r\n return toJsonValue(value);\r\n }\r\n\r\n static classKeys = CLASS_KEYS;\r\n static id = \"CjsWebgpuFormat\";\r\n static mediaTypes = [ \"shader\" ];\r\n static outputs = CjsFormat.defineOutputs({\r\n json: { default: true, decoded: true }\r\n });\r\n static extensions = [ \".carbonwebgpu\" ];\r\n static format = CARBON_WEBGPU_FORMAT;\r\n static analysisFormat = CARBON_WEBGPU_ANALYSIS_FORMAT;\r\n static packageVersion = FORMAT_WEBGPU_PACKAGE_VERSION;\r\n}\r\n\r\nexport default CjsWebgpuFormat;\r\n"],"names":["FORMAT_NAME","CjsWebgpuFormat","CjsFormat","_emit","DEFAULT_VALUES","emit","_source","source","_decodeInstructions","decodeInstructions","_permutation","permutation","_schema","schema","_classes","constructor","options","SetValues","values","normalizeValues","GetValues","CLASS_KEYS","classes","SetClasses","SetClass","type","Class","validateClassKey","undefined","validateClass","GetClass","HasClass","Read","input","readWithValues","Inspect","inspectWithValues","AnalyzeEffect","analyzeEffectWithValues","BuildEffect","buildEffectPackage","BuildShaderIr","lowerDxbcToIr","BuildWgsl","buildWgsl","BuildWgslBindingPlan","programs","buildWgslBindingPlan","BuildWgslSet","entries","buildWgslSet","ToJSON","value","toJsonValue","isCarbonWebgpu","read","inspect","analyzeEffect","buildEffect","buildShaderIr","toJSON","classKeys","id","mediaTypes","outputs","defineOutputs","json","default","decoded","extensions","format","CARBON_WEBGPU_FORMAT","analysisFormat","CARB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OC,UAAU,GAAG,CAAE,QAAQ,CAAE;AAChC,EAAA,OAAOC,OAAO,GAAG9D,SAAS,CAAC+D,aAAa,CAAC;AACrCC,IAAAA,IAAI,EAAE;AAAEC,MAAAA,OAAO,EAAE,IAAI;AAAEC,MAAAA,OAAO,EAAE;AAAK;AACzC,GAAC,CAAC;AACF,EAAA,OAAOC,UAAU,GAAG,CAAE,eAAe,CAAE;EACvC,OAAOC,MAAM,GAAGC,oBAAoB;EACpC,OAAOC,cAAc,GAAGC,6BAA6B;EACrD,OAAOC,cAAc,GAAGC,6BAA6B;AACzD;;;;"}
@@ -17,4 +17,4 @@ class WebgpuReadError extends Error {
17
17
  }
18
18
 
19
19
  export { WebgpuReadError };
20
- //# sourceMappingURL=errors.js.map
20
+ //# sourceMappingURL=WebgpuReadError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebgpuReadError.js","sources":["../../../../../../src/resource/formats/webgpu/core/WebgpuReadError.js"],"sourcesContent":["/**\r\n * Error raised when a Carbon WebGPU package or WebGPU analysis pass cannot be\r\n * completed safely.\r\n */\r\nexport class WebgpuReadError extends Error\r\n{\r\n /**\r\n * Creates a read/analysis error with structured location details.\r\n *\r\n * @param {string} message Human-readable failure reason.\r\n * @param {object} [details] Extra reader state such as source or offset.\r\n */\r\n constructor(message, details = {})\r\n {\r\n super(message);\r\n this.name = \"WebgpuReadError\";\r\n this.details = details;\r\n }\r\n}\r\n"],"names":["WebgpuReadError","Error","constructor","message","details","name"],"mappings":"AAAA;AACA;AACA;AACA;AACO,MAAMA,eAAe,SAASC,KAAK,CAC1C;AACI;AACJ;AACA;AACA;AACA;AACA;AACIC,EAAAA,WAAWA,CAACC,OAAO,EAAEC,OAAO,GAAG,EAAE,EACjC;IACI,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,iBAAiB;IAC7B,IAAI,CAACD,OAAO,GAAGA,OAAO;AAC1B,EAAA;AACJ;;;;"}
@@ -1,4 +1,4 @@
1
- import { WebgpuReadError } from '../errors.js';
1
+ import { WebgpuReadError } from '../WebgpuReadError.js';
2
2
 
3
3
  /**
4
4
  * Structural validation for a loaded WebGPU effect container.
@@ -1 +1 @@
1
- {"version":3,"file":"validateContainer.js","sources":["../../../../../../../src/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js"],"sourcesContent":["import { WebgpuReadError } from \"../errors.js\";\r\n\r\n/**\r\n * Structural validation for a loaded WebGPU effect container.\r\n *\r\n * This replaces `validateEffectPackageEnvelope`, which was 1762 lines. Most of\r\n * that is **deleted rather than translated**, and the reason matters: those\r\n * checks were not format invariants. The chunk container shattered one logical\r\n * tree into flat string-keyed arrays across `INFO`, `META`, `ANLS`, `WGSL`,\r\n * `PGRF` and `WGSB`, each holding a projection of the same effect, and roughly\r\n * 600 lines asserted that the projections still agreed with each other. A record\r\n * layout makes that question unaskable: containment replaces reference, position\r\n * replaces key, and the count word before an array replaces `Array.isArray`.\r\n *\r\n * What is deliberately **not** re-checked here, because phase 1 already enforces\r\n * it and checking twice means two places to keep correct:\r\n *\r\n * - count caps, arena containment, offset-table density and positional indexing,\r\n * and the version range — `CjsCarbonEffectReader`;\r\n * - every sized record parsing to exactly its declared end — Rule 1, in the\r\n * record codec and the block codec;\r\n * - duplicate stage type within a pass, and stage-type range — the shape adapter\r\n * fails closed on both, which is where a runtime description is built.\r\n *\r\n * What remains is the one thing that is genuinely this layer's: the container\r\n * admits all six of Carbon's stage types by design, and WebGPU can express three.\r\n * That restriction belongs to the backend, not to the container — the Carbon\r\n * region is backend-invariant, and a container that admitted only three would not\r\n * be Carbon's container.\r\n */\r\n\r\n/** Stage types WebGPU can express, by Carbon's `InputStageType` numbering. */\r\nconst WEBGPU_STAGE_TYPES = new Set([ 0, 1, 2 ]);\r\n\r\n/**\r\n * Validates a loaded container for WebGPU consumption.\r\n *\r\n * @param {object} container Loaded `CarbonWebgpuContainer`.\r\n * @param {object} [options] Validation options.\r\n * @param {string} [options.source] Source label for diagnostics.\r\n * @throws {WebgpuReadError} When the container cannot serve WebGPU.\r\n */\r\nexport function validateEffectContainer(container, options = {})\r\n{\r\n const source = options.source || container.sourcePath || \"memory\";\r\n\r\n if (!container?.IsGood())\r\n {\r\n throw new WebgpuReadError(\"Carbon WebGPU container is not readable\", {\r\n source,\r\n cause: container?.readError ?? null\r\n });\r\n }\r\n\r\n if (!container.carbon.records.length)\r\n {\r\n throw new WebgpuReadError(\"Carbon WebGPU container declares no permutation bodies\", { source });\r\n }\r\n\r\n // One check per distinct stored body. Aliased rows share a blob, so checking\r\n // per permutation would re-check identical bytes up to twenty times over on\r\n // the effects that alias hardest.\r\n const checked = new Set();\r\n\r\n for (let index = 0; index < container.carbon.records.length; index += 1)\r\n {\r\n const offset = container.carbon.records[index].offset;\r\n if (checked.has(offset)) continue;\r\n checked.add(offset);\r\n\r\n const description = container.GetDescription(index);\r\n\r\n for (const technique of description.techniques)\r\n {\r\n for (const [ passIndex, pass ] of technique.passes.entries())\r\n {\r\n for (const stage of pass.stages)\r\n {\r\n // A stage carrying no program is reflection-only: the body\r\n // is known, the translation is not, and the emitter says so\r\n // with a zero-length payload. Those are legitimate — 107\r\n // shipped body-passes carry a geometry stage — so the rule\r\n // is about stages with a program, not about stages.\r\n if (stage.shaderData.size === 0) continue;\r\n\r\n if (!WEBGPU_STAGE_TYPES.has(stage.type))\r\n {\r\n throw new WebgpuReadError(\r\n `Carbon WebGPU container carries a program for stage type ${stage.type}, `\r\n + \"which WebGPU cannot express\",\r\n {\r\n source,\r\n permutationIndex: index,\r\n pass: `${technique.name.value}.pass${passIndex}`,\r\n stageType: stage.type\r\n }\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport default validateEffectContainer;\r\n"],"names":["WEBGPU_STAGE_TYPES","Set","validateEffectContainer","container","options","source","sourcePath","IsGood","WebgpuReadError","cause","readError","carbon","records","length","checked","index","offset","has","add","description","GetDescription","technique","techniques","passIndex","pass","passes","entries","stage","stages","shaderData","size","type","permutationIndex","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G,WAAW,GAAGhB,SAAS,CAACiB,cAAc,CAACL,KAAK,CAAC;AAEnD,IAAA,KAAK,MAAMM,SAAS,IAAIF,WAAW,CAACG,UAAU,EAC9C;AACI,MAAA,KAAK,MAAM,CAAEC,SAAS,EAAEC,IAAI,CAAE,IAAIH,SAAS,CAACI,MAAM,CAACC,OAAO,EAAE,EAC5D;AACI,QAAA,KAAK,MAAMC,KAAK,IAAIH,IAAI,CAACI,MAAM,EAC/B;AACI;AACA;AACA;AACA;AACA;AACA,UAAA,IAAID,KAAK,CAACE,UAAU,CAACC,IAAI,KAAK,CAAC,EAAE;UAEjC,IAAI,CAAC9B,kBAAkB,CAACiB,GAAG,CAACU,KAAK,CAACI,IAAI,CAAC,EACvC;YACI,MAAM,IAAIvB,eAAe,CACrB,CAAA,yDAAA,EAA4DmB,KAAK,CAACI,IAAI,CAAA,EAAA,CAAI,GACxE,6BAA6B,EAC/B;cACI1B,MAAM;AACN2B,cAAAA,gBAAgB,EAAEjB,KAAK;cACvBS,IAAI,EAAE,GAAGH,SAAS,CAACY,IAAI,CAACC,KAAK,CAAA,KAAA,EAAQX,SAAS,CAAA,CAAE;cAChDY,SAAS,EAAER,KAAK,CAACI;AACrB,aACJ,CAAC;AACL,UAAA;AACJ,QAAA;AACJ,MAAA;AACJ,IAAA;AACJ,EAAA;AACJ;;;;"}
1
+ {"version":3,"file":"validateContainer.js","sources":["../../../../../../../src/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js"],"sourcesContent":["import { WebgpuReadError } from \"../WebgpuReadError.js\";\r\n\r\n/**\r\n * Structural validation for a loaded WebGPU effect container.\r\n *\r\n * This replaces `validateEffectPackageEnvelope`, which was 1762 lines. Most of\r\n * that is **deleted rather than translated**, and the reason matters: those\r\n * checks were not format invariants. The chunk container shattered one logical\r\n * tree into flat string-keyed arrays across `INFO`, `META`, `ANLS`, `WGSL`,\r\n * `PGRF` and `WGSB`, each holding a projection of the same effect, and roughly\r\n * 600 lines asserted that the projections still agreed with each other. A record\r\n * layout makes that question unaskable: containment replaces reference, position\r\n * replaces key, and the count word before an array replaces `Array.isArray`.\r\n *\r\n * What is deliberately **not** re-checked here, because phase 1 already enforces\r\n * it and checking twice means two places to keep correct:\r\n *\r\n * - count caps, arena containment, offset-table density and positional indexing,\r\n * and the version range — `CjsCarbonEffectReader`;\r\n * - every sized record parsing to exactly its declared end — Rule 1, in the\r\n * record codec and the block codec;\r\n * - duplicate stage type within a pass, and stage-type range — the shape adapter\r\n * fails closed on both, which is where a runtime description is built.\r\n *\r\n * What remains is the one thing that is genuinely this layer's: the container\r\n * admits all six of Carbon's stage types by design, and WebGPU can express three.\r\n * That restriction belongs to the backend, not to the container — the Carbon\r\n * region is backend-invariant, and a container that admitted only three would not\r\n * be Carbon's container.\r\n */\r\n\r\n/** Stage types WebGPU can express, by Carbon's `InputStageType` numbering. */\r\nconst WEBGPU_STAGE_TYPES = new Set([ 0, 1, 2 ]);\r\n\r\n/**\r\n * Validates a loaded container for WebGPU consumption.\r\n *\r\n * @param {object} container Loaded `CarbonWebgpuContainer`.\r\n * @param {object} [options] Validation options.\r\n * @param {string} [options.source] Source label for diagnostics.\r\n * @throws {WebgpuReadError} When the container cannot serve WebGPU.\r\n */\r\nexport function validateEffectContainer(container, options = {})\r\n{\r\n const source = options.source || container.sourcePath || \"memory\";\r\n\r\n if (!container?.IsGood())\r\n {\r\n throw new WebgpuReadError(\"Carbon WebGPU container is not readable\", {\r\n source,\r\n cause: container?.readError ?? null\r\n });\r\n }\r\n\r\n if (!container.carbon.records.length)\r\n {\r\n throw new WebgpuReadError(\"Carbon WebGPU container declares no permutation bodies\", { source });\r\n }\r\n\r\n // One check per distinct stored body. Aliased rows share a blob, so checking\r\n // per permutation would re-check identical bytes up to twenty times over on\r\n // the effects that alias hardest.\r\n const checked = new Set();\r\n\r\n for (let index = 0; index < container.carbon.records.length; index += 1)\r\n {\r\n const offset = container.carbon.records[index].offset;\r\n if (checked.has(offset)) continue;\r\n checked.add(offset);\r\n\r\n const description = container.GetDescription(index);\r\n\r\n for (const technique of description.techniques)\r\n {\r\n for (const [ passIndex, pass ] of technique.passes.entries())\r\n {\r\n for (const stage of pass.stages)\r\n {\r\n // A stage carrying no program is reflection-only: the body\r\n // is known, the translation is not, and the emitter says so\r\n // with a zero-length payload. Those are legitimate — 107\r\n // shipped body-passes carry a geometry stage — so the rule\r\n // is about stages with a program, not about stages.\r\n if (stage.shaderData.size === 0) continue;\r\n\r\n if (!WEBGPU_STAGE_TYPES.has(stage.type))\r\n {\r\n throw new WebgpuReadError(\r\n `Carbon WebGPU container carries a program for stage type ${stage.type}, `\r\n + \"which WebGPU cannot express\",\r\n {\r\n source,\r\n permutationIndex: index,\r\n pass: `${technique.name.value}.pass${passIndex}`,\r\n stageType: stage.type\r\n }\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport default validateEffectContainer;\r\n"],"names":["WEBGPU_STAGE_TYPES","Set","validateEffectContainer","container","options","source","sourcePath","IsGood","WebgpuReadError","cause","readError","carbon","records","length","checked","index","offset","has","add","description","GetDescription","technique","techniques","passIndex","pass","passes","entries","stage","stages","shaderData","size","type","permutationIndex","name","value","stageType"],"mappings":";;AAEA;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;AACA;AACA;;AAEA;AACA,MAAMA,kBAAkB,GAAG,IAAIC,GAAG,CAAC,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAAC;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAACC,SAAS,EAAEC,OAAO,GAAG,EAAE,EAC/D;EACI,MAAMC,MAAM,GAAGD,OAAO,CAACC,MAAM,IAAIF,SAAS,CAACG,UAAU,IAAI,QAAQ;AAEjE,EAAA,IAAI,CAACH,SAAS,EAAEI,MAAM,EAAE,EACxB;AACI,IAAA,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AK,CAACI,IAAI,CAAA,EAAA,CAAI,GACxE,6BAA6B,EAC/B;cACI1B,MAAM;AACN2B,cAAAA,gBAAgB,EAAEjB,KAAK;cACvBS,IAAI,EAAE,GAAGH,SAAS,CAACY,IAAI,CAACC,KAAK,CAAA,KAAA,EAAQX,SAAS,CAAA,CAAE;cAChDY,SAAS,EAAER,KAAK,CAACI;AACrB,aACJ,CAAC;AACL,UAAA;AACJ,QAAA;AACJ,MAAA;AACJ,IAAA;AACJ,EAAA;AACJ;;;;"}
@@ -5,7 +5,7 @@ import { readEffectAnalysis, normalizeBytecodeBytes } from './effectAnalysis.js'
5
5
  import { looksLikeCarbonWebgpuContainer, CarbonWebgpuContainer } from './carbonWebgpu/CarbonWebgpuContainer.js';
6
6
  import { validateEffectContainer } from './carbonWebgpu/validateContainer.js';
7
7
  import { resolvedPermutationIndex, deriveAnalysis, deriveWgsl, deriveBackendBodySet, deriveMetadata, deriveInfo } from './carbonWebgpu/containerViews.js';
8
- import { WebgpuReadError } from './errors.js';
8
+ import { WebgpuReadError } from './WebgpuReadError.js';
9
9
  import { lowerDxbcToIr } from './ir/lowerDxbcToIr.js';
10
10
  import { normalizeEffectPermutation, validateResolvedPermutation } from './packageEffectSelection.js';
11
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sources":["../../../../../../src/resource/formats/webgpu/core/helpers.js"],"sourcesContent":["import { toJsonWithCollections as toJsonValue } from \"../../../format/jsonPolicies.js\";\nimport { asUint8Array } from \"#utils/bytes\";\nimport CjsDxbcFormat from \"../../dxbc/index.js\";\nimport { normalizeBytecodeBytes, readEffectAnalysis } from \"./effectAnalysis.js\";\n\nimport { CarbonWebgpuContainer, looksLikeCarbonWebgpuContainer } from \"./carbonWebgpu/CarbonWebgpuContainer.js\";\nimport { validateEffectContainer } from \"./carbonWebgpu/validateContainer.js\";\nimport {\n deriveAnalysis,\n deriveBackendBodySet,\n deriveInfo,\n deriveMetadata,\n deriveWgsl,\n resolvedPermutationIndex\n} from \"./carbonWebgpu/containerViews.js\";\nimport { WebgpuReadError } from \"./errors.js\";\nimport { lowerDxbcToIr } from \"./ir/lowerDxbcToIr.js\";\nimport {\n normalizeEffectPermutation,\n validateResolvedPermutation\n} from \"./packageEffectSelection.js\";\n\nexport const OUTPUT_JSON = \"json\";\nexport const CARBON_WEBGPU_FORMAT = \"CARBON_WEBGPU\";\nexport const CARBON_WEBGPU_ANALYSIS_FORMAT = \"CARBON_WEBGPU_ANALYSIS\";\nexport const CARBON_WEBGPU_ANALYSIS_VERSION = 1;\n\nexport const DEFAULT_VALUES = Object.freeze({\n emit: OUTPUT_JSON,\n source: \"memory\",\n decodeInstructions: true,\n permutation: null,\n schema: null,\n classes: Object.freeze({})\n});\n\nconst OPTION_KEYS = new Set([ \"emit\", \"source\", \"decodeInstructions\", \"permutation\", \"schema\", \"classes\" ]);\n// One emit, as WebGL has. `Read` returns the container-backed document and that\n// document is complete: the analysis, WGSL, metadata and permutation views the\n// caller selects among, plus `backendBodySet`, which is every translated body\n// joined to its shared translation units.\n//\n// A second `raw` emit used to hand back the live `CarbonWebgpuContainer` because\n// the chunk package's JSON could not express the body set. It became the only way\n// to reach a body, so the former `engine-webgpu` donor duck-typed the container instead of reading\n// the document - and when the chunk package was replaced, the engine kept asking\n// for a shape the producer had stopped emitting. Both halves then failed, in\n// different directions, for weeks: the default emit built pipelines but resolved\n// no bodies, and the raw emit resolved bodies but built no pipelines.\n//\n// Neither is reachable now. The container stays internal to this module.\nconst VALID_EMITS = new Set([ OUTPUT_JSON ]);\n\n\nfunction normalizeEmit(emit, readerName)\n{\n if (emit === undefined || VALID_EMITS.has(emit)) return OUTPUT_JSON;\n throw new TypeError(`${readerName}: emit must be \"${OUTPUT_JSON}\", got ${JSON.stringify(emit)}`);\n}\n\nfunction assertKnownOptions(options, readerName)\n{\n for (const key of Object.keys(options))\n {\n if (!OPTION_KEYS.has(key))\n {\n throw new TypeError(`${readerName}: unknown option ${JSON.stringify(key)}`);\n }\n }\n}\n\nfunction classMap(values)\n{\n return values && values.classes ? values.classes : {};\n}\n\nfunction cloneValues(values)\n{\n return {\n emit: values.emit,\n source: values.source ?? DEFAULT_VALUES.source,\n decodeInstructions: values.decodeInstructions ?? DEFAULT_VALUES.decodeInstructions,\n permutation: values.permutation ?? null,\n schema: values.schema ?? null,\n classes: { ...classMap(values) }\n };\n}\n\n/**\n * Rejects class override keys outside a format reader's supported class set.\n *\n * @param {string[]} classKeys Supported class override keys.\n * @param {string} key Candidate override key.\n * @param {string} readerName Reader name used in diagnostics.\n */\nexport function validateClassKey(classKeys, key, readerName)\n{\n if (!classKeys.includes(key))\n {\n throw new Error(`${readerName} unknown class type \"${String(key)}\"`);\n }\n}\n\n/**\n * Validates one constructor supplied through a format reader class override.\n *\n * @param {string[]} classKeys Supported class override keys.\n * @param {string} type Candidate override key.\n * @param {Function} Class Candidate constructor.\n * @param {string} readerName Reader name used in diagnostics.\n */\nexport function validateClass(classKeys, type, Class, readerName)\n{\n validateClassKey(classKeys, type, readerName);\n if (typeof Class !== \"function\")\n {\n throw new TypeError(`${readerName} class \"${type}\" must be a constructor`);\n }\n}\n\nfunction mergeClasses(values, classes, classKeys, readerName)\n{\n if (!classes || typeof classes !== \"object\")\n {\n throw new TypeError(`${readerName} classes option must be an object`);\n }\n\n const next = { ...values.classes };\n for (const [ type, Class ] of Object.entries(classes))\n {\n validateClass(classKeys, type, Class, readerName);\n next[type] = Class;\n }\n values.classes = next;\n}\n\n/**\n * Merge format values over a base set and validate them.\n *\n * @param {object} base Current values.\n * @param {object} [options] Values to merge in.\n * @param {string[]} classKeys Valid class keys.\n * @param {string} readerName Reader name used in error messages.\n * @returns {object} A validated copy of the merged values.\n */\nexport function normalizeValues(base, options = {}, classKeys = [], readerName = \"CjsWebgpuFormat\")\n{\n if (!options || typeof options !== \"object\")\n {\n throw new TypeError(`${readerName} options must be an object`);\n }\n\n assertKnownOptions(options, readerName);\n\n const values = cloneValues(base);\n if (Object.hasOwn(options, \"emit\")) values.emit = normalizeEmit(options.emit, readerName);\n if (Object.hasOwn(options, \"source\")) values.source = typeof options.source === \"string\" && options.source ? options.source : DEFAULT_VALUES.source;\n if (Object.hasOwn(options, \"decodeInstructions\")) values.decodeInstructions = !!options.decodeInstructions;\n if (Object.hasOwn(options, \"permutation\")) values.permutation = options.permutation ?? null;\n if (Object.hasOwn(options, \"schema\")) values.schema = options.schema ?? null;\n if (Object.hasOwn(options, \"classes\")) mergeClasses(values, options.classes, classKeys, readerName);\n return values;\n}\n\n/**\n * Normalize caller input into a Uint8Array of package bytes.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.\n * @returns {Uint8Array} The payload bytes.\n */\n/**\n * Reports whether a payload has the Carbon v15 container shape.\n *\n * This is a **shape** check, not an identity check. Our containers are stock\n * Carbon v15 files, so nothing in the bytes separates one from a shipped\n * `effect.dx11` file -- and nothing should. Identity comes from the resource\n * path the file was resolved through, exactly as it does for Carbon, whose own\n * three backend trees are byte-format-identical with no language field anywhere.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.\n * @returns {boolean} True when the payload opens on Carbon's v15 version dword.\n */\nexport function isCarbonWebgpu(input)\n{\n try\n {\n return looksLikeCarbonWebgpuContainer(asUint8Array(input, \"CjsWebgpuFormat input\"));\n }\n catch\n {\n return false;\n }\n}\n\n/**\n * The shared read path used by the instance Read/Inspect and static one-shots.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU container payload.\n * @param {object} values Normalized format values.\n * @returns {CarbonWebgpuContainer} The loaded container.\n */\nexport function readRaw(input, values)\n{\n const bytes = asUint8Array(input, \"CjsWebgpuFormat input\");\n const container = new CarbonWebgpuContainer();\n const ok = container.Read(bytes, { sourcePath: values.source });\n\n if (!ok)\n {\n throw new WebgpuReadError(\n container.readError ? container.readError.message : \"Failed to read Carbon WebGPU container\",\n {\n source: values.source,\n cause: container.readError || null\n }\n );\n }\n\n try\n {\n validateEffectContainer(container, { source: values.source });\n }\n catch (error)\n {\n if (error instanceof WebgpuReadError) throw error;\n throw new WebgpuReadError(error.message, {\n source: values.source,\n cause: error\n });\n }\n\n return container;\n}\n\n/**\n * Converts a loaded container to the documented plain JSON shape.\n *\n * `analysis` and `wgsl` are **derived views**, not stored documents. The chunk\n * package kept them beside the reflection they were computed from and carried\n * digests to detect the two disagreeing; there is now one document, so there is\n * nothing left to disagree and no digest to carry.\n *\n * `chunks` is gone. It described a container that no longer exists, and a record\n * layout has no chunk table to translate it into.\n *\n * @param {CarbonWebgpuContainer} container Loaded container.\n * @param {object} [options] View options.\n * @returns {object} Plain JSON data.\n */\nexport function packageToJson(container, options = {})\n{\n const source = options.source || container.sourcePath || \"memory\";\n const permutationIndex = options.permutationIndex ?? resolvedPermutationIndex(container);\n const analysis = deriveAnalysis(container, { source, permutationIndex });\n const wgsl = deriveWgsl(container, { permutationIndex });\n\n return toJsonValue({\n format: CARBON_WEBGPU_FORMAT,\n version: container.carbon.version,\n sourcePath: source,\n info: deriveInfo(container, { source }),\n metadata: deriveMetadata(container, { source, permutationIndex }),\n permutationGraph: container.permutationGraph,\n analysis,\n wgsl,\n backendBodySet: deriveBackendBodySet(container),\n stages: analysis.stages ?? [],\n shaders: wgsl.shaders ?? [],\n layouts: wgsl.layouts ?? []\n });\n}\n\n/**\n * Shared read entry.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU container payload.\n * @param {object} values Normalized format values.\n * @returns {object} Plain JSON data.\n */\nexport function readWithValues(input, values)\n{\n return packageToJson(readRaw(input, values), { source: values.source });\n}\n\n/**\n * Compact inspection: Carbon version and compiler bytes, body counts, and the\n * resolved analysis/WGSL counts without building the full JSON package shape.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU container payload.\n * @param {object} values Normalized format values.\n * @returns {object} Plain summary data.\n */\nexport function inspectWithValues(input, values)\n{\n const container = readRaw(input, values);\n const graph = container.permutationGraph;\n const permutationIndex = resolvedPermutationIndex(container);\n const analysis = deriveAnalysis(container, { source: values.source, permutationIndex });\n const wgsl = deriveWgsl(container, { permutationIndex });\n\n return {\n source: values.source,\n isCarbonWebgpu: true,\n version: container.carbon.version,\n compilerVersion: [ ...container.carbon.compilerVersion ],\n permutationCount: graph.variants.length,\n uniqueBodyCount: graph.bodies.length,\n stageCount: analysis.stages.length,\n shaderCount: wgsl.shaders.length,\n layoutCount: wgsl.layouts.length\n };\n}\n\nfunction dxbcSource(source, key)\n{\n return source ? `${source}#${key}` : key;\n}\n\nfunction resolvedStageBytecode(stage, key, bytecodeByKey)\n{\n if (!Number.isInteger(stage.stageType)\n || !Number.isInteger(stage.passIndex)\n || typeof stage.techniqueName !== \"string\"\n || !stage.techniqueName\n || typeof stage.stageName !== \"string\"\n || !stage.stageName)\n {\n throw new Error(`${key} manifest stage identity is invalid`);\n }\n\n const innerStageType = stage.shaderBytecode?.stageType;\n if (innerStageType !== undefined && !Number.isInteger(innerStageType))\n {\n throw new Error(`${key} manifest stage bytecode type is invalid`);\n }\n\n let raw = bytecodeByKey?.get(key);\n if (!raw && bytecodeByKey instanceof Map)\n {\n raw = Array.from(bytecodeByKey.values()).find((entry) =>\n entry.techniqueName === stage.techniqueName\n && entry.passIndex === stage.passIndex\n && entry.stageType === stage.stageType\n );\n }\n if (!raw) return stage.shaderBytecode?.bytes;\n\n if (!Number.isInteger(raw.stageType)\n || stage.stageType !== raw.stageType\n || (innerStageType !== undefined && innerStageType !== raw.stageType)\n || stage.stageName !== raw.stageName\n || (stage.shaderBytecode?.stageName !== undefined\n && stage.shaderBytecode.stageName !== raw.stageName))\n {\n throw new Error(`${key} manifest and raw stage metadata disagree`);\n }\n\n if (stage.shaderBytecode?.bytes !== undefined)\n {\n const manifestBytes = normalizeBytecodeBytes(\n stage.shaderBytecode.bytes,\n `${key} manifest stage bytecode`\n );\n if (!manifestBytes\n || manifestBytes.length !== raw.bytes.length\n || manifestBytes.some((value, index) => value !== raw.bytes[index]))\n {\n throw new Error(`${key} manifest and raw stage bytecode disagree`);\n }\n }\n\n return raw.bytes;\n}\n\nfunction analyzeStage(stage, options)\n{\n const key = `${stage.techniqueName}.pass${stage.passIndex}.${stage.stageName}`;\n const shaderBytecode = stage.shaderBytecode && typeof stage.shaderBytecode === \"object\"\n ? { ...stage.shaderBytecode }\n : stage.shaderBytecode;\n if (shaderBytecode && typeof shaderBytecode === \"object\")\n {\n delete shaderBytecode.bytes;\n }\n const out = {\n ...stage,\n shaderBytecode,\n key,\n dxbc: null,\n dxbcError: null,\n ir: null,\n irError: null\n };\n\n if (options.decodeBytecode === false)\n {\n return out;\n }\n\n const bytecodeBytes = normalizeBytecodeBytes(\n options.bytecodeBytes ?? stage.shaderBytecode?.bytes,\n `${key} stage bytecode`\n );\n if (!bytecodeBytes?.length)\n {\n return out;\n }\n\n try\n {\n out.dxbc = CjsDxbcFormat.read(bytecodeBytes, {\n source: dxbcSource(options.source, key),\n decodeInstructions: options.decodeInstructions\n });\n if (options.decodeInstructions && Array.isArray(out.dxbc.instructions))\n {\n try\n {\n out.ir = lowerDxbcToIr(out.dxbc, { source: dxbcSource(options.source, key) });\n }\n catch (error)\n {\n out.irError = {\n name: error.name,\n message: error.message\n };\n }\n }\n }\n catch (error)\n {\n out.dxbcError = {\n name: error.name,\n message: error.message\n };\n }\n\n return out;\n}\n\n/**\n * Builds the normalized WebGPU analysis document from a resolved effect.\n *\n * @param {object} resolved Raw resolved-effect context from `readEffectAnalysis`.\n * @param {object} [options] Analysis options.\n * @param {string} [options.source] Source label for diagnostics.\n * @param {boolean} [options.decodeBytecode] Whether stage bytecode is inspected.\n * @param {boolean} [options.decodeInstructions] Whether DXBC instructions are decoded.\n * @returns {object} Plain JSON-compatible analysis data.\n */\nexport function buildEffectAnalysis(resolved, options = {})\n{\n const source = options.source || resolved.effectRes?.sourcePath || \"memory\";\n const decodeBytecode = options.decodeBytecode !== undefined ? !!options.decodeBytecode : true;\n const decodeInstructions = options.decodeInstructions !== undefined ? !!options.decodeInstructions : true;\n const manifest = resolved.bindingManifest?.toJSON?.() ?? null;\n const bytecodeByKey = resolved.stageBytecodeByKey instanceof Map\n ? resolved.stageBytecodeByKey\n : null;\n const stages = (manifest?.stages || []).map((stage) =>\n {\n const key = `${stage.techniqueName}.pass${stage.passIndex}.${stage.stageName}`;\n\n return analyzeStage(stage, {\n source,\n decodeBytecode,\n decodeInstructions,\n bytecodeBytes: resolvedStageBytecode(stage, key, bytecodeByKey)\n });\n });\n\n return toJsonValue({\n format: CARBON_WEBGPU_ANALYSIS_FORMAT,\n formatVersion: CARBON_WEBGPU_ANALYSIS_VERSION,\n source,\n effectVersion: resolved.effectDescription?.version ?? manifest?.version ?? resolved.effectRes?.m_version ?? null,\n compilerVersion: resolved.effectRes?.m_compilerVersion ?? null,\n effectName: manifest?.effectName || resolved.effectDescription?.effectName || null,\n bodyIndex: resolved.selection?.bodyIndex ?? 0,\n selectedOptions: resolved.selection?.selectedOptions ?? [],\n passes: manifest?.passes || [],\n stages\n });\n}\n\n/**\n * Analyzes one compiled effect payload into a normalized WebGPU-facing\n * document: selected permutation, Carbon binding manifest, and per-stage DXBC\n * decode.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Tr2 effect payload.\n * @param {object} values Normalized format values.\n * @returns {object} Plain JSON-compatible analysis data.\n */\nexport function analyzeEffectWithValues(input, values)\n{\n const permutation = normalizeEffectPermutation(values.permutation);\n const resolved = readEffectAnalysis(input, {\n source: values.source,\n permutation\n });\n validateResolvedPermutation(\n permutation,\n resolved.selection?.selectedOptions ?? []\n );\n\n return buildEffectAnalysis(resolved, {\n source: values.source,\n decodeInstructions: values.decodeInstructions\n });\n}\n\n/**\n * Deep-convert a value to plain JSON-compatible data.\n *\n * @param {any} value Value to convert.\n * @returns {any} Plain data.\n */\n/** The shared JSON policy for this reader, under the name its callers use. */\nexport { toJsonValue };\n\nexport { WebgpuReadError };\n\n"],"names":["OUTPUT_JSON","CARBON_WEBGPU_FORMAT","CARBON_WEBGPU_ANALYSIS_FORMAT","CARBON_WEBGPU_ANALYSIS_VERSION","DEFAULT_VALUES","Object","freeze","emit","source","decodeInstructions","permutation","schema","classes","OPTION_KEYS","Set","VALID_EMITS","normalizeEmit","readerName","undefined","has","TypeError","JSON","stringify","assertKnownOptions","options","key","keys","classMap","values","cloneValues","validateClassKey","classKeys","includes","Error","String","validateClass","type","Class","mergeClasses","next","entries","normalizeValues","base","hasOwn","isCarbonWebgpu","input","looksLikeCarbonWebgpuContainer","asUint8Array","readRaw","bytes","container","CarbonWebgpuContainer","ok","Read","sourcePath","WebgpuReadError","readError","message","cause","validateEffectContainer","error","packageToJson","permutationIndex","resolvedPermutationIndex","analysis","deriveAnalysis","wgsl","deriveWgsl","toJsonValue","format","version","carbon","info","deriveInfo","metadata","deriveMetadata","permutationGraph","backendBodySet","deriveBackendBodySet","stages","shaders","layouts","readWithValues","inspectWithValues","graph","compilerVersion","permutationCount","variants","length","uniqueBodyCount","bodies","stageCount","shaderCount","layoutCount","dxbcSource","resolvedStageBytecode","stage","bytecodeByKey","Number","isInteger","stageType","passIndex","techniqueName","stageName","innerStageType","shaderBytecode","raw","get","Map","Array","from","find","entry","manifestBytes","normalizeBytecodeBytes","some","value","index","analyzeStage","out","dxbc","dxbcError","ir","irError","decodeBytecode","bytecodeBytes","CjsDxbcFormat","read","isArray","instructions","lowerDxbcToIr","name","buildEffectAnalysis","resolved","effectRes","manifest","bindingManifest","toJSON","stageBytecodeByKey","map","formatVersion","effectVersion","effectDescription","m_version","m_compilerVersion","effectName","bodyIndex","selection","selectedOptions","passes","analyzeEffectWithValues","normalizeEffectPermutation","readEffectAnalysis","validateResolvedPermutation"],"mappings":";;;;;;;;;;;AAsBO,MAAMA,WAAW,GAAG;AACpB,MAAMC,oBAAoB,GAAG;AAC7B,MAAMC,6BAA6B,GAAG;AACtC,MAAMC,8BAA8B,GAAG;MAEjCC,cAAc,GAAGC,MAAM,CAACC,MAAM,CAAC;AACxCC,EAAAA,IAAI,EAAEP,W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,EAAExE,OAAO,IAAIiE,QAAQ,EAAEjE,OAAO,IAAI+D,QAAQ,CAACC,SAAS,EAAES,SAAS,IAAI,IAAI;AAChH1D,IAAAA,eAAe,EAAEgD,QAAQ,CAACC,SAAS,EAAEU,iBAAiB,IAAI,IAAI;IAC9DC,UAAU,EAAEV,QAAQ,EAAEU,UAAU,IAAIZ,QAAQ,CAACS,iBAAiB,EAAEG,UAAU,IAAI,IAAI;AAClFC,IAAAA,SAAS,EAAEb,QAAQ,CAACc,SAAS,EAAED,SAAS,IAAI,CAAC;AAC7CE,IAAAA,eAAe,EAAEf,QAAQ,CAACc,SAAS,EAAEC,eAAe,IAAI,EAAE;AAC1DC,IAAAA,MAAM,EAAEd,QAAQ,EAAEc,MAAM,IAAI,EAAE;AAC9BtE,IAAAA;AACJ,GAAC,CAAC;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASuE,uBAAuBA,CAACzG,KAAK,EAAEjB,MAAM,EACrD;AACI,EAAA,MAAMlB,WAAW,GAAG6I,0BAA0B,CAAC3H,MAAM,CAAClB,WAAW,CAAC;AAClE,EAAA,MAAM2H,QAAQ,GAAGmB,kBAAkB,CAAC3G,KAAK,EAAE;IACvCrC,MAAM,EAAEoB,MAAM,CAACpB,MAAM;AACrBE,IAAAA;AACJ,GAAC,CAAC;EACF+I,2BAA2B,CACvB/I,WAAW,EACX2H,QAAQ,CAACc,SAAS,EAAEC,eAAe,IAAI,EAC3C,CAAC;EAED,OAAOhB,mBAAmB,CAACC,QAAQ,EAAE;IACjC7H,MAAM,EAAEoB,MAAM,CAACpB,MAAM;IACrBC,kBAAkB,EAAEmB,MAAM,CAACnB;AAC/B,GAAC,CAAC;AACN;;;;"}
1
+ {"version":3,"file":"helpers.js","sources":["../../../../../../src/resource/formats/webgpu/core/helpers.js"],"sourcesContent":["import { toJsonWithCollections as toJsonValue } from \"../../../format/jsonPolicies.js\";\nimport { asUint8Array } from \"#utils/bytes\";\nimport CjsDxbcFormat from \"../../dxbc/index.js\";\nimport { normalizeBytecodeBytes, readEffectAnalysis } from \"./effectAnalysis.js\";\n\nimport { CarbonWebgpuContainer, looksLikeCarbonWebgpuContainer } from \"./carbonWebgpu/CarbonWebgpuContainer.js\";\nimport { validateEffectContainer } from \"./carbonWebgpu/validateContainer.js\";\nimport {\n deriveAnalysis,\n deriveBackendBodySet,\n deriveInfo,\n deriveMetadata,\n deriveWgsl,\n resolvedPermutationIndex\n} from \"./carbonWebgpu/containerViews.js\";\nimport { WebgpuReadError } from \"./WebgpuReadError.js\";\nimport { lowerDxbcToIr } from \"./ir/lowerDxbcToIr.js\";\nimport {\n normalizeEffectPermutation,\n validateResolvedPermutation\n} from \"./packageEffectSelection.js\";\n\nexport const OUTPUT_JSON = \"json\";\nexport const CARBON_WEBGPU_FORMAT = \"CARBON_WEBGPU\";\nexport const CARBON_WEBGPU_ANALYSIS_FORMAT = \"CARBON_WEBGPU_ANALYSIS\";\nexport const CARBON_WEBGPU_ANALYSIS_VERSION = 1;\n\nexport const DEFAULT_VALUES = Object.freeze({\n emit: OUTPUT_JSON,\n source: \"memory\",\n decodeInstructions: true,\n permutation: null,\n schema: null,\n classes: Object.freeze({})\n});\n\nconst OPTION_KEYS = new Set([ \"emit\", \"source\", \"decodeInstructions\", \"permutation\", \"schema\", \"classes\" ]);\n// One emit, as WebGL has. `Read` returns the container-backed document and that\n// document is complete: the analysis, WGSL, metadata and permutation views the\n// caller selects among, plus `backendBodySet`, which is every translated body\n// joined to its shared translation units.\n//\n// A second `raw` emit used to hand back the live `CarbonWebgpuContainer` because\n// the chunk package's JSON could not express the body set. It became the only way\n// to reach a body, so the former `engine-webgpu` donor duck-typed the container instead of reading\n// the document - and when the chunk package was replaced, the engine kept asking\n// for a shape the producer had stopped emitting. Both halves then failed, in\n// different directions, for weeks: the default emit built pipelines but resolved\n// no bodies, and the raw emit resolved bodies but built no pipelines.\n//\n// Neither is reachable now. The container stays internal to this module.\nconst VALID_EMITS = new Set([ OUTPUT_JSON ]);\n\n\nfunction normalizeEmit(emit, readerName)\n{\n if (emit === undefined || VALID_EMITS.has(emit)) return OUTPUT_JSON;\n throw new TypeError(`${readerName}: emit must be \"${OUTPUT_JSON}\", got ${JSON.stringify(emit)}`);\n}\n\nfunction assertKnownOptions(options, readerName)\n{\n for (const key of Object.keys(options))\n {\n if (!OPTION_KEYS.has(key))\n {\n throw new TypeError(`${readerName}: unknown option ${JSON.stringify(key)}`);\n }\n }\n}\n\nfunction classMap(values)\n{\n return values && values.classes ? values.classes : {};\n}\n\nfunction cloneValues(values)\n{\n return {\n emit: values.emit,\n source: values.source ?? DEFAULT_VALUES.source,\n decodeInstructions: values.decodeInstructions ?? DEFAULT_VALUES.decodeInstructions,\n permutation: values.permutation ?? null,\n schema: values.schema ?? null,\n classes: { ...classMap(values) }\n };\n}\n\n/**\n * Rejects class override keys outside a format reader's supported class set.\n *\n * @param {string[]} classKeys Supported class override keys.\n * @param {string} key Candidate override key.\n * @param {string} readerName Reader name used in diagnostics.\n */\nexport function validateClassKey(classKeys, key, readerName)\n{\n if (!classKeys.includes(key))\n {\n throw new Error(`${readerName} unknown class type \"${String(key)}\"`);\n }\n}\n\n/**\n * Validates one constructor supplied through a format reader class override.\n *\n * @param {string[]} classKeys Supported class override keys.\n * @param {string} type Candidate override key.\n * @param {Function} Class Candidate constructor.\n * @param {string} readerName Reader name used in diagnostics.\n */\nexport function validateClass(classKeys, type, Class, readerName)\n{\n validateClassKey(classKeys, type, readerName);\n if (typeof Class !== \"function\")\n {\n throw new TypeError(`${readerName} class \"${type}\" must be a constructor`);\n }\n}\n\nfunction mergeClasses(values, classes, classKeys, readerName)\n{\n if (!classes || typeof classes !== \"object\")\n {\n throw new TypeError(`${readerName} classes option must be an object`);\n }\n\n const next = { ...values.classes };\n for (const [ type, Class ] of Object.entries(classes))\n {\n validateClass(classKeys, type, Class, readerName);\n next[type] = Class;\n }\n values.classes = next;\n}\n\n/**\n * Merge format values over a base set and validate them.\n *\n * @param {object} base Current values.\n * @param {object} [options] Values to merge in.\n * @param {string[]} classKeys Valid class keys.\n * @param {string} readerName Reader name used in error messages.\n * @returns {object} A validated copy of the merged values.\n */\nexport function normalizeValues(base, options = {}, classKeys = [], readerName = \"CjsWebgpuFormat\")\n{\n if (!options || typeof options !== \"object\")\n {\n throw new TypeError(`${readerName} options must be an object`);\n }\n\n assertKnownOptions(options, readerName);\n\n const values = cloneValues(base);\n if (Object.hasOwn(options, \"emit\")) values.emit = normalizeEmit(options.emit, readerName);\n if (Object.hasOwn(options, \"source\")) values.source = typeof options.source === \"string\" && options.source ? options.source : DEFAULT_VALUES.source;\n if (Object.hasOwn(options, \"decodeInstructions\")) values.decodeInstructions = !!options.decodeInstructions;\n if (Object.hasOwn(options, \"permutation\")) values.permutation = options.permutation ?? null;\n if (Object.hasOwn(options, \"schema\")) values.schema = options.schema ?? null;\n if (Object.hasOwn(options, \"classes\")) mergeClasses(values, options.classes, classKeys, readerName);\n return values;\n}\n\n/**\n * Normalize caller input into a Uint8Array of package bytes.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.\n * @returns {Uint8Array} The payload bytes.\n */\n/**\n * Reports whether a payload has the Carbon v15 container shape.\n *\n * This is a **shape** check, not an identity check. Our containers are stock\n * Carbon v15 files, so nothing in the bytes separates one from a shipped\n * `effect.dx11` file -- and nothing should. Identity comes from the resource\n * path the file was resolved through, exactly as it does for Carbon, whose own\n * three backend trees are byte-format-identical with no language field anywhere.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.\n * @returns {boolean} True when the payload opens on Carbon's v15 version dword.\n */\nexport function isCarbonWebgpu(input)\n{\n try\n {\n return looksLikeCarbonWebgpuContainer(asUint8Array(input, \"CjsWebgpuFormat input\"));\n }\n catch\n {\n return false;\n }\n}\n\n/**\n * The shared read path used by the instance Read/Inspect and static one-shots.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU container payload.\n * @param {object} values Normalized format values.\n * @returns {CarbonWebgpuContainer} The loaded container.\n */\nexport function readRaw(input, values)\n{\n const bytes = asUint8Array(input, \"CjsWebgpuFormat input\");\n const container = new CarbonWebgpuContainer();\n const ok = container.Read(bytes, { sourcePath: values.source });\n\n if (!ok)\n {\n throw new WebgpuReadError(\n container.readError ? container.readError.message : \"Failed to read Carbon WebGPU container\",\n {\n source: values.source,\n cause: container.readError || null\n }\n );\n }\n\n try\n {\n validateEffectContainer(container, { source: values.source });\n }\n catch (error)\n {\n if (error instanceof WebgpuReadError) throw error;\n throw new WebgpuReadError(error.message, {\n source: values.source,\n cause: error\n });\n }\n\n return container;\n}\n\n/**\n * Converts a loaded container to the documented plain JSON shape.\n *\n * `analysis` and `wgsl` are **derived views**, not stored documents. The chunk\n * package kept them beside the reflection they were computed from and carried\n * digests to detect the two disagreeing; there is now one document, so there is\n * nothing left to disagree and no digest to carry.\n *\n * `chunks` is gone. It described a container that no longer exists, and a record\n * layout has no chunk table to translate it into.\n *\n * @param {CarbonWebgpuContainer} container Loaded container.\n * @param {object} [options] View options.\n * @returns {object} Plain JSON data.\n */\nexport function packageToJson(container, options = {})\n{\n const source = options.source || container.sourcePath || \"memory\";\n const permutationIndex = options.permutationIndex ?? resolvedPermutationIndex(container);\n const analysis = deriveAnalysis(container, { source, permutationIndex });\n const wgsl = deriveWgsl(container, { permutationIndex });\n\n return toJsonValue({\n format: CARBON_WEBGPU_FORMAT,\n version: container.carbon.version,\n sourcePath: source,\n info: deriveInfo(container, { source }),\n metadata: deriveMetadata(container, { source, permutationIndex }),\n permutationGraph: container.permutationGraph,\n analysis,\n wgsl,\n backendBodySet: deriveBackendBodySet(container),\n stages: analysis.stages ?? [],\n shaders: wgsl.shaders ?? [],\n layouts: wgsl.layouts ?? []\n });\n}\n\n/**\n * Shared read entry.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU container payload.\n * @param {object} values Normalized format values.\n * @returns {object} Plain JSON data.\n */\nexport function readWithValues(input, values)\n{\n return packageToJson(readRaw(input, values), { source: values.source });\n}\n\n/**\n * Compact inspection: Carbon version and compiler bytes, body counts, and the\n * resolved analysis/WGSL counts without building the full JSON package shape.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU container payload.\n * @param {object} values Normalized format values.\n * @returns {object} Plain summary data.\n */\nexport function inspectWithValues(input, values)\n{\n const container = readRaw(input, values);\n const graph = container.permutationGraph;\n const permutationIndex = resolvedPermutationIndex(container);\n const analysis = deriveAnalysis(container, { source: values.source, permutationIndex });\n const wgsl = deriveWgsl(container, { permutationIndex });\n\n return {\n source: values.source,\n isCarbonWebgpu: true,\n version: container.carbon.version,\n compilerVersion: [ ...container.carbon.compilerVersion ],\n permutationCount: graph.variants.length,\n uniqueBodyCount: graph.bodies.length,\n stageCount: analysis.stages.length,\n shaderCount: wgsl.shaders.length,\n layoutCount: wgsl.layouts.length\n };\n}\n\nfunction dxbcSource(source, key)\n{\n return source ? `${source}#${key}` : key;\n}\n\nfunction resolvedStageBytecode(stage, key, bytecodeByKey)\n{\n if (!Number.isInteger(stage.stageType)\n || !Number.isInteger(stage.passIndex)\n || typeof stage.techniqueName !== \"string\"\n || !stage.techniqueName\n || typeof stage.stageName !== \"string\"\n || !stage.stageName)\n {\n throw new Error(`${key} manifest stage identity is invalid`);\n }\n\n const innerStageType = stage.shaderBytecode?.stageType;\n if (innerStageType !== undefined && !Number.isInteger(innerStageType))\n {\n throw new Error(`${key} manifest stage bytecode type is invalid`);\n }\n\n let raw = bytecodeByKey?.get(key);\n if (!raw && bytecodeByKey instanceof Map)\n {\n raw = Array.from(bytecodeByKey.values()).find((entry) =>\n entry.techniqueName === stage.techniqueName\n && entry.passIndex === stage.passIndex\n && entry.stageType === stage.stageType\n );\n }\n if (!raw) return stage.shaderBytecode?.bytes;\n\n if (!Number.isInteger(raw.stageType)\n || stage.stageType !== raw.stageType\n || (innerStageType !== undefined && innerStageType !== raw.stageType)\n || stage.stageName !== raw.stageName\n || (stage.shaderBytecode?.stageName !== undefined\n && stage.shaderBytecode.stageName !== raw.stageName))\n {\n throw new Error(`${key} manifest and raw stage metadata disagree`);\n }\n\n if (stage.shaderBytecode?.bytes !== undefined)\n {\n const manifestBytes = normalizeBytecodeBytes(\n stage.shaderBytecode.bytes,\n `${key} manifest stage bytecode`\n );\n if (!manifestBytes\n || manifestBytes.length !== raw.bytes.length\n || manifestBytes.some((value, index) => value !== raw.bytes[index]))\n {\n throw new Error(`${key} manifest and raw stage bytecode disagree`);\n }\n }\n\n return raw.bytes;\n}\n\nfunction analyzeStage(stage, options)\n{\n const key = `${stage.techniqueName}.pass${stage.passIndex}.${stage.stageName}`;\n const shaderBytecode = stage.shaderBytecode && typeof stage.shaderBytecode === \"object\"\n ? { ...stage.shaderBytecode }\n : stage.shaderBytecode;\n if (shaderBytecode && typeof shaderBytecode === \"object\")\n {\n delete shaderBytecode.bytes;\n }\n const out = {\n ...stage,\n shaderBytecode,\n key,\n dxbc: null,\n dxbcError: null,\n ir: null,\n irError: null\n };\n\n if (options.decodeBytecode === false)\n {\n return out;\n }\n\n const bytecodeBytes = normalizeBytecodeBytes(\n options.bytecodeBytes ?? stage.shaderBytecode?.bytes,\n `${key} stage bytecode`\n );\n if (!bytecodeBytes?.length)\n {\n return out;\n }\n\n try\n {\n out.dxbc = CjsDxbcFormat.read(bytecodeBytes, {\n source: dxbcSource(options.source, key),\n decodeInstructions: options.decodeInstructions\n });\n if (options.decodeInstructions && Array.isArray(out.dxbc.instructions))\n {\n try\n {\n out.ir = lowerDxbcToIr(out.dxbc, { source: dxbcSource(options.source, key) });\n }\n catch (error)\n {\n out.irError = {\n name: error.name,\n message: error.message\n };\n }\n }\n }\n catch (error)\n {\n out.dxbcError = {\n name: error.name,\n message: error.message\n };\n }\n\n return out;\n}\n\n/**\n * Builds the normalized WebGPU analysis document from a resolved effect.\n *\n * @param {object} resolved Raw resolved-effect context from `readEffectAnalysis`.\n * @param {object} [options] Analysis options.\n * @param {string} [options.source] Source label for diagnostics.\n * @param {boolean} [options.decodeBytecode] Whether stage bytecode is inspected.\n * @param {boolean} [options.decodeInstructions] Whether DXBC instructions are decoded.\n * @returns {object} Plain JSON-compatible analysis data.\n */\nexport function buildEffectAnalysis(resolved, options = {})\n{\n const source = options.source || resolved.effectRes?.sourcePath || \"memory\";\n const decodeBytecode = options.decodeBytecode !== undefined ? !!options.decodeBytecode : true;\n const decodeInstructions = options.decodeInstructions !== undefined ? !!options.decodeInstructions : true;\n const manifest = resolved.bindingManifest?.toJSON?.() ?? null;\n const bytecodeByKey = resolved.stageBytecodeByKey instanceof Map\n ? resolved.stageBytecodeByKey\n : null;\n const stages = (manifest?.stages || []).map((stage) =>\n {\n const key = `${stage.techniqueName}.pass${stage.passIndex}.${stage.stageName}`;\n\n return analyzeStage(stage, {\n source,\n decodeBytecode,\n decodeInstructions,\n bytecodeBytes: resolvedStageBytecode(stage, key, bytecodeByKey)\n });\n });\n\n return toJsonValue({\n format: CARBON_WEBGPU_ANALYSIS_FORMAT,\n formatVersion: CARBON_WEBGPU_ANALYSIS_VERSION,\n source,\n effectVersion: resolved.effectDescription?.version ?? manifest?.version ?? resolved.effectRes?.m_version ?? null,\n compilerVersion: resolved.effectRes?.m_compilerVersion ?? null,\n effectName: manifest?.effectName || resolved.effectDescription?.effectName || null,\n bodyIndex: resolved.selection?.bodyIndex ?? 0,\n selectedOptions: resolved.selection?.selectedOptions ?? [],\n passes: manifest?.passes || [],\n stages\n });\n}\n\n/**\n * Analyzes one compiled effect payload into a normalized WebGPU-facing\n * document: selected permutation, Carbon binding manifest, and per-stage DXBC\n * decode.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Tr2 effect payload.\n * @param {object} values Normalized format values.\n * @returns {object} Plain JSON-compatible analysis data.\n */\nexport function analyzeEffectWithValues(input, values)\n{\n const permutation = normalizeEffectPermutation(values.permutation);\n const resolved = readEffectAnalysis(input, {\n source: values.source,\n permutation\n });\n validateResolvedPermutation(\n permutation,\n resolved.selection?.selectedOptions ?? []\n );\n\n return buildEffectAnalysis(resolved, {\n source: values.source,\n decodeInstructions: values.decodeInstructions\n });\n}\n\n/**\n * Deep-convert a value to plain JSON-compatible data.\n *\n * @param {any} value Value to convert.\n * @returns {any} Plain data.\n */\n/** The shared JSON policy for this reader, under the name its callers use. */\nexport { toJsonValue };\n\nexport { WebgpuReadError };\n\n"],"names":["OUTPUT_JSON","CARBON_WEBGPU_FORMAT","CARBON_WEBGPU_ANALYSIS_FORMAT","CARBON_WEBGPU_ANALYSIS_VERSION","DEFAULT_VALUES","Object","freeze","emit","source","decodeInstructions","permutation","schema","classes","OPTION_KEYS","Set","VALID_EMITS","normalizeEmit","readerName","undefined","has","TypeError","JSON","stringify","assertKnownOptions","options","key","keys","classMap","values","cloneValues","validateClassKey","classKeys","includes","Error","String","validateClass","type","Class","mergeClasses","next","entries","normalizeValues","base","hasOwn","isCarbonWebgpu","input","looksLikeCarbonWebgpuContainer","asUint8Array","readRaw","bytes","container","CarbonWebgpuContainer","ok","Read","sourcePath","WebgpuReadError","readError","message","cause","validateEffectContainer","error","packageToJson","permutationIndex","resolvedPermutationIndex","analysis","deriveAnalysis","wgsl","deriveWgsl","toJsonValue","format","version","carbon","info","deriveInfo","metadata","deriveMetadata","permutationGraph","backendBodySet","deriveBackendBodySet","stages","shaders","layouts","readWithValues","inspectWithValues","graph","compilerVersion","permutationCount","variants","length","uniqueBodyCount","bodies","stageCount","shaderCount","layoutCount","dxbcSource","resolvedStageBytecode","stage","bytecodeByKey","Number","isInteger","stageType","passIndex","techniqueName","stageName","innerStageType","shaderBytecode","raw","get","Map","Array","from","find","entry","manifestBytes","normalizeBytecodeBytes","some","value","index","analyzeStage","out","dxbc","dxbcError","ir","irError","decodeBytecode","bytecodeBytes","CjsDxbcFormat","read","isArray","instructions","lowerDxbcToIr","name","buildEffectAnalysis","resolved","effectRes","manifest","bindingManifest","toJSON","stageBytecodeByKey","map","formatVersion","effectVersion","effectDescription","m_version","m_compilerVersion","effectName","bodyIndex","selection","selectedOptions","passes","analyzeEffectWithValues","normalizeEffectPermutation","readEffectAnalysis","validateResolvedPermutation"],"mappings":";;;;;;;;;;;AAsBO,MAAMA,WAAW,GAAG;AACpB,MAAMC,oBAAoB,GAAG;AAC7B,MAAMC,6BAA6B,GAAG;AACtC,MAAMC,8BAA8B,GAAG;MAEjCC,cAAc,GAAGC,MAAM,CAACC,MAAM,CAAC;AACxCC,EAAAA,IAAI,EAAEP,WAAW;AACjBQ,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,kBAAkB,EAAE,IAAI;AACxBC,EAAAA,WAAW,EAAE,IAAI;AACjBC,EAAAA,MAAM,EAAE,IAAI;AACZC,EAAAA,OAAO,EAAEP,MAAM,CAACC,MAAM,CAAC,EAAE;AAC7B,CAAC;AAED,MAAMO,WAAW,GAAG,IAAIC,GAAG,CAAC,CAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,CAAE,CAAC;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAG,IAAID,GAAG,CAAC,CAAEd,WAAW,CAAE,CAAC;AAG5C,SAASgB,aAAaA,CAACT,IAAI,EAAEU,UAAU,EACvC;AACI,EAAA,IAAIV,IAAI,KAAKW,SAAS,IAAIH,WAAW,CAACI,GAAG,CAACZ,IAAI,CAAC,EAAE,OAAOP,WAAW;AACnE,EAAA,MAAM,IAAIoB,SAAS,CAAC,CAAA,EAAGH,UAAU,CAAA,gBAAA,EAAmBjB,WAAW,CAAA,OAAA,EAAUqB,IAAI,CAACC,SAAS,CAACf,IAAI,CAAC,EAAE,CAAC;AACpG;AAEA,SAASgB,kBAAkBA,CAACC,OAAO,EAAEP,UAAU,EAC/C;EACI,KAAK,MAAMQ,GAAG,IAAIpB,MAAM,CAACqB,IAAI,CAACF,OAAO,CAAC,EACtC;AACI,IAAA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BAAmB,CAACC,QAAQ,EAAE;IACjC7H,MAAM,EAAEoB,MAAM,CAACpB,MAAM;IACrBC,kBAAkB,EAAEmB,MAAM,CAACnB;AAC/B,GAAC,CAAC;AACN;;;;"}
@@ -23,7 +23,7 @@ const BLOCK_AFTER = new Set(["if", "loop", "switch", "break", "breakc", "continu
23
23
  function readDecoded(input, options) {
24
24
  if (input instanceof Uint8Array || input instanceof ArrayBuffer || ArrayBuffer.isView(input)) {
25
25
  const raw = CjsDxbcFormat.read(input, {
26
- emit: CjsDxbcFormat.OUTPUT_RAW,
26
+ emit: "raw",
27
27
  source: options.source || "memory",
28
28
  decodeInstructions: true
29
29
  });