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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (384) hide show
  1. package/dist/global/blue/BlueClasses.js +200 -0
  2. package/dist/global/blue/BlueClasses.js.map +1 -0
  3. package/dist/global/blue/IBlueClasses.js +79 -0
  4. package/dist/global/blue/IBlueClasses.js.map +1 -0
  5. package/dist/global/blue/IBlueDynamicResourceConstructor.js +16 -0
  6. package/dist/global/blue/IBlueDynamicResourceConstructor.js.map +1 -1
  7. package/dist/global/blue/blue.js +8 -2
  8. package/dist/global/blue/blue.js.map +1 -1
  9. package/dist/global/blue/index.js +2 -0
  10. package/dist/global/blue/index.js.map +1 -1
  11. package/dist/global/consts/index.js +0 -1
  12. package/dist/global/consts/index.js.map +1 -1
  13. package/dist/global/consts/renderContext/formats.js +26 -25
  14. package/dist/global/consts/renderContext/formats.js.map +1 -1
  15. package/dist/{trinityal/Tr2BitmapDimensions.js → global/imageio/BitmapDimensions.js} +19 -15
  16. package/dist/global/imageio/BitmapDimensions.js.map +1 -0
  17. package/dist/global/imageio/Cutout.js +28 -0
  18. package/dist/global/imageio/Cutout.js.map +1 -0
  19. package/dist/global/imageio/HostBitmap.js +1106 -0
  20. package/dist/global/imageio/HostBitmap.js.map +1 -0
  21. package/dist/global/imageio/ImageIOResult.js +99 -0
  22. package/dist/global/imageio/ImageIOResult.js.map +1 -0
  23. package/dist/global/imageio/ImageUtility.js +205 -0
  24. package/dist/global/imageio/ImageUtility.js.map +1 -0
  25. package/dist/global/imageio/LoadParameters.js +86 -0
  26. package/dist/global/imageio/LoadParameters.js.map +1 -0
  27. package/dist/global/imageio/Metadata.js +22 -0
  28. package/dist/global/imageio/Metadata.js.map +1 -0
  29. package/dist/global/imageio/index.js +8 -0
  30. package/dist/global/{consts/webgpu → imageio}/index.js.map +1 -1
  31. package/dist/global/index.js +2 -1
  32. package/dist/global/index.js.map +1 -1
  33. package/dist/global/math/color.js +1 -1
  34. package/dist/global/math/color.js.map +1 -1
  35. package/dist/global/schema/CjsSchema.js +8 -0
  36. package/dist/global/schema/CjsSchema.js.map +1 -1
  37. package/dist/index.js +12 -4
  38. package/dist/index.js.map +1 -1
  39. package/dist/resource/CjsResMan.js +47 -7
  40. package/dist/resource/CjsResMan.js.map +1 -1
  41. package/dist/resource/Tr2LightProfileRes.js +37 -0
  42. package/dist/resource/Tr2LightProfileRes.js.map +1 -1
  43. package/dist/resource/format/CjsByteWriter.js +46 -46
  44. package/dist/resource/format/CjsByteWriter.js.map +1 -1
  45. package/dist/resource/format/CjsFormat.js +7 -8
  46. package/dist/resource/format/CjsFormat.js.map +1 -1
  47. package/dist/resource/format/CjsFormatStore.js +8 -8
  48. package/dist/resource/format/CjsFormatStore.js.map +1 -1
  49. package/dist/resource/format/CjsGeometryFormat.js +114 -0
  50. package/dist/resource/format/CjsGeometryFormat.js.map +1 -0
  51. package/dist/resource/format/CjsImageFormat.js +282 -0
  52. package/dist/resource/format/CjsImageFormat.js.map +1 -0
  53. package/dist/resource/format/CjsResourceProbe.js +12 -48
  54. package/dist/resource/format/CjsResourceProbe.js.map +1 -1
  55. package/dist/resource/format/CjsStringTable.js +37 -37
  56. package/dist/resource/format/CjsStringTable.js.map +1 -1
  57. package/dist/resource/format/carbonEffect/CjsCarbonEffectReader.js +10 -10
  58. package/dist/resource/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -1
  59. package/dist/resource/format/carbonEffect/CjsCarbonEffectWriter.js +37 -37
  60. package/dist/resource/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -1
  61. package/dist/resource/format/carbonEffect/carbonEffectBackendBlock.js +35 -7
  62. package/dist/resource/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -1
  63. package/dist/resource/format/index.js +3 -1
  64. package/dist/resource/format/index.js.map +1 -1
  65. package/dist/resource/formats/black/CjsBlackFormat.js +130 -137
  66. package/dist/resource/formats/black/CjsBlackFormat.js.map +1 -1
  67. package/dist/resource/formats/bnk/CjsBnkFormat.js +12 -19
  68. package/dist/resource/formats/bnk/CjsBnkFormat.js.map +1 -1
  69. package/dist/resource/formats/bnk/core/helpers.js +1 -3
  70. package/dist/resource/formats/bnk/core/helpers.js.map +1 -1
  71. package/dist/resource/formats/cmf/CjsCmfFormat.js +19 -82
  72. package/dist/resource/formats/cmf/CjsCmfFormat.js.map +1 -1
  73. package/dist/resource/formats/cmf/core/constants.js +1 -2
  74. package/dist/resource/formats/cmf/core/constants.js.map +1 -1
  75. package/dist/resource/formats/{stl/core/targets.js → cmf/core/flatShared.js} +9 -8
  76. package/dist/resource/formats/cmf/core/flatShared.js.map +1 -0
  77. package/dist/resource/formats/cmf/core/helpers.js +13 -13
  78. package/dist/resource/formats/cmf/core/helpers.js.map +1 -1
  79. package/dist/resource/formats/cmf/core/writer.js +24 -24
  80. package/dist/resource/formats/cmf/core/writer.js.map +1 -1
  81. package/dist/resource/formats/dds/CjsDdsFormat.js +134 -17
  82. package/dist/resource/formats/dds/CjsDdsFormat.js.map +1 -1
  83. package/dist/resource/formats/dds/core/helpers.js +125 -40
  84. package/dist/resource/formats/dds/core/helpers.js.map +1 -1
  85. package/dist/resource/formats/dxbc/CjsDxbcFormat.js +14 -16
  86. package/dist/resource/formats/dxbc/CjsDxbcFormat.js.map +1 -1
  87. package/dist/resource/formats/dxbc/core/{container.js → DxbcContainer.js} +2 -2
  88. package/dist/resource/formats/dxbc/core/DxbcContainer.js.map +1 -0
  89. package/dist/resource/formats/dxbc/core/{errors.js → DxbcReadError.js} +1 -1
  90. package/dist/resource/formats/dxbc/core/DxbcReadError.js.map +1 -0
  91. package/dist/resource/formats/dxbc/core/DxbcReader.js +1 -1
  92. package/dist/resource/formats/dxbc/core/DxbcReader.js.map +1 -1
  93. package/dist/resource/formats/dxbc/core/{program.js → DxbcShaderProgram.js} +2 -2
  94. package/dist/resource/formats/dxbc/core/DxbcShaderProgram.js.map +1 -0
  95. package/dist/resource/formats/dxbc/core/{signature.js → DxbcSignatureChunk.js} +2 -2
  96. package/dist/resource/formats/dxbc/core/DxbcSignatureChunk.js.map +1 -0
  97. package/dist/resource/formats/dxbc/core/decoder.js +2 -2
  98. package/dist/resource/formats/dxbc/core/decoder.js.map +1 -1
  99. package/dist/resource/formats/dxbc/core/helpers.js +3 -3
  100. package/dist/resource/formats/dxbc/core/helpers.js.map +1 -1
  101. package/dist/resource/formats/fbx/CjsFbxFormat.js +18 -20
  102. package/dist/resource/formats/fbx/CjsFbxFormat.js.map +1 -1
  103. package/dist/resource/formats/flac/CjsFlacFormat.js +7 -13
  104. package/dist/resource/formats/flac/CjsFlacFormat.js.map +1 -1
  105. package/dist/resource/formats/fsd/32/CjsFsd32Format.js +29 -29
  106. package/dist/resource/formats/fsd/32/CjsFsd32Format.js.map +1 -1
  107. package/dist/resource/formats/fsd/64/CjsFsd64Format.js +3 -3
  108. package/dist/resource/formats/fsd/64/CjsFsd64Format.js.map +1 -1
  109. package/dist/resource/formats/fsd/64/core/CjsFsd64Binary.js +23 -23
  110. package/dist/resource/formats/fsd/64/core/CjsFsd64Binary.js.map +1 -1
  111. package/dist/resource/formats/fsd/64/core/CjsFsd64Reader.js +8 -8
  112. package/dist/resource/formats/fsd/64/core/CjsFsd64Reader.js.map +1 -1
  113. package/dist/resource/formats/fsd/CjsFsdFormat.js +23 -23
  114. package/dist/resource/formats/fsd/CjsFsdFormat.js.map +1 -1
  115. package/dist/resource/formats/gif/CjsGifFormat.js +24 -15
  116. package/dist/resource/formats/gif/CjsGifFormat.js.map +1 -1
  117. package/dist/resource/formats/gltf/CjsGltfFormat.js +33 -98
  118. package/dist/resource/formats/gltf/CjsGltfFormat.js.map +1 -1
  119. package/dist/resource/formats/gltf/core/helpers.js +3 -12
  120. package/dist/resource/formats/gltf/core/helpers.js.map +1 -1
  121. package/dist/resource/formats/gr2/CjsGr2Format.js +27 -91
  122. package/dist/resource/formats/gr2/CjsGr2Format.js.map +1 -1
  123. package/dist/resource/formats/hlsl/CjsHlslFormat.js +22 -25
  124. package/dist/resource/formats/hlsl/CjsHlslFormat.js.map +1 -1
  125. package/dist/resource/formats/hlsl/core/carbonDescriptionToRuntime.js +1 -1
  126. package/dist/resource/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -1
  127. package/dist/resource/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +3 -3
  128. package/dist/resource/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js.map +1 -1
  129. package/dist/resource/formats/ies/CjsIESFormat.js +29 -29
  130. package/dist/resource/formats/ies/CjsIESFormat.js.map +1 -1
  131. package/dist/resource/formats/jpeg/CjsJpegFormat.js +24 -15
  132. package/dist/resource/formats/jpeg/CjsJpegFormat.js.map +1 -1
  133. package/dist/resource/formats/jpeg/core/helpers.js +3 -5
  134. package/dist/resource/formats/jpeg/core/helpers.js.map +1 -1
  135. package/dist/resource/formats/jpeg/core/jpeg.js +58 -58
  136. package/dist/resource/formats/jpeg/core/jpeg.js.map +1 -1
  137. package/dist/resource/formats/jsonl/CjsJsonlFormat.js +3 -3
  138. package/dist/resource/formats/jsonl/CjsJsonlFormat.js.map +1 -1
  139. package/dist/resource/formats/mp3/CjsMp3Format.js +7 -14
  140. package/dist/resource/formats/mp3/CjsMp3Format.js.map +1 -1
  141. package/dist/resource/formats/mp3/core/helpers.js +3 -5
  142. package/dist/resource/formats/mp3/core/helpers.js.map +1 -1
  143. package/dist/resource/formats/mp4/CjsMp4Format.js +7 -13
  144. package/dist/resource/formats/mp4/CjsMp4Format.js.map +1 -1
  145. package/dist/resource/formats/mp4/core/helpers.js +3 -5
  146. package/dist/resource/formats/mp4/core/helpers.js.map +1 -1
  147. package/dist/resource/formats/obj/CjsObjFormat.js +92 -157
  148. package/dist/resource/formats/obj/CjsObjFormat.js.map +1 -1
  149. package/dist/resource/formats/obj/core/helpers.js +5 -113
  150. package/dist/resource/formats/obj/core/helpers.js.map +1 -1
  151. package/dist/resource/formats/ogg/CjsOggFormat.js +7 -14
  152. package/dist/resource/formats/ogg/CjsOggFormat.js.map +1 -1
  153. package/dist/resource/formats/pickle/CjsPickleFormat.js +7 -12
  154. package/dist/resource/formats/pickle/CjsPickleFormat.js.map +1 -1
  155. package/dist/resource/formats/pickle/core/CjsPickleProtocol0Reader.js +7 -7
  156. package/dist/resource/formats/pickle/core/CjsPickleProtocol0Reader.js.map +1 -1
  157. package/dist/resource/formats/pickle/core/CjsPickleProtocol4Reader.js +7 -7
  158. package/dist/resource/formats/pickle/core/CjsPickleProtocol4Reader.js.map +1 -1
  159. package/dist/resource/formats/png/CjsPngFormat.js +40 -15
  160. package/dist/resource/formats/png/CjsPngFormat.js.map +1 -1
  161. package/dist/resource/formats/png/core/helpers.js +4 -6
  162. package/dist/resource/formats/png/core/helpers.js.map +1 -1
  163. package/dist/resource/formats/red/CjsRedFormat.js +22 -28
  164. package/dist/resource/formats/red/CjsRedFormat.js.map +1 -1
  165. package/dist/resource/formats/schemabound/CjsSchemaBoundFormat.js +3 -7
  166. package/dist/resource/formats/schemabound/CjsSchemaBoundFormat.js.map +1 -1
  167. package/dist/resource/formats/schemabound/core/schemaBoundValues.js +5 -0
  168. package/dist/resource/formats/schemabound/core/schemaBoundValues.js.map +1 -1
  169. package/dist/resource/formats/sqlite/CjsSqliteFormat.js +4 -9
  170. package/dist/resource/formats/sqlite/CjsSqliteFormat.js.map +1 -1
  171. package/dist/resource/formats/static/CjsStaticFormat.js +4 -4
  172. package/dist/resource/formats/static/CjsStaticFormat.js.map +1 -1
  173. package/dist/resource/formats/stl/CjsStlFormat.js +39 -104
  174. package/dist/resource/formats/stl/CjsStlFormat.js.map +1 -1
  175. package/dist/resource/formats/stl/core/helpers.js +5 -19
  176. package/dist/resource/formats/stl/core/helpers.js.map +1 -1
  177. package/dist/resource/formats/tga/CjsTgaFormat.js +26 -15
  178. package/dist/resource/formats/tga/CjsTgaFormat.js.map +1 -1
  179. package/dist/resource/formats/tga/core/helpers.js +3 -5
  180. package/dist/resource/formats/tga/core/helpers.js.map +1 -1
  181. package/dist/resource/formats/vta/CjsVtaFormat.js +8 -15
  182. package/dist/resource/formats/vta/CjsVtaFormat.js.map +1 -1
  183. package/dist/resource/formats/wav/CjsWavFormat.js +7 -14
  184. package/dist/resource/formats/wav/CjsWavFormat.js.map +1 -1
  185. package/dist/resource/formats/wav/core/helpers.js +3 -5
  186. package/dist/resource/formats/wav/core/helpers.js.map +1 -1
  187. package/dist/resource/formats/webgl/CjsWebglFormat.js +103 -105
  188. package/dist/resource/formats/webgl/CjsWebglFormat.js.map +1 -1
  189. package/dist/resource/formats/webgl/core/{errors.js → WebglReadError.js} +1 -1
  190. package/dist/resource/formats/webgl/core/WebglReadError.js.map +1 -0
  191. package/dist/resource/formats/webgl/core/effectPackage.js +1 -1
  192. package/dist/resource/formats/webgl/core/effectPackage.js.map +1 -1
  193. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +3 -3
  194. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  195. package/dist/resource/formats/webgl/core/glsl/{DxbcGlslHelpers.js → DxbcGlslHelperRegistry.js} +2 -2
  196. package/dist/resource/formats/webgl/core/glsl/DxbcGlslHelperRegistry.js.map +1 -0
  197. package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +1 -1
  198. package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -1
  199. package/dist/resource/formats/webgl/core/glslBackendBlock.js +1 -1
  200. package/dist/resource/formats/webgl/core/glslBackendBlock.js.map +1 -1
  201. package/dist/resource/formats/webgl/core/helpers.js.map +1 -1
  202. package/dist/resource/formats/webgpu/CjsWebgpuFormat.js +28 -29
  203. package/dist/resource/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  204. package/dist/resource/formats/webgpu/core/{errors.js → WebgpuReadError.js} +1 -1
  205. package/dist/resource/formats/webgpu/core/WebgpuReadError.js.map +1 -0
  206. package/dist/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js +1 -1
  207. package/dist/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js.map +1 -1
  208. package/dist/resource/formats/webgpu/core/helpers.js +1 -1
  209. package/dist/resource/formats/webgpu/core/helpers.js.map +1 -1
  210. package/dist/resource/formats/webgpu/core/ir/lowerDxbcToIr.js +1 -1
  211. package/dist/resource/formats/webgpu/core/ir/lowerDxbcToIr.js.map +1 -1
  212. package/dist/resource/formats/webgpu/core/wgsl/buildWgslSet.js +18 -6
  213. package/dist/resource/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
  214. package/dist/resource/formats/webgpu/core/wgsl/lowerBindingLayout.js +39 -13
  215. package/dist/resource/formats/webgpu/core/wgsl/lowerBindingLayout.js.map +1 -1
  216. package/dist/resource/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +16 -14
  217. package/dist/resource/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js.map +1 -1
  218. package/dist/resource/formats/webm/CjsWebmFormat.js +8 -13
  219. package/dist/resource/formats/webm/CjsWebmFormat.js.map +1 -1
  220. package/dist/resource/formats/webm/core/helpers.js +3 -5
  221. package/dist/resource/formats/webm/core/helpers.js.map +1 -1
  222. package/dist/resource/formats/webp/CjsWebpFormat.js +8 -12
  223. package/dist/resource/formats/webp/CjsWebpFormat.js.map +1 -1
  224. package/dist/resource/formats/wem/CjsWemFormat.js +9 -17
  225. package/dist/resource/formats/wem/CjsWemFormat.js.map +1 -1
  226. package/dist/resource/formats/wem/core/bitStream.js +35 -35
  227. package/dist/resource/formats/wem/core/bitStream.js.map +1 -1
  228. package/dist/resource/formats/wem/core/helpers.js +1 -3
  229. package/dist/resource/formats/wem/core/helpers.js.map +1 -1
  230. package/dist/resource/formats/yaml/CjsYamlFormat.js +28 -37
  231. package/dist/resource/formats/yaml/CjsYamlFormat.js.map +1 -1
  232. package/dist/resource/imageio/ImageIO.js +142 -0
  233. package/dist/resource/imageio/ImageIO.js.map +1 -0
  234. package/dist/resource/imageio/index.js +17 -0
  235. package/dist/resource/imageio/index.js.map +1 -0
  236. package/dist/resource/index.js +7 -0
  237. package/dist/resource/index.js.map +1 -1
  238. package/dist/resource/shader/reflection/Tr2EffectResource.js +24 -2
  239. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
  240. package/dist/resource/shader/reflection/Tr2Pass.js +76 -5
  241. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
  242. package/dist/resource/texture/CjsTextureArrayConstructor.js +97 -0
  243. package/dist/resource/texture/CjsTextureArrayConstructor.js.map +1 -0
  244. package/dist/resource/texture/CjsTexturePackConstructor.js +160 -0
  245. package/dist/resource/texture/CjsTexturePackConstructor.js.map +1 -0
  246. package/dist/resource/texture/CjsTexturePipelineStepArray.js +72 -0
  247. package/dist/resource/texture/CjsTexturePipelineStepArray.js.map +1 -0
  248. package/dist/resource/texture/CjsTexturePipelineStepConvert.js +73 -0
  249. package/dist/resource/texture/CjsTexturePipelineStepConvert.js.map +1 -0
  250. package/dist/resource/texture/CjsTexturePipelineStepPack.js +71 -0
  251. package/dist/resource/texture/CjsTexturePipelineStepPack.js.map +1 -0
  252. package/dist/resource/texture/CjsTexturePipelineStepResize.js +123 -0
  253. package/dist/resource/texture/CjsTexturePipelineStepResize.js.map +1 -0
  254. package/dist/resource/texture/SolidColorTextureConstructor.js +11 -1
  255. package/dist/resource/texture/SolidColorTextureConstructor.js.map +1 -1
  256. package/dist/resource/texture/Tr2ImageRes.js +100 -68
  257. package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
  258. package/dist/resource/texture/Tr2TexturePipeline.js +45 -25
  259. package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -1
  260. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +34 -1
  261. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -1
  262. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +30 -3
  263. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -1
  264. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +81 -1
  265. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -1
  266. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +36 -1
  267. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -1
  268. package/dist/resource/texture/Tr2TexturePipelineStepPack.js +146 -24
  269. package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -1
  270. package/dist/resource/texture/TriTextureRes.js +151 -29
  271. package/dist/resource/texture/TriTextureRes.js.map +1 -1
  272. package/dist/resource/texture/index.js +7 -0
  273. package/dist/resource/texture/index.js.map +1 -1
  274. package/dist/resource/texture/registerTextureResources.js +83 -0
  275. package/dist/resource/texture/registerTextureResources.js.map +1 -0
  276. package/dist/resource/texture/solidColorTexture.js +10 -19
  277. package/dist/resource/texture/solidColorTexture.js.map +1 -1
  278. package/dist/sof/EveSOF.js +39 -7
  279. package/dist/sof/EveSOF.js.map +1 -1
  280. package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js +2 -2
  281. package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js.map +1 -1
  282. package/dist/trinity/core/Tr2ImageIOHelpers.js +80 -17
  283. package/dist/trinity/core/Tr2ImageIOHelpers.js.map +1 -1
  284. package/dist/trinity/core/Tr2RenderUtils.js +1 -1
  285. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js +49 -62
  286. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js.map +1 -1
  287. package/dist/trinity/core/Tr2TextureReference.js +114 -0
  288. package/dist/trinity/core/Tr2TextureReference.js.map +1 -0
  289. package/dist/trinity/core/device/Tr2DepthStencil.js +2 -2
  290. package/dist/trinity/core/device/Tr2DepthStencil.js.map +1 -1
  291. package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBuffer.js +1 -1
  292. package/dist/trinity/core/index.js +1 -0
  293. package/dist/trinity/core/index.js.map +1 -1
  294. package/dist/trinity/core/lighting/Tr2LightManager.js +5 -4
  295. package/dist/trinity/core/lighting/Tr2LightManager.js.map +1 -1
  296. package/dist/trinity/core/procedural/GradientTextureConstructor.js +5 -4
  297. package/dist/trinity/core/procedural/GradientTextureConstructor.js.map +1 -1
  298. package/dist/trinity/core/procedural/gradientTexture.js +10 -13
  299. package/dist/trinity/core/procedural/gradientTexture.js.map +1 -1
  300. package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js +1 -1
  301. package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js.map +1 -1
  302. package/dist/trinity/eve/EveImpactOverlay.js +102 -50
  303. package/dist/trinity/eve/EveImpactOverlay.js.map +1 -1
  304. package/dist/trinity/eve/EveModularObjectModifier.js +9 -18
  305. package/dist/trinity/eve/EveModularObjectModifier.js.map +1 -1
  306. package/dist/trinity/eve/attachment/turrets/EveTurretSet.js +175 -157
  307. package/dist/trinity/eve/attachment/turrets/EveTurretSet.js.map +1 -1
  308. package/dist/trinity/eve/attachment/turrets/EveTurretTarget.js +100 -83
  309. package/dist/trinity/eve/attachment/turrets/EveTurretTarget.js.map +1 -1
  310. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js +26 -20
  311. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js.map +1 -1
  312. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js +368 -179
  313. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js.map +1 -1
  314. package/dist/trinity/eve/child/EveChildMesh.js +242 -234
  315. package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
  316. package/dist/trinity/eve/child/EveChildTurret.js +57 -16
  317. package/dist/trinity/eve/child/EveChildTurret.js.map +1 -1
  318. package/dist/trinity/eve/child/EveSpaceObjectChild.js +28 -1
  319. package/dist/trinity/eve/child/EveSpaceObjectChild.js.map +1 -1
  320. package/dist/trinity/eve/index.js +2 -2
  321. package/dist/trinity/eve/overlays/EveDamageOverlay.js +5 -1
  322. package/dist/trinity/eve/overlays/EveDamageOverlay.js.map +1 -1
  323. package/dist/trinity/eve/scene/EveSpaceScene.js +234 -233
  324. package/dist/trinity/eve/scene/EveSpaceScene.js.map +1 -1
  325. package/dist/trinity/eve/scene/EveSpaceSceneRenderDriver.js +2 -0
  326. package/dist/trinity/eve/scene/EveSpaceSceneRenderDriver.js.map +1 -1
  327. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +492 -437
  328. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js.map +1 -1
  329. package/dist/trinity/generated/index.js +0 -1
  330. package/dist/trinity/generated/index.js.map +1 -1
  331. package/dist/trinity/generated/trinityCore/index.js +0 -1
  332. package/dist/trinity/generated/trinityCore/index.js.map +1 -1
  333. package/dist/trinity/index.js +3 -3
  334. package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js +10 -1
  335. package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js.map +1 -1
  336. package/dist/trinity/shader/Tr2DataTextureManager.js +152 -66
  337. package/dist/trinity/shader/Tr2DataTextureManager.js.map +1 -1
  338. package/dist/trinity/shader/Tr2Material.js +1 -1
  339. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js +5 -5
  340. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js.map +1 -1
  341. package/dist/trinityal/index.js +1 -1
  342. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js +2 -2
  343. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js.map +1 -1
  344. package/dist/trinityal/stub/Tr2SwapChainALStub.js +45 -45
  345. package/dist/trinityal/stub/Tr2SwapChainALStub.js.map +1 -1
  346. package/dist/trinityal/stub/Tr2TextureALStub.js +170 -170
  347. package/dist/trinityal/stub/Tr2TextureALStub.js.map +1 -1
  348. package/dist/trinityal/webgpu/CjsWebgpuDevice.js +234 -164
  349. package/dist/trinityal/webgpu/CjsWebgpuDevice.js.map +1 -1
  350. package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js +7 -0
  351. package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js.map +1 -1
  352. package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js +78 -14
  353. package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js.map +1 -1
  354. package/dist/trinityal/webgpu/core/CjsWebgpuUtils.js +94 -0
  355. package/dist/trinityal/webgpu/core/CjsWebgpuUtils.js.map +1 -0
  356. package/dist/trinityal/webgpu/internal.js +1 -0
  357. package/dist/trinityal/webgpu/internal.js.map +1 -1
  358. package/docs/global/reference/classes/README.md +90 -0
  359. package/docs/resource/concepts/format-capabilities.md +3 -3
  360. package/docs/resource/formats/README.md +1 -1
  361. package/docs/resource/reference/classes/core.md +31 -1
  362. package/docs/resource/reference/classes/formats.md +7 -7
  363. package/docs/resource/reference/classes/resources.md +76 -16
  364. package/docs/trinity/reference/classes/generated.md +0 -10
  365. package/docs/trinity/reference/classes/trinity-core.md +1692 -1682
  366. package/docs/trinityal/reference/classes/README.md +0 -10
  367. package/docs/trinityal/webgpu/reference/classes/README.md +276 -266
  368. package/package.json +4 -3
  369. package/dist/global/consts/webgpu/index.js +0 -2
  370. package/dist/global/consts/webgpu/textureFormats.js +0 -180
  371. package/dist/global/consts/webgpu/textureFormats.js.map +0 -1
  372. package/dist/resource/formats/dxbc/core/container.js.map +0 -1
  373. package/dist/resource/formats/dxbc/core/errors.js.map +0 -1
  374. package/dist/resource/formats/dxbc/core/program.js.map +0 -1
  375. package/dist/resource/formats/dxbc/core/signature.js.map +0 -1
  376. package/dist/resource/formats/stl/core/targets.js.map +0 -1
  377. package/dist/resource/formats/webgl/core/errors.js.map +0 -1
  378. package/dist/resource/formats/webgl/core/glsl/DxbcGlslHelpers.js.map +0 -1
  379. package/dist/resource/formats/webgpu/core/errors.js.map +0 -1
  380. package/dist/resource/texture/texturePipelineBehavior.js +0 -332
  381. package/dist/resource/texture/texturePipelineBehavior.js.map +0 -1
  382. package/dist/trinity/generated/trinityCore/Tr2TextureReference.js +0 -40
  383. package/dist/trinity/generated/trinityCore/Tr2TextureReference.js.map +0 -1
  384. package/dist/trinityal/Tr2BitmapDimensions.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Tr2SwapChainALStub.js","sources":["../../../../src/trinityal/stub/Tr2SwapChainALStub.js"],"sourcesContent":["// Source: trinity/trinityal/stub/Tr2SwapChainALStub.cpp\r\n// Source: trinity/trinityal/stub/Tr2SwapChainALStub.h\r\n//\r\n// A swap chain with no window behind it.\r\n//\r\n// It owns one back buffer, and `IsValid` is that back buffer's validity - so a\r\n// swap chain that failed to allocate reports itself unusable rather than\r\n// presenting into nothing.\r\n//\r\n// CARBON'S BACK BUFFER HERE IS 4x4, and that is not a placeholder someone\r\n// forgot: the stub has no window to ask for a size, and a caller that needs a\r\n// real size uses the render context's default back buffer, which is created\r\n// from the present parameters. Transcribed as it stands, because inventing a\r\n// size would make a headless test agree with a number nothing chose.\r\n\r\nimport { CjsSchema } from \"#schema\";\r\nimport { Tr2ALMemoryType, Tr2DeviceResourceAL } from \"../Tr2DeviceResourceAL/index.js\";\r\nimport { ALResult } from \"../ALResult.js\";\r\nimport { Tr2BitmapDimensions } from \"../Tr2BitmapDimensions.js\";\r\nimport { Tr2TextureALStub } from \"./Tr2TextureALStub.js\";\r\nimport { PixelFormat, Tr2GpuUsage } from \"../../global/consts/renderContext/index.js\";\r\n\r\n\r\n/** Carbon's stub back-buffer size (`Tr2SwapChainALStub.cpp:27`). */\r\nconst STUB_BACK_BUFFER_SIZE = 4;\r\n\r\n\r\n/**\r\n * A swap chain whose presents complete immediately.\r\n */\r\nexport class Tr2SwapChainALStub extends Tr2DeviceResourceAL\r\n{\r\n /** m_backBuffer */\r\n _backBuffer = new Tr2TextureALStub();\r\n\r\n /**\r\n * Creates the swap chain and its back buffer.\r\n *\r\n * @param {object} windowHandle The window to present into; ignored here.\r\n * @param {object} renderContext The context to create against.\r\n * @returns {number} An `ALResult` value.\r\n */\r\n Create(windowHandle, renderContext)\r\n {\r\n if (!renderContext.IsValid()) return ALResult.E_INVALIDARG;\r\n\r\n this._backBuffer.Destroy();\r\n this._backBuffer = new Tr2TextureALStub();\r\n\r\n return this._backBuffer.Create(\r\n Tr2BitmapDimensions.Texture2D(\r\n STUB_BACK_BUFFER_SIZE,\r\n STUB_BACK_BUFFER_SIZE,\r\n 1,\r\n PixelFormat.PIXEL_FORMAT_B8G8R8X8_UNORM\r\n ),\r\n { gpuUsage: Tr2GpuUsage.RENDER_TARGET },\r\n renderContext\r\n );\r\n }\r\n\r\n /** Releases the back buffer and leaves the device-resource registry. */\r\n Destroy()\r\n {\r\n this._backBuffer.Destroy();\r\n this._backBuffer = new Tr2TextureALStub();\r\n super.Destroy();\r\n }\r\n\r\n /**\r\n * Whether the chain can be presented.\r\n *\r\n * @returns {boolean} The back buffer's validity.\r\n */\r\n IsValid()\r\n {\r\n return this._backBuffer.IsValid();\r\n }\r\n\r\n /**\r\n * The back buffer.\r\n *\r\n * @returns {Tr2TextureALStub} The texture.\r\n */\r\n GetBackBuffer()\r\n {\r\n return this._backBuffer;\r\n }\r\n\r\n /**\r\n * Presents the back buffer. There is nothing to show, but the frame ended.\r\n *\r\n * @param {object} _renderContext The context presenting the frame; Carbon\r\n * takes it (`Tr2SwapChainALStub.cpp:41`) and names no parameter, because\r\n * the stub has nothing to present into.\r\n * @returns {number} An `ALResult` value.\r\n */\r\n Present(_renderContext)\r\n {\r\n return ALResult.S_OK;\r\n }\r\n\r\n /**\r\n * Back buffer width.\r\n *\r\n * @returns {number} Width in pixels.\r\n */\r\n GetWidth()\r\n {\r\n return this._backBuffer.GetWidth();\r\n }\r\n\r\n /**\r\n * Back buffer height.\r\n *\r\n * @returns {number} Height in pixels.\r\n */\r\n GetHeight()\r\n {\r\n return this._backBuffer.GetHeight();\r\n }\r\n\r\n /**\r\n * Which memory class this chain occupies.\r\n *\r\n * VIDEO, not managed - the one AL resource that says so, because a swap\r\n * chain's surfaces belong to the display rather than to the device heap.\r\n *\r\n * @returns {number} A `Tr2ALMemoryType` value.\r\n */\r\n GetMemoryClass()\r\n {\r\n return Tr2ALMemoryType.AL_MEMORY_VIDEO;\r\n }\r\n\r\n /**\r\n * Names the chain for a debugger.\r\n *\r\n * @param {string} _name The name Carbon would attach; the stub discards it.\r\n * @returns {number} An `ALResult` value; the stub keeps no name.\r\n */\r\n SetName(_name)\r\n {\r\n return ALResult.S_OK;\r\n }\r\n}\r\n\r\n// DECLARED AS A CALL, NOT A DECORATOR, for the reason recorded in\r\n// Tr2BitmapDimensions.js: the layer is imported straight from source by its\r\n// tests and raw Node cannot parse decorator syntax.\r\n//\r\n// The donor is NAMED rather than left to be derived from this class's name.\r\n// Carbon calls every backend's class the same thing and carries the backend in\r\n// the FILE name, because only one backend compiles at a time; we ship them\r\n// together, so the backend moves onto the class name. That divergence is the\r\n// author's to declare, never a checker's to guess.\r\nCjsSchema.define(Tr2SwapChainALStub, { className: \"Tr2SwapChainALStub\", carbon: \"Tr2SwapChainAL\" });\r\n"],"names":["STUB_BACK_BUFFER_SIZE","Tr2SwapChainALStub","Tr2DeviceResourceAL","_backBuffer","Tr2TextureALStub","Create","windowHandle","renderContext","IsValid","ALResult","E_INVALIDARG","Destroy","Tr2BitmapDimensions","Texture2D","PixelFormat","PIXEL_FORMAT_B8G8R8X8_UNORM","gpuUsage","Tr2GpuUsage","RENDER_TARGET","GetBackBuffer","Present","_renderContext","S_OK","GetWidth","GetHeight","GetMemoryClass","Tr2ALMemoryType","AL_MEMORY_VIDEO","SetName","_name","CjsSchema","define","className","carbon"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAUA;AACA,MAAMA,qBAAqB,GAAG,CAAC;;AAG/B;AACA;AACA;AACO,MAAMC,kBAAkB,SAASC,mBAAmB,CAC3D;AACE;AACAC,EAAAA,WAAW,GAAG,IAAIC,gBAAgB,EAAE;;AAEpC;AACF;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,MAAMA,CAACC,YAAY,EAAEC,aAAa,EAClC;IACE,IAAI,CAACA,aAAa,CAACC,OAAO,EAAE,EAAE,OAAOC,QAAQ,CAACC,YAAY;AAE1D,IAAA,IAAI,CAACP,WAAW,CAACQ,OAAO,EAAE;AAC1B,IAAA,IAAI,CAACR,WAAW,GAAG,IAAIC,gBAAgB,EAAE;IAEzC,OAAO,IAAI,CAACD,WAAW,CAACE,MAAM,CAC5BO,mBAAmB,CAACC,SAAS,CAC3Bb,qBAAqB,EACrBA,qBAAqB,EACrB,CAAC,EACDc,WAAW,CAACC,2BACd,CAAC,EACD;MAAEC,QAAQ,EAAEC,WAAW,CAACC;KAAe,EACvCX,aACF,CAAC;AACH,EAAA;;AAEA;AACAI,EAAAA,OAAOA,GACP;AACE,IAAA,IAAI,CAACR,WAAW,CAACQ,OAAO,EAAE;AAC1B,IAAA,IAAI,CAACR,WAAW,GAAG,IAAIC,gBAAgB,EAAE;IACzC,KAAK,CAACO,OAAO,EAAE;AACjB,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEH,EAAAA,OAAOA,GACP;AACE,IAAA,OAAO,IAAI,CAACL,WAAW,CAACK,OAAO,EAAE;AACnC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEW,EAAAA,aAAaA,GACb;IACE,OAAO,IAAI,CAAChB,WAAW;AACzB,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEiB,OAAOA,CAACC,cAAc,EACtB;IACE,OAAOZ,QAAQ,CAACa,IAAI;AACtB,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEC,EAAAA,QAAQA,GACR;AACE,IAAA,OAAO,IAAI,CAACpB,WAAW,CAACoB,QAAQ,EAAE;AACpC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEC,EAAAA,SAASA,GACT;AACE,IAAA,OAAO,IAAI,CAACrB,WAAW,CAACqB,SAAS,EAAE;AACrC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,cAAcA,GACd;IACE,OAAOC,eAAe,CAACC,eAAe;AACxC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACEC,OAAOA,CAACC,KAAK,EACb;IACE,OAAOpB,QAAQ,CAACa,IAAI;AACtB,EAAA;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAQ,SAAS,CAACC,MAAM,CAAC9B,kBAAkB,EAAE;AAAE+B,EAAAA,SAAS,EAAE,oBAAoB;AAAEC,EAAAA,MAAM,EAAE;AAAiB,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"Tr2SwapChainALStub.js","sources":["../../../../src/trinityal/stub/Tr2SwapChainALStub.js"],"sourcesContent":["// Source: trinity/trinityal/stub/Tr2SwapChainALStub.cpp\n// Source: trinity/trinityal/stub/Tr2SwapChainALStub.h\n//\n// A swap chain with no window behind it.\n//\n// It owns one back buffer, and `IsValid` is that back buffer's validity - so a\n// swap chain that failed to allocate reports itself unusable rather than\n// presenting into nothing.\n//\n// CARBON'S BACK BUFFER HERE IS 4x4, and that is not a placeholder someone\n// forgot: the stub has no window to ask for a size, and a caller that needs a\n// real size uses the render context's default back buffer, which is created\n// from the present parameters. Transcribed as it stands, because inventing a\n// size would make a headless test agree with a number nothing chose.\n\nimport { CjsSchema } from \"#schema\";\nimport { Tr2ALMemoryType, Tr2DeviceResourceAL } from \"../Tr2DeviceResourceAL/index.js\";\nimport { ALResult } from \"../ALResult.js\";\nimport { BitmapDimensions as Tr2BitmapDimensions } from \"#imageio\";\nimport { Tr2TextureALStub } from \"./Tr2TextureALStub.js\";\nimport { PixelFormat, Tr2GpuUsage } from \"../../global/consts/renderContext/index.js\";\n\n\n/** Carbon's stub back-buffer size (`Tr2SwapChainALStub.cpp:27`). */\nconst STUB_BACK_BUFFER_SIZE = 4;\n\n\n/**\n * A swap chain whose presents complete immediately.\n */\nexport class Tr2SwapChainALStub extends Tr2DeviceResourceAL\n{\n /** m_backBuffer */\n _backBuffer = new Tr2TextureALStub();\n\n /**\n * Creates the swap chain and its back buffer.\n *\n * @param {object} windowHandle The window to present into; ignored here.\n * @param {object} renderContext The context to create against.\n * @returns {number} An `ALResult` value.\n */\n Create(windowHandle, renderContext)\n {\n if (!renderContext.IsValid()) return ALResult.E_INVALIDARG;\n\n this._backBuffer.Destroy();\n this._backBuffer = new Tr2TextureALStub();\n\n return this._backBuffer.Create(\n Tr2BitmapDimensions.texture2D(\n STUB_BACK_BUFFER_SIZE,\n STUB_BACK_BUFFER_SIZE,\n 1,\n PixelFormat.PIXEL_FORMAT_B8G8R8X8_UNORM\n ),\n { gpuUsage: Tr2GpuUsage.RENDER_TARGET },\n renderContext\n );\n }\n\n /** Releases the back buffer and leaves the device-resource registry. */\n Destroy()\n {\n this._backBuffer.Destroy();\n this._backBuffer = new Tr2TextureALStub();\n super.Destroy();\n }\n\n /**\n * Whether the chain can be presented.\n *\n * @returns {boolean} The back buffer's validity.\n */\n IsValid()\n {\n return this._backBuffer.IsValid();\n }\n\n /**\n * The back buffer.\n *\n * @returns {Tr2TextureALStub} The texture.\n */\n GetBackBuffer()\n {\n return this._backBuffer;\n }\n\n /**\n * Presents the back buffer. There is nothing to show, but the frame ended.\n *\n * @param {object} _renderContext The context presenting the frame; Carbon\n * takes it (`Tr2SwapChainALStub.cpp:41`) and names no parameter, because\n * the stub has nothing to present into.\n * @returns {number} An `ALResult` value.\n */\n Present(_renderContext)\n {\n return ALResult.S_OK;\n }\n\n /**\n * Back buffer width.\n *\n * @returns {number} Width in pixels.\n */\n GetWidth()\n {\n return this._backBuffer.GetWidth();\n }\n\n /**\n * Back buffer height.\n *\n * @returns {number} Height in pixels.\n */\n GetHeight()\n {\n return this._backBuffer.GetHeight();\n }\n\n /**\n * Which memory class this chain occupies.\n *\n * VIDEO, not managed - the one AL resource that says so, because a swap\n * chain's surfaces belong to the display rather than to the device heap.\n *\n * @returns {number} A `Tr2ALMemoryType` value.\n */\n GetMemoryClass()\n {\n return Tr2ALMemoryType.AL_MEMORY_VIDEO;\n }\n\n /**\n * Names the chain for a debugger.\n *\n * @param {string} _name The name Carbon would attach; the stub discards it.\n * @returns {number} An `ALResult` value; the stub keeps no name.\n */\n SetName(_name)\n {\n return ALResult.S_OK;\n }\n}\n\n// DECLARED AS A CALL, NOT A DECORATOR, for the reason recorded in\n// Tr2BitmapDimensions.js: the layer is imported straight from source by its\n// tests and raw Node cannot parse decorator syntax.\n//\n// The donor is NAMED rather than left to be derived from this class's name.\n// Carbon calls every backend's class the same thing and carries the backend in\n// the FILE name, because only one backend compiles at a time; we ship them\n// together, so the backend moves onto the class name. That divergence is the\n// author's to declare, never a checker's to guess.\nCjsSchema.define(Tr2SwapChainALStub, { className: \"Tr2SwapChainALStub\", carbon: \"Tr2SwapChainAL\" });\n"],"names":["STUB_BACK_BUFFER_SIZE","Tr2SwapChainALStub","Tr2DeviceResourceAL","_backBuffer","Tr2TextureALStub","Create","windowHandle","renderContext","IsValid","ALResult","E_INVALIDARG","Destroy","Tr2BitmapDimensions","texture2D","PixelFormat","PIXEL_FORMAT_B8G8R8X8_UNORM","gpuUsage","Tr2GpuUsage","RENDER_TARGET","GetBackBuffer","Present","_renderContext","S_OK","GetWidth","GetHeight","GetMemoryClass","Tr2ALMemoryType","AL_MEMORY_VIDEO","SetName","_name","CjsSchema","define","className","carbon"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAUA;AACA,MAAMA,qBAAqB,GAAG,CAAC;;AAG/B;AACA;AACA;AACO,MAAMC,kBAAkB,SAASC,mBAAmB,CAC3D;AACE;AACAC,EAAAA,WAAW,GAAG,IAAIC,gBAAgB,EAAE;;AAEpC;AACF;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,MAAMA,CAACC,YAAY,EAAEC,aAAa,EAClC;IACE,IAAI,CAACA,aAAa,CAACC,OAAO,EAAE,EAAE,OAAOC,QAAQ,CAACC,YAAY;AAE1D,IAAA,IAAI,CAACP,WAAW,CAACQ,OAAO,EAAE;AAC1B,IAAA,IAAI,CAACR,WAAW,GAAG,IAAIC,gBAAgB,EAAE;IAEzC,OAAO,IAAI,CAACD,WAAW,CAACE,MAAM,CAC5BO,gBAAmB,CAACC,SAAS,CAC3Bb,qBAAqB,EACrBA,qBAAqB,EACrB,CAAC,EACDc,WAAW,CAACC,2BACd,CAAC,EACD;MAAEC,QAAQ,EAAEC,WAAW,CAACC;KAAe,EACvCX,aACF,CAAC;AACH,EAAA;;AAEA;AACAI,EAAAA,OAAOA,GACP;AACE,IAAA,IAAI,CAACR,WAAW,CAACQ,OAAO,EAAE;AAC1B,IAAA,IAAI,CAACR,WAAW,GAAG,IAAIC,gBAAgB,EAAE;IACzC,KAAK,CAACO,OAAO,EAAE;AACjB,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEH,EAAAA,OAAOA,GACP;AACE,IAAA,OAAO,IAAI,CAACL,WAAW,CAACK,OAAO,EAAE;AACnC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEW,EAAAA,aAAaA,GACb;IACE,OAAO,IAAI,CAAChB,WAAW;AACzB,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEiB,OAAOA,CAACC,cAAc,EACtB;IACE,OAAOZ,QAAQ,CAACa,IAAI;AACtB,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEC,EAAAA,QAAQA,GACR;AACE,IAAA,OAAO,IAAI,CAACpB,WAAW,CAACoB,QAAQ,EAAE;AACpC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEC,EAAAA,SAASA,GACT;AACE,IAAA,OAAO,IAAI,CAACrB,WAAW,CAACqB,SAAS,EAAE;AACrC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,cAAcA,GACd;IACE,OAAOC,eAAe,CAACC,eAAe;AACxC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACEC,OAAOA,CAACC,KAAK,EACb;IACE,OAAOpB,QAAQ,CAACa,IAAI;AACtB,EAAA;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAQ,SAAS,CAACC,MAAM,CAAC9B,kBAAkB,EAAE;AAAE+B,EAAAA,SAAS,EAAE,oBAAoB;AAAEC,EAAAA,MAAM,EAAE;AAAiB,CAAC,CAAC;;;;"}
