@carbonenginejs/runtime 0.1.0-alpha.0 → 0.1.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (935) hide show
  1. package/README.md +58 -125
  2. package/dist/audio/index.js +8 -1
  3. package/dist/audio/index.js.map +1 -1
  4. package/dist/audio/trinity/audio/AudActionLog/AudActionLogCB.js +84 -0
  5. package/dist/audio/trinity/audio/AudActionLog/AudActionLogCB.js.map +1 -0
  6. package/dist/audio/trinity/audio/AudActionLog/AudActionRecord.js +14 -0
  7. package/dist/audio/trinity/audio/AudActionLog/AudActionRecord.js.map +1 -0
  8. package/dist/audio/trinity/audio/AudActionLog/AudActionRecordExecuteActionOnPlayingID.js +26 -0
  9. package/dist/audio/trinity/audio/AudActionLog/AudActionRecordExecuteActionOnPlayingID.js.map +1 -0
  10. package/dist/audio/trinity/audio/AudActionLog/AudActionRecordPostEvent.js +27 -0
  11. package/dist/audio/trinity/audio/AudActionLog/AudActionRecordPostEvent.js.map +1 -0
  12. package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetRTPC.js +27 -0
  13. package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetRTPC.js.map +1 -0
  14. package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetState.js +25 -0
  15. package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetState.js.map +1 -0
  16. package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetSwitch.js +26 -0
  17. package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetSwitch.js.map +1 -0
  18. package/dist/audio/trinity/audio/AudActionLog/IAudActionLog.js +58 -0
  19. package/dist/audio/trinity/audio/AudActionLog/IAudActionLog.js.map +1 -0
  20. package/dist/audio/trinity/audio/AudManager.js +1 -1
  21. package/dist/audio/trinity/audio/AudManager.js.map +1 -1
  22. package/dist/audio/trinity/audio/{AudObstructionOcclusion.js → AudObstructionOcclusion/AudObstructionOcclusion.js} +8 -52
  23. package/dist/audio/trinity/audio/AudObstructionOcclusion/AudObstructionOcclusion.js.map +1 -0
  24. package/dist/audio/trinity/audio/AudObstructionOcclusion/EmitterState.js +17 -0
  25. package/dist/audio/trinity/audio/AudObstructionOcclusion/EmitterState.js.map +1 -0
  26. package/dist/audio/trinity/audio/AudObstructionOcclusion/FadingValue.js +46 -0
  27. package/dist/audio/trinity/audio/AudObstructionOcclusion/FadingValue.js.map +1 -0
  28. package/dist/audio/trinity/index.js +8 -1
  29. package/dist/audio/trinity/index.js.map +1 -1
  30. package/dist/character/CjsCharacterAppearanceConstruction.js +5 -0
  31. package/dist/character/CjsCharacterAppearanceConstruction.js.map +1 -1
  32. package/dist/character/CjsCharacterAppearanceManager.js +14 -0
  33. package/dist/character/CjsCharacterAppearanceManager.js.map +1 -1
  34. package/dist/character/CjsCharacterFoundationConstruction.js +5 -0
  35. package/dist/character/CjsCharacterFoundationConstruction.js.map +1 -1
  36. package/dist/character/CjsCharacterTexturePolicy.js +5 -0
  37. package/dist/character/CjsCharacterTexturePolicy.js.map +1 -1
  38. package/dist/character/gles/CjsCharacterGlesAppearanceAL.js +17 -0
  39. package/dist/character/gles/CjsCharacterGlesAppearanceAL.js.map +1 -1
  40. package/dist/character/gles/CjsCharacterGlesAtlasRenderer.js +2 -0
  41. package/dist/character/gles/CjsCharacterGlesAtlasRenderer.js.map +1 -1
  42. package/dist/character/gles/CjsCharacterGlesFoundationTranslator.js +5 -0
  43. package/dist/character/gles/CjsCharacterGlesFoundationTranslator.js.map +1 -1
  44. package/dist/character/gles/CjsCharacterGlesLegacyConstructionTranslator.js +5 -0
  45. package/dist/character/gles/CjsCharacterGlesLegacyConstructionTranslator.js.map +1 -1
  46. package/dist/character/gles/CjsCharacterGlesMorphDeformation.js +2 -0
  47. package/dist/character/gles/CjsCharacterGlesMorphDeformation.js.map +1 -1
  48. package/dist/character/gles/CjsCharacterGlesPaletteCompatibility.js +5 -0
  49. package/dist/character/gles/CjsCharacterGlesPaletteCompatibility.js.map +1 -1
  50. package/dist/character/gles/CjsCharacterGlesTriangleCoverage.js +5 -0
  51. package/dist/character/gles/CjsCharacterGlesTriangleCoverage.js.map +1 -1
  52. package/dist/character/webgl2/CjsCharacterWebgl2EffectRouter.js +9 -0
  53. package/dist/character/webgl2/CjsCharacterWebgl2EffectRouter.js.map +1 -1
  54. package/dist/global/blue/CjsScriptCallback.js +142 -0
  55. package/dist/global/blue/CjsScriptCallback.js.map +1 -0
  56. package/dist/global/blue/index.js +2 -0
  57. package/dist/global/blue/index.js.map +1 -0
  58. package/dist/global/consts/renderContext/formats.js +51 -1
  59. package/dist/global/consts/renderContext/formats.js.map +1 -1
  60. package/dist/global/consts/renderContext/index.js +2 -2
  61. package/dist/global/consts/renderContext/renderStates.js +16 -1
  62. package/dist/global/consts/renderContext/renderStates.js.map +1 -1
  63. package/dist/global/contracts/index.js +0 -1
  64. package/dist/global/contracts/index.js.map +1 -1
  65. package/dist/global/index.js +4 -3
  66. package/dist/global/index.js.map +1 -1
  67. package/dist/global/math/index.js +2 -0
  68. package/dist/global/math/index.js.map +1 -1
  69. package/dist/global/math/mesh.js +70 -16
  70. package/dist/global/math/mesh.js.map +1 -1
  71. package/dist/global/math/noise.js +47 -68
  72. package/dist/global/math/noise.js.map +1 -1
  73. package/dist/global/math/pool.js +18 -3
  74. package/dist/global/math/pool.js.map +1 -1
  75. package/dist/global/math/random.js +52 -0
  76. package/dist/global/math/random.js.map +1 -0
  77. package/dist/global/math/tri3.js +18 -4
  78. package/dist/global/math/tri3.js.map +1 -1
  79. package/dist/global/schema/CjsSchema.js +20 -2
  80. package/dist/global/schema/CjsSchema.js.map +1 -1
  81. package/dist/global/schema/hydration.js +14 -0
  82. package/dist/global/schema/hydration.js.map +1 -1
  83. package/dist/global/utils/bytes.js +22 -4
  84. package/dist/global/utils/bytes.js.map +1 -1
  85. package/dist/global/utils/checksum.js +80 -0
  86. package/dist/global/utils/checksum.js.map +1 -0
  87. package/dist/global/utils/errors/CjsCancellationError.js +36 -0
  88. package/dist/global/utils/errors/CjsCancellationError.js.map +1 -0
  89. package/dist/global/utils/errors/CjsError.js +21 -52
  90. package/dist/global/utils/errors/CjsError.js.map +1 -1
  91. package/dist/global/utils/errors/abort.js +1 -1
  92. package/dist/global/utils/errors/abort.js.map +1 -1
  93. package/dist/global/utils/errors/index.js +2 -1
  94. package/dist/global/utils/errors/index.js.map +1 -1
  95. package/dist/global/utils/index.js +4 -2
  96. package/dist/global/utils/index.js.map +1 -1
  97. package/dist/index.js +95 -35
  98. package/dist/index.js.map +1 -1
  99. package/dist/input/Tr2MainWindow.js +7 -9
  100. package/dist/input/Tr2MainWindow.js.map +1 -1
  101. package/dist/resource/CjsResMan.js +33 -39
  102. package/dist/resource/CjsResMan.js.map +1 -1
  103. package/dist/resource/CjsResource.js +19 -5
  104. package/dist/resource/CjsResource.js.map +1 -1
  105. package/dist/resource/audio/AudioGeometryResData.js +22 -27
  106. package/dist/resource/audio/AudioGeometryResData.js.map +1 -1
  107. package/dist/resource/audio/CjsAudioRes.js +4 -5
  108. package/dist/resource/audio/CjsAudioRes.js.map +1 -1
  109. package/dist/resource/format/CjsBitReader.js +263 -0
  110. package/dist/resource/format/CjsBitReader.js.map +1 -0
  111. package/dist/resource/format/CjsByteReader.js +130 -125
  112. package/dist/resource/format/CjsByteReader.js.map +1 -1
  113. package/dist/resource/format/CjsFormat.js +11 -4
  114. package/dist/resource/format/CjsFormat.js.map +1 -1
  115. package/dist/resource/format/CjsFormatError.js +37 -1
  116. package/dist/resource/format/CjsFormatError.js.map +1 -1
  117. package/dist/resource/format/CjsResourceProbe.js +41 -37
  118. package/dist/resource/format/CjsResourceProbe.js.map +1 -1
  119. package/dist/resource/format/carbonRecordGuard.js +33 -0
  120. package/dist/resource/format/carbonRecordGuard.js.map +1 -0
  121. package/dist/resource/format/imageSignatures.js +202 -0
  122. package/dist/resource/format/imageSignatures.js.map +1 -0
  123. package/dist/resource/format/index.js +2 -1
  124. package/dist/resource/format/index.js.map +1 -1
  125. package/dist/resource/format/jsonPolicies.js +180 -0
  126. package/dist/resource/format/jsonPolicies.js.map +1 -0
  127. package/dist/resource/formats/black/core/helpers.js +18 -29
  128. package/dist/resource/formats/black/core/helpers.js.map +1 -1
  129. package/dist/resource/formats/bnk/CjsBnkFormat.js +4 -3
  130. package/dist/resource/formats/bnk/CjsBnkFormat.js.map +1 -1
  131. package/dist/resource/formats/bnk/core/WwiseCursor.js +218 -0
  132. package/dist/resource/formats/bnk/core/WwiseCursor.js.map +1 -0
  133. package/dist/resource/formats/bnk/core/busNodes.js +2 -1
  134. package/dist/resource/formats/bnk/core/busNodes.js.map +1 -1
  135. package/dist/resource/formats/bnk/core/effectNodes.js +2 -1
  136. package/dist/resource/formats/bnk/core/effectNodes.js.map +1 -1
  137. package/dist/resource/formats/bnk/core/eventAction.js +15 -93
  138. package/dist/resource/formats/bnk/core/eventAction.js.map +1 -1
  139. package/dist/resource/formats/bnk/core/globalSettings.js +19 -94
  140. package/dist/resource/formats/bnk/core/globalSettings.js.map +1 -1
  141. package/dist/resource/formats/bnk/core/helpers.js +2 -48
  142. package/dist/resource/formats/bnk/core/helpers.js.map +1 -1
  143. package/dist/resource/formats/bnk/core/musicNodes.js +42 -134
  144. package/dist/resource/formats/bnk/core/musicNodes.js.map +1 -1
  145. package/dist/resource/formats/bnk/core/nodeBase.js +20 -111
  146. package/dist/resource/formats/bnk/core/nodeBase.js.map +1 -1
  147. package/dist/resource/formats/bnk/core/sfxNodes.js +2 -1
  148. package/dist/resource/formats/bnk/core/sfxNodes.js.map +1 -1
  149. package/dist/resource/formats/cmf/CjsCmfFormat.js +242 -228
  150. package/dist/resource/formats/cmf/CjsCmfFormat.js.map +1 -1
  151. package/dist/resource/formats/cmf/core/binary.js +54 -60
  152. package/dist/resource/formats/cmf/core/binary.js.map +1 -1
  153. package/dist/resource/formats/dds/CjsDdsFormat.js +5 -3
  154. package/dist/resource/formats/dds/CjsDdsFormat.js.map +1 -1
  155. package/dist/resource/formats/dds/core/bc6h.js +16 -18
  156. package/dist/resource/formats/dds/core/bc6h.js.map +1 -1
  157. package/dist/resource/formats/dds/core/bc7.js +28 -24
  158. package/dist/resource/formats/dds/core/bc7.js.map +1 -1
  159. package/dist/resource/formats/dds/core/helpers.js +7 -133
  160. package/dist/resource/formats/dds/core/helpers.js.map +1 -1
  161. package/dist/resource/formats/dxbc/CjsDxbcFormat.js +3 -2
  162. package/dist/resource/formats/dxbc/CjsDxbcFormat.js.map +1 -1
  163. package/dist/resource/formats/dxbc/core/helpers.js +4 -32
  164. package/dist/resource/formats/dxbc/core/helpers.js.map +1 -1
  165. package/dist/resource/formats/fbx/CjsFbxFormat.js +11 -0
  166. package/dist/resource/formats/fbx/CjsFbxFormat.js.map +1 -1
  167. package/dist/resource/formats/fbx/core/helpers.js +18 -12
  168. package/dist/resource/formats/fbx/core/helpers.js.map +1 -1
  169. package/dist/resource/formats/flac/CjsFlacFormat.js +4 -9
  170. package/dist/resource/formats/flac/CjsFlacFormat.js.map +1 -1
  171. package/dist/resource/formats/flac/core/helpers.js +1 -62
  172. package/dist/resource/formats/flac/core/helpers.js.map +1 -1
  173. package/dist/resource/formats/gif/CjsGifFormat.js +4 -9
  174. package/dist/resource/formats/gif/CjsGifFormat.js.map +1 -1
  175. package/dist/resource/formats/gif/core/helpers.js +1 -63
  176. package/dist/resource/formats/gif/core/helpers.js.map +1 -1
  177. package/dist/resource/formats/gltf/CjsGltfFormat.js +4 -3
  178. package/dist/resource/formats/gltf/CjsGltfFormat.js.map +1 -1
  179. package/dist/resource/formats/gltf/core/helpers.js +3 -19
  180. package/dist/resource/formats/gltf/core/helpers.js.map +1 -1
  181. package/dist/resource/formats/gr2/CjsGr2Format.js +105 -92
  182. package/dist/resource/formats/gr2/CjsGr2Format.js.map +1 -1
  183. package/dist/resource/formats/gr2/core/container.js +1 -10
  184. package/dist/resource/formats/gr2/core/container.js.map +1 -1
  185. package/dist/resource/formats/gr2/core/helpers.js +24 -35
  186. package/dist/resource/formats/gr2/core/helpers.js.map +1 -1
  187. package/dist/resource/formats/gr2/core/shared.js +193 -189
  188. package/dist/resource/formats/gr2/core/shared.js.map +1 -1
  189. package/dist/resource/formats/hlsl/CjsHlslFormat.js +4 -3
  190. package/dist/resource/formats/hlsl/CjsHlslFormat.js.map +1 -1
  191. package/dist/resource/formats/hlsl/core/helpers.js +1 -30
  192. package/dist/resource/formats/hlsl/core/helpers.js.map +1 -1
  193. package/dist/resource/formats/jpeg/CjsJpegFormat.js +5 -3
  194. package/dist/resource/formats/jpeg/CjsJpegFormat.js.map +1 -1
  195. package/dist/resource/formats/jpeg/core/helpers.js +7 -134
  196. package/dist/resource/formats/jpeg/core/helpers.js.map +1 -1
  197. package/dist/resource/formats/mp3/CjsMp3Format.js +4 -9
  198. package/dist/resource/formats/mp3/CjsMp3Format.js.map +1 -1
  199. package/dist/resource/formats/mp3/core/helpers.js +1 -64
  200. package/dist/resource/formats/mp3/core/helpers.js.map +1 -1
  201. package/dist/resource/formats/mp4/CjsMp4Format.js +4 -9
  202. package/dist/resource/formats/mp4/CjsMp4Format.js.map +1 -1
  203. package/dist/resource/formats/mp4/core/helpers.js +1 -73
  204. package/dist/resource/formats/mp4/core/helpers.js.map +1 -1
  205. package/dist/resource/formats/obj/CjsObjFormat.js +4 -3
  206. package/dist/resource/formats/obj/CjsObjFormat.js.map +1 -1
  207. package/dist/resource/formats/obj/core/helpers.js +93 -115
  208. package/dist/resource/formats/obj/core/helpers.js.map +1 -1
  209. package/dist/resource/formats/ogg/CjsOggFormat.js +4 -3
  210. package/dist/resource/formats/ogg/CjsOggFormat.js.map +1 -1
  211. package/dist/resource/formats/ogg/core/helpers.js +1 -15
  212. package/dist/resource/formats/ogg/core/helpers.js.map +1 -1
  213. package/dist/resource/formats/ogg/core/vorbis.js +138 -144
  214. package/dist/resource/formats/ogg/core/vorbis.js.map +1 -1
  215. package/dist/resource/formats/pickle/CjsPickleFormat.js +83 -114
  216. package/dist/resource/formats/pickle/CjsPickleFormat.js.map +1 -1
  217. package/dist/resource/formats/png/CjsPngFormat.js +5 -3
  218. package/dist/resource/formats/png/CjsPngFormat.js.map +1 -1
  219. package/dist/resource/formats/png/core/helpers.js +13 -152
  220. package/dist/resource/formats/png/core/helpers.js.map +1 -1
  221. package/dist/resource/formats/png/core/writer.js +3 -27
  222. package/dist/resource/formats/png/core/writer.js.map +1 -1
  223. package/dist/resource/formats/red/core/helpers.js +19 -29
  224. package/dist/resource/formats/red/core/helpers.js.map +1 -1
  225. package/dist/resource/formats/stl/CjsStlFormat.js +158 -147
  226. package/dist/resource/formats/stl/CjsStlFormat.js.map +1 -1
  227. package/dist/resource/formats/stl/core/helpers.js +44 -66
  228. package/dist/resource/formats/stl/core/helpers.js.map +1 -1
  229. package/dist/resource/formats/tga/CjsTgaFormat.js +5 -3
  230. package/dist/resource/formats/tga/CjsTgaFormat.js.map +1 -1
  231. package/dist/resource/formats/tga/core/helpers.js +7 -153
  232. package/dist/resource/formats/tga/core/helpers.js.map +1 -1
  233. package/dist/resource/formats/vta/CjsVtaFormat.js +4 -3
  234. package/dist/resource/formats/vta/CjsVtaFormat.js.map +1 -1
  235. package/dist/resource/formats/vta/core/helpers.js +1 -17
  236. package/dist/resource/formats/vta/core/helpers.js.map +1 -1
  237. package/dist/resource/formats/wav/CjsWavFormat.js +4 -3
  238. package/dist/resource/formats/wav/CjsWavFormat.js.map +1 -1
  239. package/dist/resource/formats/wav/core/helpers.js +1 -15
  240. package/dist/resource/formats/wav/core/helpers.js.map +1 -1
  241. package/dist/resource/formats/webgl/CjsWebglFormat.js +4 -3
  242. package/dist/resource/formats/webgl/CjsWebglFormat.js.map +1 -1
  243. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +69 -9
  244. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  245. package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +12 -3
  246. package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -1
  247. package/dist/resource/formats/webgl/core/helpers.js +39 -68
  248. package/dist/resource/formats/webgl/core/helpers.js.map +1 -1
  249. package/dist/resource/formats/webgpu/CjsWebgpuFormat.js +4 -3
  250. package/dist/resource/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  251. package/dist/resource/formats/webgpu/core/helpers.js +4 -30
  252. package/dist/resource/formats/webgpu/core/helpers.js.map +1 -1
  253. package/dist/resource/formats/webm/CjsWebmFormat.js +4 -9
  254. package/dist/resource/formats/webm/CjsWebmFormat.js.map +1 -1
  255. package/dist/resource/formats/webm/core/helpers.js +1 -73
  256. package/dist/resource/formats/webm/core/helpers.js.map +1 -1
  257. package/dist/resource/formats/webp/CjsWebpFormat.js +4 -9
  258. package/dist/resource/formats/webp/CjsWebpFormat.js.map +1 -1
  259. package/dist/resource/formats/webp/core/helpers.js +1 -62
  260. package/dist/resource/formats/webp/core/helpers.js.map +1 -1
  261. package/dist/resource/formats/wem/CjsWemFormat.js +4 -3
  262. package/dist/resource/formats/wem/CjsWemFormat.js.map +1 -1
  263. package/dist/resource/formats/wem/core/bitStream.js +83 -106
  264. package/dist/resource/formats/wem/core/bitStream.js.map +1 -1
  265. package/dist/resource/formats/wem/core/codebookLibrary.js +52 -52
  266. package/dist/resource/formats/wem/core/codebookLibrary.js.map +1 -1
  267. package/dist/resource/formats/wem/core/helpers.js +1 -15
  268. package/dist/resource/formats/wem/core/helpers.js.map +1 -1
  269. package/dist/resource/formats/wem/core/wemToOgg.js +67 -67
  270. package/dist/resource/formats/wem/core/wemToOgg.js.map +1 -1
  271. package/dist/resource/geometry/MeshDecalData.js +23 -25
  272. package/dist/resource/geometry/MeshDecalData.js.map +1 -1
  273. package/dist/resource/geometry/MeshDecalLodData.js +14 -23
  274. package/dist/resource/geometry/MeshDecalLodData.js.map +1 -1
  275. package/dist/resource/geometry/TriGeometryRes.js +299 -284
  276. package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
  277. package/dist/resource/geometry/TriGeometryResAreaData.js +30 -31
  278. package/dist/resource/geometry/TriGeometryResAreaData.js.map +1 -1
  279. package/dist/resource/geometry/TriGeometryResJointData.js +16 -24
  280. package/dist/resource/geometry/TriGeometryResJointData.js.map +1 -1
  281. package/dist/resource/geometry/TriGeometryResLodData.js +50 -41
  282. package/dist/resource/geometry/TriGeometryResLodData.js.map +1 -1
  283. package/dist/resource/geometry/TriGeometryResMeshData.js +32 -32
  284. package/dist/resource/geometry/TriGeometryResMeshData.js.map +1 -1
  285. package/dist/resource/geometry/TriGeometryResSkeletonData.js +14 -23
  286. package/dist/resource/geometry/TriGeometryResSkeletonData.js.map +1 -1
  287. package/dist/resource/geometry/TriJointBinding.js +16 -24
  288. package/dist/resource/geometry/TriJointBinding.js.map +1 -1
  289. package/dist/resource/geometry/TriMorphTargetGeometryConstants.js +22 -27
  290. package/dist/resource/geometry/TriMorphTargetGeometryConstants.js.map +1 -1
  291. package/dist/resource/geometry/TriRtGeometryConstants.js +50 -41
  292. package/dist/resource/geometry/TriRtGeometryConstants.js.map +1 -1
  293. package/dist/resource/geometry/granny/GStateBindingCallbackData.js +12 -22
  294. package/dist/resource/geometry/granny/GStateBindingCallbackData.js.map +1 -1
  295. package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js +30 -31
  296. package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js.map +1 -1
  297. package/dist/resource/index.js +1 -1
  298. package/dist/resource/shader/reflection/Tr2EffectConstant.js +16 -17
  299. package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -1
  300. package/dist/resource/shader/reflection/Tr2EffectDescription.js +26 -28
  301. package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
  302. package/dist/resource/shader/reflection/Tr2EffectLibrary.js +24 -25
  303. package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
  304. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +21 -22
  305. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
  306. package/dist/resource/shader/reflection/Tr2EffectResource.js +25 -26
  307. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
  308. package/dist/resource/shader/reflection/Tr2EffectStageInput.js +69 -72
  309. package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
  310. package/dist/resource/shader/reflection/Tr2EffectTechnique.js +17 -18
  311. package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
  312. package/dist/resource/shader/reflection/Tr2Pass.js +42 -43
  313. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
  314. package/dist/resource/shader/reflection/Tr2RenderStateSetup.js +26 -5
  315. package/dist/resource/shader/reflection/Tr2RenderStateSetup.js.map +1 -1
  316. package/dist/resource/shader/reflection/carbonRecordFields.js +87 -90
  317. package/dist/resource/shader/reflection/carbonRecordFields.js.map +1 -1
  318. package/dist/resource/shader/sampler/Tr2SamplerSetup.js +32 -34
  319. package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
  320. package/dist/resource/texture/CjsTextureArrayRes.js +1 -6
  321. package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
  322. package/dist/resource/texture/Tr2TextureLodManager.js +35 -27
  323. package/dist/resource/texture/Tr2TextureLodManager.js.map +1 -1
  324. package/dist/resource/texture/Tr2TextureLodUpdateRequest.js +16 -24
  325. package/dist/resource/texture/Tr2TextureLodUpdateRequest.js.map +1 -1
  326. package/dist/resource/texture/Tr2TexturePackChannel.js +16 -24
  327. package/dist/resource/texture/Tr2TexturePackChannel.js.map +1 -1
  328. package/dist/resource/texture/Tr2TexturePipeline.js +24 -20
  329. package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -1
  330. package/dist/resource/texture/Tr2TexturePipelineParams.js +14 -23
  331. package/dist/resource/texture/Tr2TexturePipelineParams.js.map +1 -1
  332. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +18 -25
  333. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -1
  334. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +11 -16
  335. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -1
  336. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +14 -23
  337. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -1
  338. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +12 -22
  339. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -1
  340. package/dist/resource/texture/Tr2TexturePipelineStepPack.js +38 -26
  341. package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -1
  342. package/dist/resource/worker/CjsResManMainThreadLoader.js +2 -5
  343. package/dist/resource/worker/CjsResManMainThreadLoader.js.map +1 -1
  344. package/dist/resource/worker/CjsResManWorkerLoader.js +6 -7
  345. package/dist/resource/worker/CjsResManWorkerLoader.js.map +1 -1
  346. package/dist/resource/worker/protocol.js +18 -1
  347. package/dist/resource/worker/protocol.js.map +1 -1
  348. package/dist/sof/EveSOF.js +2 -222
  349. package/dist/sof/EveSOF.js.map +1 -1
  350. package/dist/sof/SofDocumentBuilder.js +205 -0
  351. package/dist/sof/SofDocumentBuilder.js.map +1 -0
  352. package/dist/sof/faction/ErrSOFFactionColorSetTypeNotFound.js +16 -0
  353. package/dist/sof/faction/ErrSOFFactionColorSetTypeNotFound.js.map +1 -0
  354. package/dist/sof/faction/ErrSOFFactionColorSetTypeUnknown.js +16 -0
  355. package/dist/sof/faction/ErrSOFFactionColorSetTypeUnknown.js.map +1 -0
  356. package/dist/sof/faction/EveSOFDataFactionColorSet.js +3 -27
  357. package/dist/sof/faction/EveSOFDataFactionColorSet.js.map +1 -1
  358. package/dist/sof/faction/index.js +3 -1
  359. package/dist/sof/faction/index.js.map +1 -1
  360. package/dist/sof/generic/ErrSOFAreaShaderNotFound.js +18 -0
  361. package/dist/sof/generic/ErrSOFAreaShaderNotFound.js.map +1 -0
  362. package/dist/sof/generic/ErrSOFDecalShaderNotFound.js +18 -0
  363. package/dist/sof/generic/ErrSOFDecalShaderNotFound.js.map +1 -0
  364. package/dist/sof/generic/ErrSOFMaterialPrefixNotFound.js +21 -0
  365. package/dist/sof/generic/ErrSOFMaterialPrefixNotFound.js.map +1 -0
  366. package/dist/sof/generic/ErrSOFPatternMaterialPrefixNotFound.js +21 -0
  367. package/dist/sof/generic/ErrSOFPatternMaterialPrefixNotFound.js.map +1 -0
  368. package/dist/sof/generic/EveSOFDataGeneric.js +5 -69
  369. package/dist/sof/generic/EveSOFDataGeneric.js.map +1 -1
  370. package/dist/sof/generic/index.js +5 -1
  371. package/dist/sof/generic/index.js.map +1 -1
  372. package/dist/sof/index.js +23 -7
  373. package/dist/sof/index.js.map +1 -1
  374. package/dist/sof/pattern/ErrSOFProjectionNotFound.js +20 -0
  375. package/dist/sof/pattern/ErrSOFProjectionNotFound.js.map +1 -0
  376. package/dist/sof/pattern/EveSOFDataPattern.js +2 -17
  377. package/dist/sof/pattern/EveSOFDataPattern.js.map +1 -1
  378. package/dist/sof/pattern/index.js +2 -1
  379. package/dist/sof/pattern/index.js.map +1 -1
  380. package/dist/sof/shared/ErrSOFAreaTypeNotFound.js +16 -0
  381. package/dist/sof/shared/ErrSOFAreaTypeNotFound.js.map +1 -0
  382. package/dist/sof/shared/ErrSOFLogoSetTypeNotFound.js +16 -0
  383. package/dist/sof/shared/ErrSOFLogoSetTypeNotFound.js.map +1 -0
  384. package/dist/sof/shared/ErrSOFLogoSetTypeUnknown.js +16 -0
  385. package/dist/sof/shared/ErrSOFLogoSetTypeUnknown.js.map +1 -0
  386. package/dist/sof/shared/EveSOFDataArea.js +2 -13
  387. package/dist/sof/shared/EveSOFDataArea.js.map +1 -1
  388. package/dist/sof/shared/EveSOFDataLogoSet.js +3 -27
  389. package/dist/sof/shared/EveSOFDataLogoSet.js.map +1 -1
  390. package/dist/sof/shared/EveSOFDataParameter.js +2 -146
  391. package/dist/sof/shared/EveSOFDataParameter.js.map +1 -1
  392. package/dist/sof/shared/EveSOFDataParameterBool.js +40 -0
  393. package/dist/sof/shared/EveSOFDataParameterBool.js.map +1 -0
  394. package/dist/sof/shared/EveSOFDataParameterColor.js +36 -0
  395. package/dist/sof/shared/EveSOFDataParameterColor.js.map +1 -0
  396. package/dist/sof/shared/EveSOFDataParameterFloat.js +37 -0
  397. package/dist/sof/shared/EveSOFDataParameterFloat.js.map +1 -0
  398. package/dist/sof/shared/EveSOFDataParameterInt.js +37 -0
  399. package/dist/sof/shared/EveSOFDataParameterInt.js.map +1 -0
  400. package/dist/sof/shared/EveSOFDataParameterVector2.js +37 -0
  401. package/dist/sof/shared/EveSOFDataParameterVector2.js.map +1 -0
  402. package/dist/sof/shared/EveSOFDataParameterVector3.js +37 -0
  403. package/dist/sof/shared/EveSOFDataParameterVector3.js.map +1 -0
  404. package/dist/sof/shared/{EveSOFDataSpotlightAttachment.js → EveSOFDataSpotLightAttachment.js} +1 -1
  405. package/dist/sof/shared/{EveSOFDataSpotlightAttachment.js.map → EveSOFDataSpotLightAttachment.js.map} +1 -1
  406. package/dist/sof/shared/index.js +13 -4
  407. package/dist/sof/shared/index.js.map +1 -1
  408. package/dist/sof/sofDocumentValues.js +33 -0
  409. package/dist/sof/sofDocumentValues.js.map +1 -0
  410. package/dist/trinity/controllers/ITr2Controller/ITr2ActionController.js +168 -0
  411. package/dist/trinity/controllers/ITr2Controller/ITr2ActionController.js.map +1 -0
  412. package/dist/trinity/controllers/{ITr2Controller.js → ITr2Controller/ITr2Controller.js} +2 -134
  413. package/dist/trinity/controllers/ITr2Controller/ITr2Controller.js.map +1 -0
  414. package/dist/trinity/controllers/Tr2Controller.js +2 -1
  415. package/dist/trinity/controllers/Tr2Controller.js.map +1 -1
  416. package/dist/trinity/controllers/Tr2ControllerReference.js +2 -1
  417. package/dist/trinity/controllers/Tr2ControllerReference.js.map +1 -1
  418. package/dist/trinity/controllers/action/ITr2ControllerAction.js +2 -1
  419. package/dist/trinity/controllers/action/ITr2ControllerAction.js.map +1 -1
  420. package/dist/trinity/controllers/action/Tr2ActionSpawnParticles.js +10 -9
  421. package/dist/trinity/controllers/action/Tr2ActionSpawnParticles.js.map +1 -1
  422. package/dist/trinity/controllers/expression/CjsControllerExpressionCompileError.js +26 -0
  423. package/dist/trinity/controllers/expression/CjsControllerExpressionCompileError.js.map +1 -0
  424. package/dist/trinity/controllers/expression/CjsControllerExpressionEvaluateError.js +24 -0
  425. package/dist/trinity/controllers/expression/CjsControllerExpressionEvaluateError.js.map +1 -0
  426. package/dist/trinity/controllers/expression/CjsControllerExpressionParser.js +387 -0
  427. package/dist/trinity/controllers/expression/CjsControllerExpressionParser.js.map +1 -0
  428. package/dist/trinity/controllers/expression/CjsControllerExpressionProgram.js +4 -1011
  429. package/dist/trinity/controllers/expression/CjsControllerExpressionProgram.js.map +1 -1
  430. package/dist/trinity/controllers/expression/expressionRuntime.js +605 -0
  431. package/dist/trinity/controllers/expression/expressionRuntime.js.map +1 -0
  432. package/dist/trinity/controllers/index.js +5 -2
  433. package/dist/trinity/controllers/index.js.map +1 -1
  434. package/dist/trinity/controllers/state/ITr2StateMachineStateFinalizer.js +2 -1
  435. package/dist/trinity/controllers/state/ITr2StateMachineStateFinalizer.js.map +1 -1
  436. package/dist/trinity/controllers/timeline/Tr2TimelineController.js +2 -1
  437. package/dist/trinity/controllers/timeline/Tr2TimelineController.js.map +1 -1
  438. package/dist/trinity/core/ITr2Updateable.js +2 -1
  439. package/dist/trinity/core/ITr2Updateable.js.map +1 -1
  440. package/dist/trinity/core/Tr2Blitter.js +6 -3
  441. package/dist/trinity/core/Tr2Blitter.js.map +1 -1
  442. package/dist/trinity/core/Tr2Denoiser.js +256 -0
  443. package/dist/trinity/core/Tr2Denoiser.js.map +1 -0
  444. package/dist/trinity/core/Tr2GpuResourcePool/GpuResourceHandle.js +115 -0
  445. package/dist/trinity/core/Tr2GpuResourcePool/GpuResourceHandle.js.map +1 -0
  446. package/dist/trinity/core/Tr2GpuResourcePool/TextureSize2D.js +79 -0
  447. package/dist/trinity/core/Tr2GpuResourcePool/TextureSize2D.js.map +1 -0
  448. package/dist/trinity/core/{Tr2GpuResourcePool.js → Tr2GpuResourcePool/Tr2GpuResourcePool.js} +63 -151
  449. package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js.map +1 -0
  450. package/dist/trinity/core/{Tr2QuadRenderer.js → Tr2QuadRenderer/Tr2QuadRenderer.js} +8 -30
  451. package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRenderer.js.map +1 -0
  452. package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRendererEffectRecord.js +38 -0
  453. package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRendererEffectRecord.js.map +1 -0
  454. package/dist/trinity/core/Tr2RenderUtils.js +20 -3
  455. package/dist/trinity/core/Tr2RenderUtils.js.map +1 -1
  456. package/dist/trinity/core/Tr2Renderer.js +146 -1
  457. package/dist/trinity/core/Tr2Renderer.js.map +1 -1
  458. package/dist/trinity/core/Tr2ShadowMap.js +135 -14
  459. package/dist/trinity/core/Tr2ShadowMap.js.map +1 -1
  460. package/dist/trinity/core/{Tr2TextureArray.js → Tr2TextureArray/Tr2TextureArray.js} +3 -58
  461. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js.map +1 -0
  462. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArrayElement.js +61 -0
  463. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArrayElement.js.map +1 -0
  464. package/dist/trinity/core/batch/TriRenderBatch/DefaultKeyGenerator.js +26 -0
  465. package/dist/trinity/core/batch/TriRenderBatch/DefaultKeyGenerator.js.map +1 -0
  466. package/dist/trinity/core/batch/TriRenderBatch/EffectKeyGenerator.js +29 -0
  467. package/dist/trinity/core/batch/TriRenderBatch/EffectKeyGenerator.js.map +1 -0
  468. package/dist/trinity/core/batch/{ITriRenderBatchAccumulator.js → TriRenderBatch/ITriRenderBatchAccumulator.js} +30 -30
  469. package/dist/trinity/core/batch/TriRenderBatch/ITriRenderBatchAccumulator.js.map +1 -0
  470. package/dist/trinity/core/batch/{Tr2RenderBatch.js → TriRenderBatch/Tr2RenderBatch.js} +81 -154
  471. package/dist/trinity/core/batch/TriRenderBatch/Tr2RenderBatch.js.map +1 -0
  472. package/dist/trinity/core/batch/{TriRenderBatchAccumulator.js → TriRenderBatch/TriRenderBatchAccumulator.js} +7 -38
  473. package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAccumulator.js.map +1 -0
  474. package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlock.js +61 -0
  475. package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlock.js.map +1 -0
  476. package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlocksWithSharedMaterial.js +40 -0
  477. package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlocksWithSharedMaterial.js.map +1 -0
  478. package/dist/trinity/core/batch/TriRenderBatchMap.js +6 -1
  479. package/dist/trinity/core/batch/TriRenderBatchMap.js.map +1 -1
  480. package/dist/trinity/core/context/Tr2RenderContext.js +75 -57
  481. package/dist/trinity/core/context/Tr2RenderContext.js.map +1 -1
  482. package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityEvent.js +67 -0
  483. package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityEvent.js.map +1 -0
  484. package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityResults.js +50 -0
  485. package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityResults.js.map +1 -0
  486. package/dist/trinity/core/device/Tr2DepthStencil.js +186 -13
  487. package/dist/trinity/core/device/Tr2DepthStencil.js.map +1 -1
  488. package/dist/trinity/core/device/{Tr2RingBuffer.js → Tr2RingBuffer/Tr2RingBuffer.js} +27 -79
  489. package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBuffer.js.map +1 -0
  490. package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBufferOffsets.js +114 -0
  491. package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBufferOffsets.js.map +1 -0
  492. package/dist/trinity/core/device/{Tr2SuballocatedBuffer.js → Tr2SuballocatedBuffer/Tr2SuballocatedBuffer.js} +5 -59
  493. package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBuffer.js.map +1 -0
  494. package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBufferAllocation.js +80 -0
  495. package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBufferAllocation.js.map +1 -0
  496. package/dist/trinity/core/index.js +42 -15
  497. package/dist/trinity/core/index.js.map +1 -1
  498. package/dist/trinity/core/lighting/Tr2LightManager.js +6 -1
  499. package/dist/trinity/core/lighting/Tr2LightManager.js.map +1 -1
  500. package/dist/trinity/core/mesh/{ITr2ImpostorSource.js → ITr2ImpostorSource/ITr2ImpostorSource.js} +6 -28
  501. package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSource.js.map +1 -0
  502. package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSourceImpostorHash.js +32 -0
  503. package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSourceImpostorHash.js.map +1 -0
  504. package/dist/trinity/core/mesh/{ITr2InstanceData.js → ITr2InstanceData/ITr2InstanceData.js} +5 -29
  505. package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceData.js.map +1 -0
  506. package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceDataInstanceData.js +33 -0
  507. package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceDataInstanceData.js.map +1 -0
  508. package/dist/trinity/core/mesh/Tr2DirectInstanceData.js +2 -1
  509. package/dist/trinity/core/mesh/Tr2DirectInstanceData.js.map +1 -1
  510. package/dist/trinity/core/mesh/Tr2MeshBase.js +7 -1
  511. package/dist/trinity/core/mesh/Tr2MeshBase.js.map +1 -1
  512. package/dist/trinity/core/mesh/Tr2RuntimeInstanceData.js +2 -1
  513. package/dist/trinity/core/mesh/Tr2RuntimeInstanceData.js.map +1 -1
  514. package/dist/trinity/core/mesh/TriGeometryResAllocations.js +6 -2
  515. package/dist/trinity/core/mesh/TriGeometryResAllocations.js.map +1 -1
  516. package/dist/trinity/core/rawData/CjsConstantLayout.js +196 -0
  517. package/dist/trinity/core/rawData/CjsConstantLayout.js.map +1 -0
  518. package/dist/trinity/core/rawData/CjsPerFrameLayouts.js +8 -3
  519. package/dist/trinity/core/rawData/CjsPerFrameLayouts.js.map +1 -1
  520. package/dist/trinity/core/rawData/CjsPerObjectLayouts.js +40 -732
  521. package/dist/trinity/core/rawData/CjsPerObjectLayouts.js.map +1 -1
  522. package/dist/trinity/core/rawData/layouts/CjsEveBasicLayout.js +34 -0
  523. package/dist/trinity/core/rawData/layouts/CjsEveBasicLayout.js.map +1 -0
  524. package/dist/trinity/core/rawData/layouts/CjsEveBoosterSetLayout.js +69 -0
  525. package/dist/trinity/core/rawData/layouts/CjsEveBoosterSetLayout.js.map +1 -0
  526. package/dist/trinity/core/rawData/layouts/CjsEveChildBoosterSetLayout.js +59 -0
  527. package/dist/trinity/core/rawData/layouts/CjsEveChildBoosterSetLayout.js.map +1 -0
  528. package/dist/trinity/core/rawData/layouts/CjsEveChildBulletStormLayout.js +37 -0
  529. package/dist/trinity/core/rawData/layouts/CjsEveChildBulletStormLayout.js.map +1 -0
  530. package/dist/trinity/core/rawData/layouts/CjsEveChildSpherePinLayout.js +44 -0
  531. package/dist/trinity/core/rawData/layouts/CjsEveChildSpherePinLayout.js.map +1 -0
  532. package/dist/trinity/core/rawData/layouts/CjsEveLensflareLayout.js +31 -0
  533. package/dist/trinity/core/rawData/layouts/CjsEveLensflareLayout.js.map +1 -0
  534. package/dist/trinity/core/rawData/layouts/CjsEveMissileWarheadLayout.js +29 -0
  535. package/dist/trinity/core/rawData/layouts/CjsEveMissileWarheadLayout.js.map +1 -0
  536. package/dist/trinity/core/rawData/layouts/CjsEvePerObjectLayout.js +39 -0
  537. package/dist/trinity/core/rawData/layouts/CjsEvePerObjectLayout.js.map +1 -0
  538. package/dist/trinity/core/rawData/layouts/CjsEveSceneStaticParticlesLayout.js +30 -0
  539. package/dist/trinity/core/rawData/layouts/CjsEveSceneStaticParticlesLayout.js.map +1 -0
  540. package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectDecalLayout.js +78 -0
  541. package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectDecalLayout.js.map +1 -0
  542. package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectLayout.js +169 -0
  543. package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectLayout.js.map +1 -0
  544. package/dist/trinity/core/rawData/layouts/CjsEveSpacePerObjectLayout.js +107 -0
  545. package/dist/trinity/core/rawData/layouts/CjsEveSpacePerObjectLayout.js.map +1 -0
  546. package/dist/trinity/core/rawData/layouts/CjsEveSpherePinLayout.js +44 -0
  547. package/dist/trinity/core/rawData/layouts/CjsEveSpherePinLayout.js.map +1 -0
  548. package/dist/trinity/core/rawData/layouts/CjsEveStretch2Layout.js +34 -0
  549. package/dist/trinity/core/rawData/layouts/CjsEveStretch2Layout.js.map +1 -0
  550. package/dist/trinity/core/rawData/layouts/CjsEveTurretSetLayout.js +82 -0
  551. package/dist/trinity/core/rawData/layouts/CjsEveTurretSetLayout.js.map +1 -0
  552. package/dist/trinity/core/rawData/layouts/CjsTr2PerObjectLayout.js +42 -0
  553. package/dist/trinity/core/rawData/layouts/CjsTr2PerObjectLayout.js.map +1 -0
  554. package/dist/trinity/core/rawData/perObjectData/EveBasicPerObjectData.js +55 -0
  555. package/dist/trinity/core/rawData/perObjectData/EveBasicPerObjectData.js.map +1 -0
  556. package/dist/trinity/core/rawData/perObjectData/EveBoosterSetPerObjectData.js +59 -0
  557. package/dist/trinity/core/rawData/perObjectData/EveBoosterSetPerObjectData.js.map +1 -0
  558. package/dist/trinity/core/rawData/perObjectData/EveChildBoosterSetPerObjectData.js +59 -0
  559. package/dist/trinity/core/rawData/perObjectData/EveChildBoosterSetPerObjectData.js.map +1 -0
  560. package/dist/trinity/core/rawData/perObjectData/EveChildBulletStormPerObjectData.js +55 -0
  561. package/dist/trinity/core/rawData/perObjectData/EveChildBulletStormPerObjectData.js.map +1 -0
  562. package/dist/trinity/core/rawData/perObjectData/EveChildSpherePinPerObjectData.js +55 -0
  563. package/dist/trinity/core/rawData/perObjectData/EveChildSpherePinPerObjectData.js.map +1 -0
  564. package/dist/trinity/core/rawData/perObjectData/EveDecalPerObjectData.js +59 -0
  565. package/dist/trinity/core/rawData/perObjectData/EveDecalPerObjectData.js.map +1 -0
  566. package/dist/trinity/core/rawData/perObjectData/EveLensflarePerObjectData.js +55 -0
  567. package/dist/trinity/core/rawData/perObjectData/EveLensflarePerObjectData.js.map +1 -0
  568. package/dist/trinity/core/rawData/perObjectData/EveMissileWarheadPerObjectData.js +55 -0
  569. package/dist/trinity/core/rawData/perObjectData/EveMissileWarheadPerObjectData.js.map +1 -0
  570. package/dist/trinity/core/rawData/perObjectData/EveSceneStaticParticlesPerObjectData.js +55 -0
  571. package/dist/trinity/core/rawData/perObjectData/EveSceneStaticParticlesPerObjectData.js.map +1 -0
  572. package/dist/trinity/core/rawData/perObjectData/EveSpherePinPerObjectData.js +55 -0
  573. package/dist/trinity/core/rawData/perObjectData/EveSpherePinPerObjectData.js.map +1 -0
  574. package/dist/trinity/core/rawData/perObjectData/EveTurretSetPerObjectData.js +59 -0
  575. package/dist/trinity/core/rawData/perObjectData/EveTurretSetPerObjectData.js.map +1 -0
  576. package/dist/trinity/core/rawData/perObjectData/StretchPerObjectData.js +55 -0
  577. package/dist/trinity/core/rawData/perObjectData/StretchPerObjectData.js.map +1 -0
  578. package/dist/trinity/core/rawData/{Tr2PerObjectData.js → perObjectData/Tr2PerObjectData.js} +110 -62
  579. package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectData.js.map +1 -0
  580. package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataPSBuffer.js +104 -0
  581. package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataPSBuffer.js.map +1 -0
  582. package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataStandard.js +87 -0
  583. package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataStandard.js.map +1 -0
  584. package/dist/trinity/core/variable/TriVariable.js +83 -83
  585. package/dist/trinity/core/variable/TriVariable.js.map +1 -1
  586. package/dist/trinity/core/vertex/{Tr2VertexDefinition.js → Tr2VertexDefinition/Tr2VertexDefinition.js} +4 -20
  587. package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinition.js.map +1 -0
  588. package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinitionItem.js +29 -0
  589. package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinitionItem.js.map +1 -0
  590. package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js +116 -36
  591. package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js.map +1 -1
  592. package/dist/trinity/curves/curve/Tr2CurveRandomAxisRotation.js +50 -92
  593. package/dist/trinity/curves/curve/Tr2CurveRandomAxisRotation.js.map +1 -1
  594. package/dist/trinity/eve/EveModularObjectModifier.js +9 -5
  595. package/dist/trinity/eve/EveModularObjectModifier.js.map +1 -1
  596. package/dist/trinity/eve/IEveInheritPropertiesOwner.js +2 -1
  597. package/dist/trinity/eve/IEveInheritPropertiesOwner.js.map +1 -1
  598. package/dist/trinity/eve/IEveSpaceObject2.js +2 -1
  599. package/dist/trinity/eve/IEveSpaceObject2.js.map +1 -1
  600. package/dist/trinity/eve/IEveTransform.js +2 -1
  601. package/dist/trinity/eve/IEveTransform.js.map +1 -1
  602. package/dist/trinity/eve/attachment/banner/EveBannerSet.js +2 -2
  603. package/dist/trinity/eve/attachment/banner/EveBannerSet.js.map +1 -1
  604. package/dist/trinity/eve/attachment/booster/EveBoosterSet2.js +109 -133
  605. package/dist/trinity/eve/attachment/booster/EveBoosterSet2.js.map +1 -1
  606. package/dist/trinity/eve/attachment/booster/EveBoosterSet2Item.js +40 -0
  607. package/dist/trinity/eve/attachment/booster/EveBoosterSet2Item.js.map +1 -0
  608. package/dist/trinity/eve/attachment/booster/EveBoosterSet2Renderable.js +1 -1
  609. package/dist/trinity/eve/attachment/booster/EveBoosterSet2Renderable.js.map +1 -1
  610. package/dist/trinity/eve/attachment/decal/DecalMeshCache.js +2 -14
  611. package/dist/trinity/eve/attachment/decal/DecalMeshCache.js.map +1 -1
  612. package/dist/trinity/eve/attachment/decal/DecalMeshCacheMeshBuffers.js +18 -0
  613. package/dist/trinity/eve/attachment/decal/DecalMeshCacheMeshBuffers.js.map +1 -0
  614. package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js +1 -1
  615. package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js.map +1 -1
  616. package/dist/trinity/eve/attachment/haze/EveHazeSet.js +1 -1
  617. package/dist/trinity/eve/attachment/haze/EveHazeSet.js.map +1 -1
  618. package/dist/trinity/eve/attachment/plane/EvePlaneSet.js +1 -1
  619. package/dist/trinity/eve/attachment/plane/EvePlaneSet.js.map +1 -1
  620. package/dist/trinity/eve/attachment/spotlight/EveSpotlightSet.js +2 -2
  621. package/dist/trinity/eve/attachment/spotlight/EveSpotlightSet.js.map +1 -1
  622. package/dist/trinity/eve/attachment/sprite/EveSpriteLineSet.js +1 -1
  623. package/dist/trinity/eve/attachment/sprite/EveSpriteLineSet.js.map +1 -1
  624. package/dist/trinity/eve/attachment/sprite/EveSpriteSet.js +4 -2
  625. package/dist/trinity/eve/attachment/sprite/EveSpriteSet.js.map +1 -1
  626. package/dist/trinity/eve/attachment/turrets/EveTurretSet.js +143 -139
  627. package/dist/trinity/eve/attachment/turrets/EveTurretSet.js.map +1 -1
  628. package/dist/trinity/eve/camera/EveCamera.js +1 -1
  629. package/dist/trinity/eve/camera/EveCamera.js.map +1 -1
  630. package/dist/trinity/eve/child/EveChildBoosterSet.js +12 -1
  631. package/dist/trinity/eve/child/EveChildBoosterSet.js.map +1 -1
  632. package/dist/trinity/eve/child/EveChildCloud2.js +178 -151
  633. package/dist/trinity/eve/child/EveChildCloud2.js.map +1 -1
  634. package/dist/trinity/eve/child/EveChildContainer.js +141 -141
  635. package/dist/trinity/eve/child/EveChildContainer.js.map +1 -1
  636. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js +87 -0
  637. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js.map +1 -0
  638. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshArea.js +46 -0
  639. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshArea.js.map +1 -0
  640. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshInstance.js +35 -0
  641. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshInstance.js.map +1 -0
  642. package/dist/trinity/eve/child/{EveChildInstancedMeshes.js → EveChildInstancedMeshes/EveChildInstancedMeshes.js} +42 -163
  643. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js.map +1 -0
  644. package/dist/trinity/eve/child/EveChildMesh.js +218 -218
  645. package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
  646. package/dist/trinity/eve/child/EveChildPartData/EveChildPartData.js +53 -0
  647. package/dist/trinity/eve/child/EveChildPartData/EveChildPartData.js.map +1 -0
  648. package/dist/trinity/eve/child/{EveChildPartData.js → EveChildPartData/EveChildPartDataPartData.js} +9 -45
  649. package/dist/trinity/eve/child/EveChildPartData/EveChildPartDataPartData.js.map +1 -0
  650. package/dist/trinity/eve/child/EveChildParticleSystem.js +30 -29
  651. package/dist/trinity/eve/child/EveChildParticleSystem.js.map +1 -1
  652. package/dist/trinity/eve/child/EveChildTransform.js +5 -0
  653. package/dist/trinity/eve/child/EveChildTransform.js.map +1 -1
  654. package/dist/trinity/eve/child/EveChildTurret.js +7 -0
  655. package/dist/trinity/eve/child/EveChildTurret.js.map +1 -1
  656. package/dist/trinity/eve/index.js +10 -4
  657. package/dist/trinity/eve/index.js.map +1 -1
  658. package/dist/trinity/eve/lights/Tr2Light.js +5 -0
  659. package/dist/trinity/eve/lights/Tr2Light.js.map +1 -1
  660. package/dist/trinity/eve/overlays/overlayBatches.js +6 -1
  661. package/dist/trinity/eve/overlays/overlayBatches.js.map +1 -1
  662. package/dist/trinity/eve/particles/static/EveSceneStaticParticles.js +4 -4
  663. package/dist/trinity/eve/particles/static/EveSceneStaticParticles.js.map +1 -1
  664. package/dist/trinity/eve/renderable/stretch/EveStretch2.js +76 -71
  665. package/dist/trinity/eve/renderable/stretch/EveStretch2.js.map +1 -1
  666. package/dist/trinity/eve/renderable/stretch/EveStretch3.js +1 -1
  667. package/dist/trinity/eve/renderable/stretch/EveStretch3.js.map +1 -1
  668. package/dist/trinity/eve/spaceObject/EveShip2.js +3 -3
  669. package/dist/trinity/eve/spaceObject/EveShip2.js.map +1 -1
  670. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +408 -407
  671. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js.map +1 -1
  672. package/dist/trinity/eve/ui/EveTacticalOverlay.js +1 -1
  673. package/dist/trinity/eve/ui/EveTacticalOverlay.js.map +1 -1
  674. package/dist/trinity/eve/ui/lines/EveCurveLineSet.js +9 -9
  675. package/dist/trinity/eve/ui/lines/EveCurveLineSet.js.map +1 -1
  676. package/dist/trinity/eve/ui/lines/EveLineSet.js +27 -25
  677. package/dist/trinity/eve/ui/lines/EveLineSet.js.map +1 -1
  678. package/dist/trinity/eve/ui/tacticalOverlay/EveTacticalTrails.js +3 -2
  679. package/dist/trinity/eve/ui/tacticalOverlay/EveTacticalTrails.js.map +1 -1
  680. package/dist/trinity/generated/index.js +0 -1
  681. package/dist/trinity/generated/index.js.map +1 -1
  682. package/dist/trinity/generated/trinityCore/index.js +0 -1
  683. package/dist/trinity/generated/trinityCore/index.js.map +1 -1
  684. package/dist/trinity/index.js +59 -23
  685. package/dist/trinity/index.js.map +1 -1
  686. package/dist/trinity/particle/{ITr2GenericEmitter.js → ITr2GenericEmitter/ITr2GenericEmitter.js} +4 -32
  687. package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitter.js.map +1 -0
  688. package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitterUpdateArguments.js +36 -0
  689. package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitterUpdateArguments.js.map +1 -0
  690. package/dist/trinity/particle/Tr2ParticleSystem.js +4 -2
  691. package/dist/trinity/particle/Tr2ParticleSystem.js.map +1 -1
  692. package/dist/trinity/particle/element/Tr2ParticleElementData.js +15 -4
  693. package/dist/trinity/particle/element/Tr2ParticleElementData.js.map +1 -1
  694. package/dist/trinity/particle/emitter/Tr2DynamicEmitter.js +21 -20
  695. package/dist/trinity/particle/emitter/Tr2DynamicEmitter.js.map +1 -1
  696. package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js +23 -22
  697. package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js.map +1 -1
  698. package/dist/trinity/particle/emitter/Tr2StaticEmitter.js +14 -13
  699. package/dist/trinity/particle/emitter/Tr2StaticEmitter.js.map +1 -1
  700. package/dist/trinity/particle/index.js +2 -1
  701. package/dist/trinity/particle/index.js.map +1 -1
  702. package/dist/trinity/renderJob/step/TriStepPushRenderTarget.js +7 -1
  703. package/dist/trinity/renderJob/step/TriStepPushRenderTarget.js.map +1 -1
  704. package/dist/trinity/shader/Tr2Effect.js +131 -58
  705. package/dist/trinity/shader/Tr2Effect.js.map +1 -1
  706. package/dist/trinity/shader/Tr2EffectStateManager.js +17 -5
  707. package/dist/trinity/shader/Tr2EffectStateManager.js.map +1 -1
  708. package/dist/trinity/shader/Tr2Material.js +21 -4
  709. package/dist/trinity/shader/Tr2Material.js.map +1 -1
  710. package/dist/trinity/shader/material/Tr2EffectPassParameters.js +4 -1
  711. package/dist/trinity/shader/material/Tr2EffectPassParameters.js.map +1 -1
  712. package/dist/trinity/shader/parameter/Tr2GeometryBufferParameter.js +2 -2
  713. package/dist/trinity/shader/parameter/Tr2GeometryBufferParameter.js.map +1 -1
  714. package/dist/trinityal/Tr2BufferAL/Tr2BufferDescriptionAL.js +79 -0
  715. package/dist/trinityal/Tr2BufferAL/Tr2BufferDescriptionAL.js.map +1 -0
  716. package/dist/trinityal/{Tr2DeviceResourceAL.js → Tr2DeviceResourceAL/Tr2BaseDeviceResourceAL.js} +77 -79
  717. package/dist/trinityal/Tr2DeviceResourceAL/Tr2BaseDeviceResourceAL.js.map +1 -0
  718. package/dist/trinityal/Tr2DeviceResourceAL/Tr2DeviceResourceAL.js +24 -0
  719. package/dist/trinityal/Tr2DeviceResourceAL/Tr2DeviceResourceAL.js.map +1 -0
  720. package/dist/trinityal/Tr2DrawUPHelper.js +2 -1
  721. package/dist/trinityal/Tr2DrawUPHelper.js.map +1 -1
  722. package/dist/trinityal/Tr2HalHelperStructures/Tr2MsaaDesc.js +45 -0
  723. package/dist/trinityal/Tr2HalHelperStructures/Tr2MsaaDesc.js.map +1 -0
  724. package/dist/trinityal/Tr2HalHelperStructures/Tr2SamplerDescription.js +154 -0
  725. package/dist/trinityal/Tr2HalHelperStructures/Tr2SamplerDescription.js.map +1 -0
  726. package/dist/trinityal/Tr2HalHelperStructures/Tr2SubresourceData.js +48 -0
  727. package/dist/trinityal/Tr2HalHelperStructures/Tr2SubresourceData.js.map +1 -0
  728. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureCoordBox.js +75 -0
  729. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureCoordBox.js.map +1 -0
  730. package/dist/trinityal/{Tr2HalHelperStructures.js → Tr2HalHelperStructures/Tr2TextureSubresource.js} +11 -115
  731. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js.map +1 -0
  732. package/dist/trinityal/Tr2HalHelperStructures/Tr2Viewport.js +51 -0
  733. package/dist/trinityal/Tr2HalHelperStructures/Tr2Viewport.js.map +1 -0
  734. package/dist/trinityal/{Tr2RenderPassAL.js → Tr2RenderPassAL/Tr2ColorAttachment.js} +5 -28
  735. package/dist/trinityal/Tr2RenderPassAL/Tr2ColorAttachment.js.map +1 -0
  736. package/dist/trinityal/Tr2RenderPassAL/Tr2DepthAttachment.js +38 -0
  737. package/dist/trinityal/Tr2RenderPassAL/Tr2DepthAttachment.js.map +1 -0
  738. package/dist/trinityal/Tr2ResourceSetAL/Tr2RegisterMapAL.js +80 -0
  739. package/dist/trinityal/Tr2ResourceSetAL/Tr2RegisterMapAL.js.map +1 -0
  740. package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetAL.js +76 -0
  741. package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetAL.js.map +1 -0
  742. package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetALStub.js +96 -0
  743. package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetALStub.js.map +1 -0
  744. package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetDescriptionAL.js +196 -0
  745. package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetDescriptionAL.js.map +1 -0
  746. package/dist/trinityal/index.js +22 -9
  747. package/dist/trinityal/index.js.map +1 -1
  748. package/dist/trinityal/stub/Tr2BufferALStub.js +86 -141
  749. package/dist/trinityal/stub/Tr2BufferALStub.js.map +1 -1
  750. package/dist/trinityal/stub/Tr2CapsALStub.js +17 -0
  751. package/dist/trinityal/stub/Tr2CapsALStub.js.map +1 -1
  752. package/dist/trinityal/stub/Tr2ConstantBufferALStub.js +57 -41
  753. package/dist/trinityal/stub/Tr2ConstantBufferALStub.js.map +1 -1
  754. package/dist/trinityal/stub/Tr2FenceALStub.js +18 -2
  755. package/dist/trinityal/stub/Tr2FenceALStub.js.map +1 -1
  756. package/dist/trinityal/stub/Tr2GpuTimerALStub.js +97 -0
  757. package/dist/trinityal/stub/Tr2GpuTimerALStub.js.map +1 -0
  758. package/dist/trinityal/stub/Tr2OcclusionQueryALStub.js +124 -0
  759. package/dist/trinityal/stub/Tr2OcclusionQueryALStub.js.map +1 -0
  760. package/dist/trinityal/stub/Tr2PipelineStatsQueryALStub/Tr2PipelineStatsQueryALStub.js +146 -0
  761. package/dist/trinityal/stub/Tr2PipelineStatsQueryALStub/Tr2PipelineStatsQueryALStub.js.map +1 -0
  762. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2BindlessResourcesAL.js +28 -0
  763. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2BindlessResourcesAL.js.map +1 -0
  764. package/dist/trinityal/stub/{Tr2RenderContextALStub.js → Tr2RenderContextALStub/Tr2RenderContextALStub.js} +70 -75
  765. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js.map +1 -0
  766. package/dist/trinityal/stub/Tr2SamplerStateALStub.js +47 -31
  767. package/dist/trinityal/stub/Tr2SamplerStateALStub.js.map +1 -1
  768. package/dist/trinityal/stub/Tr2ShaderALStub.js +61 -45
  769. package/dist/trinityal/stub/Tr2ShaderALStub.js.map +1 -1
  770. package/dist/trinityal/stub/Tr2ShaderProgramALStub.js +51 -33
  771. package/dist/trinityal/stub/Tr2ShaderProgramALStub.js.map +1 -1
  772. package/dist/trinityal/stub/Tr2SwapChainALStub.js +61 -45
  773. package/dist/trinityal/stub/Tr2SwapChainALStub.js.map +1 -1
  774. package/dist/trinityal/stub/Tr2TextureALStub.js +188 -171
  775. package/dist/trinityal/stub/Tr2TextureALStub.js.map +1 -1
  776. package/dist/trinityal/stub/Tr2VertexLayoutALStub.js +43 -27
  777. package/dist/trinityal/stub/Tr2VertexLayoutALStub.js.map +1 -1
  778. package/dist/trinityal/stub/{Tr2VideoAdapterInfoALStub.js → Tr2VideoAdapterInfoStub.js} +16 -1
  779. package/dist/trinityal/stub/Tr2VideoAdapterInfoStub.js.map +1 -0
  780. package/dist/trinityal/stub/index.js +8 -4
  781. package/dist/trinityal/stub/index.js.map +1 -1
  782. package/dist/trinityal/vertexLayoutMatch.js +2 -2
  783. package/dist/trinityal/vertexLayoutMatch.js.map +1 -1
  784. package/dist/trinityal/webgpu/CjsWebgpuBufferAL.js +105 -90
  785. package/dist/trinityal/webgpu/CjsWebgpuBufferAL.js.map +1 -1
  786. package/dist/trinityal/webgpu/CjsWebgpuCapsAL.js +17 -0
  787. package/dist/trinityal/webgpu/CjsWebgpuCapsAL.js.map +1 -1
  788. package/dist/trinityal/webgpu/CjsWebgpuConstantBufferAL.js +15 -0
  789. package/dist/trinityal/webgpu/CjsWebgpuConstantBufferAL.js.map +1 -1
  790. package/dist/trinityal/webgpu/CjsWebgpuDevice.js +2 -2
  791. package/dist/trinityal/webgpu/CjsWebgpuDevice.js.map +1 -1
  792. package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js +900 -938
  793. package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js.map +1 -1
  794. package/dist/trinityal/webgpu/CjsWebgpuResourceSetAL.js +56 -60
  795. package/dist/trinityal/webgpu/CjsWebgpuResourceSetAL.js.map +1 -1
  796. package/dist/trinityal/webgpu/CjsWebgpuSamplerStateAL.js +16 -1
  797. package/dist/trinityal/webgpu/CjsWebgpuSamplerStateAL.js.map +1 -1
  798. package/dist/trinityal/webgpu/CjsWebgpuShaderAL.js +100 -379
  799. package/dist/trinityal/webgpu/CjsWebgpuShaderAL.js.map +1 -1
  800. package/dist/trinityal/webgpu/CjsWebgpuShaderProgramAL.js +330 -0
  801. package/dist/trinityal/webgpu/CjsWebgpuShaderProgramAL.js.map +1 -0
  802. package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js +15 -0
  803. package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js.map +1 -1
  804. package/dist/trinityal/webgpu/core/{constantArena.js → CjsWebgpuConstantArena.js} +1 -1
  805. package/dist/trinityal/webgpu/core/CjsWebgpuConstantArena.js.map +1 -0
  806. package/dist/trinityal/webgpu/core/{batchGroups.js → CjsWebgpuEncodeState.js} +1 -1
  807. package/dist/trinityal/webgpu/core/CjsWebgpuEncodeState.js.map +1 -0
  808. package/dist/trinityal/webgpu/core/{perFrameSource.js → CjsWebgpuPerFrameSource.js} +1 -1
  809. package/dist/trinityal/webgpu/core/CjsWebgpuPerFrameSource.js.map +1 -0
  810. package/dist/trinityal/webgpu/core/{pipelineCache.js → CjsWebgpuPipelineCache.js} +1 -1
  811. package/dist/trinityal/webgpu/core/CjsWebgpuPipelineCache.js.map +1 -0
  812. package/dist/trinityal/webgpu/core/{psoDescription.js → CjsWebgpuPsoDescription.js} +2 -2
  813. package/dist/trinityal/webgpu/core/CjsWebgpuPsoDescription.js.map +1 -0
  814. package/dist/trinityal/webgpu/core/{renderTarget.js → CjsWebgpuRenderTarget.js} +1 -1
  815. package/dist/trinityal/webgpu/core/CjsWebgpuRenderTarget.js.map +1 -0
  816. package/dist/trinityal/webgpu/core/{samplerSource.js → CjsWebgpuSamplerSource.js} +1 -1
  817. package/dist/trinityal/webgpu/core/CjsWebgpuSamplerSource.js.map +1 -0
  818. package/dist/trinityal/webgpu/core/{textureSource.js → CjsWebgpuTextureSource.js} +1 -1
  819. package/dist/trinityal/webgpu/core/CjsWebgpuTextureSource.js.map +1 -0
  820. package/dist/trinityal/webgpu/core/{trinityBatchDispatcher.js → CjsWebgpuTrinityBatchDispatcher.js} +4 -4
  821. package/dist/trinityal/webgpu/core/CjsWebgpuTrinityBatchDispatcher.js.map +1 -0
  822. package/dist/trinityal/webgpu/core/{trinityBatchResolver.js → CjsWebgpuTrinityBatchResolver.js} +81 -81
  823. package/dist/trinityal/webgpu/core/CjsWebgpuTrinityBatchResolver.js.map +1 -0
  824. package/dist/trinityal/webgpu/core/{trinityPassEncoder.js → CjsWebgpuTrinityPassEncoder.js} +2 -2
  825. package/dist/trinityal/webgpu/core/CjsWebgpuTrinityPassEncoder.js.map +1 -0
  826. package/dist/trinityal/webgpu/core/{workQueue.js → CjsWebgpuWorkQueue.js} +1 -1
  827. package/dist/trinityal/webgpu/core/CjsWebgpuWorkQueue.js.map +1 -0
  828. package/dist/trinityal/webgpu/internal.js +12 -11
  829. package/dist/trinityal/webgpu/internal.js.map +1 -1
  830. package/docs/audio/reference/classes/trinity.md +44 -34
  831. package/docs/character/architecture.md +276 -0
  832. package/docs/character/reference/character-appearance-plans.md +30 -66
  833. package/docs/character/reference/prepared-libraries.md +14 -30
  834. package/docs/global/reference/api.md +2 -1
  835. package/docs/global/reference/classes/README.md +53 -71
  836. package/docs/global/reference/classes/dropped.md +16 -0
  837. package/docs/resource/README.md +19 -15
  838. package/docs/resource/architecture.md +9 -2
  839. package/docs/resource/concepts/format-capabilities.md +124 -80
  840. package/docs/resource/concepts/shared-format-helpers.md +94 -0
  841. package/docs/resource/formats/README.md +230 -224
  842. package/docs/resource/formats/bitknit2.md +221 -0
  843. package/docs/resource/formats/carbon-effect-container.md +184 -269
  844. package/docs/resource/formats/gr2.md +6 -1
  845. package/docs/resource/formats/schemabound.md +28 -48
  846. package/docs/resource/formats/static.md +70 -97
  847. package/docs/resource/formats/webgl/carbon-constant-layouts.md +8 -8
  848. package/docs/resource/formats/webgl/decl-io.md +165 -256
  849. package/docs/resource/formats/webgl/memory-structured.md +64 -142
  850. package/docs/resource/formats/webgl/texture-sample.md +109 -138
  851. package/docs/resource/formats/webgpu/formats/carbon-webgpu.md +38 -69
  852. package/docs/resource/formats/webgpu/guides/effect-packaging.md +54 -116
  853. package/docs/resource/formats/webgpu/reference/api.md +64 -67
  854. package/docs/resource/formats/webgpu/reference/wgsl-compatibility.md +158 -345
  855. package/docs/resource/reference/classes/core.md +256 -236
  856. package/docs/resource/reference/classes/formats.md +1668 -1672
  857. package/docs/resource/reference/workers.md +4 -2
  858. package/docs/sof/reference/classes/core.md +1 -1
  859. package/docs/sof/reference/classes/faction.md +2 -2
  860. package/docs/sof/reference/classes/generic.md +4 -4
  861. package/docs/sof/reference/classes/pattern.md +1 -1
  862. package/docs/sof/reference/classes/shared.md +10 -10
  863. package/docs/trinity/architecture.md +55 -44
  864. package/docs/trinity/concepts/generated-class-lifecycle.md +10 -15
  865. package/docs/trinity/reference/classes/curves-and-utilities.md +496 -506
  866. package/docs/trinity/reference/classes/dropped.md +0 -189
  867. package/docs/trinity/reference/classes/eve-runtime.md +8 -8
  868. package/docs/trinity/reference/classes/generated.md +0 -10
  869. package/docs/trinity/reference/classes/particle.md +2 -2
  870. package/docs/trinity/reference/classes/trinity-core.md +1554 -1256
  871. package/docs/trinity/reference/implementation-status.md +50 -75
  872. package/docs/trinity/reference/main-semantic-extraction.md +13 -17
  873. package/docs/trinityal/reference/classes/README.md +77 -27
  874. package/docs/trinityal/reference/classes/dropped.md +92 -0
  875. package/docs/trinityal/webgpu/README.md +3 -1
  876. package/docs/trinityal/webgpu/architecture.md +121 -228
  877. package/docs/trinityal/webgpu/reference/api.md +5 -5
  878. package/docs/trinityal/webgpu/reference/classes/README.md +13 -13
  879. package/format-notices/gr2/NOTICE +18 -12
  880. package/format-notices/gr2/THIRD-PARTY-NOTICES.md +5 -5
  881. package/package.json +4 -1
  882. package/dist/audio/trinity/audio/AudActionLog.js +0 -173
  883. package/dist/audio/trinity/audio/AudActionLog.js.map +0 -1
  884. package/dist/audio/trinity/audio/AudObstructionOcclusion.js.map +0 -1
  885. package/dist/global/contracts/CjsScriptCallback.js +0 -94
  886. package/dist/global/contracts/CjsScriptCallback.js.map +0 -1
  887. package/dist/trinity/controllers/ITr2Controller.js.map +0 -1
  888. package/dist/trinity/core/Tr2GpuResourcePool.js.map +0 -1
  889. package/dist/trinity/core/Tr2QuadRenderer.js.map +0 -1
  890. package/dist/trinity/core/Tr2TextureArray.js.map +0 -1
  891. package/dist/trinity/core/batch/ITriRenderBatchAccumulator.js.map +0 -1
  892. package/dist/trinity/core/batch/Tr2RenderBatch.js.map +0 -1
  893. package/dist/trinity/core/batch/TriRenderBatchAccumulator.js.map +0 -1
  894. package/dist/trinity/core/context/CjsShadowMapExecutor.js +0 -43
  895. package/dist/trinity/core/context/CjsShadowMapExecutor.js.map +0 -1
  896. package/dist/trinity/core/context/CjsVolumetricsExecutor.js +0 -64
  897. package/dist/trinity/core/context/CjsVolumetricsExecutor.js.map +0 -1
  898. package/dist/trinity/core/context/Tr2VisibilityResults.js +0 -109
  899. package/dist/trinity/core/context/Tr2VisibilityResults.js.map +0 -1
  900. package/dist/trinity/core/device/Tr2RingBuffer.js.map +0 -1
  901. package/dist/trinity/core/device/Tr2SuballocatedBuffer.js.map +0 -1
  902. package/dist/trinity/core/mesh/ITr2ImpostorSource.js.map +0 -1
  903. package/dist/trinity/core/mesh/ITr2InstanceData.js.map +0 -1
  904. package/dist/trinity/core/rawData/Tr2PerObjectData.js.map +0 -1
  905. package/dist/trinity/core/rawData/constantLayout.js +0 -175
  906. package/dist/trinity/core/rawData/constantLayout.js.map +0 -1
  907. package/dist/trinity/core/vertex/Tr2VertexDefinition.js.map +0 -1
  908. package/dist/trinity/eve/child/EveChildInstancedMeshes.js.map +0 -1
  909. package/dist/trinity/eve/child/EveChildPartData.js.map +0 -1
  910. package/dist/trinity/generated/trinityCore/Tr2Denoiser.js +0 -47
  911. package/dist/trinity/generated/trinityCore/Tr2Denoiser.js.map +0 -1
  912. package/dist/trinity/particle/ITr2GenericEmitter.js.map +0 -1
  913. package/dist/trinityal/Tr2DeviceResourceAL.js.map +0 -1
  914. package/dist/trinityal/Tr2HalHelperStructures.js.map +0 -1
  915. package/dist/trinityal/Tr2RenderPassAL.js.map +0 -1
  916. package/dist/trinityal/Tr2ResourceSetAL.js +0 -419
  917. package/dist/trinityal/Tr2ResourceSetAL.js.map +0 -1
  918. package/dist/trinityal/Tr2SamplerDescription.js +0 -72
  919. package/dist/trinityal/Tr2SamplerDescription.js.map +0 -1
  920. package/dist/trinityal/stub/Tr2QueryALStub.js +0 -326
  921. package/dist/trinityal/stub/Tr2QueryALStub.js.map +0 -1
  922. package/dist/trinityal/stub/Tr2RenderContextALStub.js.map +0 -1
  923. package/dist/trinityal/stub/Tr2VideoAdapterInfoALStub.js.map +0 -1
  924. package/dist/trinityal/webgpu/core/batchGroups.js.map +0 -1
  925. package/dist/trinityal/webgpu/core/constantArena.js.map +0 -1
  926. package/dist/trinityal/webgpu/core/perFrameSource.js.map +0 -1
  927. package/dist/trinityal/webgpu/core/pipelineCache.js.map +0 -1
  928. package/dist/trinityal/webgpu/core/psoDescription.js.map +0 -1
  929. package/dist/trinityal/webgpu/core/renderTarget.js.map +0 -1
  930. package/dist/trinityal/webgpu/core/samplerSource.js.map +0 -1
  931. package/dist/trinityal/webgpu/core/textureSource.js.map +0 -1
  932. package/dist/trinityal/webgpu/core/trinityBatchDispatcher.js.map +0 -1
  933. package/dist/trinityal/webgpu/core/trinityBatchResolver.js.map +0 -1
  934. package/dist/trinityal/webgpu/core/trinityPassEncoder.js.map +0 -1
  935. package/dist/trinityal/webgpu/core/workQueue.js.map +0 -1
