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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (929) 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/utils/bytes.js +22 -4
  80. package/dist/global/utils/bytes.js.map +1 -1
  81. package/dist/global/utils/checksum.js +80 -0
  82. package/dist/global/utils/checksum.js.map +1 -0
  83. package/dist/global/utils/errors/CjsCancellationError.js +36 -0
  84. package/dist/global/utils/errors/CjsCancellationError.js.map +1 -0
  85. package/dist/global/utils/errors/CjsError.js +21 -52
  86. package/dist/global/utils/errors/CjsError.js.map +1 -1
  87. package/dist/global/utils/errors/abort.js +1 -1
  88. package/dist/global/utils/errors/abort.js.map +1 -1
  89. package/dist/global/utils/errors/index.js +2 -1
  90. package/dist/global/utils/errors/index.js.map +1 -1
  91. package/dist/global/utils/index.js +4 -2
  92. package/dist/global/utils/index.js.map +1 -1
  93. package/dist/index.js +95 -35
  94. package/dist/index.js.map +1 -1
  95. package/dist/input/Tr2MainWindow.js +7 -9
  96. package/dist/input/Tr2MainWindow.js.map +1 -1
  97. package/dist/resource/CjsResMan.js +33 -39
  98. package/dist/resource/CjsResMan.js.map +1 -1
  99. package/dist/resource/CjsResource.js +19 -5
  100. package/dist/resource/CjsResource.js.map +1 -1
  101. package/dist/resource/audio/AudioGeometryResData.js +22 -27
  102. package/dist/resource/audio/AudioGeometryResData.js.map +1 -1
  103. package/dist/resource/audio/CjsAudioRes.js +4 -5
  104. package/dist/resource/audio/CjsAudioRes.js.map +1 -1
  105. package/dist/resource/format/CjsBitReader.js +263 -0
  106. package/dist/resource/format/CjsBitReader.js.map +1 -0
  107. package/dist/resource/format/CjsByteReader.js +130 -125
  108. package/dist/resource/format/CjsByteReader.js.map +1 -1
  109. package/dist/resource/format/CjsFormat.js +11 -4
  110. package/dist/resource/format/CjsFormat.js.map +1 -1
  111. package/dist/resource/format/CjsFormatError.js +37 -1
  112. package/dist/resource/format/CjsFormatError.js.map +1 -1
  113. package/dist/resource/format/CjsResourceProbe.js +41 -37
  114. package/dist/resource/format/CjsResourceProbe.js.map +1 -1
  115. package/dist/resource/format/carbonRecordGuard.js +33 -0
  116. package/dist/resource/format/carbonRecordGuard.js.map +1 -0
  117. package/dist/resource/format/imageSignatures.js +202 -0
  118. package/dist/resource/format/imageSignatures.js.map +1 -0
  119. package/dist/resource/format/index.js +2 -1
  120. package/dist/resource/format/index.js.map +1 -1
  121. package/dist/resource/format/jsonPolicies.js +180 -0
  122. package/dist/resource/format/jsonPolicies.js.map +1 -0
  123. package/dist/resource/formats/black/core/helpers.js +18 -29
  124. package/dist/resource/formats/black/core/helpers.js.map +1 -1
  125. package/dist/resource/formats/bnk/CjsBnkFormat.js +4 -3
  126. package/dist/resource/formats/bnk/CjsBnkFormat.js.map +1 -1
  127. package/dist/resource/formats/bnk/core/WwiseCursor.js +218 -0
  128. package/dist/resource/formats/bnk/core/WwiseCursor.js.map +1 -0
  129. package/dist/resource/formats/bnk/core/busNodes.js +2 -1
  130. package/dist/resource/formats/bnk/core/busNodes.js.map +1 -1
  131. package/dist/resource/formats/bnk/core/effectNodes.js +2 -1
  132. package/dist/resource/formats/bnk/core/effectNodes.js.map +1 -1
  133. package/dist/resource/formats/bnk/core/eventAction.js +15 -93
  134. package/dist/resource/formats/bnk/core/eventAction.js.map +1 -1
  135. package/dist/resource/formats/bnk/core/globalSettings.js +19 -94
  136. package/dist/resource/formats/bnk/core/globalSettings.js.map +1 -1
  137. package/dist/resource/formats/bnk/core/helpers.js +2 -48
  138. package/dist/resource/formats/bnk/core/helpers.js.map +1 -1
  139. package/dist/resource/formats/bnk/core/musicNodes.js +42 -134
  140. package/dist/resource/formats/bnk/core/musicNodes.js.map +1 -1
  141. package/dist/resource/formats/bnk/core/nodeBase.js +20 -111
  142. package/dist/resource/formats/bnk/core/nodeBase.js.map +1 -1
  143. package/dist/resource/formats/bnk/core/sfxNodes.js +2 -1
  144. package/dist/resource/formats/bnk/core/sfxNodes.js.map +1 -1
  145. package/dist/resource/formats/cmf/CjsCmfFormat.js +242 -228
  146. package/dist/resource/formats/cmf/CjsCmfFormat.js.map +1 -1
  147. package/dist/resource/formats/cmf/core/binary.js +54 -60
  148. package/dist/resource/formats/cmf/core/binary.js.map +1 -1
  149. package/dist/resource/formats/dds/CjsDdsFormat.js +5 -3
  150. package/dist/resource/formats/dds/CjsDdsFormat.js.map +1 -1
  151. package/dist/resource/formats/dds/core/bc6h.js +16 -18
  152. package/dist/resource/formats/dds/core/bc6h.js.map +1 -1
  153. package/dist/resource/formats/dds/core/bc7.js +28 -24
  154. package/dist/resource/formats/dds/core/bc7.js.map +1 -1
  155. package/dist/resource/formats/dds/core/helpers.js +7 -133
  156. package/dist/resource/formats/dds/core/helpers.js.map +1 -1
  157. package/dist/resource/formats/dxbc/CjsDxbcFormat.js +3 -2
  158. package/dist/resource/formats/dxbc/CjsDxbcFormat.js.map +1 -1
  159. package/dist/resource/formats/dxbc/core/helpers.js +4 -32
  160. package/dist/resource/formats/dxbc/core/helpers.js.map +1 -1
  161. package/dist/resource/formats/fbx/CjsFbxFormat.js +11 -0
  162. package/dist/resource/formats/fbx/CjsFbxFormat.js.map +1 -1
  163. package/dist/resource/formats/fbx/core/helpers.js +18 -12
  164. package/dist/resource/formats/fbx/core/helpers.js.map +1 -1
  165. package/dist/resource/formats/flac/CjsFlacFormat.js +4 -9
  166. package/dist/resource/formats/flac/CjsFlacFormat.js.map +1 -1
  167. package/dist/resource/formats/flac/core/helpers.js +1 -62
  168. package/dist/resource/formats/flac/core/helpers.js.map +1 -1
  169. package/dist/resource/formats/gif/CjsGifFormat.js +4 -9
  170. package/dist/resource/formats/gif/CjsGifFormat.js.map +1 -1
  171. package/dist/resource/formats/gif/core/helpers.js +1 -63
  172. package/dist/resource/formats/gif/core/helpers.js.map +1 -1
  173. package/dist/resource/formats/gltf/CjsGltfFormat.js +4 -3
  174. package/dist/resource/formats/gltf/CjsGltfFormat.js.map +1 -1
  175. package/dist/resource/formats/gltf/core/helpers.js +3 -19
  176. package/dist/resource/formats/gltf/core/helpers.js.map +1 -1
  177. package/dist/resource/formats/gr2/CjsGr2Format.js +105 -92
  178. package/dist/resource/formats/gr2/CjsGr2Format.js.map +1 -1
  179. package/dist/resource/formats/gr2/core/container.js +1 -10
  180. package/dist/resource/formats/gr2/core/container.js.map +1 -1
  181. package/dist/resource/formats/gr2/core/helpers.js +24 -35
  182. package/dist/resource/formats/gr2/core/helpers.js.map +1 -1
  183. package/dist/resource/formats/gr2/core/shared.js +193 -189
  184. package/dist/resource/formats/gr2/core/shared.js.map +1 -1
  185. package/dist/resource/formats/hlsl/CjsHlslFormat.js +4 -3
  186. package/dist/resource/formats/hlsl/CjsHlslFormat.js.map +1 -1
  187. package/dist/resource/formats/hlsl/core/helpers.js +1 -30
  188. package/dist/resource/formats/hlsl/core/helpers.js.map +1 -1
  189. package/dist/resource/formats/jpeg/CjsJpegFormat.js +5 -3
  190. package/dist/resource/formats/jpeg/CjsJpegFormat.js.map +1 -1
  191. package/dist/resource/formats/jpeg/core/helpers.js +7 -134
  192. package/dist/resource/formats/jpeg/core/helpers.js.map +1 -1
  193. package/dist/resource/formats/mp3/CjsMp3Format.js +4 -9
  194. package/dist/resource/formats/mp3/CjsMp3Format.js.map +1 -1
  195. package/dist/resource/formats/mp3/core/helpers.js +1 -64
  196. package/dist/resource/formats/mp3/core/helpers.js.map +1 -1
  197. package/dist/resource/formats/mp4/CjsMp4Format.js +4 -9
  198. package/dist/resource/formats/mp4/CjsMp4Format.js.map +1 -1
  199. package/dist/resource/formats/mp4/core/helpers.js +1 -73
  200. package/dist/resource/formats/mp4/core/helpers.js.map +1 -1
  201. package/dist/resource/formats/obj/CjsObjFormat.js +4 -3
  202. package/dist/resource/formats/obj/CjsObjFormat.js.map +1 -1
  203. package/dist/resource/formats/obj/core/helpers.js +93 -115
  204. package/dist/resource/formats/obj/core/helpers.js.map +1 -1
  205. package/dist/resource/formats/ogg/CjsOggFormat.js +4 -3
  206. package/dist/resource/formats/ogg/CjsOggFormat.js.map +1 -1
  207. package/dist/resource/formats/ogg/core/helpers.js +1 -15
  208. package/dist/resource/formats/ogg/core/helpers.js.map +1 -1
  209. package/dist/resource/formats/ogg/core/vorbis.js +138 -144
  210. package/dist/resource/formats/ogg/core/vorbis.js.map +1 -1
  211. package/dist/resource/formats/pickle/CjsPickleFormat.js +83 -114
  212. package/dist/resource/formats/pickle/CjsPickleFormat.js.map +1 -1
  213. package/dist/resource/formats/png/CjsPngFormat.js +5 -3
  214. package/dist/resource/formats/png/CjsPngFormat.js.map +1 -1
  215. package/dist/resource/formats/png/core/helpers.js +13 -152
  216. package/dist/resource/formats/png/core/helpers.js.map +1 -1
  217. package/dist/resource/formats/png/core/writer.js +3 -27
  218. package/dist/resource/formats/png/core/writer.js.map +1 -1
  219. package/dist/resource/formats/red/core/helpers.js +19 -29
  220. package/dist/resource/formats/red/core/helpers.js.map +1 -1
  221. package/dist/resource/formats/stl/CjsStlFormat.js +158 -147
  222. package/dist/resource/formats/stl/CjsStlFormat.js.map +1 -1
  223. package/dist/resource/formats/stl/core/helpers.js +44 -66
  224. package/dist/resource/formats/stl/core/helpers.js.map +1 -1
  225. package/dist/resource/formats/tga/CjsTgaFormat.js +5 -3
  226. package/dist/resource/formats/tga/CjsTgaFormat.js.map +1 -1
  227. package/dist/resource/formats/tga/core/helpers.js +7 -153
  228. package/dist/resource/formats/tga/core/helpers.js.map +1 -1
  229. package/dist/resource/formats/vta/CjsVtaFormat.js +4 -3
  230. package/dist/resource/formats/vta/CjsVtaFormat.js.map +1 -1
  231. package/dist/resource/formats/vta/core/helpers.js +1 -17
  232. package/dist/resource/formats/vta/core/helpers.js.map +1 -1
  233. package/dist/resource/formats/wav/CjsWavFormat.js +4 -3
  234. package/dist/resource/formats/wav/CjsWavFormat.js.map +1 -1
  235. package/dist/resource/formats/wav/core/helpers.js +1 -15
  236. package/dist/resource/formats/wav/core/helpers.js.map +1 -1
  237. package/dist/resource/formats/webgl/CjsWebglFormat.js +4 -3
  238. package/dist/resource/formats/webgl/CjsWebglFormat.js.map +1 -1
  239. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +52 -4
  240. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  241. package/dist/resource/formats/webgl/core/helpers.js +39 -68
  242. package/dist/resource/formats/webgl/core/helpers.js.map +1 -1
  243. package/dist/resource/formats/webgpu/CjsWebgpuFormat.js +4 -3
  244. package/dist/resource/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  245. package/dist/resource/formats/webgpu/core/helpers.js +4 -30
  246. package/dist/resource/formats/webgpu/core/helpers.js.map +1 -1
  247. package/dist/resource/formats/webm/CjsWebmFormat.js +4 -9
  248. package/dist/resource/formats/webm/CjsWebmFormat.js.map +1 -1
  249. package/dist/resource/formats/webm/core/helpers.js +1 -73
  250. package/dist/resource/formats/webm/core/helpers.js.map +1 -1
  251. package/dist/resource/formats/webp/CjsWebpFormat.js +4 -9
  252. package/dist/resource/formats/webp/CjsWebpFormat.js.map +1 -1
  253. package/dist/resource/formats/webp/core/helpers.js +1 -62
  254. package/dist/resource/formats/webp/core/helpers.js.map +1 -1
  255. package/dist/resource/formats/wem/CjsWemFormat.js +4 -3
  256. package/dist/resource/formats/wem/CjsWemFormat.js.map +1 -1
  257. package/dist/resource/formats/wem/core/bitStream.js +83 -106
  258. package/dist/resource/formats/wem/core/bitStream.js.map +1 -1
  259. package/dist/resource/formats/wem/core/codebookLibrary.js +52 -52
  260. package/dist/resource/formats/wem/core/codebookLibrary.js.map +1 -1
  261. package/dist/resource/formats/wem/core/helpers.js +1 -15
  262. package/dist/resource/formats/wem/core/helpers.js.map +1 -1
  263. package/dist/resource/formats/wem/core/wemToOgg.js +67 -67
  264. package/dist/resource/formats/wem/core/wemToOgg.js.map +1 -1
  265. package/dist/resource/geometry/MeshDecalData.js +23 -25
  266. package/dist/resource/geometry/MeshDecalData.js.map +1 -1
  267. package/dist/resource/geometry/MeshDecalLodData.js +14 -23
  268. package/dist/resource/geometry/MeshDecalLodData.js.map +1 -1
  269. package/dist/resource/geometry/TriGeometryRes.js +299 -284
  270. package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
  271. package/dist/resource/geometry/TriGeometryResAreaData.js +30 -31
  272. package/dist/resource/geometry/TriGeometryResAreaData.js.map +1 -1
  273. package/dist/resource/geometry/TriGeometryResJointData.js +16 -24
  274. package/dist/resource/geometry/TriGeometryResJointData.js.map +1 -1
  275. package/dist/resource/geometry/TriGeometryResLodData.js +50 -41
  276. package/dist/resource/geometry/TriGeometryResLodData.js.map +1 -1
  277. package/dist/resource/geometry/TriGeometryResMeshData.js +32 -32
  278. package/dist/resource/geometry/TriGeometryResMeshData.js.map +1 -1
  279. package/dist/resource/geometry/TriGeometryResSkeletonData.js +14 -23
  280. package/dist/resource/geometry/TriGeometryResSkeletonData.js.map +1 -1
  281. package/dist/resource/geometry/TriJointBinding.js +16 -24
  282. package/dist/resource/geometry/TriJointBinding.js.map +1 -1
  283. package/dist/resource/geometry/TriMorphTargetGeometryConstants.js +22 -27
  284. package/dist/resource/geometry/TriMorphTargetGeometryConstants.js.map +1 -1
  285. package/dist/resource/geometry/TriRtGeometryConstants.js +50 -41
  286. package/dist/resource/geometry/TriRtGeometryConstants.js.map +1 -1
  287. package/dist/resource/geometry/granny/GStateBindingCallbackData.js +12 -22
  288. package/dist/resource/geometry/granny/GStateBindingCallbackData.js.map +1 -1
  289. package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js +30 -31
  290. package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js.map +1 -1
  291. package/dist/resource/index.js +1 -1
  292. package/dist/resource/shader/reflection/Tr2EffectConstant.js +16 -17
  293. package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -1
  294. package/dist/resource/shader/reflection/Tr2EffectDescription.js +26 -28
  295. package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
  296. package/dist/resource/shader/reflection/Tr2EffectLibrary.js +24 -25
  297. package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
  298. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +21 -22
  299. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
  300. package/dist/resource/shader/reflection/Tr2EffectResource.js +25 -26
  301. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
  302. package/dist/resource/shader/reflection/Tr2EffectStageInput.js +69 -72
  303. package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
  304. package/dist/resource/shader/reflection/Tr2EffectTechnique.js +17 -18
  305. package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
  306. package/dist/resource/shader/reflection/Tr2Pass.js +42 -43
  307. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
  308. package/dist/resource/shader/reflection/Tr2RenderStateSetup.js +26 -5
  309. package/dist/resource/shader/reflection/Tr2RenderStateSetup.js.map +1 -1
  310. package/dist/resource/shader/reflection/carbonRecordFields.js +87 -90
  311. package/dist/resource/shader/reflection/carbonRecordFields.js.map +1 -1
  312. package/dist/resource/shader/sampler/Tr2SamplerSetup.js +32 -34
  313. package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
  314. package/dist/resource/texture/CjsTextureArrayRes.js +1 -6
  315. package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
  316. package/dist/resource/texture/Tr2TextureLodManager.js +35 -27
  317. package/dist/resource/texture/Tr2TextureLodManager.js.map +1 -1
  318. package/dist/resource/texture/Tr2TextureLodUpdateRequest.js +16 -24
  319. package/dist/resource/texture/Tr2TextureLodUpdateRequest.js.map +1 -1
  320. package/dist/resource/texture/Tr2TexturePackChannel.js +16 -24
  321. package/dist/resource/texture/Tr2TexturePackChannel.js.map +1 -1
  322. package/dist/resource/texture/Tr2TexturePipeline.js +24 -20
  323. package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -1
  324. package/dist/resource/texture/Tr2TexturePipelineParams.js +14 -23
  325. package/dist/resource/texture/Tr2TexturePipelineParams.js.map +1 -1
  326. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +18 -25
  327. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -1
  328. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +11 -16
  329. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -1
  330. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +14 -23
  331. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -1
  332. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +12 -22
  333. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -1
  334. package/dist/resource/texture/Tr2TexturePipelineStepPack.js +38 -26
  335. package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -1
  336. package/dist/resource/worker/CjsResManMainThreadLoader.js +2 -5
  337. package/dist/resource/worker/CjsResManMainThreadLoader.js.map +1 -1
  338. package/dist/resource/worker/CjsResManWorkerLoader.js +6 -7
  339. package/dist/resource/worker/CjsResManWorkerLoader.js.map +1 -1
  340. package/dist/resource/worker/protocol.js +18 -1
  341. package/dist/resource/worker/protocol.js.map +1 -1
  342. package/dist/sof/EveSOF.js +2 -222
  343. package/dist/sof/EveSOF.js.map +1 -1
  344. package/dist/sof/SofDocumentBuilder.js +205 -0
  345. package/dist/sof/SofDocumentBuilder.js.map +1 -0
  346. package/dist/sof/faction/ErrSOFFactionColorSetTypeNotFound.js +16 -0
  347. package/dist/sof/faction/ErrSOFFactionColorSetTypeNotFound.js.map +1 -0
  348. package/dist/sof/faction/ErrSOFFactionColorSetTypeUnknown.js +16 -0
  349. package/dist/sof/faction/ErrSOFFactionColorSetTypeUnknown.js.map +1 -0
  350. package/dist/sof/faction/EveSOFDataFactionColorSet.js +3 -27
  351. package/dist/sof/faction/EveSOFDataFactionColorSet.js.map +1 -1
  352. package/dist/sof/faction/index.js +3 -1
  353. package/dist/sof/faction/index.js.map +1 -1
  354. package/dist/sof/generic/ErrSOFAreaShaderNotFound.js +18 -0
  355. package/dist/sof/generic/ErrSOFAreaShaderNotFound.js.map +1 -0
  356. package/dist/sof/generic/ErrSOFDecalShaderNotFound.js +18 -0
  357. package/dist/sof/generic/ErrSOFDecalShaderNotFound.js.map +1 -0
  358. package/dist/sof/generic/ErrSOFMaterialPrefixNotFound.js +21 -0
  359. package/dist/sof/generic/ErrSOFMaterialPrefixNotFound.js.map +1 -0
  360. package/dist/sof/generic/ErrSOFPatternMaterialPrefixNotFound.js +21 -0
  361. package/dist/sof/generic/ErrSOFPatternMaterialPrefixNotFound.js.map +1 -0
  362. package/dist/sof/generic/EveSOFDataGeneric.js +5 -69
  363. package/dist/sof/generic/EveSOFDataGeneric.js.map +1 -1
  364. package/dist/sof/generic/index.js +5 -1
  365. package/dist/sof/generic/index.js.map +1 -1
  366. package/dist/sof/index.js +23 -7
  367. package/dist/sof/index.js.map +1 -1
  368. package/dist/sof/pattern/ErrSOFProjectionNotFound.js +20 -0
  369. package/dist/sof/pattern/ErrSOFProjectionNotFound.js.map +1 -0
  370. package/dist/sof/pattern/EveSOFDataPattern.js +2 -17
  371. package/dist/sof/pattern/EveSOFDataPattern.js.map +1 -1
  372. package/dist/sof/pattern/index.js +2 -1
  373. package/dist/sof/pattern/index.js.map +1 -1
  374. package/dist/sof/shared/ErrSOFAreaTypeNotFound.js +16 -0
  375. package/dist/sof/shared/ErrSOFAreaTypeNotFound.js.map +1 -0
  376. package/dist/sof/shared/ErrSOFLogoSetTypeNotFound.js +16 -0
  377. package/dist/sof/shared/ErrSOFLogoSetTypeNotFound.js.map +1 -0
  378. package/dist/sof/shared/ErrSOFLogoSetTypeUnknown.js +16 -0
  379. package/dist/sof/shared/ErrSOFLogoSetTypeUnknown.js.map +1 -0
  380. package/dist/sof/shared/EveSOFDataArea.js +2 -13
  381. package/dist/sof/shared/EveSOFDataArea.js.map +1 -1
  382. package/dist/sof/shared/EveSOFDataLogoSet.js +3 -27
  383. package/dist/sof/shared/EveSOFDataLogoSet.js.map +1 -1
  384. package/dist/sof/shared/EveSOFDataParameter.js +2 -146
  385. package/dist/sof/shared/EveSOFDataParameter.js.map +1 -1
  386. package/dist/sof/shared/EveSOFDataParameterBool.js +40 -0
  387. package/dist/sof/shared/EveSOFDataParameterBool.js.map +1 -0
  388. package/dist/sof/shared/EveSOFDataParameterColor.js +36 -0
  389. package/dist/sof/shared/EveSOFDataParameterColor.js.map +1 -0
  390. package/dist/sof/shared/EveSOFDataParameterFloat.js +37 -0
  391. package/dist/sof/shared/EveSOFDataParameterFloat.js.map +1 -0
  392. package/dist/sof/shared/EveSOFDataParameterInt.js +37 -0
  393. package/dist/sof/shared/EveSOFDataParameterInt.js.map +1 -0
  394. package/dist/sof/shared/EveSOFDataParameterVector2.js +37 -0
  395. package/dist/sof/shared/EveSOFDataParameterVector2.js.map +1 -0
  396. package/dist/sof/shared/EveSOFDataParameterVector3.js +37 -0
  397. package/dist/sof/shared/EveSOFDataParameterVector3.js.map +1 -0
  398. package/dist/sof/shared/{EveSOFDataSpotlightAttachment.js → EveSOFDataSpotLightAttachment.js} +1 -1
  399. package/dist/sof/shared/{EveSOFDataSpotlightAttachment.js.map → EveSOFDataSpotLightAttachment.js.map} +1 -1
  400. package/dist/sof/shared/index.js +13 -4
  401. package/dist/sof/shared/index.js.map +1 -1
  402. package/dist/sof/sofDocumentValues.js +33 -0
  403. package/dist/sof/sofDocumentValues.js.map +1 -0
  404. package/dist/trinity/controllers/ITr2Controller/ITr2ActionController.js +168 -0
  405. package/dist/trinity/controllers/ITr2Controller/ITr2ActionController.js.map +1 -0
  406. package/dist/trinity/controllers/{ITr2Controller.js → ITr2Controller/ITr2Controller.js} +2 -134
  407. package/dist/trinity/controllers/ITr2Controller/ITr2Controller.js.map +1 -0
  408. package/dist/trinity/controllers/Tr2Controller.js +2 -1
  409. package/dist/trinity/controllers/Tr2Controller.js.map +1 -1
  410. package/dist/trinity/controllers/Tr2ControllerReference.js +2 -1
  411. package/dist/trinity/controllers/Tr2ControllerReference.js.map +1 -1
  412. package/dist/trinity/controllers/action/ITr2ControllerAction.js +2 -1
  413. package/dist/trinity/controllers/action/ITr2ControllerAction.js.map +1 -1
  414. package/dist/trinity/controllers/action/Tr2ActionSpawnParticles.js +10 -9
  415. package/dist/trinity/controllers/action/Tr2ActionSpawnParticles.js.map +1 -1
  416. package/dist/trinity/controllers/expression/CjsControllerExpressionCompileError.js +26 -0
  417. package/dist/trinity/controllers/expression/CjsControllerExpressionCompileError.js.map +1 -0
  418. package/dist/trinity/controllers/expression/CjsControllerExpressionEvaluateError.js +24 -0
  419. package/dist/trinity/controllers/expression/CjsControllerExpressionEvaluateError.js.map +1 -0
  420. package/dist/trinity/controllers/expression/CjsControllerExpressionParser.js +387 -0
  421. package/dist/trinity/controllers/expression/CjsControllerExpressionParser.js.map +1 -0
  422. package/dist/trinity/controllers/expression/CjsControllerExpressionProgram.js +4 -1011
  423. package/dist/trinity/controllers/expression/CjsControllerExpressionProgram.js.map +1 -1
  424. package/dist/trinity/controllers/expression/expressionRuntime.js +605 -0
  425. package/dist/trinity/controllers/expression/expressionRuntime.js.map +1 -0
  426. package/dist/trinity/controllers/index.js +5 -2
  427. package/dist/trinity/controllers/index.js.map +1 -1
  428. package/dist/trinity/controllers/state/ITr2StateMachineStateFinalizer.js +2 -1
  429. package/dist/trinity/controllers/state/ITr2StateMachineStateFinalizer.js.map +1 -1
  430. package/dist/trinity/controllers/timeline/Tr2TimelineController.js +2 -1
  431. package/dist/trinity/controllers/timeline/Tr2TimelineController.js.map +1 -1
  432. package/dist/trinity/core/ITr2Updateable.js +2 -1
  433. package/dist/trinity/core/ITr2Updateable.js.map +1 -1
  434. package/dist/trinity/core/Tr2Blitter.js +6 -3
  435. package/dist/trinity/core/Tr2Blitter.js.map +1 -1
  436. package/dist/trinity/core/Tr2Denoiser.js +256 -0
  437. package/dist/trinity/core/Tr2Denoiser.js.map +1 -0
  438. package/dist/trinity/core/Tr2GpuResourcePool/GpuResourceHandle.js +115 -0
  439. package/dist/trinity/core/Tr2GpuResourcePool/GpuResourceHandle.js.map +1 -0
  440. package/dist/trinity/core/Tr2GpuResourcePool/TextureSize2D.js +79 -0
  441. package/dist/trinity/core/Tr2GpuResourcePool/TextureSize2D.js.map +1 -0
  442. package/dist/trinity/core/{Tr2GpuResourcePool.js → Tr2GpuResourcePool/Tr2GpuResourcePool.js} +63 -151
  443. package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js.map +1 -0
  444. package/dist/trinity/core/{Tr2QuadRenderer.js → Tr2QuadRenderer/Tr2QuadRenderer.js} +8 -30
  445. package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRenderer.js.map +1 -0
  446. package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRendererEffectRecord.js +38 -0
  447. package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRendererEffectRecord.js.map +1 -0
  448. package/dist/trinity/core/Tr2RenderUtils.js +20 -3
  449. package/dist/trinity/core/Tr2RenderUtils.js.map +1 -1
  450. package/dist/trinity/core/Tr2Renderer.js +146 -1
  451. package/dist/trinity/core/Tr2Renderer.js.map +1 -1
  452. package/dist/trinity/core/Tr2ShadowMap.js +135 -14
  453. package/dist/trinity/core/Tr2ShadowMap.js.map +1 -1
  454. package/dist/trinity/core/{Tr2TextureArray.js → Tr2TextureArray/Tr2TextureArray.js} +3 -58
  455. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js.map +1 -0
  456. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArrayElement.js +61 -0
  457. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArrayElement.js.map +1 -0
  458. package/dist/trinity/core/batch/TriRenderBatch/DefaultKeyGenerator.js +26 -0
  459. package/dist/trinity/core/batch/TriRenderBatch/DefaultKeyGenerator.js.map +1 -0
  460. package/dist/trinity/core/batch/TriRenderBatch/EffectKeyGenerator.js +29 -0
  461. package/dist/trinity/core/batch/TriRenderBatch/EffectKeyGenerator.js.map +1 -0
  462. package/dist/trinity/core/batch/{ITriRenderBatchAccumulator.js → TriRenderBatch/ITriRenderBatchAccumulator.js} +30 -30
  463. package/dist/trinity/core/batch/TriRenderBatch/ITriRenderBatchAccumulator.js.map +1 -0
  464. package/dist/trinity/core/batch/{Tr2RenderBatch.js → TriRenderBatch/Tr2RenderBatch.js} +81 -154
  465. package/dist/trinity/core/batch/TriRenderBatch/Tr2RenderBatch.js.map +1 -0
  466. package/dist/trinity/core/batch/{TriRenderBatchAccumulator.js → TriRenderBatch/TriRenderBatchAccumulator.js} +7 -38
  467. package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAccumulator.js.map +1 -0
  468. package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlock.js +61 -0
  469. package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlock.js.map +1 -0
  470. package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlocksWithSharedMaterial.js +40 -0
  471. package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlocksWithSharedMaterial.js.map +1 -0
  472. package/dist/trinity/core/batch/TriRenderBatchMap.js +6 -1
  473. package/dist/trinity/core/batch/TriRenderBatchMap.js.map +1 -1
  474. package/dist/trinity/core/context/Tr2RenderContext.js +75 -57
  475. package/dist/trinity/core/context/Tr2RenderContext.js.map +1 -1
  476. package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityEvent.js +67 -0
  477. package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityEvent.js.map +1 -0
  478. package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityResults.js +50 -0
  479. package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityResults.js.map +1 -0
  480. package/dist/trinity/core/device/Tr2DepthStencil.js +186 -13
  481. package/dist/trinity/core/device/Tr2DepthStencil.js.map +1 -1
  482. package/dist/trinity/core/device/{Tr2RingBuffer.js → Tr2RingBuffer/Tr2RingBuffer.js} +27 -79
  483. package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBuffer.js.map +1 -0
  484. package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBufferOffsets.js +114 -0
  485. package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBufferOffsets.js.map +1 -0
  486. package/dist/trinity/core/device/{Tr2SuballocatedBuffer.js → Tr2SuballocatedBuffer/Tr2SuballocatedBuffer.js} +5 -59
  487. package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBuffer.js.map +1 -0
  488. package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBufferAllocation.js +80 -0
  489. package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBufferAllocation.js.map +1 -0
  490. package/dist/trinity/core/index.js +42 -15
  491. package/dist/trinity/core/index.js.map +1 -1
  492. package/dist/trinity/core/lighting/Tr2LightManager.js +6 -1
  493. package/dist/trinity/core/lighting/Tr2LightManager.js.map +1 -1
  494. package/dist/trinity/core/mesh/{ITr2ImpostorSource.js → ITr2ImpostorSource/ITr2ImpostorSource.js} +6 -28
  495. package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSource.js.map +1 -0
  496. package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSourceImpostorHash.js +32 -0
  497. package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSourceImpostorHash.js.map +1 -0
  498. package/dist/trinity/core/mesh/{ITr2InstanceData.js → ITr2InstanceData/ITr2InstanceData.js} +5 -29
  499. package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceData.js.map +1 -0
  500. package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceDataInstanceData.js +33 -0
  501. package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceDataInstanceData.js.map +1 -0
  502. package/dist/trinity/core/mesh/Tr2DirectInstanceData.js +2 -1
  503. package/dist/trinity/core/mesh/Tr2DirectInstanceData.js.map +1 -1
  504. package/dist/trinity/core/mesh/Tr2MeshBase.js +7 -1
  505. package/dist/trinity/core/mesh/Tr2MeshBase.js.map +1 -1
  506. package/dist/trinity/core/mesh/Tr2RuntimeInstanceData.js +2 -1
  507. package/dist/trinity/core/mesh/Tr2RuntimeInstanceData.js.map +1 -1
  508. package/dist/trinity/core/mesh/TriGeometryResAllocations.js +6 -2
  509. package/dist/trinity/core/mesh/TriGeometryResAllocations.js.map +1 -1
  510. package/dist/trinity/core/rawData/CjsConstantLayout.js +196 -0
  511. package/dist/trinity/core/rawData/CjsConstantLayout.js.map +1 -0
  512. package/dist/trinity/core/rawData/CjsPerFrameLayouts.js +8 -3
  513. package/dist/trinity/core/rawData/CjsPerFrameLayouts.js.map +1 -1
  514. package/dist/trinity/core/rawData/CjsPerObjectLayouts.js +40 -732
  515. package/dist/trinity/core/rawData/CjsPerObjectLayouts.js.map +1 -1
  516. package/dist/trinity/core/rawData/layouts/CjsEveBasicLayout.js +34 -0
  517. package/dist/trinity/core/rawData/layouts/CjsEveBasicLayout.js.map +1 -0
  518. package/dist/trinity/core/rawData/layouts/CjsEveBoosterSetLayout.js +69 -0
  519. package/dist/trinity/core/rawData/layouts/CjsEveBoosterSetLayout.js.map +1 -0
  520. package/dist/trinity/core/rawData/layouts/CjsEveChildBoosterSetLayout.js +59 -0
  521. package/dist/trinity/core/rawData/layouts/CjsEveChildBoosterSetLayout.js.map +1 -0
  522. package/dist/trinity/core/rawData/layouts/CjsEveChildBulletStormLayout.js +37 -0
  523. package/dist/trinity/core/rawData/layouts/CjsEveChildBulletStormLayout.js.map +1 -0
  524. package/dist/trinity/core/rawData/layouts/CjsEveChildSpherePinLayout.js +44 -0
  525. package/dist/trinity/core/rawData/layouts/CjsEveChildSpherePinLayout.js.map +1 -0
  526. package/dist/trinity/core/rawData/layouts/CjsEveLensflareLayout.js +31 -0
  527. package/dist/trinity/core/rawData/layouts/CjsEveLensflareLayout.js.map +1 -0
  528. package/dist/trinity/core/rawData/layouts/CjsEveMissileWarheadLayout.js +29 -0
  529. package/dist/trinity/core/rawData/layouts/CjsEveMissileWarheadLayout.js.map +1 -0
  530. package/dist/trinity/core/rawData/layouts/CjsEvePerObjectLayout.js +39 -0
  531. package/dist/trinity/core/rawData/layouts/CjsEvePerObjectLayout.js.map +1 -0
  532. package/dist/trinity/core/rawData/layouts/CjsEveSceneStaticParticlesLayout.js +30 -0
  533. package/dist/trinity/core/rawData/layouts/CjsEveSceneStaticParticlesLayout.js.map +1 -0
  534. package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectDecalLayout.js +78 -0
  535. package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectDecalLayout.js.map +1 -0
  536. package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectLayout.js +169 -0
  537. package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectLayout.js.map +1 -0
  538. package/dist/trinity/core/rawData/layouts/CjsEveSpacePerObjectLayout.js +107 -0
  539. package/dist/trinity/core/rawData/layouts/CjsEveSpacePerObjectLayout.js.map +1 -0
  540. package/dist/trinity/core/rawData/layouts/CjsEveSpherePinLayout.js +44 -0
  541. package/dist/trinity/core/rawData/layouts/CjsEveSpherePinLayout.js.map +1 -0
  542. package/dist/trinity/core/rawData/layouts/CjsEveStretch2Layout.js +34 -0
  543. package/dist/trinity/core/rawData/layouts/CjsEveStretch2Layout.js.map +1 -0
  544. package/dist/trinity/core/rawData/layouts/CjsEveTurretSetLayout.js +82 -0
  545. package/dist/trinity/core/rawData/layouts/CjsEveTurretSetLayout.js.map +1 -0
  546. package/dist/trinity/core/rawData/layouts/CjsTr2PerObjectLayout.js +42 -0
  547. package/dist/trinity/core/rawData/layouts/CjsTr2PerObjectLayout.js.map +1 -0
  548. package/dist/trinity/core/rawData/perObjectData/EveBasicPerObjectData.js +55 -0
  549. package/dist/trinity/core/rawData/perObjectData/EveBasicPerObjectData.js.map +1 -0
  550. package/dist/trinity/core/rawData/perObjectData/EveBoosterSetPerObjectData.js +59 -0
  551. package/dist/trinity/core/rawData/perObjectData/EveBoosterSetPerObjectData.js.map +1 -0
  552. package/dist/trinity/core/rawData/perObjectData/EveChildBoosterSetPerObjectData.js +59 -0
  553. package/dist/trinity/core/rawData/perObjectData/EveChildBoosterSetPerObjectData.js.map +1 -0
  554. package/dist/trinity/core/rawData/perObjectData/EveChildBulletStormPerObjectData.js +55 -0
  555. package/dist/trinity/core/rawData/perObjectData/EveChildBulletStormPerObjectData.js.map +1 -0
  556. package/dist/trinity/core/rawData/perObjectData/EveChildSpherePinPerObjectData.js +55 -0
  557. package/dist/trinity/core/rawData/perObjectData/EveChildSpherePinPerObjectData.js.map +1 -0
  558. package/dist/trinity/core/rawData/perObjectData/EveDecalPerObjectData.js +59 -0
  559. package/dist/trinity/core/rawData/perObjectData/EveDecalPerObjectData.js.map +1 -0
  560. package/dist/trinity/core/rawData/perObjectData/EveLensflarePerObjectData.js +55 -0
  561. package/dist/trinity/core/rawData/perObjectData/EveLensflarePerObjectData.js.map +1 -0
  562. package/dist/trinity/core/rawData/perObjectData/EveMissileWarheadPerObjectData.js +55 -0
  563. package/dist/trinity/core/rawData/perObjectData/EveMissileWarheadPerObjectData.js.map +1 -0
  564. package/dist/trinity/core/rawData/perObjectData/EveSceneStaticParticlesPerObjectData.js +55 -0
  565. package/dist/trinity/core/rawData/perObjectData/EveSceneStaticParticlesPerObjectData.js.map +1 -0
  566. package/dist/trinity/core/rawData/perObjectData/EveSpherePinPerObjectData.js +55 -0
  567. package/dist/trinity/core/rawData/perObjectData/EveSpherePinPerObjectData.js.map +1 -0
  568. package/dist/trinity/core/rawData/perObjectData/EveTurretSetPerObjectData.js +59 -0
  569. package/dist/trinity/core/rawData/perObjectData/EveTurretSetPerObjectData.js.map +1 -0
  570. package/dist/trinity/core/rawData/perObjectData/StretchPerObjectData.js +55 -0
  571. package/dist/trinity/core/rawData/perObjectData/StretchPerObjectData.js.map +1 -0
  572. package/dist/trinity/core/rawData/{Tr2PerObjectData.js → perObjectData/Tr2PerObjectData.js} +110 -62
  573. package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectData.js.map +1 -0
  574. package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataPSBuffer.js +104 -0
  575. package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataPSBuffer.js.map +1 -0
  576. package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataStandard.js +87 -0
  577. package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataStandard.js.map +1 -0
  578. package/dist/trinity/core/variable/TriVariable.js +83 -83
  579. package/dist/trinity/core/variable/TriVariable.js.map +1 -1
  580. package/dist/trinity/core/vertex/{Tr2VertexDefinition.js → Tr2VertexDefinition/Tr2VertexDefinition.js} +4 -20
  581. package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinition.js.map +1 -0
  582. package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinitionItem.js +29 -0
  583. package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinitionItem.js.map +1 -0
  584. package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js +116 -36
  585. package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js.map +1 -1
  586. package/dist/trinity/curves/curve/Tr2CurveRandomAxisRotation.js +50 -92
  587. package/dist/trinity/curves/curve/Tr2CurveRandomAxisRotation.js.map +1 -1
  588. package/dist/trinity/eve/EveModularObjectModifier.js +9 -5
  589. package/dist/trinity/eve/EveModularObjectModifier.js.map +1 -1
  590. package/dist/trinity/eve/IEveInheritPropertiesOwner.js +2 -1
  591. package/dist/trinity/eve/IEveInheritPropertiesOwner.js.map +1 -1
  592. package/dist/trinity/eve/IEveSpaceObject2.js +2 -1
  593. package/dist/trinity/eve/IEveSpaceObject2.js.map +1 -1
  594. package/dist/trinity/eve/IEveTransform.js +2 -1
  595. package/dist/trinity/eve/IEveTransform.js.map +1 -1
  596. package/dist/trinity/eve/attachment/banner/EveBannerSet.js +2 -2
  597. package/dist/trinity/eve/attachment/banner/EveBannerSet.js.map +1 -1
  598. package/dist/trinity/eve/attachment/booster/EveBoosterSet2.js +109 -133
  599. package/dist/trinity/eve/attachment/booster/EveBoosterSet2.js.map +1 -1
  600. package/dist/trinity/eve/attachment/booster/EveBoosterSet2Item.js +40 -0
  601. package/dist/trinity/eve/attachment/booster/EveBoosterSet2Item.js.map +1 -0
  602. package/dist/trinity/eve/attachment/booster/EveBoosterSet2Renderable.js +1 -1
  603. package/dist/trinity/eve/attachment/booster/EveBoosterSet2Renderable.js.map +1 -1
  604. package/dist/trinity/eve/attachment/decal/DecalMeshCache.js +2 -14
  605. package/dist/trinity/eve/attachment/decal/DecalMeshCache.js.map +1 -1
  606. package/dist/trinity/eve/attachment/decal/DecalMeshCacheMeshBuffers.js +18 -0
  607. package/dist/trinity/eve/attachment/decal/DecalMeshCacheMeshBuffers.js.map +1 -0
  608. package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js +1 -1
  609. package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js.map +1 -1
  610. package/dist/trinity/eve/attachment/haze/EveHazeSet.js +1 -1
  611. package/dist/trinity/eve/attachment/haze/EveHazeSet.js.map +1 -1
  612. package/dist/trinity/eve/attachment/plane/EvePlaneSet.js +1 -1
  613. package/dist/trinity/eve/attachment/plane/EvePlaneSet.js.map +1 -1
  614. package/dist/trinity/eve/attachment/spotlight/EveSpotlightSet.js +2 -2
  615. package/dist/trinity/eve/attachment/spotlight/EveSpotlightSet.js.map +1 -1
  616. package/dist/trinity/eve/attachment/sprite/EveSpriteLineSet.js +1 -1
  617. package/dist/trinity/eve/attachment/sprite/EveSpriteLineSet.js.map +1 -1
  618. package/dist/trinity/eve/attachment/sprite/EveSpriteSet.js +4 -2
  619. package/dist/trinity/eve/attachment/sprite/EveSpriteSet.js.map +1 -1
  620. package/dist/trinity/eve/attachment/turrets/EveTurretSet.js +143 -139
  621. package/dist/trinity/eve/attachment/turrets/EveTurretSet.js.map +1 -1
  622. package/dist/trinity/eve/camera/EveCamera.js +1 -1
  623. package/dist/trinity/eve/camera/EveCamera.js.map +1 -1
  624. package/dist/trinity/eve/child/EveChildBoosterSet.js +12 -1
  625. package/dist/trinity/eve/child/EveChildBoosterSet.js.map +1 -1
  626. package/dist/trinity/eve/child/EveChildCloud2.js +178 -151
  627. package/dist/trinity/eve/child/EveChildCloud2.js.map +1 -1
  628. package/dist/trinity/eve/child/EveChildContainer.js +141 -141
  629. package/dist/trinity/eve/child/EveChildContainer.js.map +1 -1
  630. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js +87 -0
  631. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js.map +1 -0
  632. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshArea.js +46 -0
  633. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshArea.js.map +1 -0
  634. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshInstance.js +35 -0
  635. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshInstance.js.map +1 -0
  636. package/dist/trinity/eve/child/{EveChildInstancedMeshes.js → EveChildInstancedMeshes/EveChildInstancedMeshes.js} +42 -163
  637. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js.map +1 -0
  638. package/dist/trinity/eve/child/EveChildMesh.js +218 -218
  639. package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
  640. package/dist/trinity/eve/child/EveChildPartData/EveChildPartData.js +53 -0
  641. package/dist/trinity/eve/child/EveChildPartData/EveChildPartData.js.map +1 -0
  642. package/dist/trinity/eve/child/{EveChildPartData.js → EveChildPartData/EveChildPartDataPartData.js} +9 -45
  643. package/dist/trinity/eve/child/EveChildPartData/EveChildPartDataPartData.js.map +1 -0
  644. package/dist/trinity/eve/child/EveChildParticleSystem.js +30 -29
  645. package/dist/trinity/eve/child/EveChildParticleSystem.js.map +1 -1
  646. package/dist/trinity/eve/child/EveChildTransform.js +5 -0
  647. package/dist/trinity/eve/child/EveChildTransform.js.map +1 -1
  648. package/dist/trinity/eve/child/EveChildTurret.js +7 -0
  649. package/dist/trinity/eve/child/EveChildTurret.js.map +1 -1
  650. package/dist/trinity/eve/index.js +10 -4
  651. package/dist/trinity/eve/index.js.map +1 -1
  652. package/dist/trinity/eve/lights/Tr2Light.js +5 -0
  653. package/dist/trinity/eve/lights/Tr2Light.js.map +1 -1
  654. package/dist/trinity/eve/overlays/overlayBatches.js +6 -1
  655. package/dist/trinity/eve/overlays/overlayBatches.js.map +1 -1
  656. package/dist/trinity/eve/particles/static/EveSceneStaticParticles.js +4 -4
  657. package/dist/trinity/eve/particles/static/EveSceneStaticParticles.js.map +1 -1
  658. package/dist/trinity/eve/renderable/stretch/EveStretch2.js +76 -71
  659. package/dist/trinity/eve/renderable/stretch/EveStretch2.js.map +1 -1
  660. package/dist/trinity/eve/renderable/stretch/EveStretch3.js +1 -1
  661. package/dist/trinity/eve/renderable/stretch/EveStretch3.js.map +1 -1
  662. package/dist/trinity/eve/spaceObject/EveShip2.js +3 -3
  663. package/dist/trinity/eve/spaceObject/EveShip2.js.map +1 -1
  664. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +408 -407
  665. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js.map +1 -1
  666. package/dist/trinity/eve/ui/EveTacticalOverlay.js +1 -1
  667. package/dist/trinity/eve/ui/EveTacticalOverlay.js.map +1 -1
  668. package/dist/trinity/eve/ui/lines/EveCurveLineSet.js +9 -9
  669. package/dist/trinity/eve/ui/lines/EveCurveLineSet.js.map +1 -1
  670. package/dist/trinity/eve/ui/lines/EveLineSet.js +27 -25
  671. package/dist/trinity/eve/ui/lines/EveLineSet.js.map +1 -1
  672. package/dist/trinity/eve/ui/tacticalOverlay/EveTacticalTrails.js +3 -2
  673. package/dist/trinity/eve/ui/tacticalOverlay/EveTacticalTrails.js.map +1 -1
  674. package/dist/trinity/generated/index.js +0 -1
  675. package/dist/trinity/generated/index.js.map +1 -1
  676. package/dist/trinity/generated/trinityCore/index.js +0 -1
  677. package/dist/trinity/generated/trinityCore/index.js.map +1 -1
  678. package/dist/trinity/index.js +59 -23
  679. package/dist/trinity/index.js.map +1 -1
  680. package/dist/trinity/particle/{ITr2GenericEmitter.js → ITr2GenericEmitter/ITr2GenericEmitter.js} +4 -32
  681. package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitter.js.map +1 -0
  682. package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitterUpdateArguments.js +36 -0
  683. package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitterUpdateArguments.js.map +1 -0
  684. package/dist/trinity/particle/Tr2ParticleSystem.js +4 -2
  685. package/dist/trinity/particle/Tr2ParticleSystem.js.map +1 -1
  686. package/dist/trinity/particle/element/Tr2ParticleElementData.js +15 -4
  687. package/dist/trinity/particle/element/Tr2ParticleElementData.js.map +1 -1
  688. package/dist/trinity/particle/emitter/Tr2DynamicEmitter.js +21 -20
  689. package/dist/trinity/particle/emitter/Tr2DynamicEmitter.js.map +1 -1
  690. package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js +23 -22
  691. package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js.map +1 -1
  692. package/dist/trinity/particle/emitter/Tr2StaticEmitter.js +14 -13
  693. package/dist/trinity/particle/emitter/Tr2StaticEmitter.js.map +1 -1
  694. package/dist/trinity/particle/index.js +2 -1
  695. package/dist/trinity/particle/index.js.map +1 -1
  696. package/dist/trinity/renderJob/step/TriStepPushRenderTarget.js +7 -1
  697. package/dist/trinity/renderJob/step/TriStepPushRenderTarget.js.map +1 -1
  698. package/dist/trinity/shader/Tr2Effect.js +131 -58
  699. package/dist/trinity/shader/Tr2Effect.js.map +1 -1
  700. package/dist/trinity/shader/Tr2EffectStateManager.js +17 -5
  701. package/dist/trinity/shader/Tr2EffectStateManager.js.map +1 -1
  702. package/dist/trinity/shader/Tr2Material.js +21 -4
  703. package/dist/trinity/shader/Tr2Material.js.map +1 -1
  704. package/dist/trinity/shader/material/Tr2EffectPassParameters.js +4 -1
  705. package/dist/trinity/shader/material/Tr2EffectPassParameters.js.map +1 -1
  706. package/dist/trinity/shader/parameter/Tr2GeometryBufferParameter.js +2 -2
  707. package/dist/trinity/shader/parameter/Tr2GeometryBufferParameter.js.map +1 -1
  708. package/dist/trinityal/Tr2BufferAL/Tr2BufferDescriptionAL.js +79 -0
  709. package/dist/trinityal/Tr2BufferAL/Tr2BufferDescriptionAL.js.map +1 -0
  710. package/dist/trinityal/{Tr2DeviceResourceAL.js → Tr2DeviceResourceAL/Tr2BaseDeviceResourceAL.js} +77 -79
  711. package/dist/trinityal/Tr2DeviceResourceAL/Tr2BaseDeviceResourceAL.js.map +1 -0
  712. package/dist/trinityal/Tr2DeviceResourceAL/Tr2DeviceResourceAL.js +24 -0
  713. package/dist/trinityal/Tr2DeviceResourceAL/Tr2DeviceResourceAL.js.map +1 -0
  714. package/dist/trinityal/Tr2DrawUPHelper.js +2 -1
  715. package/dist/trinityal/Tr2DrawUPHelper.js.map +1 -1
  716. package/dist/trinityal/Tr2HalHelperStructures/Tr2MsaaDesc.js +45 -0
  717. package/dist/trinityal/Tr2HalHelperStructures/Tr2MsaaDesc.js.map +1 -0
  718. package/dist/trinityal/Tr2HalHelperStructures/Tr2SamplerDescription.js +154 -0
  719. package/dist/trinityal/Tr2HalHelperStructures/Tr2SamplerDescription.js.map +1 -0
  720. package/dist/trinityal/Tr2HalHelperStructures/Tr2SubresourceData.js +48 -0
  721. package/dist/trinityal/Tr2HalHelperStructures/Tr2SubresourceData.js.map +1 -0
  722. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureCoordBox.js +75 -0
  723. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureCoordBox.js.map +1 -0
  724. package/dist/trinityal/{Tr2HalHelperStructures.js → Tr2HalHelperStructures/Tr2TextureSubresource.js} +11 -115
  725. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js.map +1 -0
  726. package/dist/trinityal/Tr2HalHelperStructures/Tr2Viewport.js +51 -0
  727. package/dist/trinityal/Tr2HalHelperStructures/Tr2Viewport.js.map +1 -0
  728. package/dist/trinityal/{Tr2RenderPassAL.js → Tr2RenderPassAL/Tr2ColorAttachment.js} +5 -28
  729. package/dist/trinityal/Tr2RenderPassAL/Tr2ColorAttachment.js.map +1 -0
  730. package/dist/trinityal/Tr2RenderPassAL/Tr2DepthAttachment.js +38 -0
  731. package/dist/trinityal/Tr2RenderPassAL/Tr2DepthAttachment.js.map +1 -0
  732. package/dist/trinityal/Tr2ResourceSetAL/Tr2RegisterMapAL.js +80 -0
  733. package/dist/trinityal/Tr2ResourceSetAL/Tr2RegisterMapAL.js.map +1 -0
  734. package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetAL.js +76 -0
  735. package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetAL.js.map +1 -0
  736. package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetALStub.js +96 -0
  737. package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetALStub.js.map +1 -0
  738. package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetDescriptionAL.js +196 -0
  739. package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetDescriptionAL.js.map +1 -0
  740. package/dist/trinityal/index.js +22 -9
  741. package/dist/trinityal/index.js.map +1 -1
  742. package/dist/trinityal/stub/Tr2BufferALStub.js +86 -141
  743. package/dist/trinityal/stub/Tr2BufferALStub.js.map +1 -1
  744. package/dist/trinityal/stub/Tr2CapsALStub.js +17 -0
  745. package/dist/trinityal/stub/Tr2CapsALStub.js.map +1 -1
  746. package/dist/trinityal/stub/Tr2ConstantBufferALStub.js +57 -41
  747. package/dist/trinityal/stub/Tr2ConstantBufferALStub.js.map +1 -1
  748. package/dist/trinityal/stub/Tr2FenceALStub.js +18 -2
  749. package/dist/trinityal/stub/Tr2FenceALStub.js.map +1 -1
  750. package/dist/trinityal/stub/Tr2GpuTimerALStub.js +97 -0
  751. package/dist/trinityal/stub/Tr2GpuTimerALStub.js.map +1 -0
  752. package/dist/trinityal/stub/Tr2OcclusionQueryALStub.js +124 -0
  753. package/dist/trinityal/stub/Tr2OcclusionQueryALStub.js.map +1 -0
  754. package/dist/trinityal/stub/Tr2PipelineStatsQueryALStub/Tr2PipelineStatsQueryALStub.js +146 -0
  755. package/dist/trinityal/stub/Tr2PipelineStatsQueryALStub/Tr2PipelineStatsQueryALStub.js.map +1 -0
  756. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2BindlessResourcesAL.js +28 -0
  757. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2BindlessResourcesAL.js.map +1 -0
  758. package/dist/trinityal/stub/{Tr2RenderContextALStub.js → Tr2RenderContextALStub/Tr2RenderContextALStub.js} +70 -75
  759. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js.map +1 -0
  760. package/dist/trinityal/stub/Tr2SamplerStateALStub.js +47 -31
  761. package/dist/trinityal/stub/Tr2SamplerStateALStub.js.map +1 -1
  762. package/dist/trinityal/stub/Tr2ShaderALStub.js +61 -45
  763. package/dist/trinityal/stub/Tr2ShaderALStub.js.map +1 -1
  764. package/dist/trinityal/stub/Tr2ShaderProgramALStub.js +51 -33
  765. package/dist/trinityal/stub/Tr2ShaderProgramALStub.js.map +1 -1
  766. package/dist/trinityal/stub/Tr2SwapChainALStub.js +61 -45
  767. package/dist/trinityal/stub/Tr2SwapChainALStub.js.map +1 -1
  768. package/dist/trinityal/stub/Tr2TextureALStub.js +188 -171
  769. package/dist/trinityal/stub/Tr2TextureALStub.js.map +1 -1
  770. package/dist/trinityal/stub/Tr2VertexLayoutALStub.js +43 -27
  771. package/dist/trinityal/stub/Tr2VertexLayoutALStub.js.map +1 -1
  772. package/dist/trinityal/stub/{Tr2VideoAdapterInfoALStub.js → Tr2VideoAdapterInfoStub.js} +16 -1
  773. package/dist/trinityal/stub/Tr2VideoAdapterInfoStub.js.map +1 -0
  774. package/dist/trinityal/stub/index.js +8 -4
  775. package/dist/trinityal/stub/index.js.map +1 -1
  776. package/dist/trinityal/vertexLayoutMatch.js +2 -2
  777. package/dist/trinityal/vertexLayoutMatch.js.map +1 -1
  778. package/dist/trinityal/webgpu/CjsWebgpuBufferAL.js +105 -90
  779. package/dist/trinityal/webgpu/CjsWebgpuBufferAL.js.map +1 -1
  780. package/dist/trinityal/webgpu/CjsWebgpuCapsAL.js +17 -0
  781. package/dist/trinityal/webgpu/CjsWebgpuCapsAL.js.map +1 -1
  782. package/dist/trinityal/webgpu/CjsWebgpuConstantBufferAL.js +15 -0
  783. package/dist/trinityal/webgpu/CjsWebgpuConstantBufferAL.js.map +1 -1
  784. package/dist/trinityal/webgpu/CjsWebgpuDevice.js +2 -2
  785. package/dist/trinityal/webgpu/CjsWebgpuDevice.js.map +1 -1
  786. package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js +900 -938
  787. package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js.map +1 -1
  788. package/dist/trinityal/webgpu/CjsWebgpuResourceSetAL.js +56 -60
  789. package/dist/trinityal/webgpu/CjsWebgpuResourceSetAL.js.map +1 -1
  790. package/dist/trinityal/webgpu/CjsWebgpuSamplerStateAL.js +16 -1
  791. package/dist/trinityal/webgpu/CjsWebgpuSamplerStateAL.js.map +1 -1
  792. package/dist/trinityal/webgpu/CjsWebgpuShaderAL.js +100 -379
  793. package/dist/trinityal/webgpu/CjsWebgpuShaderAL.js.map +1 -1
  794. package/dist/trinityal/webgpu/CjsWebgpuShaderProgramAL.js +330 -0
  795. package/dist/trinityal/webgpu/CjsWebgpuShaderProgramAL.js.map +1 -0
  796. package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js +15 -0
  797. package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js.map +1 -1
  798. package/dist/trinityal/webgpu/core/{constantArena.js → CjsWebgpuConstantArena.js} +1 -1
  799. package/dist/trinityal/webgpu/core/CjsWebgpuConstantArena.js.map +1 -0
  800. package/dist/trinityal/webgpu/core/{batchGroups.js → CjsWebgpuEncodeState.js} +1 -1
  801. package/dist/trinityal/webgpu/core/CjsWebgpuEncodeState.js.map +1 -0
  802. package/dist/trinityal/webgpu/core/{perFrameSource.js → CjsWebgpuPerFrameSource.js} +1 -1
  803. package/dist/trinityal/webgpu/core/CjsWebgpuPerFrameSource.js.map +1 -0
  804. package/dist/trinityal/webgpu/core/{pipelineCache.js → CjsWebgpuPipelineCache.js} +1 -1
  805. package/dist/trinityal/webgpu/core/CjsWebgpuPipelineCache.js.map +1 -0
  806. package/dist/trinityal/webgpu/core/{psoDescription.js → CjsWebgpuPsoDescription.js} +2 -2
  807. package/dist/trinityal/webgpu/core/CjsWebgpuPsoDescription.js.map +1 -0
  808. package/dist/trinityal/webgpu/core/{renderTarget.js → CjsWebgpuRenderTarget.js} +1 -1
  809. package/dist/trinityal/webgpu/core/CjsWebgpuRenderTarget.js.map +1 -0
  810. package/dist/trinityal/webgpu/core/{samplerSource.js → CjsWebgpuSamplerSource.js} +1 -1
  811. package/dist/trinityal/webgpu/core/CjsWebgpuSamplerSource.js.map +1 -0
  812. package/dist/trinityal/webgpu/core/{textureSource.js → CjsWebgpuTextureSource.js} +1 -1
  813. package/dist/trinityal/webgpu/core/CjsWebgpuTextureSource.js.map +1 -0
  814. package/dist/trinityal/webgpu/core/{trinityBatchDispatcher.js → CjsWebgpuTrinityBatchDispatcher.js} +4 -4
  815. package/dist/trinityal/webgpu/core/CjsWebgpuTrinityBatchDispatcher.js.map +1 -0
  816. package/dist/trinityal/webgpu/core/{trinityBatchResolver.js → CjsWebgpuTrinityBatchResolver.js} +81 -81
  817. package/dist/trinityal/webgpu/core/CjsWebgpuTrinityBatchResolver.js.map +1 -0
  818. package/dist/trinityal/webgpu/core/{trinityPassEncoder.js → CjsWebgpuTrinityPassEncoder.js} +2 -2
  819. package/dist/trinityal/webgpu/core/CjsWebgpuTrinityPassEncoder.js.map +1 -0
  820. package/dist/trinityal/webgpu/core/{workQueue.js → CjsWebgpuWorkQueue.js} +1 -1
  821. package/dist/trinityal/webgpu/core/CjsWebgpuWorkQueue.js.map +1 -0
  822. package/dist/trinityal/webgpu/internal.js +12 -11
  823. package/dist/trinityal/webgpu/internal.js.map +1 -1
  824. package/docs/audio/reference/classes/trinity.md +44 -34
  825. package/docs/character/architecture.md +276 -0
  826. package/docs/character/reference/character-appearance-plans.md +30 -66
  827. package/docs/character/reference/prepared-libraries.md +14 -30
  828. package/docs/global/reference/api.md +2 -1
  829. package/docs/global/reference/classes/README.md +53 -71
  830. package/docs/global/reference/classes/dropped.md +16 -0
  831. package/docs/resource/README.md +19 -15
  832. package/docs/resource/architecture.md +9 -2
  833. package/docs/resource/concepts/format-capabilities.md +124 -80
  834. package/docs/resource/concepts/shared-format-helpers.md +94 -0
  835. package/docs/resource/formats/README.md +230 -224
  836. package/docs/resource/formats/bitknit2.md +221 -0
  837. package/docs/resource/formats/carbon-effect-container.md +184 -269
  838. package/docs/resource/formats/gr2.md +6 -1
  839. package/docs/resource/formats/schemabound.md +28 -48
  840. package/docs/resource/formats/static.md +70 -97
  841. package/docs/resource/formats/webgl/carbon-constant-layouts.md +8 -8
  842. package/docs/resource/formats/webgl/decl-io.md +165 -256
  843. package/docs/resource/formats/webgl/memory-structured.md +64 -142
  844. package/docs/resource/formats/webgl/texture-sample.md +109 -138
  845. package/docs/resource/formats/webgpu/formats/carbon-webgpu.md +38 -69
  846. package/docs/resource/formats/webgpu/guides/effect-packaging.md +54 -116
  847. package/docs/resource/formats/webgpu/reference/api.md +64 -67
  848. package/docs/resource/formats/webgpu/reference/wgsl-compatibility.md +104 -260
  849. package/docs/resource/reference/classes/core.md +256 -236
  850. package/docs/resource/reference/classes/formats.md +1668 -1672
  851. package/docs/resource/reference/workers.md +4 -2
  852. package/docs/sof/reference/classes/core.md +1 -1
  853. package/docs/sof/reference/classes/faction.md +2 -2
  854. package/docs/sof/reference/classes/generic.md +4 -4
  855. package/docs/sof/reference/classes/pattern.md +1 -1
  856. package/docs/sof/reference/classes/shared.md +10 -10
  857. package/docs/trinity/architecture.md +55 -44
  858. package/docs/trinity/concepts/generated-class-lifecycle.md +10 -15
  859. package/docs/trinity/reference/classes/curves-and-utilities.md +496 -506
  860. package/docs/trinity/reference/classes/dropped.md +0 -189
  861. package/docs/trinity/reference/classes/eve-runtime.md +8 -8
  862. package/docs/trinity/reference/classes/generated.md +0 -10
  863. package/docs/trinity/reference/classes/particle.md +2 -2
  864. package/docs/trinity/reference/classes/trinity-core.md +1554 -1256
  865. package/docs/trinity/reference/implementation-status.md +50 -75
  866. package/docs/trinity/reference/main-semantic-extraction.md +13 -17
  867. package/docs/trinityal/reference/classes/README.md +77 -27
  868. package/docs/trinityal/reference/classes/dropped.md +82 -0
  869. package/docs/trinityal/webgpu/README.md +3 -1
  870. package/docs/trinityal/webgpu/architecture.md +121 -228
  871. package/docs/trinityal/webgpu/reference/api.md +5 -5
  872. package/docs/trinityal/webgpu/reference/classes/README.md +13 -13
  873. package/format-notices/gr2/NOTICE +18 -12
  874. package/format-notices/gr2/THIRD-PARTY-NOTICES.md +5 -5
  875. package/package.json +4 -1
  876. package/dist/audio/trinity/audio/AudActionLog.js +0 -173
  877. package/dist/audio/trinity/audio/AudActionLog.js.map +0 -1
  878. package/dist/audio/trinity/audio/AudObstructionOcclusion.js.map +0 -1
  879. package/dist/global/contracts/CjsScriptCallback.js +0 -94
  880. package/dist/global/contracts/CjsScriptCallback.js.map +0 -1
  881. package/dist/trinity/controllers/ITr2Controller.js.map +0 -1
  882. package/dist/trinity/core/Tr2GpuResourcePool.js.map +0 -1
  883. package/dist/trinity/core/Tr2QuadRenderer.js.map +0 -1
  884. package/dist/trinity/core/Tr2TextureArray.js.map +0 -1
  885. package/dist/trinity/core/batch/ITriRenderBatchAccumulator.js.map +0 -1
  886. package/dist/trinity/core/batch/Tr2RenderBatch.js.map +0 -1
  887. package/dist/trinity/core/batch/TriRenderBatchAccumulator.js.map +0 -1
  888. package/dist/trinity/core/context/CjsShadowMapExecutor.js +0 -43
  889. package/dist/trinity/core/context/CjsShadowMapExecutor.js.map +0 -1
  890. package/dist/trinity/core/context/CjsVolumetricsExecutor.js +0 -64
  891. package/dist/trinity/core/context/CjsVolumetricsExecutor.js.map +0 -1
  892. package/dist/trinity/core/context/Tr2VisibilityResults.js +0 -109
  893. package/dist/trinity/core/context/Tr2VisibilityResults.js.map +0 -1
  894. package/dist/trinity/core/device/Tr2RingBuffer.js.map +0 -1
  895. package/dist/trinity/core/device/Tr2SuballocatedBuffer.js.map +0 -1
  896. package/dist/trinity/core/mesh/ITr2ImpostorSource.js.map +0 -1
  897. package/dist/trinity/core/mesh/ITr2InstanceData.js.map +0 -1
  898. package/dist/trinity/core/rawData/Tr2PerObjectData.js.map +0 -1
  899. package/dist/trinity/core/rawData/constantLayout.js +0 -175
  900. package/dist/trinity/core/rawData/constantLayout.js.map +0 -1
  901. package/dist/trinity/core/vertex/Tr2VertexDefinition.js.map +0 -1
  902. package/dist/trinity/eve/child/EveChildInstancedMeshes.js.map +0 -1
  903. package/dist/trinity/eve/child/EveChildPartData.js.map +0 -1
  904. package/dist/trinity/generated/trinityCore/Tr2Denoiser.js +0 -47
  905. package/dist/trinity/generated/trinityCore/Tr2Denoiser.js.map +0 -1
  906. package/dist/trinity/particle/ITr2GenericEmitter.js.map +0 -1
  907. package/dist/trinityal/Tr2DeviceResourceAL.js.map +0 -1
  908. package/dist/trinityal/Tr2HalHelperStructures.js.map +0 -1
  909. package/dist/trinityal/Tr2RenderPassAL.js.map +0 -1
  910. package/dist/trinityal/Tr2ResourceSetAL.js +0 -419
  911. package/dist/trinityal/Tr2ResourceSetAL.js.map +0 -1
  912. package/dist/trinityal/Tr2SamplerDescription.js +0 -72
  913. package/dist/trinityal/Tr2SamplerDescription.js.map +0 -1
  914. package/dist/trinityal/stub/Tr2QueryALStub.js +0 -326
  915. package/dist/trinityal/stub/Tr2QueryALStub.js.map +0 -1
  916. package/dist/trinityal/stub/Tr2RenderContextALStub.js.map +0 -1
  917. package/dist/trinityal/stub/Tr2VideoAdapterInfoALStub.js.map +0 -1
  918. package/dist/trinityal/webgpu/core/batchGroups.js.map +0 -1
  919. package/dist/trinityal/webgpu/core/constantArena.js.map +0 -1
  920. package/dist/trinityal/webgpu/core/perFrameSource.js.map +0 -1
  921. package/dist/trinityal/webgpu/core/pipelineCache.js.map +0 -1
  922. package/dist/trinityal/webgpu/core/psoDescription.js.map +0 -1
  923. package/dist/trinityal/webgpu/core/renderTarget.js.map +0 -1
  924. package/dist/trinityal/webgpu/core/samplerSource.js.map +0 -1
  925. package/dist/trinityal/webgpu/core/textureSource.js.map +0 -1
  926. package/dist/trinityal/webgpu/core/trinityBatchDispatcher.js.map +0 -1
  927. package/dist/trinityal/webgpu/core/trinityBatchResolver.js.map +0 -1
  928. package/dist/trinityal/webgpu/core/trinityPassEncoder.js.map +0 -1
  929. package/dist/trinityal/webgpu/core/workQueue.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tr2TextureArray.js","sources":["../../../../src/trinity/core/Tr2TextureArray.js"],"sourcesContent":["// Source: trinity/trinity/Tr2TextureArray.h\n// trinity/trinity/Tr2TextureArray.cpp\nimport { type } from \"#schema\";\nimport { CjsModel } from \"#model\";\nimport { Tr2CpuUsage, Tr2GpuUsage } from \"#consts/render-context\";\n\n/**\n * Element handle returned by {@link Tr2TextureArray.AddElement}.\n *\n * Carbon's handle is a shared_ptr whose Data destructor calls\n * `RemoveElement` (Tr2TextureArray.cpp:233-236). JavaScript has no\n * destructors, so release is EXPLICIT: the owner calls `Release()` when the\n * slice is done (the lifecycle ruling - Destroy/Release verbs, never\n * finalizers). Carbon quirk kept and documented: an invalid handle reports\n * element index 0, the same value as a valid slot 0 (cpp:216-219), which is\n * why every consumer applies the +1 bias itself.\n */\nexport class Tr2TextureArrayElement\n{\n\n #array = null;\n\n #index = 0;\n\n /** Creates a handle; internal - only AddElement constructs valid ones. */\n constructor(array = null, index = 0)\n {\n this.#array = array;\n this.#index = index;\n }\n\n /** Reports whether this handle names a live slice. */\n IsValid()\n {\n return this.#array !== null;\n }\n\n /** The slice index inside the array; 0 when invalid (Carbon cpp:216-219). */\n GetElementIndex()\n {\n return this.#array !== null ? this.#index : 0;\n }\n\n /** The owning array, or null for an invalid handle. */\n GetArray()\n {\n return this.#array;\n }\n\n /**\n * The owning array's realized texture (Carbon cpp:222-229), or null -\n * realization is the abstraction layer's; it parks the AL object on the\n * array's `texture` field and every live handle sees it.\n */\n GetTexture()\n {\n return this.#array ? this.#array.texture : null;\n }\n\n /**\n * Frees the slice (Carbon's Data destructor, cpp:233-236). Idempotent.\n */\n Release()\n {\n if (this.#array === null) return;\n this.#array.RemoveElement(this.#index);\n this.#array = null;\n this.#index = 0;\n }\n\n}\n\n/** Describes a texture array's elements, dimensions, resource usage, upload increment, backing texture, and change callback. */\n@type.define({ className: \"Tr2TextureArray\", family: \"trinityCore\", purpose: \"Describes a texture array's elements, dimensions, resource usage, upload increment, backing texture, and change callback.\" })\nexport class Tr2TextureArray extends CjsModel\n{\n\n /** m_elements (std::vector<ImageIO::HostBitmap>) */\n @type.list(\"ImageIO::HostBitmap\")\n elements = [];\n\n /** m_texture (Tr2TextureAL) */\n @type.rawStruct(\"Tr2TextureAL\")\n texture = null;\n\n /** m_dimensions (Tr2BitmapDimensions) */\n @type.rawStruct(\"Tr2BitmapDimensions\")\n dimensions = null;\n\n /** m_onTextureChange (OnTextureChangeEvent) */\n @type.rawStruct(\"OnTextureChangeEvent\")\n onTextureChange = null;\n\n /** m_increment (uint32_t) */\n @type.uint32\n increment = 16;\n\n /** m_cpuUsage (Tr2CpuUsage::Type - enum Tr2CpuUsage) */\n @type.int32\n @type.enum(\"Tr2CpuUsage\")\n cpuUsage = 0;\n\n /** m_gpuUsage (Tr2GpuUsage::Type - enum Tr2GpuUsage) */\n @type.int32\n @type.enum(\"Tr2GpuUsage\")\n gpuUsage = 16;\n\n #expectedDimensions = null;\n\n #listeners = [];\n\n #revision = 0;\n\n /**\n * Pins the dimension gate before the first element arrives\n * (Carbon SetExpectedElementDimensions).\n *\n * @param {object} dimensions Bitmap-shaped dimensions.\n */\n SetExpectedElementDimensions(dimensions)\n {\n this.#expectedDimensions = dimensions ? Tr2TextureArray.describe(dimensions) : null;\n if (!this.dimensions) this.dimensions = this.#expectedDimensions;\n }\n\n /**\n * Adds one element (Tr2TextureArray.cpp:18-79), CPU description side.\n *\n * Carbon's dimension gate REJECTS any bitmap whose type, format, width,\n * height, depth or mip count differs from the array's - silently, via an\n * invalid handle - which is exactly how a wrong-mip-count light profile\n * fails to register. Slot reuse is first-fit over released elements, the\n * element data is copied in, and the array size rounds up to a multiple\n * of `increment` (16). The GPU texture rebuild (cpp:66-72, CreateTexture)\n * is the abstraction layer's job; this side bumps the revision and\n * notifies listeners, matching m_onTextureChange.\n *\n * @param {object} bitmap Element payload: format, width, height,\n * mipCount, samples (or data), with optional dimension and depth.\n * @returns {Tr2TextureArrayElement} A valid handle, or an invalid one\n * when the payload is missing or incompatible.\n */\n AddElement(bitmap)\n {\n const payload = bitmap && (bitmap.samples || bitmap.data);\n if (!payload) return new Tr2TextureArrayElement();\n\n const described = Tr2TextureArray.describe(bitmap);\n const gate = this.dimensions || this.#expectedDimensions;\n if (gate && (\n gate.dimension !== described.dimension\n || gate.format !== described.format\n || gate.width !== described.width\n || gate.height !== described.height\n || gate.depth !== described.depth\n || gate.mipCount !== described.mipCount))\n {\n return new Tr2TextureArrayElement();\n }\n\n let index = this.elements.length;\n for (let i = 0; i < this.elements.length; i++)\n {\n if (this.elements[i] === null)\n {\n index = i;\n break;\n }\n }\n if (index === this.elements.length) this.elements.push(null);\n\n this.elements[index] = { ...bitmap, samples: payload.slice() };\n\n this.dimensions = {\n ...described,\n arraySize: Math.ceil(this.elements.length / this.increment) * this.increment\n };\n this.#revision += 1;\n for (const listener of this.#listeners) listener(this);\n\n return new Tr2TextureArrayElement(this, index);\n }\n\n /**\n * Frees one slice (cpp:127-130): the slot becomes reusable; dimensions\n * and array size are deliberately untouched, exactly as Carbon leaves\n * the vector sized and the slot invalid.\n *\n * @param {number} index Slice index.\n */\n RemoveElement(index)\n {\n if (index >= 0 && index < this.elements.length)\n {\n this.elements[index] = null;\n this.#revision += 1;\n for (const listener of this.#listeners) listener(this);\n }\n }\n\n /**\n * Registers a texture-change listener (Carbon's OnTextureChange event).\n *\n * @param {Function} listener Called with this array after each change.\n * @returns {Function} Unsubscribe.\n */\n OnTextureChange(listener)\n {\n this.#listeners.push(listener);\n return () =>\n {\n const at = this.#listeners.indexOf(listener);\n if (at !== -1) this.#listeners.splice(at, 1);\n };\n }\n\n /** Element payload at an index, or null for a released slot. */\n GetElement(index)\n {\n return this.elements[index] ?? null;\n }\n\n /** Live (non-released) element count. */\n GetElementCount()\n {\n let count = 0;\n for (const element of this.elements) if (element !== null) count += 1;\n return count;\n }\n\n /** Current dimensions, or null before the first element. */\n GetDimensions()\n {\n return this.dimensions;\n }\n\n /** Element width; 0 before the first element (Carbon cpp:101-104). */\n GetWidth()\n {\n return this.dimensions ? this.dimensions.width : 0;\n }\n\n /** Element height; 0 before the first element. */\n GetHeight()\n {\n return this.dimensions ? this.dimensions.height : 0;\n }\n\n /** Slice capacity rounded to the increment; 0 before the first element. */\n GetArraySize()\n {\n return this.dimensions ? this.dimensions.arraySize ?? 0 : 0;\n }\n\n /** Element pixel format, or null before the first element. */\n GetFormat()\n {\n return this.dimensions ? this.dimensions.format : null;\n }\n\n /** Element mip count; 0 before the first element. */\n GetMipCount()\n {\n return this.dimensions ? this.dimensions.mipCount : 0;\n }\n\n /** Monotonic change counter for AL-side re-upload decisions. */\n GetRevision()\n {\n return this.#revision;\n }\n\n /**\n * Normalizes a bitmap-shaped payload to the compared dimension keys.\n *\n * @param {object} bitmap Payload or dimensions object.\n * @returns {object} Comparable dimension description.\n */\n static describe(bitmap)\n {\n return {\n dimension: bitmap.dimension ?? \"2d\",\n format: bitmap.format ?? null,\n width: bitmap.width ?? 0,\n height: bitmap.height ?? 0,\n depth: bitmap.depth ?? 1,\n mipCount: bitmap.mipCount ?? 1\n };\n }\n\n static Tr2CpuUsage = Tr2CpuUsage;\n\n static Tr2GpuUsage = Tr2GpuUsage;\n\n}\n"],"names":["Tr2TextureArrayElement","constructor","array","index","IsValid","GetElementIndex","GetArray","GetTexture","texture","Release","RemoveElement","_Tr2TextureArray","_identity","Tr2TextureArray","CjsModel","e","_init_elements","_init_extra_elements","_init_texture","_init_extra_texture","_init_dimensions","_init_extra_dimensions","_init_onTextureChange","_init_extra_onTextureChange","_init_increment","_init_extra_increment","_init_cpuUsage","_init_extra_cpuUsage","_init_gpuUsage","_init_extra_gpuUsage","c","_initClass","_applyDecs","type","define","className","family","purpose","list","rawStruct","uint32","int32","enum","elements","dimensions","onTextureChange","increment","cpuUsage","gpuUsage","SetExpectedElementDimensions","describe","AddElement","bitmap","payload","samples","data","described","gate","dimension","format","width","height","depth","mipCount","length","i","push","slice","arraySize","Math","ceil","listener","OnTextureChange","at","indexOf","splice","GetElement","GetElementCount","count","element","GetDimensions","GetWidth","GetHeight","GetArraySize","GetFormat","GetMipCount","GetRevision","Tr2CpuUsage","Tr2GpuUsage"],"mappings":";;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,sBAAsB,CACnC;EAEI,MAAM,GAAG,IAAI;EAEb,MAAM,GAAG,CAAC;;AAEV;EACAC,WAAWA,CAACC,KAAK,GAAG,IAAI,EAAEC,KAAK,GAAG,CAAC,EACnC;AACI,IAAA,IAAI,CAAC,MAAM,GAAGD,KAAK;AACnB,IAAA,IAAI,CAAC,MAAM,GAAGC,KAAK;AACvB,EAAA;;AAEA;AACAC,EAAAA,OAAOA,GACP;AACI,IAAA,OAAO,IAAI,CAAC,MAAM,KAAK,IAAI;AAC/B,EAAA;;AAEA;AACAC,EAAAA,eAAeA,GACf;AACI,IAAA,OAAO,IAAI,CAAC,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC;AACjD,EAAA;;AAEA;AACAC,EAAAA,QAAQA,GACR;IACI,OAAO,IAAI,CAAC,MAAM;AACtB,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACIC,EAAAA,UAAUA,GACV;AACI,IAAA,OAAO,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAACC,OAAO,GAAG,IAAI;AACnD,EAAA;;AAEA;AACJ;AACA;AACIC,EAAAA,OAAOA,GACP;AACI,IAAA,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI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J;AACA;AACA;AACA;AACA;IACI,OAAOpC,QAAQA,CAACE,MAAM,EACtB;MACI,OAAO;AACHM,QAAAA,SAAS,EAAEN,MAAM,CAACM,SAAS,IAAI,IAAI;AACnCC,QAAAA,MAAM,EAAEP,MAAM,CAACO,MAAM,IAAI,IAAI;AAC7BC,QAAAA,KAAK,EAAER,MAAM,CAACQ,KAAK,IAAI,CAAC;AACxBC,QAAAA,MAAM,EAAET,MAAM,CAACS,MAAM,IAAI,CAAC;AAC1BC,QAAAA,KAAK,EAAEV,MAAM,CAACU,KAAK,IAAI,CAAC;AACxBC,QAAAA,QAAQ,EAAEX,MAAM,CAACW,QAAQ,IAAI;OAChC;AACL,IAAA;GAMH;AAJUwB,EAAAA,WAAW,GAAGA,WAAW;AAEzBC,EAAAA,WAAW,GAAGA,WAAW;EAACvF,WAAAA,GAAA;IAAA,KAAA,CAAAU,gBAAA,GAAAoB,UAAA,EAAA;AAAA,EAAA;AAAA,CAAA,EAAA;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ITriRenderBatchAccumulator.js","sources":["../../../../../src/trinity/core/batch/ITriRenderBatchAccumulator.js"],"sourcesContent":["// Source: trinity/TriRenderBatch.h (ITriRenderBatchAccumulator)\r\n//\r\n// Abstract base for render-batch accumulators: shared render-mode / user-data\r\n// state plus the collect/sort contract. Concrete accumulators\r\n// (TriRenderBatchAccumulator) implement Commit/Finalize/Get*/TransferFrom. This\r\n// stays GPU-free; dispatch to the device is the engine adapter's job.\r\nimport { RenderingMode } from \"#consts/graphics\";\r\nimport { impl } from \"#schema\";\r\n\r\n\r\n/**\r\n * Abstract base for render-batch accumulators: holds the shared rendering mode,\r\n * user data and per-object-data store, and declares the collect and sort\r\n * contract concrete accumulators implement.\r\n */\r\nexport class ITriRenderBatchAccumulator\r\n{\r\n /**\r\n * Starts with zero user data, RM_ANY rendering mode and no per-object-data\r\n * store bound.\r\n */\r\n constructor()\r\n {\r\n this.userData = 0;\r\n\r\n this.renderingMode = RenderingMode.RM_ANY;\r\n\r\n // The per-object-data store (a TriPoolAllocator), set once from the render\r\n // context at scene setup. The engine builds it from its own struct\r\n // reflection; Trinity never defines a struct here.\r\n this.rawDataStore = null;\r\n }\r\n\r\n // Bind the per-object-data store (from the render context). Carbon's pool\r\n // allocator (Tr2Renderer::GetPoolAllocator) relocates onto this store.\r\n\r\n /**\r\n * Binds the per-object-data store, normally taken from the render context at\r\n * scene setup; returns this for chaining.\r\n */\r\n SetTriPoolAllocator(store)\r\n {\r\n this.rawDataStore = store;\r\n return this;\r\n }\r\n\r\n /** The bound per-object-data store, or null when none was set. */\r\n GetTriPoolAllocator()\r\n {\r\n return this.rawDataStore;\r\n }\r\n\r\n // Lease a transient per-object payload for a registered struct (the pooled\r\n // per-object-data allocation). Requires a store - there is no fallback; a\r\n // missing store is a setup error, not a silent tight-pack.\r\n\r\n /**\r\n * Leases a transient per-object payload for a registered struct from the bound\r\n * store; a missing store throws rather than silently falling back, because it\r\n * is a setup error.\r\n */\r\n Alloc(name)\r\n {\r\n if (!this.rawDataStore)\r\n {\r\n throw new Error(`ITriRenderBatchAccumulator: no per-object-data store bound (set it from the render context before Alloc \"${name}\")`);\r\n }\r\n\r\n return this.rawDataStore.Allocate(name);\r\n }\r\n\r\n // Carbon pool-allocates per-object data from the accumulator; in JS the GC\r\n // owns lifetime, so this just constructs the requested object. Retained for\r\n // the deferred { object: this } sites during the per-object-data migration.\r\n\r\n /**\r\n * Constructs the requested per-object-data object; Carbon pool-allocates here,\r\n * but in JS the GC owns lifetime, so this only calls the constructor.\r\n */\r\n Allocate(Constructor)\r\n {\r\n return new Constructor();\r\n }\r\n\r\n /**\r\n * Attaches an opaque caller value that every batch collected by this\r\n * accumulator carries.\r\n */\r\n SetUserData(userData)\r\n {\r\n this.userData = userData;\r\n }\r\n\r\n /** Sets the rendering mode that Commit stamps onto every batch collected here. */\r\n SetRenderingMode(mode)\r\n {\r\n this.renderingMode = mode;\r\n }\r\n\r\n /** The rendering mode stamped onto collected batches. */\r\n GetRenderingMode()\r\n {\r\n return this.renderingMode;\r\n }\r\n\r\n /**\r\n * Abstract: concrete accumulators drop every collected batch and reset the\r\n * shared state.\r\n */\r\n @impl.abstract\r\n Clear()\r\n {\r\n throw new Error(\"ITriRenderBatchAccumulator.Clear is abstract\");\r\n }\r\n\r\n /**\r\n * Abstract: concrete accumulators take ownership of a batch and file it for\r\n * sorting.\r\n */\r\n @impl.abstract\r\n Commit(_batch)\r\n {\r\n throw new Error(\"ITriRenderBatchAccumulator.Commit is abstract\");\r\n }\r\n\r\n /** Abstract: the GDPR-eligible batch vector. */\r\n @impl.abstract\r\n GetGdprBatches()\r\n {\r\n throw new Error(\"ITriRenderBatchAccumulator.GetGdprBatches is abstract\");\r\n }\r\n\r\n /** Abstract: the plain batch vector. */\r\n @impl.abstract\r\n GetBatches()\r\n {\r\n throw new Error(\"ITriRenderBatchAccumulator.GetBatches is abstract\");\r\n }\r\n\r\n /** Abstract: concrete accumulators sort and group-count the collected batches. */\r\n @impl.abstract\r\n Finalize()\r\n {\r\n throw new Error(\"ITriRenderBatchAccumulator.Finalize is abstract\");\r\n }\r\n\r\n /** Abstract: total number of collected batches. */\r\n @impl.abstract\r\n GetBatchCount()\r\n {\r\n throw new Error(\"ITriRenderBatchAccumulator.GetBatchCount is abstract\");\r\n }\r\n\r\n /**\r\n * Abstract: whether the collected batches are effect-sorted rather than\r\n * order-preserving.\r\n */\r\n @impl.abstract\r\n IsChainedByEffect()\r\n {\r\n throw new Error(\"ITriRenderBatchAccumulator.IsChainedByEffect is abstract\");\r\n }\r\n\r\n /** Abstract: folds another accumulator's batches into this one. */\r\n @impl.abstract\r\n TransferFrom(_source)\r\n {\r\n throw new Error(\"ITriRenderBatchAccumulator.TransferFrom is abstract\");\r\n }\r\n}\r\n"],"names":["ITriRenderBatchAccumulator","_initProto","_applyDecs","impl","abstract","e","constructor","userData","renderingMode","RenderingMode","RM_ANY","rawDataStore","SetTriPoolAllocator","store","GetTriPoolAllocator","Alloc","name","Error","Allocate","Constructor","SetUserData","SetRenderingMode","mode","GetRenderingMode","Clear","Commit","_batch","GetGdprBatches","GetBatches","Finalize","GetBatchCount","IsChainedByEffect","TransferFrom","_source"],"mappings":";;;;;;AAUA;AACA;AACA;AACA;AACA;AACO,MAAMA,0BAA0B,CACvC;AAAA,EAAA;IAAA,CAAAC,UAAA,CAAA,GAAAC,cAAA,CAAA,IAAA,EAAA,EAAA,EAAA,CAAA,CAAA,CA6FGC,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,EAAA,OAAA,CAAA,EAAA,CAAA,CAUbD,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,EAAA,QAAA,CAAA,EAAA,CAAA,CAObD,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,EAAA,gBAAA,CAAA,EAAA,CAAA,CAObD,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,EAAA,YAAA,CAAA,EAAA,CAAA,CAObD,IAAI,EAAJA,IAAI,CAACC,QAAQ,sBAObD,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,EAAA,eAAA,CAAA,EAAA,CAAA,CAUbD,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,EAAA,mBAAA,CAAA,EAAA,CAAA,CAObD,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,EAAA,cAAA,CAAA,CAAA,CAAA,CAAAC,CAAA;AAAA;AAnJd;AACF;AACA;AACA;AACEC,EAAAA,WAAWA,GACX;IAAAL,UAAA,CAAA,IAAA,CAAA;IACE,IAAI,CAACM,QAAQ,GAAG,CAAC;AAEjB,IAAA,IAAI,CAACC,aAAa,GAAGC,aAAa,CAACC,MAAM;;AAEzC;AACA;AACA;IACA,IAAI,CAACC,YAAY,GAAG,IAAI;AAC1B,EAAA;;AAEA;AACA;;AAEA;AACF;AACA;AACA;EACEC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AIX,KAAK,CAAC,mDAAmD,CAAC;AACtE,EAAA;;AAEA;AAEAY,EAAAA,QAAQA,GACR;AACE,IAAA,MAAM,IAAIZ,KAAK,CAAC,iDAAiD,CAAC;AACpE,EAAA;;AAEA;AAEAa,EAAAA,aAAaA,GACb;AACE,IAAA,MAAM,IAAIb,KAAK,CAAC,sDAAsD,CAAC;AACzE,EAAA;;AAEA;AACF;AACA;AACA;AAEEc,EAAAA,iBAAiBA,GACjB;AACE,IAAA,MAAM,IAAId,KAAK,CAAC,0DAA0D,CAAC;AAC7E,EAAA;;AAEA;EAEAe,YAAYA,CAACC,OAAO,EACpB;AACE,IAAA,MAAM,IAAIhB,KAAK,CAAC,qDAAqD,CAAC;AACxE,EAAA;AACF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tr2RenderBatch.js","sources":["../../../../../src/trinity/core/batch/Tr2RenderBatch.js"],"sourcesContent":["// Source: trinity/TriRenderBatch.h\r\n// trinity/TriRenderBatch.cpp\r\n//\r\n// GPU-free CPU render-batch descriptor plus the binning/sort helpers. A batch\r\n// holds opaque references to material/shader/geometry and plain draw arguments;\r\n// it never touches a device. The engine adapter reads a finalized accumulator's\r\n// batches and issues the actual draws (Carbon's Tr2RenderContextBase::RenderBatches*\r\n// dispatch family stays engine-side and is intentionally NOT ported here).\r\nimport { RenderingMode } from \"#consts/graphics\";\r\nimport { Topology } from \"#consts/render-context\";\r\nimport { TriGeometryRes } from \"#resource/geometry\";\r\n\r\n\r\n// Carbon sorts batches on raw pointer identity of shader/vertex-stream objects.\r\n// JS has no pointer order, so we assign each distinct reference a stable id on\r\n// first encounter. Only contiguity of equal references matters for binning, so\r\n// the ordinal itself is irrelevant as long as it is consistent within a run.\r\nlet nextOrderId = 1;\r\nconst orderIds = new WeakMap();\r\n\r\n/**\r\n * Stable per-reference ordinal standing in for Carbon's pointer ordering in\r\n * batch comparisons; assigned on first sight and held in a WeakMap, so it is\r\n * consistent within a run but meaningless across runs.\r\n */\r\nexport function OrderOf(ref)\r\n{\r\n if (ref === null || ref === undefined) return 0;\r\n if (typeof ref !== \"object\" && typeof ref !== \"function\") return Number(ref) || 0;\r\n let id = orderIds.get(ref);\r\n if (id === undefined)\r\n {\r\n id = nextOrderId++;\r\n orderIds.set(ref, id);\r\n }\r\n return id;\r\n}\r\n\r\n// A contiguous (startIndex, count) block of mesh groups. Mirrors Carbon\r\n// TriRenderBatchAreaBlock; used by the shadow/overlay area-block paths.\r\n\r\n/**\r\n * A contiguous (startIndex, count) run of mesh groups, as consumed by the shadow\r\n * and overlay area-block paths.\r\n */\r\nexport class TriRenderBatchAreaBlock\r\n{\r\n /**\r\n * Creates a block covering count groups from startIndex; both are coerced to\r\n * unsigned integers.\r\n */\r\n constructor(startIndex = 0, count = 0)\r\n {\r\n this.startIndex = startIndex >>> 0;\r\n this.count = count >>> 0;\r\n }\r\n\r\n // Compacts a set of possibly overlapping/adjacent blocks into the minimal set\r\n // of contiguous runs, in place. Mirrors TriRenderBatchAreaBlock::Optimize.\r\n\r\n /**\r\n * Compacts a vector of possibly overlapping or adjacent blocks into the\r\n * minimal set of contiguous runs, rewriting the caller's array in place and\r\n * returning it.\r\n */\r\n static Optimize(areaBlockVector)\r\n {\r\n const indices = new Set();\r\n for (const block of areaBlockVector)\r\n {\r\n for (let i = 0; i < block.count; i++) indices.add(block.startIndex + i);\r\n }\r\n\r\n const sorted = Array.from(indices).sort((a, b) => a - b);\r\n areaBlockVector.length = 0;\r\n\r\n let start = -1;\r\n let run = -1;\r\n for (const value of sorted)\r\n {\r\n if (run >= 0 && value === run + 1)\r\n {\r\n run = value;\r\n continue;\r\n }\r\n if (run >= 0) areaBlockVector.push(new TriRenderBatchAreaBlock(start, run - start + 1));\r\n start = value;\r\n run = value;\r\n }\r\n if (run >= 0) areaBlockVector.push(new TriRenderBatchAreaBlock(start, run - start + 1));\r\n return areaBlockVector;\r\n }\r\n}\r\n\r\n// A shared-material list of area blocks (shadow/overlay path). Mirrors\r\n// TriRenderBatchAreaBlocksWithSharedMaterial.\r\n\r\n/**\r\n * Groups the area blocks that draw with one shared shader material on the shadow\r\n * and overlay path.\r\n */\r\nexport class TriRenderBatchAreaBlocksWithSharedMaterial extends TriRenderBatchAreaBlock\r\n{\r\n /** Starts with no shared material and an empty block vector. */\r\n constructor()\r\n {\r\n super();\r\n this.shaderMaterial = null;\r\n this.areaBlockVector = [];\r\n }\r\n\r\n /** Compacts the owned block vector into minimal contiguous runs. */\r\n Optimize()\r\n {\r\n TriRenderBatchAreaBlock.Optimize(this.areaBlockVector);\r\n }\r\n\r\n /** Empties the block vector while keeping the shared material bound. */\r\n Clear()\r\n {\r\n this.areaBlockVector.length = 0;\r\n }\r\n}\r\n\r\n// THE ALLOCATION TYPE IS A PORT GAP, AND THESE TWO HELPERS ARE WHERE IT SHOWS.\r\n//\r\n// Carbon's `SetGeometryFromAllocations` takes a `Tr2SuballocatedBuffer::Allocation`\r\n// (`Tr2SuballocatedBuffer.h:23-66`) and simply calls `GetBuffer()`, `GetOffset()`,\r\n// `GetStride()` and `GetStartIndex()` on it - no probing, because the type is the\r\n// argument. We have no such class: it needs `Tr2VirtualAllocator`, which in\r\n// Carbon is a thin wrapper over VMA's virtual-block suballocator, so porting it\r\n// means writing a real suballocator rather than translating one.\r\n//\r\n// Until then a caller passes either a shaped allocation or a bare buffer, and\r\n// these ask WHICH rather than hedging on a method one of our own classes might\r\n// be missing. When the class lands, both helpers delete and the call sites go\r\n// back to Carbon's four direct accessor calls.\r\n\r\n/** The buffer an allocation lends, or the argument itself when it IS a buffer. */\r\nfunction AllocationBuffer(allocation)\r\n{\r\n if (!allocation) return null;\r\n\r\n return typeof allocation.GetBuffer === \"function\" ? allocation.GetBuffer() : allocation;\r\n}\r\n\r\n/** An allocation's element stride, however the caller's shape spells it. */\r\nfunction AllocationStride(allocation)\r\n{\r\n if (!allocation) return 0;\r\n\r\n if (typeof allocation.GetStride === \"function\") return allocation.GetStride();\r\n\r\n return allocation.stride ?? 0;\r\n}\r\n\r\n\r\n// A single draw's worth of CPU descriptor state. Faithful to Carbon's\r\n// Tr2RenderBatch struct; the vertex/index \"buffer\" slots hold whatever the\r\n// producer supplies (in the GPU-free runtime these are geometry-resource-backed\r\n// descriptors that the engine resolves to real buffers at dispatch time).\r\n\r\n/**\r\n * One draw's worth of CPU descriptor state - material and shader key, geometry\r\n * binding, draw arguments and sort keys - holding no device resources.\r\n */\r\nexport class Tr2RenderBatch\r\n{\r\n /**\r\n * Creates an empty batch with no material or geometry, RM_ANY rendering mode,\r\n * triangle-list topology and a group count of 1.\r\n */\r\n constructor()\r\n {\r\n this.material = null;\r\n this.shader = null;\r\n\r\n this.vertexDeclaration = 0;\r\n this.vertexStreams = [ null, null ];\r\n this.stride = [ 0, 0 ];\r\n this.indexBuffer = null;\r\n this.indexStride = 0;\r\n\r\n // GPU-free adaptation: Carbon's Tr2MeshBase::CreateGeometryBatch bakes\r\n // realized buffer allocations and computed draw arguments into the batch\r\n // during collection. Trinity instead records a geometry-resource and\r\n // area-range descriptor; the engine resolves it to realized allocations\r\n // and final draw arguments at dispatch. See the render-batch contract in\r\n // docs/architecture.md.\r\n this.geometrySource = null;\r\n\r\n this.objectData = null;\r\n this.renderingMode = RenderingMode.RM_ANY;\r\n // THE VOCABULARY IS THE ABSTRACTION LAYER'S, NOT D3D'S. This field held a\r\n // `D3dPrimitiveTopology` until 2026-09-05, and everything drew correctly\r\n // because the WebGPU engine translated on the way out. Carbon does not\r\n // translate: `SubmitGeometry` hands `batch.m_topology` straight to\r\n // `SetTopology` (`Tr2RenderContext.cpp:86`), so the two numberings have to\r\n // BE the same one, and the AL owns it. The old numbering collided rather\r\n // than merely disagreed - D3D's 4 is TRIANGLELIST, the AL's 4 is TOP_LINES.\r\n this.topology = Topology.TOP_TRIANGLES;\r\n\r\n this.indexCountPerInstance = 0;\r\n this.instanceCount = 0;\r\n this.startIndexLocation = 0;\r\n this.baseVertexLocation = 0;\r\n this.startInstanceLocation = 0;\r\n\r\n this.pickingData = 0;\r\n this.depth = 0;\r\n this.priority = 0;\r\n\r\n // Default 1; the effect-sort partition rewrites this on the first batch of\r\n // each bin-run to the run length so dispatch can stride one state-set over\r\n // several draws. Meaningless on non-leading batches of a run.\r\n this.groupCount = 1;\r\n }\r\n\r\n // Sets material and derives the shader key from it. In the realized engine the\r\n // shader is the material's shader-state interface; in GPU-free collection no\r\n // shader is realized yet, so the material (effect) itself stands in as the\r\n // shader key. Either way the shader is both the validity key (see IsValid) and\r\n // the primary bin/sort key, so effect-equal batches still group together.\r\n\r\n /**\r\n * Sets the material and derives the shader key from it, falling back to the\r\n * material itself when no shader-state interface is realized yet; that key is\r\n * both the validity test and the primary bin/sort key, so effect-equal batches\r\n * still group together.\r\n */\r\n SetMaterial(material)\r\n {\r\n this.material = material ?? null;\r\n this.shader = material?.GetShaderStateInterface() ?? material ?? null;\r\n }\r\n\r\n /** Sets the outermost sort key; lower priorities sort first. */\r\n SetPriority(priority)\r\n {\r\n this.priority = priority >>> 0;\r\n }\r\n\r\n // Carbon: SetGeometry(vertexDecl, Tr2BufferAL& vb, stride, Tr2BufferAL& ib, indexStride).\r\n\r\n /**\r\n * Binds one vertex stream and an index buffer with their strides, clearing the\r\n * second stream.\r\n */\r\n SetGeometry(vertexDeclaration, vertexBuffer, vertexStride, indexBuffer, indexStride)\r\n {\r\n this.vertexDeclaration = vertexDeclaration >>> 0;\r\n this.vertexStreams[0] = vertexBuffer ?? null;\r\n this.vertexStreams[1] = null;\r\n this.stride[0] = vertexStride >>> 0;\r\n this.indexBuffer = indexBuffer ?? null;\r\n this.indexStride = indexStride >>> 0;\r\n }\r\n\r\n // Carbon overload taking suballocated-buffer allocations (the mesh path).\r\n\r\n /**\r\n * Binds geometry from suballocated buffer allocations, taking each\r\n * allocation's buffer and stride (Carbon's mesh path).\r\n */\r\n SetGeometryFromAllocations(vertexDeclaration, vertexAllocation, indexAllocation)\r\n {\r\n this.SetGeometry(\r\n vertexDeclaration,\r\n AllocationBuffer(vertexAllocation),\r\n AllocationStride(vertexAllocation),\r\n AllocationBuffer(indexAllocation),\r\n AllocationStride(indexAllocation)\r\n );\r\n }\r\n\r\n // Carbon two-stream allocation overload.\r\n\r\n /**\r\n * Binds a two-stream allocation set; the second allocation becomes vertex\r\n * stream 1.\r\n */\r\n SetGeometryFromAllocations2(vertexDeclaration, vertexAllocation1, vertexAllocation2, indexAllocation)\r\n {\r\n this.SetGeometryFromAllocations(vertexDeclaration, vertexAllocation1, indexAllocation);\r\n this.vertexStreams[1] = AllocationBuffer(vertexAllocation2);\r\n this.stride[1] = AllocationStride(vertexAllocation2);\r\n }\r\n\r\n // GPU-free geometry binding: records the resource + mesh/area range for the\r\n // engine to resolve into realized buffers and draw arguments at dispatch.\r\n\r\n /**\r\n * GPU-free geometry binding: records the geometry resource plus the mesh and\r\n * area range for the engine to resolve into realized buffers and draw\r\n * arguments at dispatch.\r\n */\r\n SetGeometrySource(geometry, meshIndex, areaIndex, count, reversed, lod = null)\r\n {\r\n this.geometrySource = {\r\n geometry: geometry ?? null,\r\n meshIndex: meshIndex >>> 0,\r\n areaIndex: areaIndex | 0,\r\n count: count | 0,\r\n reversed: !!reversed,\r\n // The LOD the area belongs to, so the render context can realize its\r\n // allocations at submit and recompute the draw arguments against them.\r\n lod: lod ?? null\r\n };\r\n }\r\n\r\n /**\r\n * Sets the vertex-declaration key, which participates in both binning and\r\n * sorting.\r\n */\r\n SetVertexDeclaration(vertexDeclaration)\r\n {\r\n this.vertexDeclaration = vertexDeclaration >>> 0;\r\n }\r\n\r\n /** Binds one vertex stream slot and its stride. */\r\n SetStreamSource(index, vertexBuffer, vertexStride)\r\n {\r\n this.vertexStreams[index] = vertexBuffer ?? null;\r\n this.stride[index] = vertexStride >>> 0;\r\n }\r\n\r\n // Carbon spells this SetInidices (a typo in the C++ API); we use the corrected\r\n // name since both producer and consumer are ours.\r\n\r\n /**\r\n * Binds the index buffer and its stride; Carbon spells this SetInidices, a\r\n * typo corrected here because both producer and consumer are ours.\r\n */\r\n SetIndices(indexBuffer, indexStride)\r\n {\r\n this.indexBuffer = indexBuffer ?? null;\r\n this.indexStride = indexStride >>> 0;\r\n }\r\n\r\n /**\r\n * Sets the primitive topology; only TRIANGLELIST batches are eligible for GDPR\r\n * binning.\r\n */\r\n SetTopology(topology)\r\n {\r\n this.topology = topology;\r\n }\r\n\r\n /**\r\n * References the per-object payload the engine binds when dispatching this\r\n * batch; the batch borrows it and does not own it.\r\n */\r\n SetPerObjectData(objectData)\r\n {\r\n this.objectData = objectData ?? null;\r\n }\r\n\r\n /** Records the indexed instanced draw arguments verbatim. */\r\n SetDrawIndexedInstanced(indexCountPerInstance, instanceCount, startIndexLocation, baseVertexLocation, startInstanceLocation)\r\n {\r\n this.indexCountPerInstance = indexCountPerInstance >>> 0;\r\n this.instanceCount = instanceCount >>> 0;\r\n this.startIndexLocation = startIndexLocation >>> 0;\r\n this.baseVertexLocation = baseVertexLocation >>> 0;\r\n this.startInstanceLocation = startInstanceLocation >>> 0;\r\n }\r\n\r\n // Non-indexed draw: reuses indexCountPerInstance for the vertex count and\r\n // startIndexLocation for the start vertex; baseVertexLocation is left as is.\r\n\r\n /**\r\n * Records a non-indexed instanced draw, reusing indexCountPerInstance for the\r\n * vertex count and startIndexLocation for the start vertex; baseVertexLocation\r\n * is left untouched.\r\n */\r\n SetDrawInstanced(vertexCountPerInstance, instanceCount, startVertexLocation, startInstanceLocation)\r\n {\r\n this.indexCountPerInstance = vertexCountPerInstance >>> 0;\r\n this.instanceCount = instanceCount >>> 0;\r\n this.startIndexLocation = startVertexLocation >>> 0;\r\n this.startInstanceLocation = startInstanceLocation >>> 0;\r\n }\r\n\r\n /**\r\n * Sets the batch's rendering mode; note that Commit overwrites it with the\r\n * accumulator's own mode.\r\n */\r\n SetRenderingMode(mode)\r\n {\r\n this.renderingMode = mode;\r\n }\r\n\r\n // Carbon overloads SetPickingData(data) and SetPickingData(meshIndex, areaIndex).\r\n\r\n /**\r\n * Stores picking data either as a raw value or, when a second argument is\r\n * given, as the mesh index shifted above the low byte of the area index.\r\n */\r\n SetPickingData(a, b)\r\n {\r\n this.pickingData = (b === undefined) ? (a >>> 0) : (((a << 8) | (b & 0xff)) >>> 0);\r\n }\r\n\r\n // A batch is valid iff it has a shader (i.e. SetMaterial was called with a\r\n // material that exposed a shader-state interface). Invalid batches are dropped\r\n // silently at Commit time.\r\n\r\n /**\r\n * A batch is valid only once it has a shader, that is once SetMaterial\r\n * received a material; invalid batches are dropped silently at Commit.\r\n */\r\n IsValid()\r\n {\r\n return this.shader !== null && this.shader !== undefined;\r\n }\r\n\r\n // Carbon Tr2MeshBase.cpp:341-395 (the draw arguments inside\r\n // CreateGeometryBatch) and Tr2SuballocatedBuffer.cpp:212-215\r\n // (Allocation::GetStartIndex).\r\n //\r\n // THE ARITHMETIC LIVES HERE ONCE. Carbon replicates this expression in\r\n // Tr2InstancedMesh and at least eight further call sites that bypass\r\n // CreateGeometryBatch; that duplication is a defect this port declines to\r\n // inherit. Every producer calls resolveDrawArguments instead.\r\n //\r\n // A draw argument is neither wholly CPU-derivable nor wholly the engine's:\r\n //\r\n // primCount - pure geometry data (area primitive counts). CPU.\r\n // firstIndex - pure geometry data. CPU.\r\n // startIndex - firstIndex PLUS the index allocation's start index. The base\r\n // is a suballocation, which only a realizing engine knows.\r\n // baseVertex - the vertex allocation's offset / stride, which IS\r\n // GetStartIndex() hand-inlined (Tr2MeshBase.cpp:391).\r\n //\r\n // The two bases default to ZERO when nothing has realized the geometry, and\r\n // zero is the CORRECT answer for an engine that gives each mesh its own\r\n // buffers rather than suballocating from a shared one - which is what ccpwgl\r\n // does and what a first WebGL implementation naturally does. A suballocating\r\n // engine writes its allocation into the resource and the same expression\r\n // yields the pooled bases. Trinity never sees a GPU handle: it asks the\r\n // allocation for two integers.\r\n //\r\n // Carbon gates the BATCH on lod->m_allocationsValid, because in Carbon an\r\n // unrealized draw cannot exist. This runtime is GPU-free, so an unrealized\r\n // LOD is normal and the flags gate the DRAW ARGUMENTS instead: collection\r\n // still emits the geometry-source descriptor.\r\n //\r\n // LOD selection and the primitive-count sum are NOT here. Carbon declares\r\n // both beside TriGeometryRes (Resources/TriGeometryRes.h:202/:242), which\r\n // the runtime resource layer owns.\r\n\r\n /**\r\n * Carbon's indexed draw arguments for one mesh area of one LOD, or null when\r\n * the area contributes no primitives or a reversed draw has no reversed\r\n * indices - both of which are Carbon's \"emit no batch\" answers.\r\n *\r\n * `reversed` is the already-resolved winding for this draw, which Carbon\r\n * computes as `area->GetReversed() != reverseWinding` at the call site.\r\n */\r\n static resolveDrawArguments(lod, areaIndex, areaCount, reversed = false)\r\n {\r\n if (!lod) return null;\r\n\r\n // Carbon clamps both to zero before use (Tr2MeshBase.cpp:356).\r\n const index = Math.max(0, areaIndex | 0);\r\n const count = Math.max(0, areaCount | 0);\r\n\r\n const primitiveCount = TriGeometryRes.getPrimitiveCount(lod, index, count);\r\n\r\n if (!primitiveCount) return null;\r\n\r\n if (reversed && lod.reversedIndicesValid === false) return null;\r\n\r\n // Not `area.firstIndex` directly: a CMF-shaped LOD writes the area start as\r\n // a first TRIANGLE, and the geometry layer owns that conversion.\r\n const firstIndex = TriGeometryRes.getAreaFirstIndex(lod.areas?.[index]);\r\n\r\n // Carbon binds the FORWARD index allocation on both paths and only reads\r\n // the reversed allocation for the start index (Tr2MeshBase.cpp:371/375).\r\n // That works because both live in one pool at one stride; an engine that\r\n // separates them must bind the one this start index belongs to.\r\n const indices = reversed ? lod.reversedIndexAllocation : lod.indexAllocation;\r\n\r\n const startIndexLocation = reversed\r\n ? Tr2RenderBatch.startIndexOf(indices) + TriGeometryRes.getLodPrimitiveCount(lod) * 3 - firstIndex - primitiveCount * 3\r\n : Tr2RenderBatch.startIndexOf(indices) + firstIndex;\r\n\r\n return {\r\n indexCountPerInstance: primitiveCount * 3,\r\n instanceCount: 1,\r\n startIndexLocation,\r\n baseVertexLocation: Tr2RenderBatch.startIndexOf(lod.vertexAllocation),\r\n startInstanceLocation: 0\r\n };\r\n }\r\n\r\n /**\r\n * The start index of a realized suballocation, or zero when the geometry is\r\n * unrealized or the engine allocates per mesh rather than from a shared\r\n * buffer; Carbon reads Allocation::GetStartIndex.\r\n */\r\n static startIndexOf(allocation)\r\n {\r\n if (!allocation) return 0;\r\n\r\n if (typeof allocation.GetStartIndex === \"function\")\r\n {\r\n return allocation.GetStartIndex() >>> 0;\r\n }\r\n\r\n // GetStartIndex() IS offset / stride; Carbon hand-inlines exactly this for\r\n // the base vertex (Tr2MeshBase.cpp:391).\r\n const stride = AllocationStride(allocation);\r\n\r\n if (!stride) return 0;\r\n\r\n const offset = typeof allocation.GetOffset === \"function\"\r\n ? allocation.GetOffset()\r\n : allocation.offset ?? 0;\r\n\r\n return (offset / stride) >>> 0;\r\n }\r\n}\r\n\r\n// Two batches can share a single state-set (one bin/GDPR group) iff all of these\r\n// match. Note: priority, material and topology are intentionally NOT compared\r\n// here (faithful to Carbon CanBeBinned).\r\n\r\n/**\r\n * Whether two batches can share one state-set: shader, vertex declaration, index\r\n * stride, both vertex streams and rendering mode must match, while priority,\r\n * material and topology are deliberately not compared (faithful to Carbon).\r\n */\r\nexport function CanBeBinned(batch1, batch2)\r\n{\r\n return batch1.shader === batch2.shader\r\n && batch1.vertexDeclaration === batch2.vertexDeclaration\r\n && batch1.indexStride === batch2.indexStride\r\n && batch1.vertexStreams[0] === batch2.vertexStreams[0]\r\n && batch1.vertexStreams[1] === batch2.vertexStreams[1]\r\n && batch1.renderingMode === batch2.renderingMode;\r\n}\r\n\r\n// JS comparator (negative/zero/positive) reproducing Carbon Compare's strict-weak\r\n// ordering: priority, shader, vertexDeclaration, indexStride, stream0, stream1,\r\n// renderingMode. Pointer identity is replaced by a stable per-reference order id.\r\n\r\n/**\r\n * Strict-weak comparator reproducing Carbon's batch ordering - priority, shader,\r\n * vertex declaration, index stride, stream 0, stream 1, rendering mode - with\r\n * pointer identity replaced by stable order ids.\r\n */\r\nexport function CompareBatches(batch1, batch2)\r\n{\r\n if (batch1.priority !== batch2.priority) return batch1.priority - batch2.priority;\r\n\r\n const shaderOrder = OrderOf(batch1.shader) - OrderOf(batch2.shader);\r\n if (shaderOrder !== 0) return shaderOrder;\r\n\r\n if (batch1.vertexDeclaration !== batch2.vertexDeclaration) return batch1.vertexDeclaration - batch2.vertexDeclaration;\r\n if (batch1.indexStride !== batch2.indexStride) return batch1.indexStride - batch2.indexStride;\r\n\r\n const stream0Order = OrderOf(batch1.vertexStreams[0]) - OrderOf(batch2.vertexStreams[0]);\r\n if (stream0Order !== 0) return stream0Order;\r\n\r\n const stream1Order = OrderOf(batch1.vertexStreams[1]) - OrderOf(batch2.vertexStreams[1]);\r\n if (stream1Order !== 0) return stream1Order;\r\n\r\n return batch1.renderingMode - batch2.renderingMode;\r\n}\r\n\r\n// Sorts a batch vector and writes each bin-run's length onto the run's leading\r\n// batch (groupCount). Mirrors Tr2GdprBatchFullPartition. JS Array.sort is stable,\r\n// so the \"full\" and \"stable\" partition variants are behaviourally identical here.\r\n\r\n/**\r\n * Sorts a batch vector and writes each bin-run's length onto that run's leading\r\n * batch groupCount, so dispatch can stride one state-set over several draws.\r\n */\r\nexport function Tr2GdprBatchFullPartition(batches)\r\n{\r\n PartitionBatchGroups(batches);\r\n}\r\n\r\n/**\r\n * Stable variant of the full partition, behaviourally identical here because JS\r\n * Array.sort is already stable.\r\n */\r\nexport function Tr2GdprBatchStableFullPartition(batches)\r\n{\r\n PartitionBatchGroups(batches);\r\n}\r\n\r\nfunction PartitionBatchGroups(batches)\r\n{\r\n if (batches.length === 0) return;\r\n\r\n batches.sort(CompareBatches);\r\n\r\n let first = 0;\r\n for (let current = 0; current < batches.length; current++)\r\n {\r\n if (!CanBeBinned(batches[first], batches[current]))\r\n {\r\n batches[first].groupCount = current - first;\r\n first = current;\r\n }\r\n }\r\n batches[first].groupCount = batches.length - first;\r\n}\r\n"],"names":["nextOrderId","orderIds","WeakMap","OrderOf","ref","undefined","Number","id","get","set","TriRenderBatchAreaBlock","constructor","startIndex","count","Optimize","areaBlockVector","indices","Set","block","i","add","sorted","Array","from","sort","a","b","length","start","run","value","push","TriRenderBatchAreaBlocksWithSharedMaterial","shaderMaterial","Clear","AllocationBuffer","allocation","GetBuffer","AllocationStride","GetStride","stride","Tr2RenderBatch","material","shader","vertexDeclaration","vertexStreams","indexBuffer","indexStride","geometrySource","objectData","renderingMode","RenderingMode","RM_ANY","topology","Topology","TOP_TRIANGLES","indexCountPerInstance","instanceCount","startIndexLocation","baseVertexLocation","startInstanceLocation","pickingData","depth","priority","groupCount","SetMaterial","GetShaderStateInterface","SetPriority","SetGeometry","vertexBuffer","vertexStride","SetGeometryFromAllocations","vertexAllocation","indexAllocation","SetGeometryFromAllocations2","vertexAllocation1","vertexAllocation2","SetGeometrySource","geometry","meshIndex","areaIndex","reversed","lod","SetVertexDeclaration","SetStreamSource","index","SetIndices","SetTopology","SetPerObjectData","SetDrawIndexedInstanced","SetDrawInstanced","vertexCountPerInstance","startVertexLocation","SetRenderingMode","mode","SetPickingData","IsValid","resolveDrawArguments","areaCount","Math","max","primitiveCount","TriGeometryRes","getPrimitiveCount","reversedIndicesValid","firstIndex","getAreaFirstIndex","areas","reversedIndexAllocation","startIndexOf","getLodPrimitiveCount","GetStartIndex","offset","GetOffset","CanBeBinned","batch1","batch2","CompareBatches","shaderOrder","stream0Order","stream1Order","Tr2GdprBatchFullPartition","batches","PartitionBatchGroups","Tr2GdprBatchStableFullPartition","first","current"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA,IAAIA,WAAW,GAAG,CAAC;AACnB,MAAMC,QAAQ,GAAG,IAAIC,OAAO,EAAE;;AAE9B;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CAACC,GAAG,EAC3B;EACE,IAAIA,GAAG,KAAK,IAAI,IAAIA,GAAG,KAAKC,SAAS,EAAE,OAAO,CAAC;AAC/C,EAAA,IAAI,OAAOD,GAAG,KAAK,QAAQ,IAAI,OAAOA,GAAG,KAAK,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AGC,OAAO;AACjB,IAAA;AACF,EAAA;EACAJ,OAAO,CAACG,KAAK,CAAC,CAAC7D,UAAU,GAAG0D,OAAO,CAAC/F,MAAM,GAAGkG,KAAK;AACpD;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TriRenderBatchAccumulator.js","sources":["../../../../../src/trinity/core/batch/TriRenderBatchAccumulator.js"],"sourcesContent":["// Source: trinity/TriRenderBatch.h (TriRenderBatchAccumulator<KeyGenerator>,\n// DefaultKeyGenerator, EffectKeyGenerator)\n//\n// GPU-free render-batch accumulator: collects committed batches into two vectors\n// (GDPR-eligible and plain), then sorts / group-counts them on Finalize. The\n// engine adapter reads GetGdprBatches()/GetBatches()/IsChainedByEffect() from a\n// finalized accumulator and issues the actual draws.\nimport { RenderingMode } from \"#consts/graphics\";\nimport { Topology } from \"#consts/render-context\";\nimport { RenderBatchSortType } from \"../../generated/trinityCore/enums.js\";\nimport { ITriRenderBatchAccumulator } from \"./ITriRenderBatchAccumulator.js\";\nimport { CanBeBinned, OrderOf, Tr2GdprBatchFullPartition } from \"./Tr2RenderBatch.js\";\n\n\n// Unsorted, order-preserving, single vector, no GDPR. Used for transparent /\n// order-dependent passes (which are pre-sorted by object distance CPU-side).\nexport const DefaultKeyGenerator = {\n ALLOW_GDPR: false,\n\n Less(_batch1, _batch2)\n {\n return false;\n },\n\n GetSortType()\n {\n return RenderBatchSortType.RENDERBATCHSORTTYPE_NONE;\n }\n};\n\n// Effect-sorted (shader, then vertex declaration); GDPR-enabled. Used for\n// opaque / decal / depth / additive / shadow passes.\nexport const EffectKeyGenerator = {\n ALLOW_GDPR: true,\n\n Less(batch1, batch2)\n {\n const shaderOrder = OrderOf(batch1.shader) - OrderOf(batch2.shader);\n if (shaderOrder !== 0) return shaderOrder < 0;\n return batch1.vertexDeclaration < batch2.vertexDeclaration;\n },\n\n GetSortType()\n {\n return RenderBatchSortType.RENDERBATCHSORTTYPE_SORT;\n }\n};\n\n/**\n * Concrete GPU-free batch accumulator: collects committed batches into a\n * GDPR-eligible and a plain vector, then sorts and group-counts them on\n * Finalize.\n */\nexport class TriRenderBatchAccumulator extends ITriRenderBatchAccumulator\n{\n /**\n * Creates an empty accumulator whose key generator decides sorting and GDPR\n * eligibility, defaulting to the effect-sorted one.\n */\n constructor(keyGenerator = EffectKeyGenerator)\n {\n super();\n this.keyGenerator = keyGenerator;\n\n this.gdprBatches = [];\n\n this.batches = [];\n }\n\n /**\n * Drops both batch vectors and resets user data and rendering mode to their\n * defaults.\n */\n Clear()\n {\n this.userData = 0;\n this.renderingMode = RenderingMode.RM_ANY;\n this.gdprBatches.length = 0;\n this.batches.length = 0;\n }\n\n // Collects a batch. Invalid batches (no shader) are dropped. GDPR-eligible\n // batches (allowed by the key generator, GDR-compatible material, triangle\n // topology, indexed) go to the GDPR vector; the rest to the plain vector. The\n // batch's rendering mode is overwritten with the accumulator's mode (faithful\n // to Carbon). Commit takes ownership of the batch; do not reuse it afterwards.\n // Returns whether the batch was accepted (JS addition; Carbon returns void).\n\n /**\n * Collects a batch, dropping invalid ones and routing GDPR-eligible batches\n * (allowed by the key generator, GDR-compatible material, triangle list,\n * indexed) to the GDPR vector; the batch's rendering mode is overwritten with\n * the accumulator's and ownership passes here, so the caller must not reuse\n * the batch. Returns whether it was accepted.\n */\n Commit(batch)\n {\n if (!batch.IsValid()) return false;\n\n if (this.keyGenerator.ALLOW_GDPR\n && batch.material?.CompatibleWithGdr()\n && batch.topology === Topology.TOP_TRIANGLES\n && batch.indexBuffer)\n {\n this.gdprBatches.push(batch);\n }\n else\n {\n this.batches.push(batch);\n }\n batch.renderingMode = this.renderingMode;\n return true;\n }\n\n // Folds another accumulator's batches into this one, then clears the source.\n // Mirrors Carbon TransferFrom (per-thread accumulator merge).\n\n /**\n * Folds another accumulator's batches into this one and clears the source; the\n * source's GDPR batches land in the plain vector when this accumulator does\n * not allow GDPR.\n */\n TransferFrom(source)\n {\n const sourceGdpr = source.GetGdprBatches();\n const sourceBatches = source.GetBatches();\n\n if (this.keyGenerator.ALLOW_GDPR)\n {\n for (const batch of sourceGdpr) this.gdprBatches.push(batch);\n }\n else\n {\n for (const batch of sourceGdpr) this.batches.push(batch);\n }\n for (const batch of sourceBatches) this.batches.push(batch);\n\n source.Clear();\n }\n\n /** The live GDPR-eligible batch vector, not a copy. */\n GetGdprBatches()\n {\n return this.gdprBatches;\n }\n\n /** The live plain batch vector, not a copy. */\n GetBatches()\n {\n return this.batches;\n }\n\n // Sorts and group-counts the collected batches. No-op for the order-preserving\n // key generator; effect/GDPR generators sort both vectors and stamp each\n // bin-run's length onto its leading batch's groupCount.\n\n /**\n * Sorts and group-counts the collected batches: a no-op for the\n * order-preserving key generator, a full bin partition of both vectors for\n * GDPR-enabled ones, and a plain comparator sort otherwise.\n */\n Finalize()\n {\n const sortType = this.keyGenerator.GetSortType();\n if (sortType === RenderBatchSortType.RENDERBATCHSORTTYPE_NONE) return;\n\n if (this.keyGenerator.ALLOW_GDPR)\n {\n Tr2GdprBatchFullPartition(this.gdprBatches);\n Tr2GdprBatchFullPartition(this.batches);\n return;\n }\n\n const keyGenerator = this.keyGenerator;\n this.batches.sort((batch1, batch2) =>\n {\n if (keyGenerator.Less(batch1, batch2)) return -1;\n if (keyGenerator.Less(batch2, batch1)) return 1;\n return 0;\n });\n }\n\n /** Total batches across both vectors. */\n GetBatchCount()\n {\n return this.gdprBatches.length + this.batches.length;\n }\n\n /**\n * Whether the batches are effect-sorted, so consecutive batches can share one\n * state-set, rather than order-preserving.\n */\n IsChainedByEffect()\n {\n return this.keyGenerator.GetSortType() !== RenderBatchSortType.RENDERBATCHSORTTYPE_NONE;\n }\n}\n"],"names":["DefaultKeyGenerator","ALLOW_GDPR","Less","_batch1","_batch2","GetSortType","RenderBatchSortType","RENDERBATCHSORTTYPE_NONE","EffectKeyGenerator","batch1","batch2","shaderOrder","OrderOf","shader","vertexDeclaration","RENDERBATCHSORTTYPE_SORT","TriRenderBatchAccumulator","ITriRenderBatchAccumulator","constructor","keyGenerator","gdprBatches","batches","Clear","userData","renderingMode","RenderingMode","RM_ANY","length","Commit","batch","IsValid","material","CompatibleWithGdr","topology","Topology","TOP_TRIANGLES","indexBuffer","push","TransferFrom","source","sourceGdpr","GetGdprBatches","sourceBatches","GetBatches","Finalize","sortType","Tr2GdprBatchFullPartition","sort","GetBatchCount","IsChainedByEffect"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACO,MAAMA,mBAAmB,GAAG;AACjCC,EAAAA,UAAU,EAAE,KAAK;AAEjBC,EAAAA,IAAIA,CAACC,OAAO,EAAEC,OAAO,EACrB;AACE,IAAA,OAAO,KAAK;EACd,CAAC;AAEDC,EAAAA,WAAWA,GACX;IACE,OAAOC,mBAAmB,CAACC,wBAAwB;AACrD,EAAA;AACF;;AAEA;AACA;AACO,MAAMC,kBAAkB,GAAG;AAChCP,EAAAA,UAAU,EAAE,IAAI;AAEhBC,EAAAA,IAAIA,CAACO,MAAM,EAAEC,MAAM,EACnB;AACE,IAAA,MAAMC,WAAW,GAAGC,OAAO,CAACH,MAAM,CAACI,MAAM,CAAC,GAAGD,OAAO,CAACF,MAAM,CAACG,MAAM,CAAC;AACnE,IAAA,IAAIF,WAAW,KAAK,CAAC,EAAE,OAAOA,WAAW,GAAG,CAAC;AAC7C,IAAA,OAAOF,MAAM,CAACK,iBAAiB,GAAGJ,MAAM,CAACI,iBAAiB;EAC5D,CAAC;AAEDT,EAAAA,WAAWA,GACX;IACE,OAAOC,mBAAmB,CAACS,wBAAwB;AACrD,EAAA;AACF;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,yBAAyB,SAASC,0BAA0B,CACzE;AACE;AACF;AACA;AACA;AACEC,EAAAA,WAAWA,CAACC,YAAY,GAAGX,kBAAkB,EAC7C;AACE,IAAA,KAAK,EAAE;IACP,IAAI,CAACW,YAAY,GAAGA,YAAY;IAEhC,IAAI,CAACC,WAAW,GAAG,EAAE;IAErB,IAAI,CAACC,OAAO,GA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IAAI,CAACN,OAAO,CAACM,MAAM;AACtD,EAAA;;AAEA;AACF;AACA;AACA;AACEsB,EAAAA,iBAAiBA,GACjB;IACE,OAAO,IAAI,CAAC9B,YAAY,CAACd,WAAW,EAAE,KAAKC,mBAAmB,CAACC,wBAAwB;AACzF,EAAA;AACF;;;;"}