@@ -2,7 +2,7 @@ import { CjsSchema } from '#schema';
2
2
  import { Tr2ALMemoryType } from '../Tr2DeviceResourceAL/Tr2BaseDeviceResourceAL.js';
3
3
  import { Tr2DeviceResourceAL } from '../Tr2DeviceResourceAL/Tr2DeviceResourceAL.js';
4
4
  import { ALResult } from '../ALResult.js';
5
- import { Tr2BitmapDimensions } from '../Tr2BitmapDimensions.js';
5
+ import { BitmapDimensions } from '#imageio';
6
6
  import { Crop, Tr2TextureSubresource } from '../Tr2HalHelperStructures/Tr2TextureSubresource.js';
7
7
  import { TextureType, IsCompressedFormat } from '../../global/consts/renderContext/formats.js';
8
8
  import '../../global/consts/renderContext/pipeline.js';
@@ -49,12 +49,12 @@ import { Tr2MsaaDesc } from '../Tr2HalHelperStructures/Tr2MsaaDesc.js';
49
49
  /** Carbon's "no descriptor heap index", returned by both heap accessors. */
50
50
  const NO_HEAP_INDEX = 0xffffffff;
51
51
 
52
- /**
53
- * A texture that validates like a real one and holds its pixels on the CPU.
52
+ /**
53
+ * A texture that validates like a real one and holds its pixels on the CPU.
54
54
  */