@@ -33,8 +33,9 @@ const SPECIAL_OPERAND_NAMES = {
33
33
  /**
34
34
  * Formats decoded DXBC operands as GLSL ES 3.00 expressions and assignments.
35
35
  *
36
- * Type policy: register files use float `vec4`s. Packed-light shaders also
37
- * retain uint companions for temporary registers; integer reads use those
36
+ * Type policy: register files use float `vec4`s. Packed-light shaders and
37
+ * shaders reading SV_VertexID/SV_InstanceID also retain uint companions for
38
+ * temporary registers; integer reads use those
38
39
  * companions to avoid losing packed bits through float storage. Other integer and
39
40
  * unsigned reads/writes bitcast at the use site (`floatBitsToInt` family),
40
41
  * mirroring HLSLcc's lowering when reflection-driven type analysis is
@@ -58,6 +59,10 @@ class DxbcGlslOperandFormatter {
58
59
  // bitcast (floatBitsToInt(attr)) - ccpwgl uploads them as plain float
59
60
  // values, not integer bit patterns (see DxbcGlslEmitter._declareVertexInput).
60
61
  this.integerInputs = options.integerInputs || null;
62
+ // Map of input register index -> GLSL integer built-in (`gl_VertexID`).
63
+ // Integer reads use the built-in directly instead of bitcasting its
64
+ // float bit-pattern register, which ANGLE/D3D11 does not preserve.
65
+ this.systemIntegerInputs = options.systemIntegerInputs || null;
61
66
  this.names = {
62
67
  temp: index => `r${index}`,
63
68
  indexableTemp: index => `x${index}`,
@@ -127,7 +132,11 @@ class DxbcGlslOperandFormatter {
127
132
  }
128
133
  if (as !== "float") {
129
134
  const integerInputKind = operand.type === 1 && this.integerInputs ? this.integerInputs.get(operand.registerIndex) : undefined;
130
- if (operand.type === 0 && this.integerTemps && !floatSpaceModifier) {
135
+ const systemInteger = operand.type === 1 && this.systemIntegerInputs ? this.systemIntegerInputs.get(operand.registerIndex) : undefined;
136
+ if (systemInteger && !floatSpaceModifier) {
137
+ const width = suffix ? suffix.length - 1 : 4;
138
+ expression = `${VEC_TYPE_BY_KIND[as][width - 1]}(${systemInteger})`;
139
+ } else if (operand.type === 0 && this.integerTemps && !floatSpaceModifier) {
131
140
  // Raw integer companion. An integer `neg` applies to it
132
141
  // directly below; a float-space abs forces the float register
133
142
  // through the bitcast branch instead.
@@ -1 +1 @@
1
- {"version":3,"file":"DxbcGlslOperandFormatter.js","sources":["../../../../../../../src/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js"],"sourcesContent":["import { WebglReadError } from \"../errors.js\";\r\n\r\nconst COMPONENTS = [ \"x\", \"y\", \"z\", \"w\" ];\r\nconst COMPONENT_INDEX = { x: 0, y: 1, z: 2, w: 3 };\r\nconst VEC_TYPE_BY_KIND = {\r\n float: [ \"float\", \"vec2\", \"vec3\", \"vec4\" ],\r\n int: [ \"int\", \"ivec2\", \"ivec3\", \"ivec4\" ],\r\n uint: [ \"uint\", \"uvec2\", \"uvec3\", \"uvec4\" ]\r\n};\r\nconst BITCAST_FROM_FLOAT = { int: \"floatBitsToInt\", uint: \"floatBitsToUint\" };\r\nconst BITCAST_TO_FLOAT = { int: \"intBitsToFloat\", uint: \"uintBitsToFloat\" };\r\n\r\n/**\r\n * Operand types that resolve to a special GLSL built-in instead of a register.\r\n */\r\nconst SPECIAL_OPERAND_NAMES = {\r\n 12: \"gl_FragDepth\",\r\n 38: \"gl_FragDepth\",\r\n 39: \"gl_FragDepth\"\r\n};\r\n\r\n/**\r\n * Formats decoded DXBC operands as GLSL ES 3.00 expressions and assignments.\r\n *\r\n * Type policy: register files use float `vec4`s. Packed-light shaders also\r\n * retain uint companions for temporary registers; integer reads use those\r\n * companions to avoid losing packed bits through float storage. Other integer and\r\n * unsigned reads/writes bitcast at the use site (`floatBitsToInt` family),\r\n * mirroring HLSLcc's lowering when reflection-driven type analysis is\r\n * unavailable — which is always true for this stripped-DXBC corpus.\r\n *\r\n * Register naming defaults to the fork's register-stable ABI: `r#` temps,\r\n * `v#`/`o#` stage IO, `cb#.data[i]` constant buffers, `t#`/`s#` resources.\r\n */\r\nexport class DxbcGlslOperandFormatter\r\n{\r\n /**\r\n * @param {object} [options] Naming overrides.\r\n * @param {object} [options.names] Partial override of the register-name builders.\r\n * @param {boolean} [options.integerTemps] Read temporary integer lanes from uint companions.\r\n */\r\n constructor(options = {})\r\n {\r\n this.componentMap = options.componentMap || null;\r\n this.integerTemps = options.integerTemps === true;\r\n // Map of vertex-input register index -> \"int\"|\"uint\" for inputs whose\r\n // ISGN component type is integer but whose GLSL declaration was\r\n // float-lowered. Integer reads of these VALUE-convert (int(attr)), not\r\n // bitcast (floatBitsToInt(attr)) - ccpwgl uploads them as plain float\r\n // values, not integer bit patterns (see DxbcGlslEmitter._declareVertexInput).\r\n this.integerInputs = options.integerInputs || null;\r\n this.names = {\r\n temp: (index) => `r${index}`,\r\n indexableTemp: (index) => `x${index}`,\r\n input: (index) => `v${index}`,\r\n output: (index) => `o${index}`,\r\n constantBuffer: (slot) => `cb${slot}`,\r\n constantBufferMember: \"data\",\r\n resource: (index) => `t${index}`,\r\n sampler: (index) => `s${index}`,\r\n uav: (index) => `u${index}`,\r\n // Compute-stage pseudo-registers (map-style lowering): fixed names, one\r\n // instance per shader, independent of any register index.\r\n threadId: () => \"vThreadID\",\r\n threadGroupId: () => \"vThreadGroupID\",\r\n threadIdInGroup: () => \"vThreadIDInGroup\",\r\n threadIdInGroupFlattened: () => \"vThreadIDInGroupFlattened\",\r\n immediateConstantBuffer: \"icb\",\r\n ...options.names\r\n };\r\n }\r\n\r\n /**\r\n * Formats a source operand as a typed GLSL expression.\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {object} [options] Formatting context.\r\n * @param {string} [options.destMask] Destination write mask driving swizzle selection.\r\n * @param {\"float\"|\"int\"|\"uint\"} [options.as] Type the consuming instruction reads.\r\n * @returns {string} GLSL expression.\r\n */\r\n sourceExpression(operand, options = {})\r\n {\r\n const destMask = options.destMask || \"xyzw\";\r\n const as = options.as || \"float\";\r\n\r\n if (operand.type === 4)\r\n {\r\n return this._immediateExpression(operand, destMask, as);\r\n }\r\n if (operand.type === 5)\r\n {\r\n throw new WebglReadError(\"64-bit immediates are not supported by the WebGL2 emitter\", {\r\n operandType: operand.typeName\r\n });\r\n }\r\n\r\n const suffix = this._swizzleSuffix(operand, destMask);\r\n let expression = this.registerReference(operand) + suffix;\r\n\r\n // Modifier placement is PER MODIFIER on a typed read, and getting it\r\n // wrong has broken shipped shaders in both directions:\r\n //\r\n // - `neg` on an integer read is DXBC's integer negation - two's\r\n // complement AFTER the reinterpret (`iadd r, -a, b` emits\r\n // `(-floatBitsToInt(a)) + ...`). Applying it in float space merely\r\n // flips the sign bit and broke every lines3d instance offset.\r\n // - `abs`/`absneg` have no integer form in DXBC; they appear on\r\n // typed reads only as FLOAT modifiers (condition tests, f16tof32\r\n // sources) and must wrap the float expression INSIDE the bitcast:\r\n // `abs(floatBitsToUint(x))` is invalid GLSL ES 3.00 (abs is\r\n // undefined for genUType) and failed the whole effect at compile.\r\n const modifierName = operand.modifierName;\r\n const floatSpaceModifier = as === \"float\" || modifierName === \"abs\" || modifierName === \"absneg\";\r\n if (floatSpaceModifier)\r\n {\r\n if (modifierName === \"neg\")\r\n {\r\n expression = `(-${expression})`;\r\n }\r\n else if (modifierName === \"abs\")\r\n {\r\n expression = `abs(${expression})`;\r\n }\r\n else if (modifierName === \"absneg\")\r\n {\r\n expression = `(-abs(${expression}))`;\r\n }\r\n }\r\n\r\n if (as !== \"float\")\r\n {\r\n const integerInputKind = operand.type === 1 && this.integerInputs\r\n ? this.integerInputs.get(operand.registerIndex)\r\n : undefined;\r\n\r\n if (operand.type === 0 && this.integerTemps && !floatSpaceModifier)\r\n {\r\n // Raw integer companion. An integer `neg` applies to it\r\n // directly below; a float-space abs forces the float register\r\n // through the bitcast branch instead.\r\n const raw = `cjsBitsR${operand.registerIndex}${suffix}`;\r\n const width = suffix ? suffix.length - 1 : 4;\r\n expression = as === \"uint\" ? raw : `${VEC_TYPE_BY_KIND.int[width - 1]}(${raw})`;\r\n }\r\n else if (integerInputKind)\r\n {\r\n // Float-lowered integer vertex attribute (e.g. BLENDINDICES):\r\n // the register holds the value (3.0), not the bit pattern of 3,\r\n // so convert rather than bitcast (which would read garbage).\r\n const width = suffix ? suffix.length - 1 : 4;\r\n expression = `${VEC_TYPE_BY_KIND[as][width - 1]}(${expression})`;\r\n }\r\n else\r\n {\r\n expression = `${BITCAST_FROM_FLOAT[as]}(${expression})`;\r\n }\r\n\r\n if (modifierName === \"neg\")\r\n {\r\n // Integer negation of the typed read (two's complement).\r\n expression = `(-${expression})`;\r\n }\r\n }\r\n return expression;\r\n }\r\n\r\n /**\r\n * Remaps register-space component letters into an operand's declared-variable\r\n * component space (an input packed at `.z` of its register but declared as a\r\n * scalar `float` reads without any suffix; one packed at `.zw` and declared\r\n * `vec2` reads `.xy`).\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {string} chars Register-space component letters.\r\n * @returns {string} Declared-space component letters (\"\" for scalar variables).\r\n */\r\n remapComponents(operand, chars)\r\n {\r\n const declared = this.componentMap ? this.componentMap(operand) : null;\r\n if (!declared || declared === \"xyzw\")\r\n {\r\n return chars;\r\n }\r\n if (declared.length === 1)\r\n {\r\n return \"\";\r\n }\r\n return [ ...chars ]\r\n .map((component) =>\r\n {\r\n const index = declared.indexOf(component);\r\n return COMPONENTS[index >= 0 ? index : 0];\r\n })\r\n .join(\"\");\r\n }\r\n\r\n /**\r\n * Computes how many components a formatted source expression yields, after\r\n * declared-variable remapping (a swizzle over a scalar-declared input reads\r\n * as width 1 regardless of the requested mask width).\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {string} [destMask] Destination write mask driving swizzle selection.\r\n * @returns {number} Component count of the emitted expression.\r\n */\r\n expressionWidth(operand, destMask = \"xyzw\")\r\n {\r\n if (operand.type === 4)\r\n {\r\n return operand.componentCount === 1 ? 1 : destMask.length;\r\n }\r\n if (operand.componentCount < 4 || operand.selectionModeName === \"select1\")\r\n {\r\n return 1;\r\n }\r\n let selected = destMask;\r\n if (operand.selectionModeName === \"swizzle\")\r\n {\r\n selected = [ ...destMask ].map((component) => operand.swizzle[COMPONENT_INDEX[component]]).join(\"\");\r\n }\r\n else if (operand.selectionModeName === \"mask\" && operand.mask && operand.mask !== \"xyzw\")\r\n {\r\n selected = operand.mask;\r\n }\r\n const remapped = this.remapComponents(operand, selected);\r\n return remapped === \"\" ? 1 : remapped.length;\r\n }\r\n\r\n /**\r\n * Resolves a destination operand to its register reference and write masks.\r\n *\r\n * @param {object} operand Decoded destination operand.\r\n * @returns {{ref:string,mask:string,registerMask:string}|null} Target with the\r\n * declared-space display mask and the register-space mask, or null for the\r\n * `null` register.\r\n */\r\n destination(operand)\r\n {\r\n if (operand.type === 13)\r\n {\r\n return null;\r\n }\r\n if (SPECIAL_OPERAND_NAMES[operand.type])\r\n {\r\n return { ref: SPECIAL_OPERAND_NAMES[operand.type], mask: \"\", registerMask: operand.mask || \"xyzw\" };\r\n }\r\n const registerMask = operand.mask || \"\";\r\n return {\r\n ref: this.registerReference(operand),\r\n mask: this.remapComponents(operand, registerMask),\r\n registerMask\r\n };\r\n }\r\n\r\n /**\r\n * Builds a full assignment statement for a destination operand.\r\n *\r\n * @param {object} destOperand Decoded destination operand.\r\n * @param {string} valueExpression GLSL expression producing the value.\r\n * @param {object} [options] Assignment context.\r\n * @param {boolean} [options.saturate] Wrap the value in `clamp(v, 0.0, 1.0)`.\r\n * @param {\"float\"|\"int\"|\"uint\"} [options.as] Type of `valueExpression`; non-float\r\n * values are bitcast back into the float register storage.\r\n * @returns {string|null} GLSL statement, or null when the destination is `null`.\r\n */\r\n assignment(destOperand, valueExpression, options = {})\r\n {\r\n const target = this.destination(destOperand);\r\n if (!target)\r\n {\r\n return null;\r\n }\r\n let value = valueExpression;\r\n const as = options.as || \"float\";\r\n if (as !== \"float\")\r\n {\r\n value = `${BITCAST_TO_FLOAT[as]}(${value})`;\r\n }\r\n if (options.saturate)\r\n {\r\n value = `clamp(${value}, 0.0, 1.0)`;\r\n }\r\n const mask = target.mask ? `.${target.mask}` : \"\";\r\n return `${target.ref}${mask} = ${value};`;\r\n }\r\n\r\n /**\r\n * Resolves an operand's register reference without swizzle or casts.\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @returns {string} GLSL lvalue such as `r0`, `cb3.data[26]`, or `t0`.\r\n */\r\n registerReference(operand)\r\n {\r\n const indices = operand.indices;\r\n switch (operand.type)\r\n {\r\n case 0:\r\n return this.names.temp(this._immediateIndex(operand, 0));\r\n case 1:\r\n if (indices.length !== 1)\r\n {\r\n throw new WebglReadError(\"Multi-dimensional inputs are not supported by the WebGL2 emitter\", {\r\n operandType: operand.typeName,\r\n dimensions: indices.length\r\n });\r\n }\r\n return this.names.input(this._immediateIndex(operand, 0));\r\n case 2:\r\n return this.names.output(this._immediateIndex(operand, 0));\r\n case 3:\r\n return `${this.names.indexableTemp(this._immediateIndex(operand, 0))}[${this._indexExpression(operand, 1)}]`;\r\n case 6:\r\n return this.names.sampler(this._registerIndex(operand));\r\n case 7:\r\n return this.names.resource(this._registerIndex(operand));\r\n case 8: {\r\n // A constant-buffer operand is indexed either 2D or 3D, and both\r\n // appear in the shipped corpus - 1,660 two-dimensional against\r\n // 1,747 three-dimensional across 152 shaders.\r\n //\r\n // 2D: (register, row) - shader model 5.0\r\n // 3D: (range id, register, row) - shader model 5.1\r\n //\r\n // Reading a 3D operand as if it were 2D takes the range id for\r\n // the register and the register for the row. The range id is the\r\n // ordinal of the `dcl_constant_buffer` that introduced the\r\n // binding, so it equals the register only while a shader declares\r\n // its buffers contiguously from zero. A shader declaring b0, b1,\r\n // b3 emits `cb2` for every b3 reference - a slot it never\r\n // declared, which fails to compile - and every shader that does\r\n // compile reads its rows from the register number.\r\n const dimension = operand.indices.length - 2;\r\n const member = this.names.constantBufferMember;\r\n const base = this.names.constantBuffer(\r\n this._immediateIndex(operand, dimension)\r\n );\r\n return `${base}${member ? `.${member}` : \"\"}[${this._indexExpression(operand, dimension + 1)}]`;\r\n }\r\n case 9:\r\n return `${this.names.immediateConstantBuffer}[${this._indexExpression(operand, 0)}]`;\r\n case 30:\r\n return this.names.uav(this._registerIndex(operand));\r\n case 32:\r\n return this.names.threadId();\r\n case 33:\r\n return this.names.threadGroupId();\r\n case 34:\r\n return this.names.threadIdInGroup();\r\n case 36:\r\n return this.names.threadIdInGroupFlattened();\r\n default:\r\n if (SPECIAL_OPERAND_NAMES[operand.type])\r\n {\r\n return SPECIAL_OPERAND_NAMES[operand.type];\r\n }\r\n throw new WebglReadError(\"Operand type is not supported by the WebGL2 emitter\", {\r\n operandType: operand.typeName\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Formats an immediate32 operand as a scalar or vector literal.\r\n *\r\n * @param {object} operand Decoded immediate operand.\r\n * @param {string} destMask Destination write mask.\r\n * @param {\"float\"|\"int\"|\"uint\"} as Literal type.\r\n * @returns {string} GLSL literal expression.\r\n * @private\r\n */\r\n _immediateExpression(operand, destMask, as)\r\n {\r\n const literals = operand.immediateValues.map((value) => this._literal(value, as));\r\n if (operand.componentCount === 1)\r\n {\r\n return literals[0];\r\n }\r\n const selected = [ ...destMask ].map((component) =>\r\n {\r\n const slot = COMPONENT_INDEX[component];\r\n if (slot === undefined || slot >= literals.length)\r\n {\r\n throw new WebglReadError(\"Immediate component selection is out of range\", {\r\n destMask,\r\n component\r\n });\r\n }\r\n return literals[slot];\r\n });\r\n if (selected.length === 1)\r\n {\r\n return selected[0];\r\n }\r\n return `${VEC_TYPE_BY_KIND[as][selected.length - 1]}(${selected.join(\", \")})`;\r\n }\r\n\r\n /**\r\n * Formats one immediate dword as a GLSL literal.\r\n *\r\n * @param {{uint32:number,float32:number|null}} value Immediate value views.\r\n * @param {\"float\"|\"int\"|\"uint\"} as Literal type.\r\n * @returns {string} GLSL literal.\r\n * @private\r\n */\r\n _literal(value, as)\r\n {\r\n if (as === \"uint\")\r\n {\r\n return `${value.uint32 >>> 0}u`;\r\n }\r\n if (as === \"int\")\r\n {\r\n return `${value.uint32 | 0}`;\r\n }\r\n const float = value.float32;\r\n if (!Number.isFinite(float))\r\n {\r\n return `uintBitsToFloat(${value.uint32 >>> 0}u)`;\r\n }\r\n if (Object.is(float, -0))\r\n {\r\n return \"-0.0\";\r\n }\r\n const text = String(float);\r\n return /[.e]/.test(text) ? text : `${text}.0`;\r\n }\r\n\r\n /**\r\n * Applies the operand's component selection against a destination mask.\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {string} destMask Destination write mask.\r\n * @returns {string} Swizzle suffix including the leading dot, or empty.\r\n * @private\r\n */\r\n _swizzleSuffix(operand, destMask)\r\n {\r\n if (operand.componentCount < 4)\r\n {\r\n return \"\";\r\n }\r\n let selected = \"\";\r\n if (operand.selectionModeName === \"select1\")\r\n {\r\n selected = operand.selected;\r\n }\r\n else if (operand.selectionModeName === \"swizzle\")\r\n {\r\n selected = [ ...destMask ]\r\n .map((component) => operand.swizzle[COMPONENT_INDEX[component]])\r\n .join(\"\");\r\n }\r\n else if (operand.selectionModeName === \"mask\" && operand.mask && operand.mask !== \"xyzw\")\r\n {\r\n selected = operand.mask;\r\n }\r\n else\r\n {\r\n return \"\";\r\n }\r\n const remapped = this.remapComponents(operand, selected);\r\n return remapped ? `.${remapped}` : \"\";\r\n }\r\n\r\n /**\r\n * Reads a purely immediate operand index.\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {number} dimension Index dimension.\r\n * @returns {number} Immediate index value.\r\n * @private\r\n */\r\n /**\r\n * The bound register of a resource-like operand.\r\n *\r\n * Shader model 5.1 prepends a range id to every register-bearing operand, so\r\n * a resource that is 1D at 5.0 is 2D at 5.1 and a constant buffer that is 2D\r\n * becomes 3D. The register is what trails: reading dimension 0 unconditionally\r\n * takes the range id instead, which is the ordinal of the declaration that\r\n * introduced the binding and equals the register only while a shader declares\r\n * its bindings contiguously from zero.\r\n *\r\n * Measured across 40 shipped effects: 56 of 161 two-dimensional resource\r\n * operands and 4 of 145 sampler operands carry a range id that differs from\r\n * their register. Those named the wrong binding entirely - a texel fetch\r\n * landing on a samplerCube, which GLSL ES 3.00 has no overload for.\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @returns {number} Bound register index.\r\n */\r\n _registerIndex(operand)\r\n {\r\n const dimension = operand.indices.length - 1;\r\n const index = operand.indices[dimension];\r\n if (index?.relative)\r\n {\r\n // A dynamically indexed binding. GLSL ES 3.00 has no dynamic sampler\r\n // indexing, so there is nothing to emit. Reading dimension 0 instead\r\n // would find the range id - an immediate - and quietly emit a fixed\r\n // binding that is simply the wrong one.\r\n throw new WebglReadError(\r\n \"Resource operand uses a relative register index; GLSL ES 3.00 has no dynamic binding indexing\",\r\n { operandType: operand.typeName, dimension }\r\n );\r\n }\r\n return this._immediateIndex(operand, dimension);\r\n }\r\n\r\n /**\r\n * Return one required immediate operand index.\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {number} dimension Index dimension.\r\n * @returns {number} Immediate index value.\r\n * @private\r\n */\r\n _immediateIndex(operand, dimension)\r\n {\r\n const index = operand.indices[dimension];\r\n if (!index || index.values.length === 0 || index.relative)\r\n {\r\n throw new WebglReadError(\"Expected an immediate register index\", {\r\n operandType: operand.typeName,\r\n dimension\r\n });\r\n }\r\n return index.values[0];\r\n }\r\n\r\n /**\r\n * Formats an operand index that may combine an immediate offset with a\r\n * relative register (for example `cb3[r1.y + 26]`).\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {number} dimension Index dimension.\r\n * @returns {string} GLSL index expression.\r\n * @private\r\n */\r\n _indexExpression(operand, dimension)\r\n {\r\n const index = operand.indices[dimension];\r\n if (!index)\r\n {\r\n throw new WebglReadError(\"Missing operand index dimension\", {\r\n operandType: operand.typeName,\r\n dimension\r\n });\r\n }\r\n if (index.representation === 1 || index.representation === 4)\r\n {\r\n throw new WebglReadError(\"64-bit register indices are not supported by the WebGL2 emitter\", {\r\n operandType: operand.typeName,\r\n dimension\r\n });\r\n }\r\n\r\n const immediate = index.values.length ? index.values[0] : null;\r\n const relative = index.relative\r\n ? this.sourceExpression(index.relative, { destMask: \"x\", as: \"int\" })\r\n : null;\r\n\r\n if (relative && immediate)\r\n {\r\n return `${relative} + ${immediate}`;\r\n }\r\n if (relative)\r\n {\r\n return relative;\r\n }\r\n if (immediate === null)\r\n {\r\n throw new WebglReadError(\"Operand index has neither immediate nor relative part\", {\r\n operandType: operand.typeName,\r\n dimension\r\n });\r\n }\r\n return String(immediate);\r\n }\r\n}\r\n"],"names":["COMPONENTS","COMPONENT_INDEX","x","y","z","w","VEC_TYPE_BY_KIND","float","int","uint","BITCAST_FROM_FLOAT","BITCAST_TO_FLOAT","SPECIAL_OPERAND_NAMES","DxbcGlslOperandFormatter","constructor","options","componentMap","integerTemps","integerInputs","names","temp","index","indexableTemp","input","output","constantBuffer","slot","constantBufferMember","resource","sampler","uav","threadId","threadGroupId","threadIdInGroup","threadIdInGroupFlattened","immediateConstantBuffer","sourceExpression","operand","destMask","as","type","_immediateExpression","WebglReadError","operandType","typeName","suffix","_swizzleSuffix","expression","registerReference","modifierName","floatSpaceModifier","integerInputKind","get","registerIndex","undefined","raw","width","length","remapComponents","chars","declared","map","component","indexOf","join","expressionWidth","componentCount","selectionModeName","selected","swizzle","mask","remapped","destination","ref","registerMask","assignment","destOperand","valueExpression","target","value","saturate","indices","_immediateIndex","dimensions","_indexExpression","_registerIndex","dimension","member","base","literals","immediateValues","_literal","uint32","float32","Number","isFinite","Object","is","text","String","test","relative","values","represent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"version":3,"file":"DxbcGlslOperandFormatter.js","sources":["../../../../../../../src/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js"],"sourcesContent":["import { WebglReadError } from \"../errors.js\";\r\n\r\nconst COMPONENTS = [ \"x\", \"y\", \"z\", \"w\" ];\r\nconst COMPONENT_INDEX = { x: 0, y: 1, z: 2, w: 3 };\r\nconst VEC_TYPE_BY_KIND = {\r\n float: [ \"float\", \"vec2\", \"vec3\", \"vec4\" ],\r\n int: [ \"int\", \"ivec2\", \"ivec3\", \"ivec4\" ],\r\n uint: [ \"uint\", \"uvec2\", \"uvec3\", \"uvec4\" ]\r\n};\r\nconst BITCAST_FROM_FLOAT = { int: \"floatBitsToInt\", uint: \"floatBitsToUint\" };\r\nconst BITCAST_TO_FLOAT = { int: \"intBitsToFloat\", uint: \"uintBitsToFloat\" };\r\n\r\n/**\r\n * Operand types that resolve to a special GLSL built-in instead of a register.\r\n */\r\nconst SPECIAL_OPERAND_NAMES = {\r\n 12: \"gl_FragDepth\",\r\n 38: \"gl_FragDepth\",\r\n 39: \"gl_FragDepth\"\r\n};\r\n\r\n/**\r\n * Formats decoded DXBC operands as GLSL ES 3.00 expressions and assignments.\r\n *\r\n * Type policy: register files use float `vec4`s. Packed-light shaders and\r\n * shaders reading SV_VertexID/SV_InstanceID also retain uint companions for\r\n * temporary registers; integer reads use those\r\n * companions to avoid losing packed bits through float storage. Other integer and\r\n * unsigned reads/writes bitcast at the use site (`floatBitsToInt` family),\r\n * mirroring HLSLcc's lowering when reflection-driven type analysis is\r\n * unavailable — which is always true for this stripped-DXBC corpus.\r\n *\r\n * Register naming defaults to the fork's register-stable ABI: `r#` temps,\r\n * `v#`/`o#` stage IO, `cb#.data[i]` constant buffers, `t#`/`s#` resources.\r\n */\r\nexport class DxbcGlslOperandFormatter\r\n{\r\n /**\r\n * @param {object} [options] Naming overrides.\r\n * @param {object} [options.names] Partial override of the register-name builders.\r\n * @param {boolean} [options.integerTemps] Read temporary integer lanes from uint companions.\r\n */\r\n constructor(options = {})\r\n {\r\n this.componentMap = options.componentMap || null;\r\n this.integerTemps = options.integerTemps === true;\r\n // Map of vertex-input register index -> \"int\"|\"uint\" for inputs whose\r\n // ISGN component type is integer but whose GLSL declaration was\r\n // float-lowered. Integer reads of these VALUE-convert (int(attr)), not\r\n // bitcast (floatBitsToInt(attr)) - ccpwgl uploads them as plain float\r\n // values, not integer bit patterns (see DxbcGlslEmitter._declareVertexInput).\r\n this.integerInputs = options.integerInputs || null;\r\n // Map of input register index -> GLSL integer built-in (`gl_VertexID`).\r\n // Integer reads use the built-in directly instead of bitcasting its\r\n // float bit-pattern register, which ANGLE/D3D11 does not preserve.\r\n this.systemIntegerInputs = options.systemIntegerInputs || null;\r\n this.names = {\r\n temp: (index) => `r${index}`,\r\n indexableTemp: (index) => `x${index}`,\r\n input: (index) => `v${index}`,\r\n output: (index) => `o${index}`,\r\n constantBuffer: (slot) => `cb${slot}`,\r\n constantBufferMember: \"data\",\r\n resource: (index) => `t${index}`,\r\n sampler: (index) => `s${index}`,\r\n uav: (index) => `u${index}`,\r\n // Compute-stage pseudo-registers (map-style lowering): fixed names, one\r\n // instance per shader, independent of any register index.\r\n threadId: () => \"vThreadID\",\r\n threadGroupId: () => \"vThreadGroupID\",\r\n threadIdInGroup: () => \"vThreadIDInGroup\",\r\n threadIdInGroupFlattened: () => \"vThreadIDInGroupFlattened\",\r\n immediateConstantBuffer: \"icb\",\r\n ...options.names\r\n };\r\n }\r\n\r\n /**\r\n * Formats a source operand as a typed GLSL expression.\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {object} [options] Formatting context.\r\n * @param {string} [options.destMask] Destination write mask driving swizzle selection.\r\n * @param {\"float\"|\"int\"|\"uint\"} [options.as] Type the consuming instruction reads.\r\n * @returns {string} GLSL expression.\r\n */\r\n sourceExpression(operand, options = {})\r\n {\r\n const destMask = options.destMask || \"xyzw\";\r\n const as = options.as || \"float\";\r\n\r\n if (operand.type === 4)\r\n {\r\n return this._immediateExpression(operand, destMask, as);\r\n }\r\n if (operand.type === 5)\r\n {\r\n throw new WebglReadError(\"64-bit immediates are not supported by the WebGL2 emitter\", {\r\n operandType: operand.typeName\r\n });\r\n }\r\n\r\n const suffix = this._swizzleSuffix(operand, destMask);\r\n let expression = this.registerReference(operand) + suffix;\r\n\r\n // Modifier placement is PER MODIFIER on a typed read, and getting it\r\n // wrong has broken shipped shaders in both directions:\r\n //\r\n // - `neg` on an integer read is DXBC's integer negation - two's\r\n // complement AFTER the reinterpret (`iadd r, -a, b` emits\r\n // `(-floatBitsToInt(a)) + ...`). Applying it in float space merely\r\n // flips the sign bit and broke every lines3d instance offset.\r\n // - `abs`/`absneg` have no integer form in DXBC; they appear on\r\n // typed reads only as FLOAT modifiers (condition tests, f16tof32\r\n // sources) and must wrap the float expression INSIDE the bitcast:\r\n // `abs(floatBitsToUint(x))` is invalid GLSL ES 3.00 (abs is\r\n // undefined for genUType) and failed the whole effect at compile.\r\n const modifierName = operand.modifierName;\r\n const floatSpaceModifier = as === \"float\" || modifierName === \"abs\" || modifierName === \"absneg\";\r\n if (floatSpaceModifier)\r\n {\r\n if (modifierName === \"neg\")\r\n {\r\n expression = `(-${expression})`;\r\n }\r\n else if (modifierName === \"abs\")\r\n {\r\n expression = `abs(${expression})`;\r\n }\r\n else if (modifierName === \"absneg\")\r\n {\r\n expression = `(-abs(${expression}))`;\r\n }\r\n }\r\n\r\n if (as !== \"float\")\r\n {\r\n const integerInputKind = operand.type === 1 && this.integerInputs\r\n ? this.integerInputs.get(operand.registerIndex)\r\n : undefined;\r\n const systemInteger = operand.type === 1 && this.systemIntegerInputs\r\n ? this.systemIntegerInputs.get(operand.registerIndex)\r\n : undefined;\r\n\r\n if (systemInteger && !floatSpaceModifier)\r\n {\r\n const width = suffix ? suffix.length - 1 : 4;\r\n expression = `${VEC_TYPE_BY_KIND[as][width - 1]}(${systemInteger})`;\r\n }\r\n else if (operand.type === 0 && this.integerTemps && !floatSpaceModifier)\r\n {\r\n // Raw integer companion. An integer `neg` applies to it\r\n // directly below; a float-space abs forces the float register\r\n // through the bitcast branch instead.\r\n const raw = `cjsBitsR${operand.registerIndex}${suffix}`;\r\n const width = suffix ? suffix.length - 1 : 4;\r\n expression = as === \"uint\" ? raw : `${VEC_TYPE_BY_KIND.int[width - 1]}(${raw})`;\r\n }\r\n else if (integerInputKind)\r\n {\r\n // Float-lowered integer vertex attribute (e.g. BLENDINDICES):\r\n // the register holds the value (3.0), not the bit pattern of 3,\r\n // so convert rather than bitcast (which would read garbage).\r\n const width = suffix ? suffix.length - 1 : 4;\r\n expression = `${VEC_TYPE_BY_KIND[as][width - 1]}(${expression})`;\r\n }\r\n else\r\n {\r\n expression = `${BITCAST_FROM_FLOAT[as]}(${expression})`;\r\n }\r\n\r\n if (modifierName === \"neg\")\r\n {\r\n // Integer negation of the typed read (two's complement).\r\n expression = `(-${expression})`;\r\n }\r\n }\r\n return expression;\r\n }\r\n\r\n /**\r\n * Remaps register-space component letters into an operand's declared-variable\r\n * component space (an input packed at `.z` of its register but declared as a\r\n * scalar `float` reads without any suffix; one packed at `.zw` and declared\r\n * `vec2` reads `.xy`).\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {string} chars Register-space component letters.\r\n * @returns {string} Declared-space component letters (\"\" for scalar variables).\r\n */\r\n remapComponents(operand, chars)\r\n {\r\n const declared = this.componentMap ? this.componentMap(operand) : null;\r\n if (!declared || declared === \"xyzw\")\r\n {\r\n return chars;\r\n }\r\n if (declared.length === 1)\r\n {\r\n return \"\";\r\n }\r\n return [ ...chars ]\r\n .map((component) =>\r\n {\r\n const index = declared.indexOf(component);\r\n return COMPONENTS[index >= 0 ? index : 0];\r\n })\r\n .join(\"\");\r\n }\r\n\r\n /**\r\n * Computes how many components a formatted source expression yields, after\r\n * declared-variable remapping (a swizzle over a scalar-declared input reads\r\n * as width 1 regardless of the requested mask width).\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {string} [destMask] Destination write mask driving swizzle selection.\r\n * @returns {number} Component count of the emitted expression.\r\n */\r\n expressionWidth(operand, destMask = \"xyzw\")\r\n {\r\n if (operand.type === 4)\r\n {\r\n return operand.componentCount === 1 ? 1 : destMask.length;\r\n }\r\n if (operand.componentCount < 4 || operand.selectionModeName === \"select1\")\r\n {\r\n return 1;\r\n }\r\n let selected = destMask;\r\n if (operand.selectionModeName === \"swizzle\")\r\n {\r\n selected = [ ...destMask ].map((component) => operand.swizzle[COMPONENT_INDEX[component]]).join(\"\");\r\n }\r\n else if (operand.selectionModeName === \"mask\" && operand.mask && operand.mask !== \"xyzw\")\r\n {\r\n selected = operand.mask;\r\n }\r\n const remapped = this.remapComponents(operand, selected);\r\n return remapped === \"\" ? 1 : remapped.length;\r\n }\r\n\r\n /**\r\n * Resolves a destination operand to its register reference and write masks.\r\n *\r\n * @param {object} operand Decoded destination operand.\r\n * @returns {{ref:string,mask:string,registerMask:string}|null} Target with the\r\n * declared-space display mask and the register-space mask, or null for the\r\n * `null` register.\r\n */\r\n destination(operand)\r\n {\r\n if (operand.type === 13)\r\n {\r\n return null;\r\n }\r\n if (SPECIAL_OPERAND_NAMES[operand.type])\r\n {\r\n return { ref: SPECIAL_OPERAND_NAMES[operand.type], mask: \"\", registerMask: operand.mask || \"xyzw\" };\r\n }\r\n const registerMask = operand.mask || \"\";\r\n return {\r\n ref: this.registerReference(operand),\r\n mask: this.remapComponents(operand, registerMask),\r\n registerMask\r\n };\r\n }\r\n\r\n /**\r\n * Builds a full assignment statement for a destination operand.\r\n *\r\n * @param {object} destOperand Decoded destination operand.\r\n * @param {string} valueExpression GLSL expression producing the value.\r\n * @param {object} [options] Assignment context.\r\n * @param {boolean} [options.saturate] Wrap the value in `clamp(v, 0.0, 1.0)`.\r\n * @param {\"float\"|\"int\"|\"uint\"} [options.as] Type of `valueExpression`; non-float\r\n * values are bitcast back into the float register storage.\r\n * @returns {string|null} GLSL statement, or null when the destination is `null`.\r\n */\r\n assignment(destOperand, valueExpression, options = {})\r\n {\r\n const target = this.destination(destOperand);\r\n if (!target)\r\n {\r\n return null;\r\n }\r\n let value = valueExpression;\r\n const as = options.as || \"float\";\r\n if (as !== \"float\")\r\n {\r\n value = `${BITCAST_TO_FLOAT[as]}(${value})`;\r\n }\r\n if (options.saturate)\r\n {\r\n value = `clamp(${value}, 0.0, 1.0)`;\r\n }\r\n const mask = target.mask ? `.${target.mask}` : \"\";\r\n return `${target.ref}${mask} = ${value};`;\r\n }\r\n\r\n /**\r\n * Resolves an operand's register reference without swizzle or casts.\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @returns {string} GLSL lvalue such as `r0`, `cb3.data[26]`, or `t0`.\r\n */\r\n registerReference(operand)\r\n {\r\n const indices = operand.indices;\r\n switch (operand.type)\r\n {\r\n case 0:\r\n return this.names.temp(this._immediateIndex(operand, 0));\r\n case 1:\r\n if (indices.length !== 1)\r\n {\r\n throw new WebglReadError(\"Multi-dimensional inputs are not supported by the WebGL2 emitter\", {\r\n operandType: operand.typeName,\r\n dimensions: indices.length\r\n });\r\n }\r\n return this.names.input(this._immediateIndex(operand, 0));\r\n case 2:\r\n return this.names.output(this._immediateIndex(operand, 0));\r\n case 3:\r\n return `${this.names.indexableTemp(this._immediateIndex(operand, 0))}[${this._indexExpression(operand, 1)}]`;\r\n case 6:\r\n return this.names.sampler(this._registerIndex(operand));\r\n case 7:\r\n return this.names.resource(this._registerIndex(operand));\r\n case 8: {\r\n // A constant-buffer operand is indexed either 2D or 3D, and both\r\n // appear in the shipped corpus - 1,660 two-dimensional against\r\n // 1,747 three-dimensional across 152 shaders.\r\n //\r\n // 2D: (register, row) - shader model 5.0\r\n // 3D: (range id, register, row) - shader model 5.1\r\n //\r\n // Reading a 3D operand as if it were 2D takes the range id for\r\n // the register and the register for the row. The range id is the\r\n // ordinal of the `dcl_constant_buffer` that introduced the\r\n // binding, so it equals the register only while a shader declares\r\n // its buffers contiguously from zero. A shader declaring b0, b1,\r\n // b3 emits `cb2` for every b3 reference - a slot it never\r\n // declared, which fails to compile - and every shader that does\r\n // compile reads its rows from the register number.\r\n const dimension = operand.indices.length - 2;\r\n const member = this.names.constantBufferMember;\r\n const base = this.names.constantBuffer(\r\n this._immediateIndex(operand, dimension)\r\n );\r\n return `${base}${member ? `.${member}` : \"\"}[${this._indexExpression(operand, dimension + 1)}]`;\r\n }\r\n case 9:\r\n return `${this.names.immediateConstantBuffer}[${this._indexExpression(operand, 0)}]`;\r\n case 30:\r\n return this.names.uav(this._registerIndex(operand));\r\n case 32:\r\n return this.names.threadId();\r\n case 33:\r\n return this.names.threadGroupId();\r\n case 34:\r\n return this.names.threadIdInGroup();\r\n case 36:\r\n return this.names.threadIdInGroupFlattened();\r\n default:\r\n if (SPECIAL_OPERAND_NAMES[operand.type])\r\n {\r\n return SPECIAL_OPERAND_NAMES[operand.type];\r\n }\r\n throw new WebglReadError(\"Operand type is not supported by the WebGL2 emitter\", {\r\n operandType: operand.typeName\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Formats an immediate32 operand as a scalar or vector literal.\r\n *\r\n * @param {object} operand Decoded immediate operand.\r\n * @param {string} destMask Destination write mask.\r\n * @param {\"float\"|\"int\"|\"uint\"} as Literal type.\r\n * @returns {string} GLSL literal expression.\r\n * @private\r\n */\r\n _immediateExpression(operand, destMask, as)\r\n {\r\n const literals = operand.immediateValues.map((value) => this._literal(value, as));\r\n if (operand.componentCount === 1)\r\n {\r\n return literals[0];\r\n }\r\n const selected = [ ...destMask ].map((component) =>\r\n {\r\n const slot = COMPONENT_INDEX[component];\r\n if (slot === undefined || slot >= literals.length)\r\n {\r\n throw new WebglReadError(\"Immediate component selection is out of range\", {\r\n destMask,\r\n component\r\n });\r\n }\r\n return literals[slot];\r\n });\r\n if (selected.length === 1)\r\n {\r\n return selected[0];\r\n }\r\n return `${VEC_TYPE_BY_KIND[as][selected.length - 1]}(${selected.join(\", \")})`;\r\n }\r\n\r\n /**\r\n * Formats one immediate dword as a GLSL literal.\r\n *\r\n * @param {{uint32:number,float32:number|null}} value Immediate value views.\r\n * @param {\"float\"|\"int\"|\"uint\"} as Literal type.\r\n * @returns {string} GLSL literal.\r\n * @private\r\n */\r\n _literal(value, as)\r\n {\r\n if (as === \"uint\")\r\n {\r\n return `${value.uint32 >>> 0}u`;\r\n }\r\n if (as === \"int\")\r\n {\r\n return `${value.uint32 | 0}`;\r\n }\r\n const float = value.float32;\r\n if (!Number.isFinite(float))\r\n {\r\n return `uintBitsToFloat(${value.uint32 >>> 0}u)`;\r\n }\r\n if (Object.is(float, -0))\r\n {\r\n return \"-0.0\";\r\n }\r\n const text = String(float);\r\n return /[.e]/.test(text) ? text : `${text}.0`;\r\n }\r\n\r\n /**\r\n * Applies the operand's component selection against a destination mask.\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {string} destMask Destination write mask.\r\n * @returns {string} Swizzle suffix including the leading dot, or empty.\r\n * @private\r\n */\r\n _swizzleSuffix(operand, destMask)\r\n {\r\n if (operand.componentCount < 4)\r\n {\r\n return \"\";\r\n }\r\n let selected = \"\";\r\n if (operand.selectionModeName === \"select1\")\r\n {\r\n selected = operand.selected;\r\n }\r\n else if (operand.selectionModeName === \"swizzle\")\r\n {\r\n selected = [ ...destMask ]\r\n .map((component) => operand.swizzle[COMPONENT_INDEX[component]])\r\n .join(\"\");\r\n }\r\n else if (operand.selectionModeName === \"mask\" && operand.mask && operand.mask !== \"xyzw\")\r\n {\r\n selected = operand.mask;\r\n }\r\n else\r\n {\r\n return \"\";\r\n }\r\n const remapped = this.remapComponents(operand, selected);\r\n return remapped ? `.${remapped}` : \"\";\r\n }\r\n\r\n /**\r\n * Reads a purely immediate operand index.\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {number} dimension Index dimension.\r\n * @returns {number} Immediate index value.\r\n * @private\r\n */\r\n /**\r\n * The bound register of a resource-like operand.\r\n *\r\n * Shader model 5.1 prepends a range id to every register-bearing operand, so\r\n * a resource that is 1D at 5.0 is 2D at 5.1 and a constant buffer that is 2D\r\n * becomes 3D. The register is what trails: reading dimension 0 unconditionally\r\n * takes the range id instead, which is the ordinal of the declaration that\r\n * introduced the binding and equals the register only while a shader declares\r\n * its bindings contiguously from zero.\r\n *\r\n * Measured across 40 shipped effects: 56 of 161 two-dimensional resource\r\n * operands and 4 of 145 sampler operands carry a range id that differs from\r\n * their register. Those named the wrong binding entirely - a texel fetch\r\n * landing on a samplerCube, which GLSL ES 3.00 has no overload for.\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @returns {number} Bound register index.\r\n */\r\n _registerIndex(operand)\r\n {\r\n const dimension = operand.indices.length - 1;\r\n const index = operand.indices[dimension];\r\n if (index?.relative)\r\n {\r\n // A dynamically indexed binding. GLSL ES 3.00 has no dynamic sampler\r\n // indexing, so there is nothing to emit. Reading dimension 0 instead\r\n // would find the range id - an immediate - and quietly emit a fixed\r\n // binding that is simply the wrong one.\r\n throw new WebglReadError(\r\n \"Resource operand uses a relative register index; GLSL ES 3.00 has no dynamic binding indexing\",\r\n { operandType: operand.typeName, dimension }\r\n );\r\n }\r\n return this._immediateIndex(operand, dimension);\r\n }\r\n\r\n /**\r\n * Return one required immediate operand index.\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {number} dimension Index dimension.\r\n * @returns {number} Immediate index value.\r\n * @private\r\n */\r\n _immediateIndex(operand, dimension)\r\n {\r\n const index = operand.indices[dimension];\r\n if (!index || index.values.length === 0 || index.relative)\r\n {\r\n throw new WebglReadError(\"Expected an immediate register index\", {\r\n operandType: operand.typeName,\r\n dimension\r\n });\r\n }\r\n return index.values[0];\r\n }\r\n\r\n /**\r\n * Formats an operand index that may combine an immediate offset with a\r\n * relative register (for example `cb3[r1.y + 26]`).\r\n *\r\n * @param {object} operand Decoded operand.\r\n * @param {number} dimension Index dimension.\r\n * @returns {string} GLSL index expression.\r\n * @private\r\n */\r\n _indexExpression(operand, dimension)\r\n {\r\n const index = operand.indices[dimension];\r\n if (!index)\r\n {\r\n throw new WebglReadError(\"Missing operand index dimension\", {\r\n operandType: operand.typeName,\r\n dimension\r\n });\r\n }\r\n if (index.representation === 1 || index.representation === 4)\r\n {\r\n throw new WebglReadError(\"64-bit register indices are not supported by the WebGL2 emitter\", {\r\n operandType: operand.typeName,\r\n dimension\r\n });\r\n }\r\n\r\n const immediate = index.values.length ? index.values[0] : null;\r\n const relative = index.relative\r\n ? this.sourceExpression(index.relative, { destMask: \"x\", as: \"int\" })\r\n : null;\r\n\r\n if (relative && immediate)\r\n {\r\n return `${relative} + ${immediate}`;\r\n }\r\n if (relative)\r\n {\r\n return relative;\r\n }\r\n if (immediate === null)\r\n {\r\n throw new WebglReadError(\"Operand index has neither immediate nor relative part\", {\r\n operandType: operand.typeName,\r\n dimension\r\n });\r\n }\r\n return String(immediate);\r\n }\r\n}\r\n"],"names":["COMPONENTS","COMPONENT_INDEX","x","y","z","w","VEC_TYPE_BY_KIND","float","int","uint","BITCAST_FROM_FLOAT","BITCAST_TO_FLOAT","SPECIAL_OPERAND_NAMES","DxbcGlslOperandFormatter","constructor","options","componentMap","integerTemps","integerInputs","systemIntegerInputs","names","temp","index","indexableTemp","input","output","constantBuffer","slot","constantBufferMember","resource","sampler","uav","threadId","threadGroupId","threadIdInGroup","threadIdInGroupFlattened","immediateConstantBuffer","sourceExpression","operand","destMask","as","type","_immediateExpression","WebglReadError","operandType","typeName","suffix","_swizzleSuffix","expression","registerReference","modifierName","floatSpaceModifier","integerInputKind","get","registerIndex","undefined","systemInteger","width","length","raw","remapComponents","chars","declared","map","component","indexOf","join","expressionWidth","componentCount","selectionModeName","selected","swizzle","mask","remapped","destination","ref","registerMask","assignment","destOperand","valueExpression","target","value","saturate","indices","_immediateIndex","dimensions","_indexExpression","_registerIndex","dimension","member","base","literals","immediateValues","_literal","uint32","float32","Number","isFinite","Object","is","text","String","test","relative","values","representation","immediate"],"mappings":";;AAEA,MAAMA,UAAU,GAAG,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAE;AACzC,MAAMC,eAAe,GAAG;AAAEC,EAAAA,CAA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,IAAIG,SAAS,EACzB;AACI,MAAA,OAAO,CAAA,EAAGH,QAAQ,CAAA,GAAA,EAAMG,SAAS,CAAA,CAAE;AACvC,IAAA;AACA,IAAA,IAAIH,QAAQ,EACZ;AACI,MAAA,OAAOA,QAAQ;AACnB,IAAA;IACA,IAAIG,SAAS,KAAK,IAAI,EACtB;AACI,MAAA,MAAM,IAAI/D,cAAc,CAAC,uDAAuD,EAAE;QAC9EC,WAAW,EAAEN,OAAO,CAACO,QAAQ;AAC7B2C,QAAAA;AACJ,OAAC,CAAC;AACN,IAAA;IACA,OAAOa,MAAM,CAACK,SAAS,CAAC;AAC5B,EAAA;AACJ;;;;"}
@@ -11,13 +11,13 @@ const DEFAULT_VALUES = Object.freeze({
11
11
  const VALID_EMITS = new Set([OUTPUT_JSON]);
12
12
  const OPTION_KEYS = new Set(["emit", "source"]);
13
13
 
14
- /**
15
- * Merge format values over a base set and validate them.
16
- *
17
- * @param {object} base Current values.
18
- * @param {object} [options] Values to merge in.
19
- * @param {string} [readerName] Reader name used in error messages.
20
- * @returns {object} A validated copy of the merged values.
14
+ /**
15
+ * Merge format values over a base set and validate them.
16
+ *
17
+ * @param {object} base Current values.
18
+ * @param {object} [options] Values to merge in.
19
+ * @param {string} [readerName] Reader name used in error messages.
20
+ * @returns {object} A validated copy of the merged values.
21
21
  */
22
22
  function normalizeValues(base, options = {}, readerName = "CjsWebglFormat") {
23
23
  if (!options || typeof options !== "object") {
@@ -44,21 +44,21 @@ function normalizeValues(base, options = {}, readerName = "CjsWebglFormat") {
44
44
  };
45
45
  }
46
46
 
47
- /**
48
- * Normalize caller input into a Uint8Array of package/DXBC bytes.
49
- *
50
- * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.
51
- * @returns {Uint8Array} The payload bytes.
47
+ /**
48
+ * Normalize caller input into a Uint8Array of package/DXBC bytes.
49
+ *
50
+ * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.
51
+ * @returns {Uint8Array} The payload bytes.
52
52
  */
53
- /**
54
- * Reports whether a payload has the Carbon effect container shape.
55
- *
56
- * A shape check, not an identity check: our files are stock Carbon containers,
57
- * so nothing in the bytes distinguishes a WebGL one from a shipped
58
- * `effect.dx11`. Identity comes from the path the file was resolved through.
59
- *
60
- * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.
61
- * @returns {boolean} True when the payload has the container shape.
53
+ /**
54
+ * Reports whether a payload has the Carbon effect container shape.
55
+ *
56
+ * A shape check, not an identity check: our files are stock Carbon containers,
57
+ * so nothing in the bytes distinguishes a WebGL one from a shipped
58
+ * `effect.dx11`. Identity comes from the path the file was resolved through.
59
+ *
60
+ * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.
61
+ * @returns {boolean} True when the payload has the container shape.
62
62
  */
63
63
  function isWebglEffectContainer(input) {
64
64
  try {
@@ -67,24 +67,24 @@ function isWebglEffectContainer(input) {
67
67
  return false;
68
68
  }
69
69
  }
70
- const EMIT_GLSL_OPTION_KEYS = new Set(["constantBufferStyle", "pixelConstantBufferRemap", "samplerName", "vertexStructuredCapacity", "dataTextureWidth", "stubResourceRegisters", "neutralResourceRegisters", "detailMapArrayRegisters", "lightConstantBuffer", "lightPackedTexture", "packedLightProfiles", "emulatedAddressing", "depthRange", "pairVaryings", "source"]);
71
- const EMIT_GLSL_PROFILE_KEYS = new Set(["constantBufferStyle", "pixelConstantBufferRemap", "samplerName", "vertexStructuredCapacity", "dataTextureWidth", "stubResourceRegisters", "neutralResourceRegisters", "detailMapArrayRegisters", "lightConstantBuffer", "lightPackedTexture", "packedLightProfiles", "emulatedAddressing", "depthRange"]);
70
+ const EMIT_GLSL_OPTION_KEYS = new Set(["constantBufferStyle", "pixelConstantBufferRemap", "samplerName", "vertexStructuredCapacity", "dataTextureWidth", "stubResourceRegisters", "neutralResourceRegisters", "detailMapArrayRegisters", "lightConstantBuffer", "lightPackedTexture", "packedLightProfiles", "emulatedAddressing", "depthRange", "clipYFlip", "pairVaryings", "source"]);
71
+ const EMIT_GLSL_PROFILE_KEYS = new Set(["constantBufferStyle", "pixelConstantBufferRemap", "samplerName", "vertexStructuredCapacity", "dataTextureWidth", "stubResourceRegisters", "neutralResourceRegisters", "detailMapArrayRegisters", "lightConstantBuffer", "lightPackedTexture", "packedLightProfiles", "emulatedAddressing", "depthRange", "clipYFlip"]);
72
72
 
73
- /**
74
- * Translates one DXBC stage into GLSL ES 3.00 source, sharing one core path
75
- * between `CjsWebglFormat.emitGlsl` (static) and `EmitGlsl` (instance).
76
- *
77
- * `options` is a flat bag combining the emitter's ccpwgl-profile constructor
78
- * bits (`constantBufferStyle`, `pixelConstantBufferRemap`, `samplerName`,
79
- * `vertexStructuredCapacity`, `dataTextureWidth`) with its per-call Emit
80
- * options (`pairVaryings`, `source`); omitted keys keep the emitter's
81
- * existing defaults exactly.
82
- *
83
- * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.
84
- * @param {object} [options] Combined profile/emit options.
85
- * @returns {{source:string,stageName:string,inputs:object[],outputs:object[],bindings:object[],warnings:string[],computeFragment:(object|undefined)}}
86
- * GLSL text plus the IO contract the packaging layer records; compute
87
- * stages add the emitter's `computeFragment` host contract.
73
+ /**
74
+ * Translates one DXBC stage into GLSL ES 3.00 source, sharing one core path
75
+ * between `CjsWebglFormat.emitGlsl` (static) and `EmitGlsl` (instance).
76
+ *
77
+ * `options` is a flat bag combining the emitter's ccpwgl-profile constructor
78
+ * bits (`constantBufferStyle`, `pixelConstantBufferRemap`, `samplerName`,
79
+ * `vertexStructuredCapacity`, `dataTextureWidth`) with its per-call Emit
80
+ * options (`pairVaryings`, `source`); omitted keys keep the emitter's
81
+ * existing defaults exactly.
82
+ *
83
+ * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.
84
+ * @param {object} [options] Combined profile/emit options.
85
+ * @returns {{source:string,stageName:string,inputs:object[],outputs:object[],bindings:object[],warnings:string[],computeFragment:(object|undefined)}}
86
+ * GLSL text plus the IO contract the packaging layer records; compute
87
+ * stages add the emitter's `computeFragment` host contract.
88
88
  */
89
89
  function emitGlslWithOptions(dxbcBytes, options = {}) {
90
90
  if (!options || typeof options !== "object") {
@@ -118,34 +118,5 @@ function emitGlslWithOptions(dxbcBytes, options = {}) {
118
118
  };
119
119
  }
120
120
 
121
- /**
122
- * Deep-convert a value to plain JSON-compatible data. Typed arrays become
123
- * plain number arrays; Maps/Sets become objects/arrays; class instances
124
- * with toJSON are honoured.
125
- *
126
- * @param {any} value Value to convert.
127
- * @returns {any} Plain data.
128
- */
129
- function toJsonValue(value) {
130
- if (value === null || value === undefined) return value ?? null;
131
- if (typeof value === "number" || typeof value === "string" || typeof value === "boolean") return value;
132
- if (typeof value === "bigint") return value.toString();
133
- if (ArrayBuffer.isView(value)) return Array.from(value);
134
- if (Array.isArray(value)) return value.map(toJsonValue);
135
- if (value instanceof Map) {
136
- const out = {};
137
- for (const [key, entry] of value) out[key] = toJsonValue(entry);
138
- return out;
139
- }
140
- if (value instanceof Set) return Array.from(value, toJsonValue);
141
- if (typeof value === "object") {
142
- if (typeof value.toJSON === "function") return toJsonValue(value.toJSON());
143
- const out = {};
144
- for (const key of Object.keys(value)) out[key] = toJsonValue(value[key]);
145
- return out;
146
- }
147
- return null;
148
- }
149
-
150
- export { DEFAULT_VALUES, OUTPUT_JSON, emitGlslWithOptions, isWebglEffectContainer, normalizeValues, toJsonValue };
121
+ export { DEFAULT_VALUES, OUTPUT_JSON, emitGlslWithOptions, isWebglEffectContainer, normalizeValues };
151
122
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sources":["../../../../../../src/resource/formats/webgl/core/helpers.js"],"sourcesContent":["import { asUint8Array } from \"#utils/bytes\";\r\n\r\n/**\r\n * Internal glue for CjsWebglFormat.\r\n *\r\n * Keeps the public class file small: input/option normalization, DXBC-to-GLSL\r\n * emission, and JSON conversion live here. Reading an effect is\r\n * `readGlslEffectContainer` and summarising one is `inspectGlslEffectContainer`;\r\n * neither needs glue, so neither is wrapped here. The GLSL emitter lives under\r\n * src/formats/webgl/core/glsl.\r\n */\r\n\r\nimport { DxbcGlslEmitter } from \"./glsl/DxbcGlslEmitter.js\";\r\nimport { applyPackedLightFixups } from \"./glsl/packedLightFixups.js\";\r\nimport { WebglReadError } from \"./errors.js\";\r\nimport {\r\n looksLikeCarbonEffectContainer\r\n} from \"../../../format/carbonEffect/CjsCarbonEffectReader.js\";\r\n\r\nexport const OUTPUT_JSON = \"json\";\r\n\r\nexport const DEFAULT_VALUES = Object.freeze({\r\n emit: OUTPUT_JSON,\r\n source: \"memory\"\r\n});\r\n\r\nconst VALID_EMITS = new Set([ OUTPUT_JSON ]);\r\nconst OPTION_KEYS = new Set([ \"emit\", \"source\" ]);\r\n\r\n/**\r\n * Merge format values over a base set and validate them.\r\n *\r\n * @param {object} base Current values.\r\n * @param {object} [options] Values to merge in.\r\n * @param {string} [readerName] Reader name used in error messages.\r\n * @returns {object} A validated copy of the merged values.\r\n */\r\nexport function normalizeValues(base, options = {}, readerName = \"CjsWebglFormat\")\r\n{\r\n if (!options || typeof options !== \"object\")\r\n {\r\n throw new TypeError(`${readerName}: options must be an object`);\r\n }\r\n for (const key of Object.keys(options))\r\n {\r\n if (!OPTION_KEYS.has(key))\r\n {\r\n throw new TypeError(`${readerName}: unknown option ${JSON.stringify(key)}`);\r\n }\r\n }\r\n\r\n const values = { ...base, ...options };\r\n\r\n if (!VALID_EMITS.has(values.emit))\r\n {\r\n throw new TypeError(`${readerName}: emit must be \"${OUTPUT_JSON}\", got ${JSON.stringify(values.emit)}`);\r\n }\r\n if (typeof values.source !== \"string\" || !values.source)\r\n {\r\n values.source = DEFAULT_VALUES.source;\r\n }\r\n\r\n return {\r\n emit: values.emit,\r\n source: values.source\r\n };\r\n}\r\n\r\n/**\r\n * Normalize caller input into a Uint8Array of package/DXBC bytes.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.\r\n * @returns {Uint8Array} The payload bytes.\r\n */\r\n/**\r\n * Reports whether a payload has the Carbon effect container shape.\r\n *\r\n * A shape check, not an identity check: our files are stock Carbon containers,\r\n * so nothing in the bytes distinguishes a WebGL one from a shipped\r\n * `effect.dx11`. Identity comes from the path the file was resolved through.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.\r\n * @returns {boolean} True when the payload has the container shape.\r\n */\r\nexport function isWebglEffectContainer(input)\r\n{\r\n try\r\n {\r\n return looksLikeCarbonEffectContainer(asUint8Array(input, \"CjsWebglFormat input\"));\r\n }\r\n catch\r\n {\r\n return false;\r\n }\r\n}\r\n\r\nconst EMIT_GLSL_OPTION_KEYS = new Set([\r\n \"constantBufferStyle\",\r\n \"pixelConstantBufferRemap\",\r\n \"samplerName\",\r\n \"vertexStructuredCapacity\",\r\n \"dataTextureWidth\",\r\n \"stubResourceRegisters\",\r\n \"neutralResourceRegisters\",\r\n \"detailMapArrayRegisters\",\r\n \"lightConstantBuffer\",\r\n \"lightPackedTexture\",\r\n \"packedLightProfiles\",\r\n \"emulatedAddressing\",\r\n \"depthRange\",\r\n \"pairVaryings\",\r\n \"source\"\r\n]);\r\n\r\nconst EMIT_GLSL_PROFILE_KEYS = new Set([\r\n \"constantBufferStyle\",\r\n \"pixelConstantBufferRemap\",\r\n \"samplerName\",\r\n \"vertexStructuredCapacity\",\r\n \"dataTextureWidth\",\r\n \"stubResourceRegisters\",\r\n \"neutralResourceRegisters\",\r\n \"detailMapArrayRegisters\",\r\n \"lightConstantBuffer\",\r\n \"lightPackedTexture\",\r\n \"packedLightProfiles\",\r\n \"emulatedAddressing\",\r\n \"depthRange\"\r\n]);\r\n\r\n/**\r\n * Translates one DXBC stage into GLSL ES 3.00 source, sharing one core path\r\n * between `CjsWebglFormat.emitGlsl` (static) and `EmitGlsl` (instance).\r\n *\r\n * `options` is a flat bag combining the emitter's ccpwgl-profile constructor\r\n * bits (`constantBufferStyle`, `pixelConstantBufferRemap`, `samplerName`,\r\n * `vertexStructuredCapacity`, `dataTextureWidth`) with its per-call Emit\r\n * options (`pairVaryings`, `source`); omitted keys keep the emitter's\r\n * existing defaults exactly.\r\n *\r\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\r\n * @param {object} [options] Combined profile/emit options.\r\n * @returns {{source:string,stageName:string,inputs:object[],outputs:object[],bindings:object[],warnings:string[],computeFragment:(object|undefined)}}\r\n * GLSL text plus the IO contract the packaging layer records; compute\r\n * stages add the emitter's `computeFragment` host contract.\r\n */\r\nexport function emitGlslWithOptions(dxbcBytes, options = {})\r\n{\r\n if (!options || typeof options !== \"object\")\r\n {\r\n throw new TypeError(\"CjsWebglFormat: emitGlsl options must be an object\");\r\n }\r\n for (const key of Object.keys(options))\r\n {\r\n if (!EMIT_GLSL_OPTION_KEYS.has(key))\r\n {\r\n throw new TypeError(`CjsWebglFormat: unknown emitGlsl option ${JSON.stringify(key)}`);\r\n }\r\n }\r\n\r\n const profile = {};\r\n for (const key of EMIT_GLSL_PROFILE_KEYS)\r\n {\r\n if (Object.prototype.hasOwnProperty.call(options, key)) profile[key] = options[key];\r\n }\r\n\r\n const emitter = new DxbcGlslEmitter({ profile });\r\n const result = emitter.Emit(dxbcBytes, {\r\n source: options.source,\r\n pairVaryings: options.pairVaryings\r\n });\r\n\r\n // The packed local-light lowering leaves two idioms that must not reach a\r\n // driver: a flag mask round-tripped through a float, and an all-bits mask\r\n // stored as a float and then used for branch control, where 0xFFFFFFFF is a\r\n // NaN. Applied here rather than at a call site so every caller gets them.\r\n if (!options.lightPackedTexture) return result;\r\n\r\n return {\r\n ...result,\r\n source: applyPackedLightFixups(result.source, result.stageName)\r\n };\r\n}\r\n\r\n/**\r\n * Deep-convert a value to plain JSON-compatible data. Typed arrays become\r\n * plain number arrays; Maps/Sets become objects/arrays; class instances\r\n * with toJSON are honoured.\r\n *\r\n * @param {any} value Value to convert.\r\n * @returns {any} Plain data.\r\n */\r\nexport function toJsonValue(value)\r\n{\r\n if (value === null || value === undefined) return value ?? null;\r\n if (typeof value === \"number\" || typeof value === \"string\" || typeof value === \"boolean\") return value;\r\n if (typeof value === \"bigint\") return value.toString();\r\n if (ArrayBuffer.isView(value)) return Array.from(value);\r\n if (Array.isArray(value)) return value.map(toJsonValue);\r\n if (value instanceof Map)\r\n {\r\n const out = {};\r\n for (const [ key, entry ] of value) out[key] = toJsonValue(entry);\r\n return out;\r\n }\r\n if (value instanceof Set) return Array.from(value, toJsonValue);\r\n if (typeof value === \"object\")\r\n {\r\n if (typeof value.toJSON === \"function\") return toJsonValue(value.toJSON());\r\n const out = {};\r\n for (const key of Object.keys(value)) out[key] = toJsonValue(value[key]);\r\n return out;\r\n }\r\n return null;\r\n}\r\n\r\nexport { WebglReadError };\r\n\r\n"],"names":["OUTPUT_JSON","DEFAULT_VALUES","Object","freeze","emit","source","VALID_EMITS","Set","OPTION_KEYS","normalizeValues","base","options","readerName","TypeError","key","keys","has","JSON","stringify","values","isWebglEffectContainer","input","looksLikeCarbonEffectContainer","asUint8Array","EMIT_GLSL_OPTION_KEYS","EMIT_GLSL_PROFILE_KEYS","emitGlslWithOptions","dxbcBytes","profile","prototype","hasOwnProperty","call","emitter","DxbcGlslEmitter","result","Emit","pairVaryings","lightPackedTexture","applyPackedLightFixups","stageName","toJsonValue","value","undefined","toString","ArrayBuffer","isView","Array","from","isArray","map","Map","out","entry","toJSON"],"mappings":";;;;;AAmBO,MAAMA,WAAW,GAAG;MAEdC,cAAc,GAAGC,MAAM,CAACC,MAAM,CAAC;AACxCC,EAAAA,IAAI,EAAEJ,WAAW;AACjBK,EAAAA,MAAM,EAAE;AACZ,CAAC;AAED,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAAC,CAAEP,WAAW,CAAE,CAAC;AAC5C,MAAMQ,WAAW,GAAG,IAAID,GAAG,CAAC,CAAE,MAAM,EAAE,QAAQ,CAAE,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AAC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OAAOA,KAAK,CAACQ,GAAG,CAACT,WAAW,CAAC;EACvD,IAAIC,KAAK,YAAYS,GAAG,EACxB;IACI,MAAMC,GAAG,GAAG,EAAE;AACd,IAAA,KAAK,MAAM,CAAErC,GAAG,EAAEsC,KAAK,CAAE,IAAIX,KAAK,EAAEU,GAAG,CAACrC,GAAG,CAAC,GAAG0B,WAAW,CAACY,KAAK,CAAC;AACjE,IAAA,OAAOD,GAAG;AACd,EAAA;AACA,EAAA,IAAIV,KAAK,YAAYlC,GAAG,EAAE,OAAOuC,KAAK,CAACC,IAAI,CAACN,KAAK,EAAED,WAAW,CAAC;AAC/D,EAAA,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAC7B;AACI,IAAA,IAAI,OAAOA,KAAK,CAACY,MAAM,KAAK,UAAU,EAAE,OAAOb,WAAW,CAACC,KAAK,CAACY,MAAM,EAAE,CAAC;IAC1E,MAAMF,GAAG,GAAG,EAAE;IACd,KAAK,MAAMrC,GAAG,IAAIZ,MAAM,CAACa,IAAI,CAAC0B,KAAK,CAAC,EAAEU,GAAG,CAACrC,GAAG,CAAC,GAAG0B,WAAW,CAACC,KAAK,CAAC3B,GAAG,CAAC,CAAC;AACxE,IAAA,OAAOqC,GAAG;AACd,EAAA;AACA,EAAA,OAAO,IAAI;AACf;;;;"}
1
+ {"version":3,"file":"helpers.js","sources":["../../../../../../src/resource/formats/webgl/core/helpers.js"],"sourcesContent":["import { toJsonWithCollections as toJsonValue } from \"../../../format/jsonPolicies.js\";\nimport { asUint8Array } from \"#utils/bytes\";\n\n/**\n * Internal glue for CjsWebglFormat.\n *\n * Keeps the public class file small: input/option normalization, DXBC-to-GLSL\n * emission, and JSON conversion live here. Reading an effect is\n * `readGlslEffectContainer` and summarising one is `inspectGlslEffectContainer`;\n * neither needs glue, so neither is wrapped here. The GLSL emitter lives under\n * src/formats/webgl/core/glsl.\n */\n\nimport { DxbcGlslEmitter } from \"./glsl/DxbcGlslEmitter.js\";\nimport { applyPackedLightFixups } from \"./glsl/packedLightFixups.js\";\nimport { WebglReadError } from \"./errors.js\";\nimport {\n looksLikeCarbonEffectContainer\n} from \"../../../format/carbonEffect/CjsCarbonEffectReader.js\";\n\nexport const OUTPUT_JSON = \"json\";\n\nexport const DEFAULT_VALUES = Object.freeze({\n emit: OUTPUT_JSON,\n source: \"memory\"\n});\n\nconst VALID_EMITS = new Set([ OUTPUT_JSON ]);\nconst OPTION_KEYS = new Set([ \"emit\", \"source\" ]);\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} [readerName] Reader name used in error messages.\n * @returns {object} A validated copy of the merged values.\n */\nexport function normalizeValues(base, options = {}, readerName = \"CjsWebglFormat\")\n{\n if (!options || typeof options !== \"object\")\n {\n throw new TypeError(`${readerName}: options must be an object`);\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 const values = { ...base, ...options };\n\n if (!VALID_EMITS.has(values.emit))\n {\n throw new TypeError(`${readerName}: emit must be \"${OUTPUT_JSON}\", got ${JSON.stringify(values.emit)}`);\n }\n if (typeof values.source !== \"string\" || !values.source)\n {\n values.source = DEFAULT_VALUES.source;\n }\n\n return {\n emit: values.emit,\n source: values.source\n };\n}\n\n/**\n * Normalize caller input into a Uint8Array of package/DXBC 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 effect container shape.\n *\n * A shape check, not an identity check: our files are stock Carbon containers,\n * so nothing in the bytes distinguishes a WebGL one from a shipped\n * `effect.dx11`. Identity comes from the path the file was resolved through.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate payload.\n * @returns {boolean} True when the payload has the container shape.\n */\nexport function isWebglEffectContainer(input)\n{\n try\n {\n return looksLikeCarbonEffectContainer(asUint8Array(input, \"CjsWebglFormat input\"));\n }\n catch\n {\n return false;\n }\n}\n\nconst EMIT_GLSL_OPTION_KEYS = new Set([\n \"constantBufferStyle\",\n \"pixelConstantBufferRemap\",\n \"samplerName\",\n \"vertexStructuredCapacity\",\n \"dataTextureWidth\",\n \"stubResourceRegisters\",\n \"neutralResourceRegisters\",\n \"detailMapArrayRegisters\",\n \"lightConstantBuffer\",\n \"lightPackedTexture\",\n \"packedLightProfiles\",\n \"emulatedAddressing\",\n \"depthRange\",\n \"clipYFlip\",\n \"pairVaryings\",\n \"source\"\n]);\n\nconst EMIT_GLSL_PROFILE_KEYS = new Set([\n \"constantBufferStyle\",\n \"pixelConstantBufferRemap\",\n \"samplerName\",\n \"vertexStructuredCapacity\",\n \"dataTextureWidth\",\n \"stubResourceRegisters\",\n \"neutralResourceRegisters\",\n \"detailMapArrayRegisters\",\n \"lightConstantBuffer\",\n \"lightPackedTexture\",\n \"packedLightProfiles\",\n \"emulatedAddressing\",\n \"depthRange\",\n \"clipYFlip\"\n]);\n\n/**\n * Translates one DXBC stage into GLSL ES 3.00 source, sharing one core path\n * between `CjsWebglFormat.emitGlsl` (static) and `EmitGlsl` (instance).\n *\n * `options` is a flat bag combining the emitter's ccpwgl-profile constructor\n * bits (`constantBufferStyle`, `pixelConstantBufferRemap`, `samplerName`,\n * `vertexStructuredCapacity`, `dataTextureWidth`) with its per-call Emit\n * options (`pairVaryings`, `source`); omitted keys keep the emitter's\n * existing defaults exactly.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\n * @param {object} [options] Combined profile/emit options.\n * @returns {{source:string,stageName:string,inputs:object[],outputs:object[],bindings:object[],warnings:string[],computeFragment:(object|undefined)}}\n * GLSL text plus the IO contract the packaging layer records; compute\n * stages add the emitter's `computeFragment` host contract.\n */\nexport function emitGlslWithOptions(dxbcBytes, options = {})\n{\n if (!options || typeof options !== \"object\")\n {\n throw new TypeError(\"CjsWebglFormat: emitGlsl options must be an object\");\n }\n for (const key of Object.keys(options))\n {\n if (!EMIT_GLSL_OPTION_KEYS.has(key))\n {\n throw new TypeError(`CjsWebglFormat: unknown emitGlsl option ${JSON.stringify(key)}`);\n }\n }\n\n const profile = {};\n for (const key of EMIT_GLSL_PROFILE_KEYS)\n {\n if (Object.prototype.hasOwnProperty.call(options, key)) profile[key] = options[key];\n }\n\n const emitter = new DxbcGlslEmitter({ profile });\n const result = emitter.Emit(dxbcBytes, {\n source: options.source,\n pairVaryings: options.pairVaryings\n });\n\n // The packed local-light lowering leaves two idioms that must not reach a\n // driver: a flag mask round-tripped through a float, and an all-bits mask\n // stored as a float and then used for branch control, where 0xFFFFFFFF is a\n // NaN. Applied here rather than at a call site so every caller gets them.\n if (!options.lightPackedTexture) return result;\n\n return {\n ...result,\n source: applyPackedLightFixups(result.source, result.stageName)\n };\n}\n\n/**\n * Deep-convert a value to plain JSON-compatible data. Typed arrays become\n * plain number arrays; Maps/Sets become objects/arrays; class instances\n * with toJSON are honoured.\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 { WebglReadError };\n\n"],"names":["OUTPUT_JSON","DEFAULT_VALUES","Object","freeze","emit","source","VALID_EMITS","Set","OPTION_KEYS","normalizeValues","base","options","readerName","TypeError","key","keys","has","JSON","stringify","values","isWebglEffectContainer","input","looksLikeCarbonEffectContainer","asUint8Array","EMIT_GLSL_OPTION_KEYS","EMIT_GLSL_PROFILE_KEYS","emitGlslWithOptions","dxbcBytes","profile","prototype","hasOwnProperty","call","emitter","DxbcGlslEmitter","result","Emit","pairVaryings","lightPackedTexture","applyPackedLightFixups","stageName"],"mappings":";;;;;AAoBO,MAAMA,WAAW,GAAG;MAEdC,cAAc,GAAGC,MAAM,CAACC,MAAM,CAAC;AACxCC,EAAAA,IAAI,EAAEJ,WAAW;AACjBK,EAAAA,MAAM,EAAE;AACZ,CAAC;AAED,MAAMC,WAAW,GAAG,IAA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AACF,GAAG,CAAC,EACnC;MACI,MAAM,IAAID,SAAS,CAAC,CAAA,wCAAA,EAA2CI,IAAI,CAACC,SAAS,CAACJ,GAAG,CAAC,CAAA,CAAE,CAAC;AACzF,IAAA;AACJ,EAAA;EAEA,MAAMc,OAAO,GAAG,EAAE;AAClB,EAAA,KAAK,MAAMd,GAAG,IAAIW,sBAAsB,EACxC;IACI,IAAIvB,MAAM,CAAC2B,SAAS,CAACC,cAAc,CAACC,IAAI,CAACpB,OAAO,EAAEG,GAAG,CAAC,EAAEc,OAAO,CAACd,GAAG,CAAC,GAAGH,OAAO,CAACG,GAAG,CAAC;AACvF,EAAA;AAEA,EAAA,MAAMkB,OAAO,GAAG,IAAIC,eAAe,CAAC;AAAEL,IAAAA;AAAQ,GAAC,CAAC;AAChD,EAAA,MAAMM,MAAM,GAAGF,OAAO,CAACG,IAAI,CAACR,SAAS,EAAE;IACnCtB,MAAM,EAAEM,OAAO,CAACN,MAAM;IACtB+B,YAAY,EAAEzB,OAAO,CAACyB;AAC1B,GAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA,EAAA,IAAI,CAACzB,OAAO,CAAC0B,kBAAkB,EAAE,OAAOH,MAAM;EAE9C,OAAO;AACH,IAAA,GAAGA,MAAM;IACT7B,MAAM,EAAEiC,sBAAsB,CAACJ,MAAM,CAAC7B,MAAM,EAAE6B,MAAM,CAACK,SAAS;GACjE;AACL;;;;"}
@@ -6,7 +6,8 @@ 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, toJsonValue, 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, OUTPUT_JSON, CARBON_WEBGPU_FORMAT, CARBON_WEBGPU_ANALYSIS_FORMAT } from './core/helpers.js';
10
+ import { toJsonWithCollections } from '../../format/jsonPolicies.js';
10
11
 
11
12
  const FORMAT_NAME = "CjsWebgpuFormat";
12
13
 
@@ -229,7 +230,7 @@ class CjsWebgpuFormat extends CjsFormat {
229
230
  * @returns {any} Plain JSON-compatible data.
230
231
  */
231
232
  ToJSON(value) {
232
- return toJsonValue(value);
233
+ return toJsonWithCollections(value);
233
234
  }
234
235
 
235
236
  /**
@@ -339,7 +340,7 @@ class CjsWebgpuFormat extends CjsFormat {
339
340
  * @returns {any} Plain JSON-compatible data.
340
341
  */
341
342
  static toJSON(value) {
342
- return toJsonValue(value);
343
+ return toJsonWithCollections(value);
343
344
  }
344
345
  static OUTPUT_JSON = OUTPUT_JSON;
345
346
  static CLASS_KEYS = CLASS_KEYS;
@@ -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,GAAGK,MAAM,CAACJ,MAAM;AAC5B,IAAA,IAAI,CAAC,QAAQ,GAAGI,MAAM,CAACI,OAAO;AAC9B,IAAA,OAAO,IAAI;AACf,EAAA;;AA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;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\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":";;;;;;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