@@ -1,43 +0,0 @@
1
- import { applyDecs2311 as _applyDecs2311 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
- import { impl } from '#schema';
3
-
4
- let _initProto;
5
-
6
- /**
7
- * Nominal backend contract for realizing Trinity's cascaded-shadow intents.
8
- *
9
- * Trinity owns split calculation and the call order. Engine implementations
10
- * extend this class and realize the physical atlas, render passes and optional
11
- * denoising. Every base method throws so an incomplete engine integration is
12
- * visible immediately.
13
- */
14
- class CjsShadowMapExecutor {
15
- static {
16
- [_initProto] = _applyDecs2311(this, [], [[[impl, impl.abstract], 18, "PrepareShadowRendering"], [[impl, impl.abstract], 18, "BeginShadowRendering"], [[impl, impl.abstract], 18, "EndShadowRendering"], [[impl, impl.abstract], 18, "DrawToShadowMapResult"]]).e;
17
- }
18
- constructor() {
19
- _initProto(this);
20
- }
21
- /** Allocates and prepares the physical cascaded-shadow atlas. */
22
- PrepareShadowRendering(_shadowMap, _renderContext) {
23
- throw new Error("CjsShadowMapExecutor.PrepareShadowRendering must be implemented by an engine.");
24
- }
25
-
26
- /** Begins rendering one logical split into its atlas cell. */
27
- BeginShadowRendering(_shadowMap, _splitIndex, _renderContext) {
28
- throw new Error("CjsShadowMapExecutor.BeginShadowRendering must be implemented by an engine.");
29
- }
30
-
31
- /** Restores engine render state after the cascaded-shadow pass. */
32
- EndShadowRendering(_shadowMap, _renderContext) {
33
- throw new Error("CjsShadowMapExecutor.EndShadowRendering must be implemented by an engine.");
34
- }
35
-
36
- /** Produces the screen-space shadow result and applies optional denoising. */
37
- DrawToShadowMapResult(_shadowMap, _depthMap, _cascadedShadowDepth, _upscaling, _renderContext) {
38
- throw new Error("CjsShadowMapExecutor.DrawToShadowMapResult must be implemented by an engine.");
39
- }
40
- }
41
-
42
- export { CjsShadowMapExecutor };
43
- //# sourceMappingURL=CjsShadowMapExecutor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CjsShadowMapExecutor.js","sources":["../../../../../src/trinity/core/context/CjsShadowMapExecutor.js"],"sourcesContent":["import { impl } from \"#schema\";\n\n\n/**\n * Nominal backend contract for realizing Trinity's cascaded-shadow intents.\r\n *\r\n * Trinity owns split calculation and the call order. Engine implementations\r\n * extend this class and realize the physical atlas, render passes and optional\r\n * denoising. Every base method throws so an incomplete engine integration is\r\n * visible immediately.\r\n */\r\nexport class CjsShadowMapExecutor\r\n{\r\n /** Allocates and prepares the physical cascaded-shadow atlas. */\n @impl.abstract\n PrepareShadowRendering(_shadowMap, _renderContext)\n {\r\n throw new Error(\"CjsShadowMapExecutor.PrepareShadowRendering must be implemented by an engine.\");\r\n }\r\n\r\n /** Begins rendering one logical split into its atlas cell. */\n @impl.abstract\n BeginShadowRendering(_shadowMap, _splitIndex, _renderContext)\n {\r\n throw new Error(\"CjsShadowMapExecutor.BeginShadowRendering must be implemented by an engine.\");\r\n }\r\n\r\n /** Restores engine render state after the cascaded-shadow pass. */\n @impl.abstract\n EndShadowRendering(_shadowMap, _renderContext)\n {\r\n throw new Error(\"CjsShadowMapExecutor.EndShadowRendering must be implemented by an engine.\");\r\n }\r\n\r\n /** Produces the screen-space shadow result and applies optional denoising. */\n @impl.abstract\n DrawToShadowMapResult(_shadowMap, _depthMap, _cascadedShadowDepth, _upscaling, _renderContext)\n {\r\n throw new Error(\"CjsShadowMapExecutor.DrawToShadowMapResult must be implemented by an engine.\");\r\n }\r\n}\r\n"],"names":["CjsShadowMapExecutor","_initProto","_applyDecs","impl","abstract","e","constructor","PrepareShadowRendering","_shadowMap","_renderContext","Error","BeginShadowRendering","_splitIndex","EndShadowRendering","DrawToShadowMapResult","_depthMap","_cascadedShadowDepth","_upscaling"],"mappings":";;;;;AAGA;AACA;AAC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
2
- import { impl } from '#schema';
3
-
4
- let _initProto;
5
-
6
- /**
7
- * Nominal backend contract for realizing Trinity's volumetric and froxel-fog
8
- * intents.
9
- *
10
- * Trinity owns fog blending, quality policy, logical state and constant-data
11
- * production. Engine implementations extend this class and realize physical
12
- * textures, passes, variable-store texture publication and shadow draws.
13
- * Every base method throws so incomplete engine composition fails visibly.
14
- */
15
- class CjsVolumetricsExecutor {
16
- static {
17
- [_initProto] = _applyDecs2311(this, [], [[[impl, impl.abstract], 18, "RenderVolumetrics"], [[impl, impl.abstract], 18, "GetEmptyVolumetricTexture"], [[impl, impl.abstract], 18, "RenderFog"], [[impl, impl.abstract], 18, "RenderFogIntoReflectionMap"], [[impl, impl.abstract], 18, "GetEmptyFogTexture"], [[impl, impl.abstract], 18, "UpdateFogEnvironmentMap"], [[impl, impl.abstract], 18, "UpdateVariableStore"], [[impl, impl.abstract], 18, "RenderShadows"]]).e;
18
- }
19
- constructor() {
20
- _initProto(this);
21
- }
22
- /** Realizes Carbon's volumetric-renderable pass and returns its texture. */
23
- RenderVolumetrics(_renderer, _registry, _frustum, _sceneDepth, _froxelFog, _sunDirection, _depthSlices, _raytracingEnabled, _gpuResourcePool, _renderContext) {
24
- throw new Error("CjsVolumetricsExecutor.RenderVolumetrics must be implemented by an engine.");
25
- }
26
-
27
- /** Returns the backend's shared empty volumetric texture. */
28
- GetEmptyVolumetricTexture(_gpuResourcePool) {
29
- throw new Error("CjsVolumetricsExecutor.GetEmptyVolumetricTexture must be implemented by an engine.");
30
- }
31
-
32
- /** Realizes the primary-view froxel fog pass and returns its texture. */
33
- RenderFog(_renderer, _renderContext, _gpuResourcePool, _width, _height, _cascadedShadowMap, _raytracingGeometry, _shadowQuality, _sunDirection, _sunColor, _origin, _originShift, _view, _projection, _viewLast, _projectionLast) {
34
- throw new Error("CjsVolumetricsExecutor.RenderFog must be implemented by an engine.");
35
- }
36
-
37
- /** Realizes the reflection-view froxel fog pass and returns its texture. */
38
- RenderFogIntoReflectionMap(_renderer, _renderContext, _gpuResourcePool, _width, _height, _sunDirection, _sunColor, _origin, _view, _projection) {
39
- throw new Error("CjsVolumetricsExecutor.RenderFogIntoReflectionMap must be implemented by an engine.");
40
- }
41
-
42
- /** Returns the backend's shared empty fog texture. */
43
- GetEmptyFogTexture(_gpuResourcePool) {
44
- throw new Error("CjsVolumetricsExecutor.GetEmptyFogTexture must be implemented by an engine.");
45
- }
46
-
47
- /** Realizes the Mie environment-map update. */
48
- UpdateFogEnvironmentMap(_renderer, _renderContext) {
49
- throw new Error("CjsVolumetricsExecutor.UpdateFogEnvironmentMap must be implemented by an engine.");
50
- }
51
-
52
- /** Publishes the engine's realized fog textures to its variable store. */
53
- UpdateVariableStore(_renderer, _renderContext) {
54
- throw new Error("CjsVolumetricsExecutor.UpdateVariableStore must be implemented by an engine.");
55
- }
56
-
57
- /** Realizes volumetric shadow batches. */
58
- RenderShadows(_renderer, _registry, _shadowMap, _renderContext) {
59
- throw new Error("CjsVolumetricsExecutor.RenderShadows must be implemented by an engine.");
60
- }
61
- }
62
-
63
- export { CjsVolumetricsExecutor };
64
- //# sourceMappingURL=CjsVolumetricsExecutor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CjsVolumetricsExecutor.js","sources":["../../../../../src/trinity/core/context/CjsVolumetricsExecutor.js"],"sourcesContent":["import { impl } from \"#schema\";\n\n\n/**\n * Nominal backend contract for realizing Trinity's volumetric and froxel-fog\r\n * intents.\r\n *\r\n * Trinity owns fog blending, quality policy, logical state and constant-data\r\n * production. Engine implementations extend this class and realize physical\r\n * textures, passes, variable-store texture publication and shadow draws.\r\n * Every base method throws so incomplete engine composition fails visibly.\r\n */\r\nexport class CjsVolumetricsExecutor\n{\n /** Realizes Carbon's volumetric-renderable pass and returns its texture. */\n @impl.abstract\n RenderVolumetrics(\n _renderer,\r\n _registry,\r\n _frustum,\r\n _sceneDepth,\r\n _froxelFog,\r\n _sunDirection,\r\n _depthSlices,\r\n _raytracingEnabled,\r\n _gpuResourcePool,\r\n _renderContext\r\n )\r\n {\r\n throw new Error(\"CjsVolumetricsExecutor.RenderVolumetrics must be implemented by an engine.\");\r\n }\r\n\r\n /** Returns the backend's shared empty volumetric texture. */\n @impl.abstract\n GetEmptyVolumetricTexture(_gpuResourcePool)\n {\r\n throw new Error(\"CjsVolumetricsExecutor.GetEmptyVolumetricTexture must be implemented by an engine.\");\r\n }\r\n\r\n /** Realizes the primary-view froxel fog pass and returns its texture. */\n @impl.abstract\n RenderFog(\n _renderer,\r\n _renderContext,\r\n _gpuResourcePool,\r\n _width,\r\n _height,\r\n _cascadedShadowMap,\r\n _raytracingGeometry,\r\n _shadowQuality,\r\n _sunDirection,\r\n _sunColor,\r\n _origin,\r\n _originShift,\r\n _view,\r\n _projection,\r\n _viewLast,\r\n _projectionLast\r\n )\r\n {\r\n throw new Error(\"CjsVolumetricsExecutor.RenderFog must be implemented by an engine.\");\r\n }\r\n\r\n /** Realizes the reflection-view froxel fog pass and returns its texture. */\n @impl.abstract\n RenderFogIntoReflectionMap(\n _renderer,\r\n _renderContext,\r\n _gpuResourcePool,\r\n _width,\r\n _height,\r\n _sunDirection,\r\n _sunColor,\r\n _origin,\r\n _view,\r\n _projection\r\n )\r\n {\r\n throw new Error(\"CjsVolumetricsExecutor.RenderFogIntoReflectionMap must be implemented by an engine.\");\r\n }\r\n\r\n /** Returns the backend's shared empty fog texture. */\n @impl.abstract\n GetEmptyFogTexture(_gpuResourcePool)\n {\r\n throw new Error(\"CjsVolumetricsExecutor.GetEmptyFogTexture must be implemented by an engine.\");\r\n }\r\n\r\n /** Realizes the Mie environment-map update. */\n @impl.abstract\n UpdateFogEnvironmentMap(_renderer, _renderContext)\n {\r\n throw new Error(\"CjsVolumetricsExecutor.UpdateFogEnvironmentMap must be implemented by an engine.\");\r\n }\r\n\r\n /** Publishes the engine's realized fog textures to its variable store. */\n @impl.abstract\n UpdateVariableStore(_renderer, _renderContext)\n {\r\n throw new Error(\"CjsVolumetricsExecutor.UpdateVariableStore must be implemented by an engine.\");\r\n }\r\n\r\n /** Realizes volumetric shadow batches. */\n @impl.abstract\n RenderShadows(_renderer, _registry, _shadowMap, _renderContext)\n {\r\n throw new Error(\"CjsVolumetricsExecutor.RenderShadows must be implemented by an engine.\");\r\n }\r\n}\r\n"],"names":["CjsVolumetricsExecutor","_initProto","_applyDecs","impl","abstract","e","constructor","RenderVolumetrics","_renderer","_registry","_frustum","_sceneDepth","_froxelFog","_sunDirection","_depthSlices","_raytracingEnabled","_gpuResourcePool","_renderContext","Error","GetEmptyVolumetricTexture","RenderFog","_width","_height","_cascadedShadowMap","_raytracingGeometry","_shadowQuality","_sunColor","_origin","_originShift","_view","_projection","_viewLast","_projectionLast","RenderFogIntoReflectionMap","GetEmptyFogTexture","UpdateFogEnvironmentMap","UpdateVariableStore","RenderShadows","_shadowMap"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,sBAAsB,CACnC;AAAA,EAAA;IAAA,CAAAC,UAAA,CAAA,GAAAC,cAAA,CAAA,IAAA,EAAA,EAAA,EAAA,CAAA,CAAA,CAEGC,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,EAAA,mBAAA,CAAA,EAAA,CAAA,CAkBbD,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,EAAA,2BAAA,CAAA,EAAA,CAAA,CAObD,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,EAAA,WAAA,CAAA,EAAA,CAAA,CAwBbD,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,EAAA,4BAAA,CAAA,EAAA,CAAA,CAkBbD,IAAI,EAAJA,IAAI,CAACC,QAAQ,gCAObD,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,EAAA,yBAAA,CAAA,EAAA,CAAA,CAObD,IAAI,EAAJA,IAAI,CAACC,QAAQ,CAAA,EAAA,EAAA,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IAAA,MAAM,IAAIC,KAAK,CAAC,kFAAkF,CAAC;AACrG,EAAA;;AAEA;AAEAkB,EAAAA,mBAAmBA,CAAC5B,SAAS,EAAES,cAAc,EAC7C;AACE,IAAA,MAAM,IAAIC,KAAK,CAAC,8EAA8E,CAAC;AACjG,EAAA;;AAEA;EAEAmB,aAAaA,CAAC7B,SAAS,EAAEC,SAAS,EAAE6B,UAAU,EAAErB,cAAc,EAC9D;AACE,IAAA,MAAM,IAAIC,KAAK,CAAC,wEAAwE,CAAC;AAC3F,EAAA;AACF;;;;"}
@@ -1,109 +0,0 @@
1
- import { applyDecs2311 as _applyDecs2311 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
- import { CjsModel } from '#model';
3
- import { carbon, impl, type } from '#schema';
4
- import { mat4 } from '#math/mat4';
5
- import { vec4 } from '#math/vec4';
6
-
7
- let _initProto, _initClass;
8
-
9
- /**
10
- * Carbon's Tr2VisibilityEvent struct - the shared shape producers push into
11
- * Tr2VisibilityResults and the interior/portal visibility consumers read.
12
- * Plain data, not Blue-exposed.
13
- */
14
- class Tr2VisibilityEvent {
15
- userData = null;
16
- objectToWorldMatrix = mat4.create();
17
- clipPlane = vec4.create();
18
-
19
- /** Tr2Rect scissor - left/top/right/bottom in pixels. */
20
- scissorRect = {
21
- left: 0,
22
- top: 0,
23
- right: 0,
24
- bottom: 0
25
- };
26
- stencilWrite = 0;
27
- stencilTest = 0;
28
- mirrorIndex = -1;
29
- eventType = Tr2VisibilityEvent.EventType.INSTANCE_VISIBLE;
30
- useClipPlane = false;
31
- isMirroredInLeftHandedSpace = false;
32
- static EventType = Object.freeze({
33
- QUERY_BEGIN: 1 << 0,
34
- QUERY_END: 1 << 1,
35
- PORTAL_ENTER: 1 << 2,
36
- PORTAL_EXIT: 1 << 3,
37
- PORTAL_PRE_EXIT: 1 << 4,
38
- CELL_IMMEDIATE_REPORT: 1 << 5,
39
- VIEW_PARAMETERS_CHANGED: 1 << 6,
40
- INSTANCE_VISIBLE: 1 << 7,
41
- REMOVAL_SUGGESTED: 1 << 8,
42
- INSTANCE_IMMEDIATE_REPORT: 1 << 9,
43
- REGION_OF_INFLUENCE_ACTIVE: 1 << 10,
44
- REGION_OF_INFLUENCE_INACTIVE: 1 << 11,
45
- STENCIL_MASK: 1 << 12,
46
- TEXT_MESSAGE: 1 << 13,
47
- DRAW_LINE_2D: 1 << 14,
48
- DRAW_LINE_3D: 1 << 15,
49
- DRAW_BUFFER: 1 << 16,
50
- OCCLUSION_QUERY_BEGIN: 1 << 17,
51
- OCCLUSION_QUERY_END: 1 << 18,
52
- OCCLUSION_QUERY_GET_RESULT: 1 << 19,
53
- OCCLUSION_QUERY_DRAW_DEPTH_TEST: 1 << 20,
54
- INSTANCE_DRAW_DEPTH: 1 << 21,
55
- FLUSH_DEPTH: 1 << 22,
56
- DEPTH_PASS_BEGIN: 1 << 23,
57
- DEPTH_PASS_END: 1 << 24,
58
- COLOR_PASS_BEGIN: 1 << 25,
59
- COLOR_PASS_END: 1 << 26,
60
- TILE_BEGIN: 1 << 27,
61
- TILE_END: 1 << 28,
62
- FLUSH_GPU_COMMAND_BUFFER: 1 << 29
63
- });
64
- }
65
-
66
- /**
67
- * Collects the visibility events a visibility executor emits, for the interior
68
- * and portal consumers to read back.
69
- */
70
- let _Tr2VisibilityResults;
71
- class Tr2VisibilityResults extends CjsModel {
72
- static {
73
- ({
74
- e: [_initProto],
75
- c: [_Tr2VisibilityResults, _initClass]
76
- } = _applyDecs2311(this, [type.define({
77
- className: "Tr2VisibilityResults",
78
- family: "trinityCore"
79
- })], [[[carbon, carbon.method, impl, impl.adapted], 18, "AddVisibilityEvent"], [[carbon, carbon.method, impl, impl.adapted], 18, "GetEvents"], [[carbon, carbon.method, impl, impl.implemented], 18, "Clear"], [[carbon, carbon.method, impl, impl.implemented], 18, "GetNumVisibilityEvents"]], 0, void 0, CjsModel));
80
- }
81
- // Carbon's m_events is private transient execution state, not Blue data.
82
- #events = (_initProto(this), []);
83
-
84
- /** Adds the value-like visibility event emitted by a visibility executor. */
85
- AddVisibilityEvent(event) {
86
- this.#events.push(event);
87
- }
88
-
89
- /** Returns a detached container view of the current visibility events. */
90
- GetEvents() {
91
- return this.#events.slice();
92
- }
93
-
94
- /** Clears the result set. */
95
- Clear() {
96
- this.#events.length = 0;
97
- }
98
-
99
- /** Gets the number of visibility events in the result set. */
100
- GetNumVisibilityEvents() {
101
- return this.#events.length;
102
- }
103
- static {
104
- _initClass();
105
- }
106
- }
107
-
108
- export { Tr2VisibilityEvent, _Tr2VisibilityResults as Tr2VisibilityResults };
109
- //# sourceMappingURL=Tr2VisibilityResults.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tr2VisibilityResults.js","sources":["../../../../../src/trinity/core/context/Tr2VisibilityResults.js"],"sourcesContent":["// Source: trinity/trinity/Tr2VisibilityResults.h\n// trinity/trinity/Tr2VisibilityResults.cpp\r\n// trinity/trinity/Tr2VisibilityResults_Blue.cpp\r\nimport { CjsModel } from \"#model\";\r\nimport { carbon, impl, type } from \"#schema\";\r\nimport { mat4 } from \"#math/mat4\";\r\nimport { vec4 } from \"#math/vec4\";\r\n\r\n\r\n/**\r\n * Carbon's Tr2VisibilityEvent struct - the shared shape producers push into\r\n * Tr2VisibilityResults and the interior/portal visibility consumers read.\r\n * Plain data, not Blue-exposed.\r\n */\r\nexport class Tr2VisibilityEvent\r\n{\r\n\r\n userData = null;\r\n\r\n objectToWorldMatrix = mat4.create();\r\n\r\n clipPlane = vec4.create();\r\n\r\n /** Tr2Rect scissor - left/top/right/bottom in pixels. */\r\n scissorRect = { left: 0, top: 0, right: 0, bottom: 0 };\r\n\r\n stencilWrite = 0;\r\n\r\n stencilTest = 0;\r\n\r\n mirrorIndex = -1;\r\n\r\n eventType = Tr2VisibilityEvent.EventType.INSTANCE_VISIBLE;\r\n\r\n useClipPlane = false;\r\n\r\n isMirroredInLeftHandedSpace = false;\r\n\r\n static EventType = Object.freeze({\r\n QUERY_BEGIN: 1 << 0,\r\n QUERY_END: 1 << 1,\r\n PORTAL_ENTER: 1 << 2,\r\n PORTAL_EXIT: 1 << 3,\r\n PORTAL_PRE_EXIT: 1 << 4,\r\n CELL_IMMEDIATE_REPORT: 1 << 5,\r\n VIEW_PARAMETERS_CHANGED: 1 << 6,\r\n INSTANCE_VISIBLE: 1 << 7,\r\n REMOVAL_SUGGESTED: 1 << 8,\r\n INSTANCE_IMMEDIATE_REPORT: 1 << 9,\r\n REGION_OF_INFLUENCE_ACTIVE: 1 << 10,\r\n REGION_OF_INFLUENCE_INACTIVE: 1 << 11,\r\n STENCIL_MASK: 1 << 12,\r\n TEXT_MESSAGE: 1 << 13,\r\n DRAW_LINE_2D: 1 << 14,\r\n DRAW_LINE_3D: 1 << 15,\r\n DRAW_BUFFER: 1 << 16,\r\n OCCLUSION_QUERY_BEGIN: 1 << 17,\r\n OCCLUSION_QUERY_END: 1 << 18,\r\n OCCLUSION_QUERY_GET_RESULT: 1 << 19,\r\n OCCLUSION_QUERY_DRAW_DEPTH_TEST: 1 << 20,\r\n INSTANCE_DRAW_DEPTH: 1 << 21,\r\n FLUSH_DEPTH: 1 << 22,\r\n DEPTH_PASS_BEGIN: 1 << 23,\r\n DEPTH_PASS_END: 1 << 24,\r\n COLOR_PASS_BEGIN: 1 << 25,\r\n COLOR_PASS_END: 1 << 26,\r\n TILE_BEGIN: 1 << 27,\r\n TILE_END: 1 << 28,\r\n FLUSH_GPU_COMMAND_BUFFER: 1 << 29\r\n });\r\n\r\n}\r\n\r\n\r\n/**\r\n * Collects the visibility events a visibility executor emits, for the interior\r\n * and portal consumers to read back.\r\n */\r\n@type.define({ className: \"Tr2VisibilityResults\", family: \"trinityCore\" })\r\nexport class Tr2VisibilityResults extends CjsModel\r\n{\r\n\r\n // Carbon's m_events is private transient execution state, not Blue data.\r\n #events = [];\r\n\r\n /** Adds the value-like visibility event emitted by a visibility executor. */\r\n @carbon.method\r\n @impl.adapted\r\n AddVisibilityEvent(event)\r\n {\r\n this.#events.push(event);\r\n }\r\n\r\n /** Returns a detached container view of the current visibility events. */\r\n @carbon.method\r\n @impl.adapted\r\n GetEvents()\r\n {\r\n return this.#events.slice();\r\n }\r\n\r\n /** Clears the result set. */\r\n @carbon.method\r\n @impl.implemented\r\n Clear()\r\n {\r\n this.#events.length = 0;\r\n }\r\n\r\n /** Gets the number of visibility events in the result set. */\r\n @carbon.method\r\n @impl.implemented\r\n GetNumVisibilityEvents()\r\n {\r\n return this.#events.length;\r\n }\r\n\r\n}\r\n"],"names":["Tr2VisibilityEvent","userData","objectToWorldMatrix","mat4","create","clipPlane","vec4","scissorRect","left","top","right","bottom","stencilWrite","stencilTest","mirrorIndex","eventType","EventType","INSTANCE_VISIBLE","useClipPlane","isMirroredInLeftHandedSpace","Object","freeze","QUERY_BEGIN","QUERY_END","PORTAL_ENTER","PORTAL_EXIT","PORTAL_PRE_EXIT","CELL_IMMEDIATE_REPORT","VIEW_PARAMETERS_CHANGED","REMOVAL_SUGGESTED","INSTANCE_IMMEDIATE_REPORT","REGION_OF_INFLUENCE_ACTIVE","REGION_OF_INFLUENCE_INACTIVE","STENCIL_MASK","TEXT_MESSAGE","DRAW_LINE_2D","DRAW_LINE_3D","DRAW_BUFFER","OCCLUSION_QUERY_BEGIN","OCCLUSION_QUERY_END","OCCLUSION_QUERY_GET_RESULT","OCCLUSION_QUERY_DRAW_DEPTH_TEST","INSTANCE_DRAW_DEPTH","FLUSH_DEPTH","DEPTH_PASS_BEGIN","DEPTH_PASS_END","COLOR_PASS_BEGIN","COLOR_PASS_END","TILE_BEGIN","TILE_END","FLUSH_GPU_COMMAND_BUFFER","_Tr2VisibilityResults","Tr2VisibilityResults","CjsModel","e","_initProto","c","_initClass","_applyDecs","type","define","className","family","carbon","method","impl","adapted","implemented","AddVisibilityEvent","event","push","GetEvents","slice","Clear","length","GetNumVisibilityEvents"],"mappings":";;;;;;;;AASA;AACA;AACA;AACA;AACA;AACO,MAAMA,kBAAkB,CAC/B;AAEEC,EAAAA,QAAQ,GAA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EAAJA,IAAI,CAACE,WAAW,CAAA,EAAA,EAAA,EAAA,wBAAA,CAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAhCuBd,QAAQ,CAAA;AAAA;AAGhD;AACA,EAAA,OAAO,IAAAE,UAAA,CAAA,IAAA,CAAA,EAAG,EAAE;;AAEZ;EAGAa,kBAAkBA,CAACC,KAAK,EACxB;AACE,IAAA,IAAI,CAAC,OAAO,CAACC,IAAI,CAACD,KAAK,CAAC;AAC1B,EAAA;;AAEA;AAGAE,EAAAA,SAASA,GACT;AACE,IAAA,OAAO,IAAI,CAAC,OAAO,CAACC,KAAK,EAAE;AAC7B,EAAA;;AAEA;AAGAC,EAAAA,KAAKA,GACL;AACE,IAAA,IAAI,CAAC,OAAO,CAACC,MAAM,GAAG,CAAC;AACzB,EAAA;;AAEA;AAGAC,EAAAA,sBAAsBA,GACtB;AACE,IAAA,OAAO,IAAI,CAAC,OAAO,CAACD,MAAM;AAC5B,EAAA;AAAC,EAAA;IAAAjB,UAAA,EAAA;AAAA;AAEH;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tr2RingBuffer.js","sources":["../../../../../src/trinity/core/device/Tr2RingBuffer.js"],"sourcesContent":["// Source: trinity/trinity/Tr2RingBuffer.h\n// Source: trinity/trinity/Tr2RingBuffer.cpp\n//\n// One shared arena that many objects upload per-frame rows into, and a small\n// per-consumer cursor that remembers where this frame's rows and last frame's\n// rows landed.\n//\n// WHY A RING AND NOT A BUFFER EACH. Every booster set, every morph target, every\n// skinned thing wants a handful of rows on the GPU each frame. A buffer each\n// means an allocation each; one ring means one allocation and an offset each.\n// The offset is what a shader is handed.\n//\n// WHY TWO OBJECTS, which is the part worth reading twice. `Tr2RingBuffer` is the\n// arena and there is one per DATA TYPE. `Tr2RingBufferOffsets` is the cursor and\n// there is one per CONSUMER, held by value. The cursor keeps the PREVIOUS\n// frame's offset as well as this frame's, which is what a pass reading last\n// frame's transforms needs - motion vectors, trails, anything comparing two\n// frames. Collapsing the two into \"upload and get an offset back\" works today\n// and quietly loses that.\n//\n// THE FRAME FENCE IS THE WHOLE DESIGN. Rows uploaded for a frame cannot be\n// overwritten until the GPU has finished that frame, so the ring records a\n// locked region per upload and only moves its tail past regions whose frame the\n// device reports complete. `SetFrameNumbers` is deliberately pessimistic - it\n// clamps \"completed\" to two frames behind \"recording\" no matter what it is\n// told.\n//\n// THREE DIFFERENCES FROM CARBON, EACH FORCED:\n//\n// - Carbon reaches a process-wide render context through a macro; we have none,\n// so the context is supplied to `GetInstance` and kept. Same reason\n// `TriDevice`'s capability methods are still unimplemented.\n// - Carbon drives the fence from EveSpaceScene::Update, which reaches the\n// process-wide render context (`EveSpaceScene.cpp:441-445`). We have no\n// process-wide context, so nothing ticks a ring per frame yet and a caller\n// must drive `SetFrameNumbers` itself. The seeding at creation IS Carbon's.\n// - Carbon's `SetFrameNumbers` erases consumed locked regions only when it finds\n// an incomplete one, so a ring whose regions all complete erases none and the\n// list grows for the life of the process. That is survivable in a game\n// session and is not in a browser tab, so the consumed prefix is erased in\n// both cases. The tail it computes is identical either way.\n\nimport { carbon, impl, io, type } from \"#schema\";\nimport { CjsModel } from \"#model\";\nimport { Tr2BufferALStub, Tr2BufferDescriptionAL } from \"../../../trinityal/index.js\";\nimport { Tr2CpuUsage, Tr2GpuUsage } from \"#consts/render-context\";\n\n\nfunction failRing(message)\n{\n const error = new Error(`Tr2RingBuffer: ${message}`);\n error.code = \"CJS_RING_BUFFER_INVALID\";\n throw error;\n}\n\n\n/** Carbon's `INITIAL_SIZE` (`Tr2RingBuffer.cpp:8`), in ELEMENTS rather than bytes. */\nconst INITIAL_SIZE = 16 * 1024;\n\n/** Carbon's `Tr2RingBufferOffsets::INVALID_OFFSET`. */\nconst INVALID_OFFSET = 0xffffffff;\n\n\n/**\n * Where one consumer's rows landed, this frame and last.\n *\n * Held by value in Carbon, so each consumer owns one rather than sharing.\n */\nexport class Tr2RingBufferOffsets\n{\n /** Carbon's `INVALID_OFFSET`; the \"nothing uploaded\" state, and a no-draw. */\n static INVALID_OFFSET = INVALID_OFFSET;\n\n /** m_currentFrameOffset */\n #currentFrameOffset = INVALID_OFFSET;\n\n /** m_previousFrameOffset */\n #previousFrameOffset = INVALID_OFFSET;\n\n /**\n * Where this frame's rows start, in elements.\n *\n * @returns {number} The offset, or `INVALID_OFFSET` before an upload.\n */\n GetCurrentFrameOffset()\n {\n return this.#currentFrameOffset;\n }\n\n /**\n * Where last frame's rows start, in elements.\n *\n * @returns {number} The offset, or `INVALID_OFFSET` before a second frame.\n */\n GetPreviousFrameOffset()\n {\n return this.#previousFrameOffset;\n }\n\n /**\n * Uploads this consumer's rows, ONCE per frame.\n *\n * The early return is the interesting line: a second upload in the same frame\n * is ignored rather than appended, so an object updated twice does not eat\n * the ring twice. `AdvanceFrame` is what re-arms it.\n *\n * @param {Tr2RingBuffer} buffer The arena for this data type.\n * @param {ArrayBufferView} transforms The packed rows.\n * @param {number} count How many rows.\n * @returns {void}\n */\n UploadTransforms(buffer, transforms, count)\n {\n if (this.#currentFrameOffset !== INVALID_OFFSET) return;\n\n this.#currentFrameOffset = buffer.UploadTransforms(transforms, count);\n\n // First frame: last frame's rows are this frame's, so a shader reading the\n // previous offset reads something valid rather than nothing.\n if (this.#previousFrameOffset === INVALID_OFFSET)\n {\n this.#previousFrameOffset = this.#currentFrameOffset;\n }\n }\n\n /**\n * Rolls this frame's offset into last frame's and re-arms the upload.\n *\n * @returns {void}\n */\n AdvanceFrame()\n {\n this.#previousFrameOffset = this.#currentFrameOffset;\n this.#currentFrameOffset = INVALID_OFFSET;\n }\n}\n\n\n/**\n * One upload arena per data type, fenced by frame.\n */\n@type.define({ className: \"Tr2RingBuffer\", family: \"trinityCore\" })\nexport class Tr2RingBuffer extends CjsModel\n{\n /** One arena per data type, as Carbon's typed `GetInstance` gives. */\n static #instances = new Map();\n\n /** m_name */\n @io.persist\n @type.string\n name = \"\";\n\n /** m_stride - bytes per element; every upload must match it. */\n @io.persist\n @type.uint32\n stride = 0;\n\n /** m_size - capacity in ELEMENTS, not bytes. */\n @io.read\n @type.uint32\n size = 0;\n\n /** m_head - where the next upload lands, in elements. */\n @io.read\n @type.uint32\n head = 0;\n\n /** m_tail - the oldest element the GPU may still be reading. */\n @io.read\n @type.uint32\n tail = 0;\n\n /** m_frame - the frame being recorded. */\n #frame = 0;\n\n /** m_mirror - the CPU copy, and the authority until a backend uploads it. */\n #mirror = new Uint8Array(0);\n\n /** m_buffer */\n #buffer = null;\n\n /** m_dirtyRegions[2] - what changed since the last PrepareBuffer. */\n #dirtyRegions = [ { offset: 0, size: 0 }, { offset: 0, size: 0 } ];\n\n /** m_lockedRegions - uploads the GPU may still be reading, by frame. */\n #lockedRegions = [];\n\n /** The render context this ring creates and updates its buffer through. */\n #renderContext = null;\n\n /**\n * The arena for one data type, created on first ask.\n *\n * Carbon keys this on the C++ type (`GetInstance<T>`); a key and a stride say\n * the same thing here, and the stride is checked on every ask so two callers\n * cannot disagree about what a row is.\n *\n * @param {string} key Names the data type, e.g. \"ChildBoosterInstance\".\n * @param {number} stride Bytes per row.\n * @param {object} renderContext The context to create the buffer through.\n * @returns {Tr2RingBuffer} The arena.\n */\n static GetInstance(key, stride, renderContext)\n {\n if (typeof key !== \"string\" || !key) failRing(\"an instance needs a data-type key\");\n if (!Number.isInteger(stride) || stride <= 0) failRing(`${key} needs a positive stride`);\n\n const existing = Tr2RingBuffer.#instances.get(key);\n\n if (existing)\n {\n if (existing.stride !== stride)\n {\n failRing(`${key} was created with stride ${existing.stride}, not ${stride}`);\n }\n\n return existing;\n }\n\n const created = new Tr2RingBuffer();\n\n created.stride = stride;\n created.SetName(key);\n created.#renderContext = renderContext;\n\n // Carbon seeds the fence from the context before the first sizing\n // (`Tr2RingBuffer.cpp:121`), so a ring created mid-session does not think\n // every frame ever recorded is still in flight.\n created.SetFrameNumbers(renderContext.GetRecordingFrameNumber(), renderContext.GetRenderedFrameNumber());\n created.Resize(INITIAL_SIZE);\n\n Tr2RingBuffer.#instances.set(key, created);\n\n return created;\n }\n\n /** Forgets every arena. Test and teardown only; Carbon's are process-lived. */\n static ResetInstances()\n {\n Tr2RingBuffer.#instances.clear();\n }\n\n /**\n * Names the ring, and its buffer if one exists.\n *\n * @param {string} name The debug label.\n * @returns {void}\n */\n @carbon.method\n @impl.implemented\n SetName(name)\n {\n this.name = name;\n\n if (this.#buffer && this.#buffer.IsValid()) this.#buffer.SetName(name);\n }\n\n /**\n * The backend buffer these rows live in.\n *\n * @returns {object|null} The buffer, or null before the first size.\n */\n @carbon.method\n @impl.implemented\n GetGpuBuffer()\n {\n return this.#buffer;\n }\n\n /**\n * Copies rows in and returns where they landed, in elements.\n *\n * TWO RING RULES, IN CARBON'S ORDER. When the head is ahead of the tail and\n * the rows will not fit before the end, it wraps to zero. When the head is\n * BEHIND the tail and would reach it, the ring is full of frames the GPU may\n * still be reading, so it doubles instead of overwriting them.\n *\n * @param {ArrayBufferView} data The packed rows.\n * @param {number} count How many rows.\n * @returns {number} The element offset the rows landed at.\n */\n @carbon.method\n @impl.implemented\n UploadTransforms(data, count)\n {\n if (!ArrayBuffer.isView(data)) failRing(\"UploadTransforms needs a typed array of rows\");\n if (!Number.isInteger(count) || count < 0) failRing(\"UploadTransforms needs a row count\");\n\n const bytes = count * this.stride;\n\n if (data.byteLength < bytes)\n {\n failRing(`${count} rows of ${this.stride} bytes need ${bytes}, and ${data.byteLength} were given`);\n }\n\n if (this.head >= this.tail && this.head + count > this.size) this.head = 0;\n\n if (this.head < this.tail && this.head + count >= this.tail) this.Resize(this.size * 2);\n\n this.#mirror.set(new Uint8Array(data.buffer, data.byteOffset, bytes), this.head * this.stride);\n\n // The two regions exist so a wrap can be described without a third: one run\n // ends at the head, or the other does. Neither means the head moved without\n // this ring being told, which is a caller writing behind its back.\n const first = this.#dirtyRegions[0];\n const second = this.#dirtyRegions[1];\n\n if (first.offset + first.size === this.head) first.size += count;\n else if (second.offset + second.size === this.head) second.size += count;\n else failRing(\"neither dirty region ends at the head; the ring was written to behind its back\");\n\n const offset = this.head;\n\n this.head += count;\n\n return offset;\n }\n\n /**\n * Pushes what changed to the backend and locks it for this frame.\n *\n * @param {object} renderContext The context to update through.\n * @returns {void}\n */\n @carbon.method\n @impl.implemented\n PrepareBuffer(renderContext)\n {\n for (const region of this.#dirtyRegions)\n {\n if (!region.size) continue;\n\n this.#buffer.UpdateBuffer(\n region.offset * this.stride,\n region.size * this.stride,\n this.#mirror.subarray(region.offset * this.stride, (region.offset + region.size) * this.stride),\n renderContext\n );\n\n this.#lockedRegions.push({ frame: this.#frame, tail: region.offset + region.size });\n }\n\n this.#dirtyRegions[0] = { offset: this.head, size: 0 };\n this.#dirtyRegions[1] = { offset: 0, size: 0 };\n }\n\n /**\n * Moves the tail past every upload the device has finished with.\n *\n * CARBON DISTRUSTS THE COMPLETED NUMBER and clamps it to two frames behind\n * the one being recorded, whatever it is told. Freeing a frame the GPU is\n * still reading corrupts it, and the cost of being late is a slightly larger\n * ring.\n *\n * @param {number} recordingFrame The frame being recorded.\n * @param {number} completedFrame The frame the device reports finished.\n * @returns {void}\n */\n @carbon.method\n @impl.implemented\n SetFrameNumbers(recordingFrame, completedFrame)\n {\n this.#frame = recordingFrame;\n\n const completed = Math.min(completedFrame, recordingFrame - 2);\n let consumed = 0;\n\n for (const region of this.#lockedRegions)\n {\n if (region.frame > completed) break;\n\n this.tail = region.tail;\n consumed += 1;\n }\n\n // See the head comment: Carbon erases only when it stops early, so a ring\n // whose regions all complete never erases any. Same tail, bounded list.\n if (consumed) this.#lockedRegions.splice(0, consumed);\n }\n\n /**\n * Grows the ring, keeping what it already holds.\n *\n * Carbon marks the WHOLE old extent dirty and parks the head at the old size\n * with the tail at the new one, so the next upload lands in the fresh space\n * and everything already written is re-uploaded once.\n *\n * @param {number} size The new capacity, in elements.\n * @returns {void}\n */\n @carbon.method\n @impl.implemented\n Resize(size)\n {\n if (!Number.isInteger(size) || size <= 0) failRing(\"a ring needs a positive size\");\n\n const previousSize = this.size;\n const grown = new Uint8Array(size * this.stride);\n\n grown.set(this.#mirror.subarray(0, Math.min(this.#mirror.length, grown.length)));\n\n this.#dirtyRegions[0] = { offset: 0, size: previousSize };\n this.#dirtyRegions[1] = { offset: 0, size: 0 };\n this.#lockedRegions.length = 0;\n this.#mirror = grown;\n this.head = previousSize;\n this.size = size;\n this.tail = size;\n\n this.#CreateBuffer(null);\n }\n\n /**\n * Recreates the backend buffer from the mirror after a device loss.\n *\n * @returns {boolean} True.\n */\n @carbon.method\n @impl.implemented\n OnPrepareResources()\n {\n if (this.#mirror.length && !(this.#buffer && this.#buffer.IsValid())) this.#CreateBuffer(this.#mirror);\n\n return true;\n }\n\n /**\n * Creates the backend buffer at the current size.\n *\n * WRITE_OFTEN and NON_SYNCRONIZED_WRITE are Carbon's, and they are what a\n * ring is: written every frame, and never waited on, because the frame fence\n * already guarantees nobody is reading what is being written.\n */\n #CreateBuffer(initialData)\n {\n if (!this.#renderContext) failRing(`${this.name} has no render context to create its buffer through`);\n\n if (this.#buffer) this.#buffer.Destroy();\n\n this.#buffer = new Tr2BufferALStub();\n\n const description = Tr2BufferDescriptionAL.FromStride(\n this.stride,\n this.size,\n Tr2GpuUsage.SHADER_RESOURCE,\n Tr2CpuUsage.WRITE_OFTEN | Tr2CpuUsage.NON_SYNCRONIZED_WRITE\n );\n\n this.#buffer.Create(description, initialData, this.#renderContext);\n this.#buffer.SetName(this.name);\n }\n}\n"],"names":["failRing","message","error","Error","code","INITIAL_SIZE","INVALID_OFFSET","Tr2RingBufferOffsets","GetCurrentFrameOffset","GetPreviousFrameOffset","UploadTransforms","buffer","transforms","count","AdvanceFrame","_Tr2RingBuffer","_identity","Tr2RingBuffer","CjsModel","e","_init_name","_init_extra_name","_init_stride","_init_extra_stride","_init_size","_init_extra_size","_init_head","_init_extra_head","_init_tail","_init_extra_tail","_initProto","c","_initClass","_applyDecs","type","define","className","family","io","persist","string","uint32","read","carbon","method","impl","implemented","name","stride","size","head","tail","Uint8Array","offset","GetInstance","key","renderContext","Number","isInteger","existing","get","created","SetName","SetFrameNumbers","GetRecordingFrameNumber","GetRenderedFrameNumber","Resize","set","ResetInstances","clear","IsValid","GetGpuBuffer","data","ArrayBuffer","isView","bytes","byteLength","byteOffset","first","second","PrepareBuffer","region","UpdateBuffer","subarray","push","frame","recordingFrame","completedFrame","completed","Math","min","consumed","splice","previousSize","grown","length","OnPrepareResources","#CreateBuffer","initialData","Destroy","Tr2BufferALStub","description","Tr2BufferDescriptionAL","FromStride","Tr2GpuUsage","SHADER_RESOURCE","Tr2CpuUsage","WRITE_OFTEN","NON_SYNCRONIZED_WRITE","Create","Map","constructor"],"mappings":";;;;;;;;;;;;;AAgDA,SAASA,QAAQA,CAACC,OAAO,EACzB;EACE,MAAMC,KAAK,GAAG,IAAIC,KAAK,CAAC,CAAA,eAAA,EAAkBF,OAAO,EAAE,CAAC;EACpDC,KAAK,CAACE,IAAI,GAAG,yBAAyB;AACtC,EAAA,MAAMF,KAAK;AACb;;AAGA;AACA,MAAMG,YAAY,GAAG,EAAE,GAAG,IAAI;;AAE9B;AACA,MAAMC,cAAc,GAAG,UAAU;;AAGjC;AACA;AACA;AACA;AACA;AACO,MAAMC,oBAAoB,CACjC;AACE;EACA,OAAOD,cAAc,GAAGA,cAAc;;AAEtC;EACA,mBAAmB,GAAGA,cAAc;;AAEpC;EACA,oBAAoB,GAAGA,cAAc;;AAErC;AACF;AACA;AACA;AACA;AACEE,EAAAA,qBAAqBA,GACrB;IACE,OAAO,IAAI,CAAC,mBAAmB;AACjC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEC,EAAAA,sBAAsBA,GACtB;IACE,OAAO,IAAI,CAAC,oBAAoB;AAClC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,gBAAgBA,CAACC,MAAM,EAAEC,UAAU,EAAEC,KAAK,EAC1C;AACE,IAAA,IAAI,IAAI,CAAC,mBAAmB,KAAKP,cAAc,EAAE;IAE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,IAAI,EACTuD,WAAW,CAACC,eAAe,EAC3BC,WAAW,CAACC,WAAW,GAAGD,WAAW,CAACE,qBACxC,CAAC;AAED,MAAA,IAAI,CAAC,OAAO,CAACC,MAAM,CAACR,WAAW,EAAEH,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC;MAClE,IAAI,CAAC,OAAO,CAACpC,OAAO,CAAC,IAAI,CAACf,IAAI,CAAC;AACjC,IAAA;GACD;AAlTQ,EAAA,UAAU,GAAG,IAAI+D,GAAG,EAAE;EAACC,WAAAA,GAAA;IAAA,KAAA,CAAAhG,cAAA,GAAAiB,UAAA,EAAA;AAAA,EAAA;AAAA,CAAA,EAAA;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tr2SuballocatedBuffer.js","sources":["../../../../../src/trinity/core/device/Tr2SuballocatedBuffer.js"],"sourcesContent":["// Source: trinity/trinity/Tr2SuballocatedBuffer.h\n// trinity/trinity/Tr2SuballocatedBuffer.cpp\n//\n// Carbon's suballocated device buffer: one big `Tr2BufferAL` that many\n// allocations share, so that a mesh's vertices are `(buffer, offset, stride)`\n// rather than a buffer of their own. `TriGeometryRes` keeps ONE of these for\n// the whole process (`TriGeometryRes.cpp:33-38`, 32 MiB blocks), and a render\n// batch carries the shared buffer plus a stride while the allocation's offset\n// rides `baseVertexLocation` / `startIndexLocation` (`Tr2MeshBase.cpp:372-392`).\n//\n// WHERE THIS DIFFERS. Carbon grows by `Expand()`: a bigger buffer, a GPU copy of\n// the old contents, one buffer still. WebGPU can copy buffer to buffer only\n// inside a command encoder, which a load-time allocation does not have, so this\n// grows by adding a BLOCK: a second `Tr2BufferAL` of the block size, and\n// allocations after it carry that block. A batch binds its allocation's own\n// buffer, so nothing above notices - except that two meshes in different\n// blocks cannot share one stream binding, which they could not anyway.\n//\n// Not ported: `Free` (Carbon's virtual allocator reclaims; ours is append-only\n// until the resource that owns the buffer releases it), `MapForReading`.\nimport { Tr2BufferDescriptionAL } from \"../../../trinityal/stub/Tr2BufferALStub.js\";\nimport { Tr2CpuUsage } from \"#consts/render-context\";\nimport { Failed } from \"../../../trinityal/ALResult.js\";\n\n\n/** `SHARED_BUFFER_BLOCK_SIZE` (`TriGeometryRes.h:15`). */\nexport const SHARED_BUFFER_BLOCK_SIZE = 32 * 1024 * 1024;\n\n/** `SHARED_BUFFER_MAX_SIZE` (`TriGeometryRes.h:16`). */\nexport const SHARED_BUFFER_MAX_SIZE = 2048 * 1024 * 1024;\n\n\n/**\n * Carbon's `Tr2SuballocatedBuffer::Allocation`: where in which buffer, at\n * what stride.\n */\nexport class Tr2SuballocatedBufferAllocation\n{\n /** The block's `Tr2BufferAL`. */\n m_buffer = null;\n\n m_offset = 0;\n\n m_size = 0;\n\n m_stride = 0;\n\n m_parent = null;\n\n /** The block's `Tr2BufferAL`. */\n GetBuffer()\n {\n return this.m_buffer;\n }\n\n /** The allocation's first byte within that block. */\n GetOffset()\n {\n return this.m_offset;\n }\n\n /** The allocation's size in bytes. */\n GetSize()\n {\n return this.m_size;\n }\n\n /** Bytes per element, which `GetStartIndex` divides by. */\n GetStride()\n {\n return this.m_stride;\n }\n\n /** `m_offset / m_stride`: the first element, which the draw arguments add. */\n GetStartIndex()\n {\n return this.m_stride ? Math.floor(this.m_offset / this.m_stride) : 0;\n }\n\n /** Whether the allocation names a block and has any size. */\n IsValid()\n {\n return this.m_buffer !== null && this.m_size > 0;\n }\n\n /**\n * Rewrites the allocation, whole or in part.\n *\n * @param {ArrayBufferView} data The bytes.\n * @param {object} renderContext The context to update through.\n * @param {number} [offset] Byte offset within the allocation.\n * @param {number} [size] Bytes to write.\n * @returns {number} An `ALResult` value.\n */\n Update(data, renderContext, offset = 0, size = data.byteLength)\n {\n return this.m_buffer.UpdateBuffer(this.m_offset + offset, size, data, renderContext);\n }\n}\n\n\n/**\n * Carbon's `Tr2SuballocatedBuffer`: one growable pool of device buffer blocks\n * that hands out `Tr2SuballocatedBufferAllocation` slices.\n */\nexport class Tr2SuballocatedBuffer\n{\n m_name = \"\";\n\n m_gpuUsage = 0;\n\n m_blockSize = SHARED_BUFFER_BLOCK_SIZE;\n\n m_maxSize = SHARED_BUFFER_MAX_SIZE;\n\n /** The blocks, each a `Tr2BufferAL` of `m_blockSize` bytes. */\n m_blocks = [];\n\n /** The next free byte in the last block. */\n m_offset = 0;\n\n m_allocations = [];\n\n /**\n * @param {string} name A debug name.\n * @param {number} gpuUsage `Tr2GpuUsage` flags for every block.\n * @param {number} [blockSize] Bytes per block.\n * @param {number} [maxSize] Bytes in total before allocation refuses.\n */\n constructor(name, gpuUsage, blockSize = SHARED_BUFFER_BLOCK_SIZE, maxSize = SHARED_BUFFER_MAX_SIZE)\n {\n this.m_name = String(name ?? \"\");\n this.m_gpuUsage = gpuUsage;\n this.m_blockSize = blockSize;\n this.m_maxSize = maxSize;\n }\n\n /**\n * Reserves `count` elements of `stride` bytes and uploads them.\n *\n * Carbon asserts `offset % stride == 0` (`Tr2SuballocatedBuffer.cpp:24-63`):\n * the offset is element-aligned so `GetStartIndex` is exact. Alignment here\n * is to the least common multiple of the stride and four, which keeps the\n * offset both element-aligned and a legal `writeBuffer` offset.\n *\n * @param {number} stride Bytes per element.\n * @param {number} count Elements.\n * @param {ArrayBufferView|null} data The bytes, or null to reserve only.\n * @param {object} renderContext The context to create and update through.\n * @returns {Tr2SuballocatedBufferAllocation|null} The allocation, or null when refused.\n */\n Allocate(stride, count, data, renderContext)\n {\n if (!Number.isInteger(stride) || stride <= 0 || !Number.isInteger(count) || count <= 0) return null;\n\n const size = stride * count;\n\n if (size > this.m_blockSize) return null;\n\n const alignment = Lcm(stride, 4);\n let offset = Math.ceil(this.m_offset / alignment) * alignment;\n\n if (this.m_blocks.length === 0 || offset + size > this.m_blockSize)\n {\n if ((this.m_blocks.length + 1) * this.m_blockSize > this.m_maxSize) return null;\n if (!this.#AddBlock(renderContext)) return null;\n\n offset = 0;\n }\n\n const allocation = new Tr2SuballocatedBufferAllocation();\n\n allocation.m_buffer = this.m_blocks[this.m_blocks.length - 1];\n allocation.m_offset = offset;\n allocation.m_size = size;\n allocation.m_stride = stride;\n allocation.m_parent = this;\n\n this.m_offset = offset + size;\n this.m_allocations.push(allocation);\n\n if (data && Failed(allocation.Update(data, renderContext)))\n {\n this.m_allocations.pop();\n\n return null;\n }\n\n return allocation;\n }\n\n /** Carbon's `OnPrepareResources`: the block is a stride-4 byte pool. */\n #AddBlock(renderContext)\n {\n const description = Tr2BufferDescriptionAL.FromStride(4, this.m_blockSize / 4, this.m_gpuUsage, Tr2CpuUsage.WRITE);\n const block = renderContext.CreateBuffer(description, null);\n\n if (!block) return false;\n\n block.SetName(`${this.m_name} block ${this.m_blocks.length}`);\n this.m_blocks.push(block);\n this.m_offset = 0;\n\n return true;\n }\n\n /** The most recent block, Carbon's one buffer. */\n GetBuffer()\n {\n return this.m_blocks[this.m_blocks.length - 1] ?? null;\n }\n\n /** Every block this buffer has made. */\n GetBlocks()\n {\n return this.m_blocks;\n }\n\n /** Releases every block and forgets every allocation. */\n ReleaseResources()\n {\n for (const block of this.m_blocks) block.Destroy();\n\n this.m_blocks = [];\n this.m_offset = 0;\n\n for (const allocation of this.m_allocations)\n {\n allocation.m_buffer = null;\n allocation.m_size = 0;\n }\n\n this.m_allocations = [];\n }\n}\n\n\nfunction Gcd(a, b)\n{\n while (b) [ a, b ] = [ b, a % b ];\n\n return a;\n}\n\nfunction Lcm(a, b)\n{\n return (a * b) / Gcd(a, b);\n}\n"],"names":["SHARED_BUFFER_BLOCK_SIZE","SHARED_BUFFER_MAX_SIZE","Tr2SuballocatedBufferAllocation","m_buffer","m_offset","m_size","m_stride","m_parent","GetBuffer","GetOffset","GetSize","GetStride","GetStartIndex","Math","floor","IsValid","Update","data","renderContext","offset","size","byteLength","UpdateBuffer","Tr2SuballocatedBuffer","m_name","m_gpuUsage","m_blockSize","m_maxSize","m_blocks","m_allocations","constructor","name","gpuUsage","blockSize","maxSize","String","Allocate","stride","count","Number","isInteger","alignment","Lcm","ceil","length","allocation","push","Failed","pop","#AddBlock","description","Tr2BufferDescriptionAL","FromStride","Tr2CpuUsage","WRITE","block","CreateBuffer","SetName","GetBlocks","ReleaseResources","Destroy","Gcd","a","b"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;MACaA,wBAAwB,GAAG,EAAE,GAAG,IAAI,GAAG;;AAEpD;MACaC,sBAAsB,GAAG,IAAI,GAAG,IAAI,GAAG;;AAGpD;AACA;AACA;AACA;AACO,MAAMC,+BAA+B,CAC5C;AACE;AACAC,EAAAA,QAAQ,GAAG,IAAI;AAEfC,EAAAA,QAAQ,GAAG,CAAC;AAEZC,EAAAA,MAAM,GAAG,CAAC;AAEVC,EAAAA,QAAQ,GAAG,CAAC;AAEZC,EAAAA,QAAQ,GAAG,IAAI;;AAEf;AACAC,EAAAA,SAASA,GACT;IACE,OAAO,IAAI,CAACL,QAAQ;AACtB,EAAA;;AAEA;AACAM,EAAAA,SAASA,GACT;IACE,OAAO,IAAI,CAACL,QAAQ;AACtB,EAAA;;AAEA;AACAM,EAAAA,OAAOA,GACP;IACE,OAAO,IAAI,CAACL,MAAM;AACpB,EAAA;;AAEA;AACAM,EAAAA,SAASA,GACT;IACE,OAAO,IAAI,CAACL,QAAQ;AACtB,EAAA;;AAEA;AACAM,EAAAA,aAAaA,GACb;AACE,IAAA,OAAO,IAAI,CAACN,QAAQ,GAAGO,IAAI,CAACC,KAAK,CAAC,IAAI,CAACV,QAAQ,GAAG,IAAI,CAACE,QAAQ,CAAC,GAAG,CAAC;AACtE,EAAA;;AAEA;AACAS,EAAAA,OAAOA,GACP;IACE,OAAO,IAAI,CAACZ,QAAQ,KAAK,IAAI,IAAI,IAAI,CAACE,MAAM,GAAG,CAAC;AAClD,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEW,EAAAA,MAAMA,CAACC,IAAI,EAAEC,aAAa,EAAEC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U,CAACxC,MAAM,GAAG,CAAC;AACvB,IAAA;IAEA,IAAI,CAACwB,aAAa,GAAG,EAAE;AACzB,EAAA;AACF;AAGA,SAASgC,GAAGA,CAACC,CAAC,EAAEC,CAAC,EACjB;AACE,EAAA,OAAOA,CAAC,EAAE,CAAED,CAAC,EAAEC,CAAC,CAAE,GAAG,CAAEA,CAAC,EAAED,CAAC,GAAGC,CAAC,CAAE;AAEjC,EAAA,OAAOD,CAAC;AACV;AAEA,SAASpB,GAAGA,CAACoB,CAAC,EAAEC,CAAC,EACjB;EACE,OAAQD,CAAC,GAAGC,CAAC,GAAIF,GAAG,CAACC,CAAC,EAAEC,CAAC,CAAC;AAC5B;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ITr2ImpostorSource.js","sources":["../../../../../src/trinity/core/mesh/ITr2ImpostorSource.js"],"sourcesContent":["// Source: trinity/trinity/Tr2ImpostorManager.h\nimport { vec3 } from \"#math/vec3\";\nimport { CjsModel } from \"#model\";\nimport { CjsSchema, impl, type } from \"#schema\";\n\n\nconst ITR2_IMPOSTOR_SOURCE = Symbol.for(\"carbonenginejs.contract.ITr2ImpostorSource\");\n\n\n/** Camera directions used to decide when an impostor must be recaptured. */\n@type.define({ className: \"ITr2ImpostorSourceImpostorHash\", family: \"trinityCore\" })\nexport class ITr2ImpostorSourceImpostorHash extends CjsModel\n{\n @type.vec3\n viewDir = vec3.create();\n\n @type.vec3\n upDir = vec3.create();\n}\n\n\n/** Contract for an object that can be captured into an impostor atlas. */\nexport class ITr2ImpostorSource\n{\n static [Symbol.hasInstance](value)\n {\n return value !== null && value !== undefined && value[ITR2_IMPOSTOR_SOURCE] === true;\n }\n\n /** Writes the source's current local-to-world transform into `out`. */\n GetLocalToWorldTransform(_out)\n {\n throw new Error(\"ITr2ImpostorSource.GetLocalToWorldTransform must be implemented by an impostor source.\");\n }\n\n /** Collects the batches used to capture this source into an impostor. */\n GetImpostorBatches(_frustum, _batches)\n {\n throw new Error(\"ITr2ImpostorSource.GetImpostorBatches must be implemented by an impostor source.\");\n }\n\n /** Scores how urgently a changed view hash should be recaptured. */\n GetRenderPriority(_oldHash, _newHash)\n {\n throw new Error(\"ITr2ImpostorSource.GetRenderPriority must be implemented by an impostor source.\");\n }\n\n /** Writes the source's current impostor bounding sphere into `out`. */\n GetImpostorBoundingSphere(_out)\n {\n throw new Error(\"ITr2ImpostorSource.GetImpostorBoundingSphere must be implemented by an impostor source.\");\n }\n\n /** Writes the bounding sphere used for the previous impostor capture. */\n GetLastImpostorBoundingSphere(_out)\n {\n throw new Error(\"ITr2ImpostorSource.GetLastImpostorBoundingSphere must be implemented by an impostor source.\");\n }\n}\n\nObject.defineProperty(ITr2ImpostorSource.prototype, ITR2_IMPOSTOR_SOURCE, { value: true });\nfor (const method of [\n \"GetLocalToWorldTransform\",\n \"GetImpostorBatches\",\n \"GetRenderPriority\",\n \"GetImpostorBoundingSphere\",\n \"GetLastImpostorBoundingSphere\"\n])\n{\n CjsSchema.decorateMethod(ITr2ImpostorSource, method, impl.abstract);\n}\nCjsSchema.define(ITr2ImpostorSource, { className: \"ITr2ImpostorSource\" });\n\n\n/** Adds the ITr2ImpostorSource contract without replacing an existing base. */\nexport function withITr2ImpostorSource(Base)\n{\n const Provider = class extends Base\n {\n GetLocalToWorldTransform(out)\n {\n return ITr2ImpostorSource.prototype.GetLocalToWorldTransform.call(this, out);\n }\n\n GetImpostorBatches(frustum, batches)\n {\n return ITr2ImpostorSource.prototype.GetImpostorBatches.call(this, frustum, batches);\n }\n\n GetRenderPriority(oldHash, newHash)\n {\n return ITr2ImpostorSource.prototype.GetRenderPriority.call(this, oldHash, newHash);\n }\n\n GetImpostorBoundingSphere(out)\n {\n return ITr2ImpostorSource.prototype.GetImpostorBoundingSphere.call(this, out);\n }\n\n GetLastImpostorBoundingSphere(out)\n {\n return ITr2ImpostorSource.prototype.GetLastImpostorBoundingSphere.call(this, out);\n }\n };\n\n Object.defineProperty(Provider.prototype, ITR2_IMPOSTOR_SOURCE, { value: true });\n for (const method of [\n \"GetLocalToWorldTransform\",\n \"GetImpostorBatches\",\n \"GetRenderPriority\",\n \"GetImpostorBoundingSphere\",\n \"GetLastImpostorBoundingSphere\"\n ])\n {\n CjsSchema.decorateMethod(Provider, method, impl.abstract);\n }\n return Provider;\n}\n"],"names":["ITR2_IMPOSTOR_SOURCE","Symbol","for","_ITr2ImpostorSourceIm","ITr2ImpostorSourceImpostorHash","CjsModel","e","_init_viewDir","_init_extra_viewDir","_init_upDir","_init_extra_upDir","c","_initClass","_applyDecs","type","define","className","family","vec3","constructor","args","viewDir","create","upDir","ITr2ImpostorSource","hasInstance","value","undefined","GetLocalToWorldTransform","_out","Error","GetImpostorBatches","_frustum","_batches","GetRenderPriority","_oldHash","_newHash","GetImpostorBoundingSphere","GetLastImpostorBoundingSphere","Object","defineProperty","prototype","method","CjsSchema","decorateMethod","impl","abstract","withITr2ImpostorSource","Base","Provider","out","call","frustum","batches","oldHash","newHash"],"mappings":";;;;;;AAMA,MAAMA,oBAAoB,GAAGC,MAAM,CAACC,GAAG,CAAC,4CAA4C,CAAC;;AAGrF;AAAA,IAAAC;AACA,MAAAC,8BAAA,SACoDC,QAAQ,CAC5D;AAAA,EAAA;AAAA,IAAA,CAAA;AAAAC,MAAAA,CAAA,GAAAC,aAAA,EAAAC,mBAAA,EAAAC,WAAA,EAAAC,iBAAA,CAAA;MAAAC,CAAA,EAAA,CAAAR,qBAAA,EAAAS,UAAA;AAAA,KAAA,GAAAC,cAAA,CAAA,IAAA,EAAA,CAFCC,IAAI,CAACC,MAAM,CAAC;AAAEC,MAAAA,SAAS,EAAE,gCAAgC;AAAEC,MAAAA,MAAM,EAAE;AAAc,KAAC,CAAC,CAAA,EAAA,CAAA,CAAA,CAGjFH,IAAI,EAAJA,IAAI,CAACI,IAAI,CAAA,EAAA,EAAA,EAAA,SAAA,CAAA,EAAA,CAAA,CAGTJ,IAAI,EAAJA,IAAI,CAACI,IAAI,6BALwCb,QAAQ,CAAA;AAAA;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AA;GACD;EAEDX,MAAM,CAACC,cAAc,CAACS,QAAQ,CAACR,SAAS,EAAEzC,oBAAoB,EAAE;AAAE0B,IAAAA,KAAK,EAAE;AAAK,GAAC,CAAC;AAChF,EAAA,KAAK,MAAMgB,MAAM,IAAI,CACnB,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,2BAA2B,EAC3B,+BAA+B,CAChC,EACD;IACEC,SAAS,CAACC,cAAc,CAACK,QAAQ,EAAEP,MAAM,EAAEG,IAAI,CAACC,QAAQ,CAAC;AAC3D,EAAA;AACA,EAAA,OAAOG,QAAQ;AACjB;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ITr2InstanceData.js","sources":["../../../../../src/trinity/core/mesh/ITr2InstanceData.js"],"sourcesContent":["// Source: trinity/trinity/Include/ITr2InstanceData.h\nimport { CjsModel } from \"#model\";\nimport { CjsSchema, impl, type } from \"#schema\";\n\n\nconst ITR2_INSTANCE_DATA = Symbol.for(\"carbonenginejs.contract.ITr2InstanceData\");\n\n\n/** One realized instance-buffer slice returned by an ITr2InstanceData provider. */\n@type.define({ className: \"ITr2InstanceDataInstanceData\", family: \"trinityCore\" })\nexport class ITr2InstanceDataInstanceData extends CjsModel\n{\n @type.rawStruct(\"Tr2BufferAL\")\n buffer = null;\n\n @type.uint32\n offset = 0;\n\n @type.uint32\n stride = 0;\n\n @type.uint32\n count = 0;\n}\n\n\n/** Contract for a provider of instance-stream data and layout metadata. */\nexport class ITr2InstanceData\n{\n static [Symbol.hasInstance](value)\n {\n return value !== null && value !== undefined && value[ITR2_INSTANCE_DATA] === true;\n }\n\n /** Whether the provider's instance stream is ready for batch collection. */\n IsInstanceDataReady()\n {\n throw new Error(\"ITr2InstanceData.IsInstanceDataReady must be implemented by an instance-data provider.\");\n }\n\n /** Returns one realized instance-buffer slice for a screen-size selection. */\n GetInstanceData(_bufferIndex, _screenSize)\n {\n throw new Error(\"ITr2InstanceData.GetInstanceData must be implemented by an instance-data provider.\");\n }\n\n /** Returns the vertex declaration for one instance buffer. */\n GetInstanceBufferVertexDeclaration(_bufferIndex)\n {\n throw new Error(\"ITr2InstanceData.GetInstanceBufferVertexDeclaration must be implemented by an instance-data provider.\");\n }\n\n /** Returns the local bounding box represented by one instance buffer. */\n GetInstanceBufferBoundingBox(_bufferIndex)\n {\n throw new Error(\"ITr2InstanceData.GetInstanceBufferBoundingBox must be implemented by an instance-data provider.\");\n }\n}\n\nObject.defineProperty(ITr2InstanceData.prototype, ITR2_INSTANCE_DATA, { value: true });\nfor (const method of [\n \"IsInstanceDataReady\",\n \"GetInstanceData\",\n \"GetInstanceBufferVertexDeclaration\",\n \"GetInstanceBufferBoundingBox\"\n])\n{\n CjsSchema.decorateMethod(ITr2InstanceData, method, impl.abstract);\n}\nCjsSchema.define(ITr2InstanceData, { className: \"ITr2InstanceData\" });\n\n\n/** Adds the ITr2InstanceData contract without replacing an existing base. */\nexport function withITr2InstanceData(Base)\n{\n const Provider = class extends Base\n {\n IsInstanceDataReady()\n {\n return ITr2InstanceData.prototype.IsInstanceDataReady.call(this);\n }\n\n GetInstanceData(bufferIndex, screenSize)\n {\n return ITr2InstanceData.prototype.GetInstanceData.call(this, bufferIndex, screenSize);\n }\n\n GetInstanceBufferVertexDeclaration(bufferIndex)\n {\n return ITr2InstanceData.prototype.GetInstanceBufferVertexDeclaration.call(this, bufferIndex);\n }\n\n GetInstanceBufferBoundingBox(bufferIndex)\n {\n return ITr2InstanceData.prototype.GetInstanceBufferBoundingBox.call(this, bufferIndex);\n }\n };\n\n Object.defineProperty(Provider.prototype, ITR2_INSTANCE_DATA, { value: true });\n for (const method of [\n \"IsInstanceDataReady\",\n \"GetInstanceData\",\n \"GetInstanceBufferVertexDeclaration\",\n \"GetInstanceBufferBoundingBox\"\n ])\n {\n CjsSchema.decorateMethod(Provider, method, impl.abstract);\n }\n return Provider;\n}\n"],"names":["ITR2_INSTANCE_DATA","Symbol","for","_ITr2InstanceDataInst","ITr2InstanceDataInstanceData","CjsModel","e","_init_buffer","_init_extra_buffer","_init_offset","_init_extra_offset","_init_stride","_init_extra_stride","_init_count","_init_extra_count","c","_initClass","_applyDecs","type","define","className","family","rawStruct","uint32","constructor","args","buffer","offset","stride","count","ITr2InstanceData","hasInstance","value","undefined","IsInstanceDataReady","Error","GetInstanceData","_bufferIndex","_screenSize","GetInstanceBufferVertexDeclaration","GetInstanceBufferBoundingBox","Object","defineProperty","prototype","method","CjsSchema","decorateMethod","impl","abstract","withITr2InstanceData","Base","Provider","call","bufferIndex","screenSize"],"mappings":";;;;;AAKA,MAAMA,kBAAkB,GAAGC,MAAM,CAACC,GAAG,CAAC,0CAA0C,CAAC;;AAGjF;AAAA,IAAAC;AACA,MAAAC,4BAAA,SACkDC,QAAQ,CAC1D;AAAA,EAAA;AAAA,IAAA,CAAA;AAAAC,MAAAA,CAAA,EAAA,CAAAC,YAAA,EAAAC,kBAAA,EAAAC,YAAA,EAAAC,kBAAA,EAAAC,YAAA,EAAAC,kBAAA,EAAAC,WAAA,EAAAC,iBAAA,CAAA;MAAAC,CAAA,EAAA,CAAAZ,qBAAA,EAAAa,UAAA;AAAA,KAAA,GAAAC,cAAA,CAAA,IAAA,EAAA,CAFCC,IAAI,CAACC,MAAM,CAAC;AAAEC,MAAAA,SAAS,EAAE,8BAA8B;AAAEC,MAAAA,MAAM,EAAE;KAAe,CAAC,CAAA,EAAA,CAAA,CAG/EH,IAAI,CAACI,SAAS,CAAC,aAAa,CAAC,EAAA,CAAA,EAAA,QAAA,CAAA,EAAA,CAAA,CAG7BJ,IAAI,EAAJA,IAAI,CAACK,MAAM,CAAA,EAAA,EAAA,EAAA,QAAA,CAAA,EAAA,CAAA,CAGXL,IAAI,EAAJA,IAAI,CAACK,MAAM,CAAA,EAAA,EAAA,EAAA,QAAA,CAAA,EAAA,CAAA,CAGXL,IAAI,EAAJA,IAAI,CAACK,MAAM,CAAA,EAAA,EAAA,EAAA,OAAA,CAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAXoCl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