55
55
  class Tr2TextureALStub extends Tr2DeviceResourceAL {
56
56
  /** m_desc */
57
- _desc = new Tr2BitmapDimensions();
57
+ _desc = new BitmapDimensions();
58
58
 
59
59
  /** m_msaa */
60
60
  _msaa = new Tr2MsaaDesc();
@@ -68,20 +68,20 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
68
68
  /** m_data - allocated on first map, released on unmap unless kept "often". */
69
69
  _data = null;
70
70
 
71
- /**
72
- * Creates the texture.
73
- *
74
- * Every refusal below is Carbon's, in Carbon's order
75
- * (`Tr2TextureALStub.cpp:18-95`).
76
- *
77
- * @param {Tr2BitmapDimensions} desc The texture description.
78
- * @param {object} options Creation options.
79
- * @param {number} [options.gpuUsage] A `Tr2GpuUsage` bit set.
80
- * @param {number} [options.cpuUsage] A `Tr2CpuUsage` bit set.
81
- * @param {Tr2MsaaDesc} [options.msaa] Multisample description.
82
- * @param {object[]} [options.initialData] Initial subresource data, if any.
83
- * @param {object} renderContext The context to create against.
84
- * @returns {number} An `ALResult` value.
71
+ /**
72
+ * Creates the texture.
73
+ *
74
+ * Every refusal below is Carbon's, in Carbon's order
75
+ * (`Tr2TextureALStub.cpp:18-95`).
76
+ *
77
+ * @param {Tr2BitmapDimensions} desc The texture description.
78
+ * @param {object} options Creation options.
79
+ * @param {number} [options.gpuUsage] A `Tr2GpuUsage` bit set.
80
+ * @param {number} [options.cpuUsage] A `Tr2CpuUsage` bit set.
81
+ * @param {Tr2MsaaDesc} [options.msaa] Multisample description.
82
+ * @param {object[]} [options.initialData] Initial subresource data, if any.
83
+ * @param {object} renderContext The context to create against.
84
+ * @returns {number} An `ALResult` value.
85
85
  */
86
86
  Create(desc, options, renderContext) {
87
87
  this._Reset();
@@ -142,12 +142,12 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
142
142
  return ALResult.S_OK;
143
143
  }
144
144
 
145
- /**
146
- * Adopts a texture shared by another device.
147
- *
148
- * Carbon's stub refuses: sharing needs a real device on both sides.
149
- *
150
- * @returns {number} An `ALResult` value.
145
+ /**
146
+ * Adopts a texture shared by another device.
147
+ *
148
+ * Carbon's stub refuses: sharing needs a real device on both sides.
149
+ *
150
+ * @returns {number} An `ALResult` value.
151
151
  */
152
152
  OpenShared() {
153
153
  return ALResult.E_FAIL;
@@ -155,7 +155,7 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
155
155
 
156
156
  /** Carbon's impl `Destroy`: clears the description without unregistering. */
157
157
  _Reset() {
158
- this._desc = new Tr2BitmapDimensions();
158
+ this._desc = new BitmapDimensions();
159
159
  this._msaa = new Tr2MsaaDesc();
160
160
  this._gpuUsage = Tr2GpuUsage.NONE;
161
161
  this._cpuUsage = Tr2CpuUsage.NONE;
@@ -168,155 +168,155 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
168
168
  super.Destroy();
169
169
  }
170
170
 
171
- /**
172
- * Whether the texture holds anything.
173
- *
174
- * Carbon's test is the width, because a created texture always has one.
175
- *
176
- * @returns {boolean} True when created.
171
+ /**
172
+ * Whether the texture holds anything.
173
+ *
174
+ * Carbon's test is the width, because a created texture always has one.
175
+ *
176
+ * @returns {boolean} True when created.
177
177
  */
178
178
  IsValid() {
179
179
  return this._desc.GetWidth() !== 0;
180
180
  }
181
181
 
182
- /**
183
- * Which memory class this texture occupies.
184
- *
185
- * @returns {number} A `Tr2ALMemoryType` value.
182
+ /**
183
+ * Which memory class this texture occupies.
184
+ *
185
+ * @returns {number} A `Tr2ALMemoryType` value.
186
186
  */
187
187
  GetMemoryClass() {
188
188
  return Tr2ALMemoryType.AL_MEMORY_MANAGED;
189
189
  }
190
190
 
191
- /**
192
- * The texture description.
193
- *
194
- * @returns {Tr2BitmapDimensions} The description.
191
+ /**
192
+ * The texture description.
193
+ *
194
+ * @returns {Tr2BitmapDimensions} The description.
195
195
  */
196
196
  GetDesc() {
197
197
  return this._desc;
198
198
  }
199
199
 
200
- /**
201
- * The multisample description.
202
- *
203
- * @returns {Tr2MsaaDesc} The description.
200
+ /**
201
+ * The multisample description.
202
+ *
203
+ * @returns {Tr2MsaaDesc} The description.
204
204
  */
205
205
  GetMsaaDesc() {
206
206
  return this._msaa;
207
207
  }
208
208
 
209
- /**
210
- * The GPU usage this texture was created with.
211
- *
212
- * @returns {number} A `Tr2GpuUsage` bit set.
209
+ /**
210
+ * The GPU usage this texture was created with.
211
+ *
212
+ * @returns {number} A `Tr2GpuUsage` bit set.
213
213
  */
214
214
  GetGpuUsage() {
215
215
  return this._gpuUsage;
216
216
  }
217
217
 
218
- /**
219
- * The CPU usage this texture was created with.
220
- *
221
- * @returns {number} A `Tr2CpuUsage` bit set.
218
+ /**
219
+ * The CPU usage this texture was created with.
220
+ *
221
+ * @returns {number} A `Tr2CpuUsage` bit set.
222
222
  */
223
223
  GetCpuUsage() {
224
224
  return this._cpuUsage;
225
225
  }
226
226
 
227
- /**
228
- * Width of mip zero.
229
- *
230
- * @returns {number} Width in pixels.
227
+ /**
228
+ * Width of mip zero.
229
+ *
230
+ * @returns {number} Width in pixels.
231
231
  */
232
232
  GetWidth() {
233
233
  return this._desc.GetWidth();
234
234
  }
235
235
 
236
- /**
237
- * Height of mip zero.
238
- *
239
- * @returns {number} Height in pixels.
236
+ /**
237
+ * Height of mip zero.
238
+ *
239
+ * @returns {number} Height in pixels.
240
240
  */
241
241
  GetHeight() {
242
242
  return this._desc.GetHeight();
243
243
  }
244
244
 
245
- /**
246
- * Volume depth.
247
- *
248
- * @returns {number} Depth in slices.
245
+ /**
246
+ * Volume depth.
247
+ *
248
+ * @returns {number} Depth in slices.
249
249
  */
250
250
  GetDepth() {
251
251
  return this._desc.GetDepth();
252
252
  }
253
253
 
254
- /**
255
- * The declared mip count.
256
- *
257
- * @returns {number} Mip levels as declared.
254
+ /**
255
+ * The declared mip count.
256
+ *
257
+ * @returns {number} Mip levels as declared.
258
258
  */
259
259
  GetMipCount() {
260
260
  return this._desc.GetMipCount();
261
261
  }
262
262
 
263
- /**
264
- * The mip count in effect.
265
- *
266
- * @returns {number} Mip levels.
263
+ /**
264
+ * The mip count in effect.
265
+ *
266
+ * @returns {number} Mip levels.
267
267
  */
268
268
  GetTrueMipCount() {
269
269
  return this._desc.GetTrueMipCount();
270
270
  }
271
271
 
272
- /**
273
- * The pixel format.
274
- *
275
- * @returns {number} A `PixelFormat` value.
272
+ /**
273
+ * The pixel format.
274
+ *
275
+ * @returns {number} A `PixelFormat` value.
276
276
  */
277
277
  GetFormat() {
278
278
  return this._desc.GetFormat();
279
279
  }
280
280
 
281
- /**
282
- * The texture type.
283
- *
284
- * @returns {number} A `TextureType` value.
281
+ /**
282
+ * The texture type.
283
+ *
284
+ * @returns {number} A `TextureType` value.
285
285
  */
286
286
  GetType() {
287
287
  return this._desc.GetType();
288
288
  }
289
289
 
290
- /**
291
- * Slices in the array.
292
- *
293
- * @returns {number} Array size.
290
+ /**
291
+ * Slices in the array.
292
+ *
293
+ * @returns {number} Array size.
294
294
  */
295
295
  GetArraySize() {
296
296
  return this._desc.GetArraySize();
297
297
  }
298
298
 
299
- /**
300
- * Bytes in one mip.
301
- *
302
- * @param {number} mip Mip level.
303
- * @returns {number} Size in bytes.
299
+ /**
300
+ * Bytes in one mip.
301
+ *
302
+ * @param {number} mip Mip level.
303
+ * @returns {number} Size in bytes.
304
304
  */
305
305
  GetMipSize(mip) {
306
306
  return this._desc.GetMipSize(mip);
307
307
  }
308
308
 
309
- /**
310
- * Allocates and returns the storage for one subresource, for reading.
311
- *
312
- * The CPU-read check comes FIRST, before validity, because a texture that
313
- * was never created for reading is a caller mistake rather than a state
314
- * problem - which is why it answers `E_INVALIDCALL` and not `E_FAIL`.
315
- *
316
- * @param {Tr2TextureSubresource} region The subresource to map.
317
- * @param {boolean} synchronize Whether to wait for outstanding GPU work.
318
- * @param {object} renderContext The context to map against.
319
- * @returns {{result: number, data: Uint8Array|null, pitch: number}} The mapping.
309
+ /**
310
+ * Allocates and returns the storage for one subresource, for reading.
311
+ *
312
+ * The CPU-read check comes FIRST, before validity, because a texture that
313
+ * was never created for reading is a caller mistake rather than a state
314
+ * problem - which is why it answers `E_INVALIDCALL` and not `E_FAIL`.
315
+ *
316
+ * @param {Tr2TextureSubresource} region The subresource to map.
317
+ * @param {boolean} synchronize Whether to wait for outstanding GPU work.
318
+ * @param {object} renderContext The context to map against.
319
+ * @returns {{result: number, data: Uint8Array|null, pitch: number}} The mapping.
320
320
  */
321
321
  MapForReading(region, synchronize, renderContext) {
322
322
  if (!HasFlag(this._cpuUsage, Tr2CpuUsage.READ)) return {
@@ -347,12 +347,12 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
347
347
  this._ReleaseUnlessKept();
348
348
  }
349
349
 
350
- /**
351
- * Allocates and returns the storage for one subresource, for writing.
352
- *
353
- * @param {Tr2TextureSubresource} region The subresource to map.
354
- * @param {object} renderContext The context to map against.
355
- * @returns {{result: number, data: Uint8Array|null, pitch: number}} The mapping.
350
+ /**
351
+ * Allocates and returns the storage for one subresource, for writing.
352
+ *
353
+ * @param {Tr2TextureSubresource} region The subresource to map.
354
+ * @param {object} renderContext The context to map against.
355
+ * @returns {{result: number, data: Uint8Array|null, pitch: number}} The mapping.
356
356
  */
357
357
  MapForWriting(region, renderContext) {
358
358
  if (!HasFlag(this._cpuUsage, Tr2CpuUsage.WRITE)) return {
@@ -420,18 +420,18 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
420
420
  }
421
421
  }
422
422
 
423
- /**
424
- * Writes pixels into one subresource.
425
- *
426
- * A texture mapped often is written through a map, not through this, so
427
- * Carbon refuses `WRITE_OFTEN` here outright.
428
- *
429
- * @param {Tr2TextureSubresource} region The subresource to write.
430
- * @param {ArrayBufferView} source The pixels.
431
- * @param {number} pitch Bytes per row in the source.
432
- * @param {number} slicePitch Bytes per slice in the source.
433
- * @param {object} renderContext The context to write against.
434
- * @returns {number} An `ALResult` value.
423
+ /**
424
+ * Writes pixels into one subresource.
425
+ *
426
+ * A texture mapped often is written through a map, not through this, so
427
+ * Carbon refuses `WRITE_OFTEN` here outright.
428
+ *
429
+ * @param {Tr2TextureSubresource} region The subresource to write.
430
+ * @param {ArrayBufferView} source The pixels.
431
+ * @param {number} pitch Bytes per row in the source.
432
+ * @param {number} slicePitch Bytes per slice in the source.
433
+ * @param {object} renderContext The context to write against.
434
+ * @returns {number} An `ALResult` value.
435
435
  */
436
436
  UpdateSubresource(region, source, pitch, slicePitch, renderContext) {
437
437
  if (HasFlag(this._cpuUsage, Tr2CpuUsage.WRITE_OFTEN)) return ALResult.E_INVALIDCALL;
@@ -442,17 +442,17 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
442
442
  return ALResult.S_OK;
443
443
  }
444
444
 
445
- /**
446
- * Copies a region from another texture.
447
- *
448
- * A whole-to-whole copy short-circuits; anything else must survive `Crop`,
449
- * which is where a mismatched face count or an empty overlap is caught.
450
- *
451
- * @param {Tr2TextureSubresource} destSubresource The region to write.
452
- * @param {Tr2TextureALStub} source The texture to read.
453
- * @param {Tr2TextureSubresource} sourceSubresource The region to read.
454
- * @param {object} renderContext The context to copy against.
455
- * @returns {number} An `ALResult` value.
445
+ /**
446
+ * Copies a region from another texture.
447
+ *
448
+ * A whole-to-whole copy short-circuits; anything else must survive `Crop`,
449
+ * which is where a mismatched face count or an empty overlap is caught.
450
+ *
451
+ * @param {Tr2TextureSubresource} destSubresource The region to write.
452
+ * @param {Tr2TextureALStub} source The texture to read.
453
+ * @param {Tr2TextureSubresource} sourceSubresource The region to read.
454
+ * @param {object} renderContext The context to copy against.
455
+ * @returns {number} An `ALResult` value.
456
456
  */
457
457
  CopySubresourceRegion(destSubresource, source, sourceSubresource, renderContext) {
458
458
  if (!this.IsValid() || !renderContext.IsValid()) return ALResult.E_INVALIDCALL;
@@ -470,13 +470,13 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
470
470
  return ALResult.S_OK;
471
471
  }
472
472
 
473
- /**
474
- * Regenerates the mip chain.
475
- *
476
- * Only a texture that is both a render target and a shader resource can be
477
- * generated into, because that is how the hardware does it.
478
- *
479
- * @returns {number} An `ALResult` value.
473
+ /**
474
+ * Regenerates the mip chain.
475
+ *
476
+ * Only a texture that is both a render target and a shader resource can be
477
+ * generated into, because that is how the hardware does it.
478
+ *
479
+ * @returns {number} An `ALResult` value.
480
480
  */
481
481
  GenerateMipMaps() {
482
482
  if (!HasFlag(this._gpuUsage, Tr2GpuUsage.RENDER_TARGET) || !HasFlag(this._gpuUsage, Tr2GpuUsage.SHADER_RESOURCE)) {
@@ -485,15 +485,15 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
485
485
  return ALResult.S_OK;
486
486
  }
487
487
 
488
- /**
489
- * Resolves a multisampled texture into a single-sampled one.
490
- *
491
- * With one sample there is nothing to resolve, so Carbon falls back to a
492
- * plain copy - and inherits that copy's validation with it.
493
- *
494
- * @param {Tr2TextureALStub} destination The texture to resolve into.
495
- * @param {object} renderContext The context to resolve against.
496
- * @returns {number} An `ALResult` value.
488
+ /**
489
+ * Resolves a multisampled texture into a single-sampled one.
490
+ *
491
+ * With one sample there is nothing to resolve, so Carbon falls back to a
492
+ * plain copy - and inherits that copy's validation with it.
493
+ *
494
+ * @param {Tr2TextureALStub} destination The texture to resolve into.
495
+ * @param {object} renderContext The context to resolve against.
496
+ * @returns {number} An `ALResult` value.
497
497
  */
498
498
  Resolve(destination, renderContext) {
499
499
  if (this._msaa.samples <= 1) {
@@ -512,58 +512,58 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
512
512
  return ALResult.S_OK;
513
513
  }
514
514
 
515
- /**
516
- * The handle another device could open this texture by.
517
- *
518
- * @returns {number} Always zero; the stub shares nothing.
515
+ /**
516
+ * The handle another device could open this texture by.
517
+ *
518
+ * @returns {number} Always zero; the stub shares nothing.
519
519
  */
520
520
  GetSharedHandle() {
521
521
  return 0;
522
522
  }
523
523
 
524
- /**
525
- * Where the shader-resource view sits in the descriptor heap.
526
- *
527
- * @returns {number} Carbon's "no index".
524
+ /**
525
+ * Where the shader-resource view sits in the descriptor heap.
526
+ *
527
+ * @returns {number} Carbon's "no index".
528
528
  */
529
529
  GetSrvIndexInHeap() {
530
530
  return NO_HEAP_INDEX;
531
531
  }
532
532
 
533
- /**
534
- * Where the unordered-access view sits in the descriptor heap.
535
- *
536
- * @returns {number} Carbon's "no index".
533
+ /**
534
+ * Where the unordered-access view sits in the descriptor heap.
535
+ *
536
+ * @returns {number} Carbon's "no index".
537
537
  */
538
538
  GetUavIndexInHeap() {
539
539
  return NO_HEAP_INDEX;
540
540
  }
541
541
 
542
- /**
543
- * Names the texture for a debugger.
544
- *
545
- * @param {string} _name The name Carbon would attach; the stub discards it.
546
- * @returns {number} An `ALResult` value; the stub keeps no name.
542
+ /**
543
+ * Names the texture for a debugger.
544
+ *
545
+ * @param {string} _name The name Carbon would attach; the stub discards it.
546
+ * @returns {number} An `ALResult` value; the stub keeps no name.
547
547
  */
548
548
  SetName(_name) {
549
549
  return ALResult.S_OK;
550
550
  }
551
551
 
552
- /**
553
- * The debug name.
554
- *
555
- * @returns {null} Always null, as Carbon's stub returns.
552
+ /**
553
+ * The debug name.
554
+ *
555
+ * @returns {null} Always null, as Carbon's stub returns.
556
556
  */
557
557
  GetName() {
558
558
  return null;
559
559
  }
560
560
  }
561
561
 
562
- /**
563
- * Copies a subresource region, so a call that crops does not alter its caller.
564
- *
565
- * @param {Tr2TextureSubresource} region The region to copy.
566
- * @returns {Tr2TextureSubresource} An independent copy.
562
+ /**
563
+ * Copies a subresource region, so a call that crops does not alter its caller.
564
+ *
565
+ * @param {Tr2TextureSubresource} region The region to copy.
566
+ * @returns {Tr2TextureSubresource} An independent copy.
567
567
  */
568
568
  function CopyRegion(region) {
569
569
  const copy = new Tr2TextureSubresource();