@carbonenginejs/runtime-resource 0.9.2 → 0.11.0

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 (544) hide show
  1. package/NOTICE +3 -2
  2. package/README.md +47 -6
  3. package/dist/CjsMotherLode.js +88 -88
  4. package/dist/CjsMotherLode.js.map +1 -1
  5. package/dist/CjsResMan.js +717 -228
  6. package/dist/CjsResMan.js.map +1 -1
  7. package/dist/CjsResManFetchProvider.js +94 -0
  8. package/dist/CjsResManFetchProvider.js.map +1 -0
  9. package/dist/{CjsResManQueue.js → CjsResManWorkQueue.js} +112 -25
  10. package/dist/CjsResManWorkQueue.js.map +1 -0
  11. package/dist/format/CjsBlueReader.js +89 -0
  12. package/dist/format/CjsBlueReader.js.map +1 -1
  13. package/dist/format/CjsFormat.js +42 -16
  14. package/dist/format/CjsFormat.js.map +1 -1
  15. package/dist/format/CjsReader.js +4 -0
  16. package/dist/format/CjsReader.js.map +1 -1
  17. package/dist/format/CjsResourceProbe.js +2 -0
  18. package/dist/format/CjsResourceProbe.js.map +1 -1
  19. package/dist/format/effect/effectPermutationGraph.js +257 -0
  20. package/dist/format/effect/effectPermutationGraph.js.map +1 -0
  21. package/dist/format/effect/effectReflectionPackage.js +636 -0
  22. package/dist/format/effect/effectReflectionPackage.js.map +1 -0
  23. package/dist/format/effect/sha256.js +114 -0
  24. package/dist/format/effect/sha256.js.map +1 -0
  25. package/dist/format/payloadContract.js +20 -0
  26. package/dist/format/payloadContract.js.map +1 -1
  27. package/dist/formats/black/CjsBlackFormat.js +15 -1
  28. package/dist/formats/black/CjsBlackFormat.js.map +1 -1
  29. package/dist/formats/black/core/CjsBlackBinaryReader.js +103 -0
  30. package/dist/formats/black/core/CjsBlackBinaryReader.js.map +1 -1
  31. package/dist/formats/black/core/CjsBlackPropertyReaders.js +61 -0
  32. package/dist/formats/black/core/CjsBlackPropertyReaders.js.map +1 -1
  33. package/dist/formats/black/core/CjsBlackReader.js +125 -0
  34. package/dist/formats/black/core/CjsBlackReader.js.map +1 -1
  35. package/dist/formats/black/core/CjsBlackSchemaRegistry.js +103 -0
  36. package/dist/formats/black/core/CjsBlackSchemaRegistry.js.map +1 -1
  37. package/dist/formats/black/core/helpers.js +17 -0
  38. package/dist/formats/black/core/helpers.js.map +1 -1
  39. package/dist/formats/bnk/CjsBnkFormat.js +8 -0
  40. package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
  41. package/dist/formats/bnk/core/helpers.js +20 -0
  42. package/dist/formats/bnk/core/helpers.js.map +1 -1
  43. package/dist/formats/bnk/core/musicNodes.js +40 -3
  44. package/dist/formats/bnk/core/musicNodes.js.map +1 -1
  45. package/dist/formats/bnk/core/soundbanksInfo.js +2 -0
  46. package/dist/formats/bnk/core/soundbanksInfo.js.map +1 -1
  47. package/dist/formats/cmf/core/binary.js +71 -0
  48. package/dist/formats/cmf/core/binary.js.map +1 -1
  49. package/dist/formats/cmf/core/buffers.js +4 -0
  50. package/dist/formats/cmf/core/buffers.js.map +1 -1
  51. package/dist/formats/cmf/core/helpers.js +31 -0
  52. package/dist/formats/cmf/core/helpers.js.map +1 -1
  53. package/dist/formats/cmf/core/schema.js +10 -0
  54. package/dist/formats/cmf/core/schema.js.map +1 -1
  55. package/dist/formats/cmf/core/shared.js +9 -0
  56. package/dist/formats/cmf/core/shared.js.map +1 -1
  57. package/dist/formats/cmf/core/writer.js +54 -0
  58. package/dist/formats/cmf/core/writer.js.map +1 -1
  59. package/dist/formats/dds/core/bc6h.js +10 -0
  60. package/dist/formats/dds/core/bc6h.js.map +1 -1
  61. package/dist/formats/dds/core/bc7.js +16 -0
  62. package/dist/formats/dds/core/bc7.js.map +1 -1
  63. package/dist/formats/dds/core/helpers.js +47 -0
  64. package/dist/formats/dds/core/helpers.js.map +1 -1
  65. package/dist/formats/dxbc/CjsDxbcFormat.js +142 -0
  66. package/dist/formats/dxbc/CjsDxbcFormat.js.map +1 -0
  67. package/dist/formats/dxbc/core/DxbcReader.js +266 -0
  68. package/dist/formats/dxbc/core/DxbcReader.js.map +1 -0
  69. package/dist/formats/dxbc/core/container.js +169 -0
  70. package/dist/formats/dxbc/core/container.js.map +1 -0
  71. package/dist/formats/dxbc/core/decoder.js +789 -0
  72. package/dist/formats/dxbc/core/decoder.js.map +1 -0
  73. package/dist/formats/dxbc/core/errors.js +19 -0
  74. package/dist/formats/dxbc/core/errors.js.map +1 -0
  75. package/dist/formats/dxbc/core/helpers.js +220 -0
  76. package/dist/formats/dxbc/core/helpers.js.map +1 -0
  77. package/dist/formats/dxbc/core/opcodes.js +45 -0
  78. package/dist/formats/dxbc/core/opcodes.js.map +1 -0
  79. package/dist/formats/dxbc/core/program.js +91 -0
  80. package/dist/formats/dxbc/core/program.js.map +1 -0
  81. package/dist/formats/dxbc/core/signature.js +172 -0
  82. package/dist/formats/dxbc/core/signature.js.map +1 -0
  83. package/dist/formats/dxbc/index.js +2 -0
  84. package/dist/formats/dxbc/index.js.map +1 -0
  85. package/dist/formats/fbx/core/helpers.js +21 -0
  86. package/dist/formats/fbx/core/helpers.js.map +1 -1
  87. package/dist/formats/flac/CjsFlacFormat.js +49 -0
  88. package/dist/formats/flac/CjsFlacFormat.js.map +1 -1
  89. package/dist/formats/flac/core/helpers.js +20 -0
  90. package/dist/formats/flac/core/helpers.js.map +1 -1
  91. package/dist/formats/gif/CjsGifFormat.js +49 -0
  92. package/dist/formats/gif/CjsGifFormat.js.map +1 -1
  93. package/dist/formats/gif/core/helpers.js +20 -0
  94. package/dist/formats/gif/core/helpers.js.map +1 -1
  95. package/dist/formats/gltf/core/helpers.js +15 -0
  96. package/dist/formats/gltf/core/helpers.js.map +1 -1
  97. package/dist/formats/gltf/core/parser.js +13 -0
  98. package/dist/formats/gltf/core/parser.js.map +1 -1
  99. package/dist/formats/gltf/core/targets.js +10 -0
  100. package/dist/formats/gltf/core/targets.js.map +1 -1
  101. package/dist/formats/gr2/core/bitknit2.js +2 -0
  102. package/dist/formats/gr2/core/bitknit2.js.map +1 -1
  103. package/dist/formats/gr2/core/helpers.js +20 -0
  104. package/dist/formats/gr2/core/helpers.js.map +1 -1
  105. package/dist/formats/gr2/core/targets.js +10 -0
  106. package/dist/formats/gr2/core/targets.js.map +1 -1
  107. package/dist/formats/hlsl/CjsHlslFormat.js +254 -0
  108. package/dist/formats/hlsl/CjsHlslFormat.js.map +1 -0
  109. package/dist/formats/hlsl/core/HlslBinaryUtils.js +15 -0
  110. package/dist/formats/hlsl/core/HlslBinaryUtils.js.map +1 -0
  111. package/dist/formats/hlsl/core/HlslEffectReadError.js +19 -0
  112. package/dist/formats/hlsl/core/HlslEffectReadError.js.map +1 -0
  113. package/dist/formats/hlsl/core/HlslEffectStateManager.js +130 -0
  114. package/dist/formats/hlsl/core/HlslEffectStateManager.js.map +1 -0
  115. package/dist/formats/hlsl/core/HlslReader.js +266 -0
  116. package/dist/formats/hlsl/core/HlslReader.js.map +1 -0
  117. package/dist/formats/hlsl/core/HlslRenderStateSetup.js +37 -0
  118. package/dist/formats/hlsl/core/HlslRenderStateSetup.js.map +1 -0
  119. package/dist/formats/hlsl/core/HlslResourceSetDescription.js +94 -0
  120. package/dist/formats/hlsl/core/HlslResourceSetDescription.js.map +1 -0
  121. package/dist/formats/hlsl/core/HlslShaderBytecode.js +44 -0
  122. package/dist/formats/hlsl/core/HlslShaderBytecode.js.map +1 -0
  123. package/dist/formats/hlsl/core/analysis.js +51 -0
  124. package/dist/formats/hlsl/core/analysis.js.map +1 -0
  125. package/dist/formats/hlsl/core/helpers.js +270 -0
  126. package/dist/formats/hlsl/core/helpers.js.map +1 -0
  127. package/dist/formats/hlsl/core/json.js +284 -0
  128. package/dist/formats/hlsl/core/json.js.map +1 -0
  129. package/dist/formats/hlsl/core/metadata.js +327 -0
  130. package/dist/formats/hlsl/core/metadata.js.map +1 -0
  131. package/dist/formats/hlsl/core/portableReflection.js +848 -0
  132. package/dist/formats/hlsl/core/portableReflection.js.map +1 -0
  133. package/dist/formats/hlsl/core/render-states.js +280 -0
  134. package/dist/formats/hlsl/core/render-states.js.map +1 -0
  135. package/dist/formats/hlsl/core/tr2/HlslRenderContextEnum.js +43 -0
  136. package/dist/formats/hlsl/core/tr2/HlslRenderContextEnum.js.map +1 -0
  137. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +294 -0
  138. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -0
  139. package/dist/formats/hlsl/core/tr2/resources/HlslShaderPermutation.js +33 -0
  140. package/dist/formats/hlsl/core/tr2/resources/HlslShaderPermutation.js.map +1 -0
  141. package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js +416 -0
  142. package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js.map +1 -0
  143. package/dist/formats/hlsl/core/tr2/shader/HlslEffectConstant.js +40 -0
  144. package/dist/formats/hlsl/core/tr2/shader/HlslEffectConstant.js.map +1 -0
  145. package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js +742 -0
  146. package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js.map +1 -0
  147. package/dist/formats/hlsl/core/tr2/shader/HlslEffectLibrary.js +52 -0
  148. package/dist/formats/hlsl/core/tr2/shader/HlslEffectLibrary.js.map +1 -0
  149. package/dist/formats/hlsl/core/tr2/shader/HlslEffectParameterAnnotation.js +38 -0
  150. package/dist/formats/hlsl/core/tr2/shader/HlslEffectParameterAnnotation.js.map +1 -0
  151. package/dist/formats/hlsl/core/tr2/shader/HlslEffectResource.js +50 -0
  152. package/dist/formats/hlsl/core/tr2/shader/HlslEffectResource.js.map +1 -0
  153. package/dist/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +86 -0
  154. package/dist/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js.map +1 -0
  155. package/dist/formats/hlsl/core/tr2/shader/HlslEffectTechnique.js +31 -0
  156. package/dist/formats/hlsl/core/tr2/shader/HlslEffectTechnique.js.map +1 -0
  157. package/dist/formats/hlsl/core/tr2/shader/HlslPass.js +42 -0
  158. package/dist/formats/hlsl/core/tr2/shader/HlslPass.js.map +1 -0
  159. package/dist/formats/hlsl/core/tr2/shader/HlslSamplerDescription.js +55 -0
  160. package/dist/formats/hlsl/core/tr2/shader/HlslSamplerDescription.js.map +1 -0
  161. package/dist/formats/hlsl/core/tr2/shader/HlslSamplerSetup.js +29 -0
  162. package/dist/formats/hlsl/core/tr2/shader/HlslSamplerSetup.js.map +1 -0
  163. package/dist/formats/hlsl/core/tr2/shader/HlslShader.js +220 -0
  164. package/dist/formats/hlsl/core/tr2/shader/HlslShader.js.map +1 -0
  165. package/dist/formats/hlsl/core/tr2/shader/HlslShaderOption.js +30 -0
  166. package/dist/formats/hlsl/core/tr2/shader/HlslShaderOption.js.map +1 -0
  167. package/dist/formats/hlsl/index.js +2 -0
  168. package/dist/formats/hlsl/index.js.map +1 -0
  169. package/dist/formats/hlsl/portable.js +2 -0
  170. package/dist/formats/hlsl/portable.js.map +1 -0
  171. package/dist/formats/index.js +4 -0
  172. package/dist/formats/index.js.map +1 -1
  173. package/dist/formats/jpeg/core/helpers.js +52 -0
  174. package/dist/formats/jpeg/core/helpers.js.map +1 -1
  175. package/dist/formats/jpeg/core/jpeg.js +93 -0
  176. package/dist/formats/jpeg/core/jpeg.js.map +1 -1
  177. package/dist/formats/mp3/core/helpers.js +37 -0
  178. package/dist/formats/mp3/core/helpers.js.map +1 -1
  179. package/dist/formats/mp4/core/helpers.js +35 -0
  180. package/dist/formats/mp4/core/helpers.js.map +1 -1
  181. package/dist/formats/ogg/CjsOggFormat.js +49 -0
  182. package/dist/formats/ogg/CjsOggFormat.js.map +1 -1
  183. package/dist/formats/ogg/core/helpers.js +23 -0
  184. package/dist/formats/ogg/core/helpers.js.map +1 -1
  185. package/dist/formats/ogg/core/vorbis.js +13 -0
  186. package/dist/formats/ogg/core/vorbis.js.map +1 -1
  187. package/dist/formats/png/core/helpers.js +52 -0
  188. package/dist/formats/png/core/helpers.js.map +1 -1
  189. package/dist/formats/red/CjsRedFormat.js +2 -0
  190. package/dist/formats/red/CjsRedFormat.js.map +1 -1
  191. package/dist/formats/red/core/CjsRedReader.js +52 -0
  192. package/dist/formats/red/core/CjsRedReader.js.map +1 -1
  193. package/dist/formats/red/core/helpers.js +19 -0
  194. package/dist/formats/red/core/helpers.js.map +1 -1
  195. package/dist/formats/stl/core/stl.js +8 -0
  196. package/dist/formats/stl/core/stl.js.map +1 -1
  197. package/dist/formats/stl/core/targets.js +10 -0
  198. package/dist/formats/stl/core/targets.js.map +1 -1
  199. package/dist/formats/tga/core/helpers.js +47 -0
  200. package/dist/formats/tga/core/helpers.js.map +1 -1
  201. package/dist/formats/wav/core/helpers.js +37 -0
  202. package/dist/formats/wav/core/helpers.js.map +1 -1
  203. package/dist/formats/webgl/CjsWebglFormat.js +221 -0
  204. package/dist/formats/webgl/CjsWebglFormat.js.map +1 -0
  205. package/dist/formats/webgl/core/cewg/CewgPackage.js +339 -0
  206. package/dist/formats/webgl/core/cewg/CewgPackage.js.map +1 -0
  207. package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js +104 -0
  208. package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js.map +1 -0
  209. package/dist/formats/webgl/core/cewg/binary.js +101 -0
  210. package/dist/formats/webgl/core/cewg/binary.js.map +1 -0
  211. package/dist/formats/webgl/core/cewgCompleteness.js +81 -0
  212. package/dist/formats/webgl/core/cewgCompleteness.js.map +1 -0
  213. package/dist/formats/webgl/core/effectPackage.js +789 -0
  214. package/dist/formats/webgl/core/effectPackage.js.map +1 -0
  215. package/dist/formats/webgl/core/effectPackageValidation.js +331 -0
  216. package/dist/formats/webgl/core/effectPackageValidation.js.map +1 -0
  217. package/dist/formats/webgl/core/errors.js +27 -0
  218. package/dist/formats/webgl/core/errors.js.map +1 -0
  219. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js +2678 -0
  220. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -0
  221. package/dist/formats/webgl/core/glsl/DxbcGlslHelpers.js +89 -0
  222. package/dist/formats/webgl/core/glsl/DxbcGlslHelpers.js.map +1 -0
  223. package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +428 -0
  224. package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -0
  225. package/dist/formats/webgl/core/helpers.js +306 -0
  226. package/dist/formats/webgl/core/helpers.js.map +1 -0
  227. package/dist/formats/webgl/index.js +2 -0
  228. package/dist/formats/webgl/index.js.map +1 -0
  229. package/dist/formats/webgpu/CjsWebgpuFormat.js +376 -0
  230. package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -0
  231. package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js +415 -0
  232. package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js.map +1 -0
  233. package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js +100 -0
  234. package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js.map +1 -0
  235. package/dist/formats/webgpu/core/cewgpu/binary.js +93 -0
  236. package/dist/formats/webgpu/core/cewgpu/binary.js.map +1 -0
  237. package/dist/formats/webgpu/core/cewgpu/tags.js +17 -0
  238. package/dist/formats/webgpu/core/cewgpu/tags.js.map +1 -0
  239. package/dist/formats/webgpu/core/effectAnalysis.js +82 -0
  240. package/dist/formats/webgpu/core/effectAnalysis.js.map +1 -0
  241. package/dist/formats/webgpu/core/effectBackendBodySet.js +305 -0
  242. package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -0
  243. package/dist/formats/webgpu/core/effectPackageValidation.js +1078 -0
  244. package/dist/formats/webgpu/core/effectPackageValidation.js.map +1 -0
  245. package/dist/formats/webgpu/core/errors.js +20 -0
  246. package/dist/formats/webgpu/core/errors.js.map +1 -0
  247. package/dist/formats/webgpu/core/helpers.js +448 -0
  248. package/dist/formats/webgpu/core/helpers.js.map +1 -0
  249. package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +223 -0
  250. package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js.map +1 -0
  251. package/dist/formats/webgpu/core/ir/buildControlFlow.js +220 -0
  252. package/dist/formats/webgpu/core/ir/buildControlFlow.js.map +1 -0
  253. package/dist/formats/webgpu/core/ir/indexableTemps.js +137 -0
  254. package/dist/formats/webgpu/core/ir/indexableTemps.js.map +1 -0
  255. package/dist/formats/webgpu/core/ir/inferValueTypes.js +454 -0
  256. package/dist/formats/webgpu/core/ir/inferValueTypes.js.map +1 -0
  257. package/dist/formats/webgpu/core/ir/lowerDxbcToIr.js +494 -0
  258. package/dist/formats/webgpu/core/ir/lowerDxbcToIr.js.map +1 -0
  259. package/dist/formats/webgpu/core/ir/resolveRegisterFlow.js +177 -0
  260. package/dist/formats/webgpu/core/ir/resolveRegisterFlow.js.map +1 -0
  261. package/dist/formats/webgpu/core/ir/sourceLanes.js +61 -0
  262. package/dist/formats/webgpu/core/ir/sourceLanes.js.map +1 -0
  263. package/dist/formats/webgpu/core/packageEffect.js +300 -0
  264. package/dist/formats/webgpu/core/packageEffect.js.map +1 -0
  265. package/dist/formats/webgpu/core/packageEffectSelection.js +164 -0
  266. package/dist/formats/webgpu/core/packageEffectSelection.js.map +1 -0
  267. package/dist/formats/webgpu/core/packageMetadata.js +8 -0
  268. package/dist/formats/webgpu/core/packageMetadata.js.map +1 -0
  269. package/dist/formats/webgpu/core/schema.js +4 -0
  270. package/dist/formats/webgpu/core/schema.js.map +1 -0
  271. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +275 -0
  272. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -0
  273. package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +182 -0
  274. package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js.map +1 -0
  275. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +324 -0
  276. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -0
  277. package/dist/formats/webgpu/core/wgsl/emitWgsl.js +356 -0
  278. package/dist/formats/webgpu/core/wgsl/emitWgsl.js.map +1 -0
  279. package/dist/formats/webgpu/core/wgsl/hoistEscapingValues.js +77 -0
  280. package/dist/formats/webgpu/core/wgsl/hoistEscapingValues.js.map +1 -0
  281. package/dist/formats/webgpu/core/wgsl/lowerBindingLayout.js +451 -0
  282. package/dist/formats/webgpu/core/wgsl/lowerBindingLayout.js.map +1 -0
  283. package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +754 -0
  284. package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js.map +1 -0
  285. package/dist/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +457 -0
  286. package/dist/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js.map +1 -0
  287. package/dist/formats/webgpu/core/wgsl/lowerFragmentProgram.js +1572 -0
  288. package/dist/formats/webgpu/core/wgsl/lowerFragmentProgram.js.map +1 -0
  289. package/dist/formats/webgpu/core/wgsl/lowerMergeHistogramsComputeProgram.js +659 -0
  290. package/dist/formats/webgpu/core/wgsl/lowerMergeHistogramsComputeProgram.js.map +1 -0
  291. package/dist/formats/webgpu/core/wgsl/lowerParticleClearComputePrograms.js +734 -0
  292. package/dist/formats/webgpu/core/wgsl/lowerParticleClearComputePrograms.js.map +1 -0
  293. package/dist/formats/webgpu/core/wgsl/lowerParticleEmitComputeProgram.js +583 -0
  294. package/dist/formats/webgpu/core/wgsl/lowerParticleEmitComputeProgram.js.map +1 -0
  295. package/dist/formats/webgpu/core/wgsl/lowerSkinVerticesComputeProgram.js +621 -0
  296. package/dist/formats/webgpu/core/wgsl/lowerSkinVerticesComputeProgram.js.map +1 -0
  297. package/dist/formats/webgpu/core/wgsl/lowerSortComputeProgram.js +824 -0
  298. package/dist/formats/webgpu/core/wgsl/lowerSortComputeProgram.js.map +1 -0
  299. package/dist/formats/webgpu/core/wgsl/lowerSortInnerComputeProgram.js +697 -0
  300. package/dist/formats/webgpu/core/wgsl/lowerSortInnerComputeProgram.js.map +1 -0
  301. package/dist/formats/webgpu/core/wgsl/lowerSortStepComputeProgram.js +559 -0
  302. package/dist/formats/webgpu/core/wgsl/lowerSortStepComputeProgram.js.map +1 -0
  303. package/dist/formats/webgpu/core/wgsl/lowerVertexProgram.js +1328 -0
  304. package/dist/formats/webgpu/core/wgsl/lowerVertexProgram.js.map +1 -0
  305. package/dist/formats/webgpu/core/wgsl/particleEmitSemanticDigest.js +110 -0
  306. package/dist/formats/webgpu/core/wgsl/particleEmitSemanticDigest.js.map +1 -0
  307. package/dist/formats/webgpu/core/wgsl/precisionControls.js +55 -0
  308. package/dist/formats/webgpu/core/wgsl/precisionControls.js.map +1 -0
  309. package/dist/formats/webgpu/core/wgsl/selectionPlans.js +758 -0
  310. package/dist/formats/webgpu/core/wgsl/selectionPlans.js.map +1 -0
  311. package/dist/formats/webgpu/core/wgsl/uniformity.js +78 -0
  312. package/dist/formats/webgpu/core/wgsl/uniformity.js.map +1 -0
  313. package/dist/formats/webgpu/core/wgsl/validateExactComputeIr.js +196 -0
  314. package/dist/formats/webgpu/core/wgsl/validateExactComputeIr.js.map +1 -0
  315. package/dist/formats/webgpu/core/wgsl/validateHandleOperand.js +37 -0
  316. package/dist/formats/webgpu/core/wgsl/validateHandleOperand.js.map +1 -0
  317. package/dist/formats/webgpu/index.js +2 -0
  318. package/dist/formats/webgpu/index.js.map +1 -0
  319. package/dist/formats/webm/core/helpers.js +35 -0
  320. package/dist/formats/webm/core/helpers.js.map +1 -1
  321. package/dist/formats/webp/CjsWebpFormat.js +49 -0
  322. package/dist/formats/webp/CjsWebpFormat.js.map +1 -1
  323. package/dist/formats/webp/core/helpers.js +23 -0
  324. package/dist/formats/webp/core/helpers.js.map +1 -1
  325. package/dist/formats/wem/CjsWemFormat.js +8 -0
  326. package/dist/formats/wem/CjsWemFormat.js.map +1 -1
  327. package/dist/formats/wem/core/bitStream.js +2 -0
  328. package/dist/formats/wem/core/bitStream.js.map +1 -1
  329. package/dist/formats/wem/core/helpers.js +20 -0
  330. package/dist/formats/wem/core/helpers.js.map +1 -1
  331. package/dist/formats/yaml/CjsYamlFormat.js +45 -0
  332. package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
  333. package/dist/formats/yaml/core/CjsYamlReader.js +91 -0
  334. package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -1
  335. package/dist/formats/yaml/core/helpers.js +10 -0
  336. package/dist/formats/yaml/core/helpers.js.map +1 -1
  337. package/dist/index.js +56 -43
  338. package/dist/index.js.map +1 -1
  339. package/dist/{CjsResource.js → resource/CjsResource.js} +232 -17
  340. package/dist/resource/CjsResource.js.map +1 -0
  341. package/dist/{resources → resource}/Tr2LightProfileRes.js +4 -3
  342. package/dist/resource/Tr2LightProfileRes.js.map +1 -0
  343. package/dist/{resources → resource/audio}/AudioGeometryResData.js +1 -1
  344. package/dist/resource/audio/AudioGeometryResData.js.map +1 -0
  345. package/dist/resource/audio/CjsAudioBufferRes.js +86 -0
  346. package/dist/resource/audio/CjsAudioBufferRes.js.map +1 -0
  347. package/dist/resource/audio/CjsAudioRes.js +213 -0
  348. package/dist/resource/audio/CjsAudioRes.js.map +1 -0
  349. package/dist/resource/audio/index.js +4 -0
  350. package/dist/resource/audio/index.js.map +1 -0
  351. package/dist/{resources → resource/geometry}/MeshDecalData.js +1 -1
  352. package/dist/resource/geometry/MeshDecalData.js.map +1 -0
  353. package/dist/{resources → resource/geometry}/MeshDecalLodData.js +1 -1
  354. package/dist/resource/geometry/MeshDecalLodData.js.map +1 -0
  355. package/dist/resource/geometry/TriGeometryRes.js +656 -0
  356. package/dist/resource/geometry/TriGeometryRes.js.map +1 -0
  357. package/dist/{resources → resource/geometry}/TriGeometryResAreaData.js +1 -1
  358. package/dist/resource/geometry/TriGeometryResAreaData.js.map +1 -0
  359. package/dist/{resources → resource/geometry}/TriGeometryResJointData.js +1 -1
  360. package/dist/resource/geometry/TriGeometryResJointData.js.map +1 -0
  361. package/dist/{resources → resource/geometry}/TriGeometryResLodData.js +1 -1
  362. package/dist/resource/geometry/TriGeometryResLodData.js.map +1 -0
  363. package/dist/{resources → resource/geometry}/TriGeometryResMeshData.js +1 -1
  364. package/dist/resource/geometry/TriGeometryResMeshData.js.map +1 -0
  365. package/dist/{resources → resource/geometry}/TriGeometryResSkeletonData.js +1 -1
  366. package/dist/resource/geometry/TriGeometryResSkeletonData.js.map +1 -0
  367. package/dist/{resources → resource/geometry}/TriJointBinding.js +1 -1
  368. package/dist/resource/geometry/TriJointBinding.js.map +1 -0
  369. package/dist/{resources → resource/geometry}/TriMorphTargetGeometryConstants.js +1 -1
  370. package/dist/resource/geometry/TriMorphTargetGeometryConstants.js.map +1 -0
  371. package/dist/{resources → resource/geometry}/TriRtGeometryConstants.js +1 -1
  372. package/dist/resource/geometry/TriRtGeometryConstants.js.map +1 -0
  373. package/dist/{resources → resource/geometry/granny}/GStateBindingCallbackData.js +1 -1
  374. package/dist/resource/geometry/granny/GStateBindingCallbackData.js.map +1 -0
  375. package/dist/{resources → resource/geometry/granny}/Tr2GrannyIntersectionResult.js +1 -1
  376. package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js.map +1 -0
  377. package/dist/{resources → resource/geometry/granny}/Tr2GrannyStateRes.js +6 -5
  378. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -0
  379. package/dist/{resources → resource/geometry/granny}/TriGrannyRes.js +6 -5
  380. package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -0
  381. package/dist/{resources → resource/geometry/granny}/enums.js +1 -9
  382. package/dist/resource/geometry/granny/enums.js.map +1 -0
  383. package/dist/resource/geometry/granny/index.js +6 -0
  384. package/dist/resource/geometry/granny/index.js.map +1 -0
  385. package/dist/resource/geometry/index.js +17 -0
  386. package/dist/resource/geometry/index.js.map +1 -0
  387. package/dist/resource/index.js +52 -0
  388. package/dist/resource/index.js.map +1 -0
  389. package/dist/resource/resourceBoundary.js +64 -0
  390. package/dist/resource/resourceBoundary.js.map +1 -0
  391. package/dist/resource/shader/Tr2EffectRes.js +429 -0
  392. package/dist/resource/shader/Tr2EffectRes.js.map +1 -0
  393. package/dist/resource/shader/Tr2MaterialArea.js +34 -0
  394. package/dist/resource/shader/Tr2MaterialArea.js.map +1 -0
  395. package/dist/resource/shader/Tr2MaterialMesh.js +30 -0
  396. package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -0
  397. package/dist/resource/shader/Tr2MaterialRes.js +35 -0
  398. package/dist/resource/shader/Tr2MaterialRes.js.map +1 -0
  399. package/dist/resource/shader/Tr2Shader.js +256 -0
  400. package/dist/resource/shader/Tr2Shader.js.map +1 -0
  401. package/dist/resource/shader/Tr2ShaderPermutation.js +47 -0
  402. package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -0
  403. package/dist/resource/shader/index.js +17 -0
  404. package/dist/resource/shader/index.js.map +1 -0
  405. package/dist/resource/shader/portable.js +33 -0
  406. package/dist/resource/shader/portable.js.map +1 -0
  407. package/dist/resource/shader/reflection/Tr2EffectConstant.js +135 -0
  408. package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -0
  409. package/dist/resource/shader/reflection/Tr2EffectDefine.js +28 -0
  410. package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -0
  411. package/dist/resource/shader/reflection/Tr2EffectDescription.js +107 -0
  412. package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -0
  413. package/dist/resource/shader/reflection/Tr2EffectLibrary.js +145 -0
  414. package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -0
  415. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +103 -0
  416. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -0
  417. package/dist/resource/shader/reflection/Tr2EffectResource.js +84 -0
  418. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -0
  419. package/dist/resource/shader/reflection/Tr2EffectStageInput.js +239 -0
  420. package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -0
  421. package/dist/resource/shader/reflection/Tr2EffectTechnique.js +66 -0
  422. package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -0
  423. package/dist/resource/shader/reflection/Tr2Pass.js +109 -0
  424. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -0
  425. package/dist/resource/shader/sampler/Tr2SamplerSetup.js +75 -0
  426. package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -0
  427. package/dist/{texture → resource/texture}/CjsTextureArrayRes.js +83 -6
  428. package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -0
  429. package/dist/{texture/CjsTextureParameterProxy.js → resource/texture/CjsTextureArrayResParameterProxy.js} +56 -10
  430. package/dist/resource/texture/CjsTextureArrayResParameterProxy.js.map +1 -0
  431. package/dist/{resources → resource/texture}/Tr2ImageRes.js +6 -4
  432. package/dist/resource/texture/Tr2ImageRes.js.map +1 -0
  433. package/dist/{resources → resource/texture}/Tr2TextureLodManager.js +3 -1
  434. package/dist/resource/texture/Tr2TextureLodManager.js.map +1 -0
  435. package/dist/{resources → resource/texture}/Tr2TextureLodUpdateRequest.js +1 -1
  436. package/dist/resource/texture/Tr2TextureLodUpdateRequest.js.map +1 -0
  437. package/dist/{resources → resource/texture}/Tr2TexturePackChannel.js +1 -1
  438. package/dist/resource/texture/Tr2TexturePackChannel.js.map +1 -0
  439. package/dist/{resources → resource/texture}/Tr2TexturePipeline.js +6 -4
  440. package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -0
  441. package/dist/{resources → resource/texture}/Tr2TexturePipelineParams.js +1 -1
  442. package/dist/resource/texture/Tr2TexturePipelineParams.js.map +1 -0
  443. package/dist/{resources → resource/texture}/Tr2TexturePipelineStepCompress.js +1 -1
  444. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -0
  445. package/dist/{resources → resource/texture}/Tr2TexturePipelineStepGenerateMips.js +1 -1
  446. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -0
  447. package/dist/{resources → resource/texture}/Tr2TexturePipelineStepLimitSize.js +1 -1
  448. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -0
  449. package/dist/{resources → resource/texture}/Tr2TexturePipelineStepLoad.js +1 -1
  450. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -0
  451. package/dist/{resources → resource/texture}/Tr2TexturePipelineStepPack.js +1 -1
  452. package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -0
  453. package/dist/{resources → resource/texture}/TriTextureRes.js +42 -26
  454. package/dist/resource/texture/TriTextureRes.js.map +1 -0
  455. package/dist/resource/texture/index.js +15 -0
  456. package/dist/resource/texture/index.js.map +1 -0
  457. package/dist/{resources → resource/texture}/texturePipelineBehavior.js +59 -59
  458. package/dist/resource/texture/texturePipelineBehavior.js.map +1 -0
  459. package/dist/worker/CjsResManMainThreadLoader.js +87 -0
  460. package/dist/worker/CjsResManMainThreadLoader.js.map +1 -0
  461. package/dist/worker/CjsResManWorker.js +217 -0
  462. package/dist/worker/CjsResManWorker.js.map +1 -0
  463. package/dist/worker/CjsResManWorkerLoader.js +434 -0
  464. package/dist/worker/CjsResManWorkerLoader.js.map +1 -0
  465. package/dist/worker/protocol.js +12 -0
  466. package/dist/worker/protocol.js.map +1 -0
  467. package/docs/README.md +16 -3
  468. package/docs/architecture.md +39 -16
  469. package/docs/concepts/resource-lifecycle.md +2 -1
  470. package/docs/formats/README.md +8 -0
  471. package/docs/formats/provenance.md +11 -3
  472. package/docs/reference/classes/README.md +6 -4
  473. package/docs/reference/classes/audio.md +30 -0
  474. package/docs/reference/classes/core.md +31 -11
  475. package/docs/reference/classes/formats.md +440 -0
  476. package/docs/reference/classes/resources.md +151 -41
  477. package/docs/reference/classes/texture.md +7 -7
  478. package/docs/reference/motherlode-cache.md +17 -0
  479. package/docs/reference/queues.md +9 -1
  480. package/docs/reference/workers.md +135 -0
  481. package/docs/roadmap.md +27 -1
  482. package/format-notices/dxbc/LICENSE +21 -0
  483. package/format-notices/dxbc/NOTICE +20 -0
  484. package/format-notices/hlsl/LICENSE +21 -0
  485. package/format-notices/hlsl/NOTICE +25 -0
  486. package/format-notices/webgl/LICENSE +21 -0
  487. package/format-notices/webgl/NOTICE +35 -0
  488. package/format-notices/webgpu/LICENSE +21 -0
  489. package/format-notices/webgpu/NOTICE +31 -0
  490. package/package.json +13 -1
  491. package/dist/CjsResManQueue.js.map +0 -1
  492. package/dist/CjsResource.js.map +0 -1
  493. package/dist/CjsResourceSource.js +0 -68
  494. package/dist/CjsResourceSource.js.map +0 -1
  495. package/dist/resourcePath.js +0 -18
  496. package/dist/resourcePath.js.map +0 -1
  497. package/dist/resourceStates.js +0 -9
  498. package/dist/resourceStates.js.map +0 -1
  499. package/dist/resources/AudioGeometryResData.js.map +0 -1
  500. package/dist/resources/GStateBindingCallbackData.js.map +0 -1
  501. package/dist/resources/MeshDecalData.js.map +0 -1
  502. package/dist/resources/MeshDecalLodData.js.map +0 -1
  503. package/dist/resources/Tr2EffectRes.js +0 -71
  504. package/dist/resources/Tr2EffectRes.js.map +0 -1
  505. package/dist/resources/Tr2GrannyIntersectionResult.js.map +0 -1
  506. package/dist/resources/Tr2GrannyStateRes.js.map +0 -1
  507. package/dist/resources/Tr2ImageRes.js.map +0 -1
  508. package/dist/resources/Tr2LightProfileRes.js.map +0 -1
  509. package/dist/resources/Tr2MaterialArea.js +0 -34
  510. package/dist/resources/Tr2MaterialArea.js.map +0 -1
  511. package/dist/resources/Tr2MaterialMesh.js +0 -31
  512. package/dist/resources/Tr2MaterialMesh.js.map +0 -1
  513. package/dist/resources/Tr2MaterialRes.js +0 -34
  514. package/dist/resources/Tr2MaterialRes.js.map +0 -1
  515. package/dist/resources/Tr2ShaderPermutation.js +0 -43
  516. package/dist/resources/Tr2ShaderPermutation.js.map +0 -1
  517. package/dist/resources/Tr2TextureLodManager.js.map +0 -1
  518. package/dist/resources/Tr2TextureLodUpdateRequest.js.map +0 -1
  519. package/dist/resources/Tr2TexturePackChannel.js.map +0 -1
  520. package/dist/resources/Tr2TexturePipeline.js.map +0 -1
  521. package/dist/resources/Tr2TexturePipelineParams.js.map +0 -1
  522. package/dist/resources/Tr2TexturePipelineStepCompress.js.map +0 -1
  523. package/dist/resources/Tr2TexturePipelineStepGenerateMips.js.map +0 -1
  524. package/dist/resources/Tr2TexturePipelineStepLimitSize.js.map +0 -1
  525. package/dist/resources/Tr2TexturePipelineStepLoad.js.map +0 -1
  526. package/dist/resources/Tr2TexturePipelineStepPack.js.map +0 -1
  527. package/dist/resources/TriGeometryRes.js +0 -239
  528. package/dist/resources/TriGeometryRes.js.map +0 -1
  529. package/dist/resources/TriGeometryResAreaData.js.map +0 -1
  530. package/dist/resources/TriGeometryResJointData.js.map +0 -1
  531. package/dist/resources/TriGeometryResLodData.js.map +0 -1
  532. package/dist/resources/TriGeometryResMeshData.js.map +0 -1
  533. package/dist/resources/TriGeometryResSkeletonData.js.map +0 -1
  534. package/dist/resources/TriGrannyRes.js.map +0 -1
  535. package/dist/resources/TriJointBinding.js.map +0 -1
  536. package/dist/resources/TriMorphTargetGeometryConstants.js.map +0 -1
  537. package/dist/resources/TriRtGeometryConstants.js.map +0 -1
  538. package/dist/resources/TriTextureRes.js.map +0 -1
  539. package/dist/resources/enums.js.map +0 -1
  540. package/dist/resources/resourceBoundary.js +0 -47
  541. package/dist/resources/resourceBoundary.js.map +0 -1
  542. package/dist/resources/texturePipelineBehavior.js.map +0 -1
  543. package/dist/texture/CjsTextureArrayRes.js.map +0 -1
  544. package/dist/texture/CjsTextureParameterProxy.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  # Resources class catalog
2
2
 
3
3
  Status: Evolving
4
- Scope: `@carbonenginejs/runtime-resource` classes under `src/resources`
4
+ Scope: `@carbonenginejs/runtime-resource` classes under `src/resource`
5
5
  Audience: Users, maintainers, and automated readers
6
- Summary: Provides one-sentence purpose descriptors for the Carbon-shaped semantic resource and data classes in src/resources.
6
+ Summary: Provides one-sentence purpose descriptors for the Carbon-shaped semantic resource and data classes in the src/resource family tree.
7
7
 
8
8
  <!-- class:AudioGeometryResData -->
9
9
  ## `AudioGeometryResData`
@@ -11,7 +11,7 @@ Summary: Provides one-sentence purpose descriptors for the Carbon-shaped semanti
11
11
  Data record mirroring Carbon's per-mesh audio-geometry block: an id plus the vertices, indices, and min/max bounds consumed by audio occlusion.
12
12
 
13
13
  - Export: `@carbonenginejs/runtime-resource`
14
- - Source: `src/resources/AudioGeometryResData.js`
14
+ - Source: `src/resource/audio/AudioGeometryResData.js`
15
15
  - Visibility: Public
16
16
  - Kind: Faithful Carbon port
17
17
 
@@ -21,7 +21,7 @@ Data record mirroring Carbon's per-mesh audio-geometry block: an id plus the ver
21
21
  Data record mirroring Carbon's GState binding callback payload, holding the `gsf_path` string that identifies the Granny state file to bind.
22
22
 
23
23
  - Export: `@carbonenginejs/runtime-resource`
24
- - Source: `src/resources/GStateBindingCallbackData.js`
24
+ - Source: `src/resource/geometry/granny/GStateBindingCallbackData.js`
25
25
  - Visibility: Public
26
26
  - Kind: Faithful Carbon port
27
27
 
@@ -31,7 +31,7 @@ Data record mirroring Carbon's GState binding callback payload, holding the `gsf
31
31
  Data record mirroring Carbon's per-mesh decal block: an index-buffer allocation reference, a LOD mask, and the per-LOD decal ranges.
32
32
 
33
33
  - Export: `@carbonenginejs/runtime-resource`
34
- - Source: `src/resources/MeshDecalData.js`
34
+ - Source: `src/resource/geometry/MeshDecalData.js`
35
35
  - Visibility: Public
36
36
  - Kind: Faithful Carbon port
37
37
 
@@ -41,17 +41,127 @@ Data record mirroring Carbon's per-mesh decal block: an index-buffer allocation
41
41
  Data record mirroring Carbon's per-LOD decal range, holding the start index and primitive count for one decal LOD.
42
42
 
43
43
  - Export: `@carbonenginejs/runtime-resource`
44
- - Source: `src/resources/MeshDecalLodData.js`
44
+ - Source: `src/resource/geometry/MeshDecalLodData.js`
45
45
  - Visibility: Public
46
46
  - Kind: Faithful Carbon port
47
47
 
48
48
  <!-- class:Tr2EffectRes -->
49
49
  ## `Tr2EffectRes`
50
50
 
51
- Resource record that owns effect/shader payload facts, including the permutation description, while engine packages decide shader-module, pipeline, bind-group, and sampler realization.
51
+ Resource record that owns an effect package, resolves global and local permutation options, hydrates exact portable reflection into canonical shaders, and caches them by body index.
52
52
 
53
53
  - Export: `@carbonenginejs/runtime-resource`
54
- - Source: `src/resources/Tr2EffectRes.js`
54
+ - Source: `src/resource/shader/Tr2EffectRes.js`
55
+ - Visibility: Public
56
+ - Kind: Adapted Carbon concept
57
+
58
+ <!-- class:Tr2EffectConstant -->
59
+ ## `Tr2EffectConstant`
60
+
61
+ Canonical device-free reflection record for one named constant, including register layout and exact default bytes.
62
+
63
+ - Export: `@carbonenginejs/runtime-resource/resource/shader`
64
+ - Source: `src/resource/shader/reflection/Tr2EffectConstant.js`
65
+ - Visibility: Public
66
+ - Kind: Adapted Carbon concept
67
+
68
+ <!-- class:Tr2EffectDefine -->
69
+ ## `Tr2EffectDefine`
70
+
71
+ Canonical name/value record for one reflected effect define.
72
+
73
+ - Export: `@carbonenginejs/runtime-resource/resource/shader`
74
+ - Source: `src/resource/shader/reflection/Tr2EffectDefine.js`
75
+ - Visibility: Public
76
+ - Kind: Faithful Carbon port
77
+
78
+ <!-- class:Tr2EffectDescription -->
79
+ ## `Tr2EffectDescription`
80
+
81
+ Canonical device-free effect body containing techniques, annotations, and library reflection.
82
+
83
+ - Export: `@carbonenginejs/runtime-resource/resource/shader`
84
+ - Source: `src/resource/shader/reflection/Tr2EffectDescription.js`
85
+ - Visibility: Public
86
+ - Kind: Adapted Carbon concept
87
+
88
+ <!-- class:Tr2EffectLibrary -->
89
+ ## `Tr2EffectLibrary`
90
+
91
+ Canonical reflected shader-library record containing source bytes, exported symbols, and derived ray-tracing entry roles.
92
+
93
+ - Export: `@carbonenginejs/runtime-resource/resource/shader`
94
+ - Source: `src/resource/shader/reflection/Tr2EffectLibrary.js`
95
+ - Visibility: Public
96
+ - Kind: Adapted Carbon concept
97
+
98
+ <!-- class:Tr2EffectParameterAnnotation -->
99
+ ## `Tr2EffectParameterAnnotation`
100
+
101
+ Canonical typed parameter annotation that also preserves its exact raw scalar bits.
102
+
103
+ - Export: `@carbonenginejs/runtime-resource/resource/shader`
104
+ - Source: `src/resource/shader/reflection/Tr2EffectParameterAnnotation.js`
105
+ - Visibility: Public
106
+ - Kind: Adapted Carbon concept
107
+
108
+ <!-- class:Tr2EffectResource -->
109
+ ## `Tr2EffectResource`
110
+
111
+ Canonical stage-resource reflection record for textures, buffers, UAVs, and related binding metadata.
112
+
113
+ - Export: `@carbonenginejs/runtime-resource/resource/shader`
114
+ - Source: `src/resource/shader/reflection/Tr2EffectResource.js`
115
+ - Visibility: Public
116
+ - Kind: Adapted Carbon concept
117
+
118
+ <!-- class:Tr2EffectStageInput -->
119
+ ## `Tr2EffectStageInput`
120
+
121
+ Canonical device-free stage record containing source program bytes, constants, resources, samplers, and signatures.
122
+
123
+ - Export: `@carbonenginejs/runtime-resource/resource/shader`
124
+ - Source: `src/resource/shader/reflection/Tr2EffectStageInput.js`
125
+ - Visibility: Public
126
+ - Kind: Adapted Carbon concept
127
+
128
+ <!-- class:Tr2EffectTechnique -->
129
+ ## `Tr2EffectTechnique`
130
+
131
+ Canonical named technique record containing its ordered reflected passes and shader-type mask.
132
+
133
+ - Export: `@carbonenginejs/runtime-resource/resource/shader`
134
+ - Source: `src/resource/shader/reflection/Tr2EffectTechnique.js`
135
+ - Visibility: Public
136
+ - Kind: Adapted Carbon concept
137
+
138
+ <!-- class:Tr2Pass -->
139
+ ## `Tr2Pass`
140
+
141
+ Canonical reflected pass record containing ordered stage inputs and renderer-neutral render-state values.
142
+
143
+ - Export: `@carbonenginejs/runtime-resource/resource/shader`
144
+ - Source: `src/resource/shader/reflection/Tr2Pass.js`
145
+ - Visibility: Public
146
+ - Kind: Adapted Carbon concept
147
+
148
+ <!-- class:Tr2SamplerSetup -->
149
+ ## `Tr2SamplerSetup`
150
+
151
+ Canonical device-free sampler reflection record preserving static/dynamic setup and nullable source names.
152
+
153
+ - Export: `@carbonenginejs/runtime-resource/resource/shader`
154
+ - Source: `src/resource/shader/sampler/Tr2SamplerSetup.js`
155
+ - Visibility: Public
156
+ - Kind: Adapted Carbon concept
157
+
158
+ <!-- class:Tr2Shader -->
159
+ ## `Tr2Shader`
160
+
161
+ Canonical device-free hydrated shader graph and top-level portable-reflection orchestrator.
162
+
163
+ - Export: `@carbonenginejs/runtime-resource/resource/shader`
164
+ - Source: `src/resource/shader/Tr2Shader.js`
55
165
  - Visibility: Public
56
166
  - Kind: Adapted Carbon concept
57
167
 
@@ -61,7 +171,7 @@ Resource record that owns effect/shader payload facts, including the permutation
61
171
  Data record mirroring Carbon's Granny intersection-query result: hit position, normal, UV, bone index, and mesh/area indices with per-field presence flags.
62
172
 
63
173
  - Export: `@carbonenginejs/runtime-resource`
64
- - Source: `src/resources/Tr2GrannyIntersectionResult.js`
174
+ - Source: `src/resource/geometry/granny/Tr2GrannyIntersectionResult.js`
65
175
  - Visibility: Public
66
176
  - Kind: Faithful Carbon port
67
177
 
@@ -71,7 +181,7 @@ Data record mirroring Carbon's Granny intersection-query result: hit position, n
71
181
  Resource that holds a plain GState payload, which may carry additive skeleton/state data without models, and validates that skeleton data or additive animations are present.
72
182
 
73
183
  - Export: `@carbonenginejs/runtime-resource`
74
- - Source: `src/resources/Tr2GrannyStateRes.js`
184
+ - Source: `src/resource/geometry/granny/Tr2GrannyStateRes.js`
75
185
  - Visibility: Public
76
186
  - Kind: Adapted Carbon concept
77
187
 
@@ -81,7 +191,7 @@ Resource that holds a plain GState payload, which may carry additive skeleton/st
81
191
  Resource record that holds a validated canonical RGBA image payload and mirrors its width/height metadata, leaving any device texture realization to engine packages.
82
192
 
83
193
  - Export: `@carbonenginejs/runtime-resource`
84
- - Source: `src/resources/Tr2ImageRes.js`
194
+ - Source: `src/resource/texture/Tr2ImageRes.js`
85
195
  - Visibility: Public
86
196
  - Kind: Adapted Carbon concept
87
197
 
@@ -91,47 +201,47 @@ Resource record that holds a validated canonical RGBA image payload and mirrors
91
201
  Resource that holds a plain light-profile payload, which may be richer than the data retained by the resource or the active engine adapter.
92
202
 
93
203
  - Export: `@carbonenginejs/runtime-resource`
94
- - Source: `src/resources/Tr2LightProfileRes.js`
204
+ - Source: `src/resource/Tr2LightProfileRes.js`
95
205
  - Visibility: Public
96
206
  - Kind: Adapted Carbon concept
97
207
 
98
208
  <!-- class:Tr2MaterialArea -->
99
209
  ## `Tr2MaterialArea`
100
210
 
101
- Persisted data record mirroring Carbon's material-area node, pairing a material parameter-store reference with a metatype string.
211
+ Associates one material-area metatype with its persisted parameter store.
102
212
 
103
213
  - Export: `@carbonenginejs/runtime-resource`
104
- - Source: `src/resources/Tr2MaterialArea.js`
214
+ - Source: `src/resource/shader/Tr2MaterialArea.js`
105
215
  - Visibility: Public
106
216
  - Kind: Faithful Carbon port
107
217
 
108
218
  <!-- class:Tr2MaterialMesh -->
109
219
  ## `Tr2MaterialMesh`
110
220
 
111
- Persisted data record mirroring Carbon's material-mesh node, holding the dictionary of material areas for one mesh.
221
+ Holds the persisted material-area dictionary for one material mesh.
112
222
 
113
223
  - Export: `@carbonenginejs/runtime-resource`
114
- - Source: `src/resources/Tr2MaterialMesh.js`
224
+ - Source: `src/resource/shader/Tr2MaterialMesh.js`
115
225
  - Visibility: Public
116
226
  - Kind: Faithful Carbon port
117
227
 
118
228
  <!-- class:Tr2MaterialRes -->
119
229
  ## `Tr2MaterialRes`
120
230
 
121
- Persisted data record mirroring Carbon's material resource root, holding a name and the dictionary of material meshes.
231
+ Root persisted material record containing its authored name and material mesh dictionary.
122
232
 
123
233
  - Export: `@carbonenginejs/runtime-resource`
124
- - Source: `src/resources/Tr2MaterialRes.js`
234
+ - Source: `src/resource/shader/Tr2MaterialRes.js`
125
235
  - Visibility: Public
126
236
  - Kind: Faithful Carbon port
127
237
 
128
238
  <!-- class:Tr2ShaderPermutation -->
129
239
  ## `Tr2ShaderPermutation`
130
240
 
131
- Data record mirroring Carbon's shader-permutation description: name, option list, default option, description text, and permutation type.
241
+ Describes one authored effect permutation and the option values a shader resolver may select.
132
242
 
133
243
  - Export: `@carbonenginejs/runtime-resource`
134
- - Source: `src/resources/Tr2ShaderPermutation.js`
244
+ - Source: `src/resource/shader/Tr2ShaderPermutation.js`
135
245
  - Visibility: Public
136
246
  - Kind: Faithful Carbon port
137
247
 
@@ -141,7 +251,7 @@ Data record mirroring Carbon's shader-permutation description: name, option list
141
251
  CPU-side registry of texture resources participating in LOD management that owns deterministic membership and Carbon-shaped memory counters, while device allocation and budget policy stay in engine packages.
142
252
 
143
253
  - Export: `@carbonenginejs/runtime-resource`
144
- - Source: `src/resources/Tr2TextureLodManager.js`
254
+ - Source: `src/resource/texture/Tr2TextureLodManager.js`
145
255
  - Visibility: Public
146
256
  - Kind: Adapted Carbon concept
147
257
 
@@ -151,7 +261,7 @@ CPU-side registry of texture resources participating in LOD management that owns
151
261
  Data record mirroring Carbon's texture-LOD update request: the frame number, requested mip change, and RAM-cache flag.
152
262
 
153
263
  - Export: `@carbonenginejs/runtime-resource`
154
- - Source: `src/resources/Tr2TextureLodUpdateRequest.js`
264
+ - Source: `src/resource/texture/Tr2TextureLodUpdateRequest.js`
155
265
  - Visibility: Public
156
266
  - Kind: Faithful Carbon port
157
267
 
@@ -161,7 +271,7 @@ Data record mirroring Carbon's texture-LOD update request: the frame number, req
161
271
  Persisted data record mirroring Carbon's pack-step channel selection: the source channel index, fill value, and source texture path for one output channel.
162
272
 
163
273
  - Export: `@carbonenginejs/runtime-resource`
164
- - Source: `src/resources/Tr2TexturePackChannel.js`
274
+ - Source: `src/resource/texture/Tr2TexturePackChannel.js`
165
275
  - Visibility: Public
166
276
  - Kind: Faithful Carbon port
167
277
 
@@ -171,7 +281,7 @@ Persisted data record mirroring Carbon's pack-step channel selection: the source
171
281
  Persisted CPU bitmap-transformation pipeline that executes its ordered steps asynchronously to produce a canonical plain RGBA payload and reports the resource paths its load and pack steps depend on.
172
282
 
173
283
  - Export: `@carbonenginejs/runtime-resource`
174
- - Source: `src/resources/Tr2TexturePipeline.js`
284
+ - Source: `src/resource/texture/Tr2TexturePipeline.js`
175
285
  - Visibility: Public
176
286
  - Kind: Adapted Carbon concept
177
287
 
@@ -181,7 +291,7 @@ Persisted CPU bitmap-transformation pipeline that executes its ordered steps asy
181
291
  Data record mirroring Carbon's texture-pipeline execution parameters, holding the maximum output width and height.
182
292
 
183
293
  - Export: `@carbonenginejs/runtime-resource`
184
- - Source: `src/resources/Tr2TexturePipelineParams.js`
294
+ - Source: `src/resource/texture/Tr2TexturePipelineParams.js`
185
295
  - Visibility: Public
186
296
  - Kind: Faithful Carbon port
187
297
 
@@ -191,7 +301,7 @@ Data record mirroring Carbon's texture-pipeline execution parameters, holding th
191
301
  Persisted pipeline-step record mirroring Carbon's compress step, naming the target pixel format and per-channel error weights.
192
302
 
193
303
  - Export: `@carbonenginejs/runtime-resource`
194
- - Source: `src/resources/Tr2TexturePipelineStepCompress.js`
304
+ - Source: `src/resource/texture/Tr2TexturePipelineStepCompress.js`
195
305
  - Visibility: Public
196
306
  - Kind: Faithful Carbon port
197
307
 
@@ -201,7 +311,7 @@ Persisted pipeline-step record mirroring Carbon's compress step, naming the targ
201
311
  Attribute-free persisted marker step mirroring Carbon's mip-generation step; the mip generation itself happens where the pipeline executes.
202
312
 
203
313
  - Export: `@carbonenginejs/runtime-resource`
204
- - Source: `src/resources/Tr2TexturePipelineStepGenerateMips.js`
314
+ - Source: `src/resource/texture/Tr2TexturePipelineStepGenerateMips.js`
205
315
  - Visibility: Public
206
316
  - Kind: Faithful Carbon port
207
317
 
@@ -211,7 +321,7 @@ Attribute-free persisted marker step mirroring Carbon's mip-generation step; the
211
321
  Persisted pipeline-step record mirroring Carbon's size-limit step, holding the maximum width and height the bitmap may keep.
212
322
 
213
323
  - Export: `@carbonenginejs/runtime-resource`
214
- - Source: `src/resources/Tr2TexturePipelineStepLimitSize.js`
324
+ - Source: `src/resource/texture/Tr2TexturePipelineStepLimitSize.js`
215
325
  - Visibility: Public
216
326
  - Kind: Faithful Carbon port
217
327
 
@@ -221,7 +331,7 @@ Persisted pipeline-step record mirroring Carbon's size-limit step, holding the m
221
331
  Persisted pipeline-step record mirroring Carbon's load step, holding the source texture path the pipeline reads.
222
332
 
223
333
  - Export: `@carbonenginejs/runtime-resource`
224
- - Source: `src/resources/Tr2TexturePipelineStepLoad.js`
334
+ - Source: `src/resource/texture/Tr2TexturePipelineStepLoad.js`
225
335
  - Visibility: Public
226
336
  - Kind: Faithful Carbon port
227
337
 
@@ -231,7 +341,7 @@ Persisted pipeline-step record mirroring Carbon's load step, holding the source
231
341
  Persisted pipeline-step record mirroring Carbon's pack step, naming the target pixel format and the four per-channel pack sources.
232
342
 
233
343
  - Export: `@carbonenginejs/runtime-resource`
234
- - Source: `src/resources/Tr2TexturePipelineStepPack.js`
344
+ - Source: `src/resource/texture/Tr2TexturePipelineStepPack.js`
235
345
  - Visibility: Public
236
346
  - Kind: Faithful Carbon port
237
347
 
@@ -241,7 +351,7 @@ Persisted pipeline-step record mirroring Carbon's pack step, naming the target p
241
351
  Resource record that owns geometry payload facts (meshes, optional skeletons and animations) and LOD-force metadata, while engine packages decide device buffers, vertex declarations, and draw-time state.
242
352
 
243
353
  - Export: `@carbonenginejs/runtime-resource`
244
- - Source: `src/resources/TriGeometryRes.js`
354
+ - Source: `src/resource/geometry/TriGeometryRes.js`
245
355
  - Visibility: Public
246
356
  - Kind: Adapted Carbon concept
247
357
 
@@ -251,7 +361,7 @@ Resource record that owns geometry payload facts (meshes, optional skeletons and
251
361
  Data record mirroring Carbon's geometry area block: a named draw range with bounds, joint bindings, skinning/morph flags, and ray-tracing structure references.
252
362
 
253
363
  - Export: `@carbonenginejs/runtime-resource`
254
- - Source: `src/resources/TriGeometryResAreaData.js`
364
+ - Source: `src/resource/geometry/TriGeometryResAreaData.js`
255
365
  - Visibility: Public
256
366
  - Kind: Faithful Carbon port
257
367
 
@@ -261,7 +371,7 @@ Data record mirroring Carbon's geometry area block: a named draw range with boun
261
371
  Data record mirroring Carbon's geometry joint entry: a joint name, parent-joint index, and inverse world transform.
262
372
 
263
373
  - Export: `@carbonenginejs/runtime-resource`
264
- - Source: `src/resources/TriGeometryResJointData.js`
374
+ - Source: `src/resource/geometry/TriGeometryResJointData.js`
265
375
  - Visibility: Public
266
376
  - Kind: Faithful Carbon port
267
377
 
@@ -271,7 +381,7 @@ Data record mirroring Carbon's geometry joint entry: a joint name, parent-joint
271
381
  Data record mirroring Carbon's per-LOD geometry block: mesh reference, naming and screen-size selection data, vertex/primitive counts, UV densities, areas, and buffer-allocation references.
272
382
 
273
383
  - Export: `@carbonenginejs/runtime-resource`
274
- - Source: `src/resources/TriGeometryResLodData.js`
384
+ - Source: `src/resource/geometry/TriGeometryResLodData.js`
275
385
  - Visibility: Public
276
386
  - Kind: Faithful Carbon port
277
387
 
@@ -281,7 +391,7 @@ Data record mirroring Carbon's per-LOD geometry block: mesh reference, naming an
281
391
  Data record mirroring Carbon's per-mesh geometry block: name, vertex layout facts, bounds, joint bindings, audio geometry, decals, and the LOD list.
282
392
 
283
393
  - Export: `@carbonenginejs/runtime-resource`
284
- - Source: `src/resources/TriGeometryResMeshData.js`
394
+ - Source: `src/resource/geometry/TriGeometryResMeshData.js`
285
395
  - Visibility: Public
286
396
  - Kind: Faithful Carbon port
287
397
 
@@ -291,7 +401,7 @@ Data record mirroring Carbon's per-mesh geometry block: name, vertex layout fact
291
401
  Data record mirroring Carbon's geometry skeleton block, pairing a skeleton name with its joint list.
292
402
 
293
403
  - Export: `@carbonenginejs/runtime-resource`
294
- - Source: `src/resources/TriGeometryResSkeletonData.js`
404
+ - Source: `src/resource/geometry/TriGeometryResSkeletonData.js`
295
405
  - Visibility: Public
296
406
  - Kind: Faithful Carbon port
297
407
 
@@ -301,7 +411,7 @@ Data record mirroring Carbon's geometry skeleton block, pairing a skeleton name
301
411
  Resource that owns lifecycle identity for decoded Granny data attached as a plain payload with models or meshes, keeping reader and engine-specific behavior outside the class.
302
412
 
303
413
  - Export: `@carbonenginejs/runtime-resource`
304
- - Source: `src/resources/TriGrannyRes.js`
414
+ - Source: `src/resource/geometry/granny/TriGrannyRes.js`
305
415
  - Visibility: Public
306
416
  - Kind: Adapted Carbon concept
307
417
 
@@ -311,7 +421,7 @@ Resource that owns lifecycle identity for decoded Granny data attached as a plai
311
421
  Data record mirroring Carbon's joint binding: a joint name with its oriented-bounding-box minimum and maximum.
312
422
 
313
423
  - Export: `@carbonenginejs/runtime-resource`
314
- - Source: `src/resources/TriJointBinding.js`
424
+ - Source: `src/resource/geometry/TriJointBinding.js`
315
425
  - Visibility: Public
316
426
  - Kind: Faithful Carbon port
317
427
 
@@ -321,7 +431,7 @@ Data record mirroring Carbon's joint binding: a joint name with its oriented-bou
321
431
  Data record mirroring Carbon's morph-target geometry constants: vertex-buffer stride, position/tangent offsets and types, and vertex count.
322
432
 
323
433
  - Export: `@carbonenginejs/runtime-resource`
324
- - Source: `src/resources/TriMorphTargetGeometryConstants.js`
434
+ - Source: `src/resource/geometry/TriMorphTargetGeometryConstants.js`
325
435
  - Visibility: Public
326
436
  - Kind: Faithful Carbon port
327
437
 
@@ -331,7 +441,7 @@ Data record mirroring Carbon's morph-target geometry constants: vertex-buffer st
331
441
  Data record mirroring Carbon's ray-tracing geometry constants: index/vertex buffer ids and strides plus attribute offsets and types.
332
442
 
333
443
  - Export: `@carbonenginejs/runtime-resource`
334
- - Source: `src/resources/TriRtGeometryConstants.js`
444
+ - Source: `src/resource/geometry/TriRtGeometryConstants.js`
335
445
  - Visibility: Public
336
446
  - Kind: Faithful Carbon port
337
447
 
@@ -341,6 +451,6 @@ Data record mirroring Carbon's ray-tracing geometry constants: index/vertex buff
341
451
  Resource record that owns Carbon-style texture identity and validated texture, RGBA, or video payload facts with mirrored dimension/format metadata, while engine packages decide what those facts become on a device.
342
452
 
343
453
  - Export: `@carbonenginejs/runtime-resource`
344
- - Source: `src/resources/TriTextureRes.js`
454
+ - Source: `src/resource/texture/TriTextureRes.js`
345
455
  - Visibility: Public
346
456
  - Kind: Adapted Carbon concept
@@ -1,9 +1,9 @@
1
1
  # Texture class catalog
2
2
 
3
3
  Status: Evolving
4
- Scope: `@carbonenginejs/runtime-resource` classes under `src/texture`
4
+ Scope: `@carbonenginejs/runtime-resource` classes under `src/resource/texture`
5
5
  Audience: Users, maintainers, and automated readers
6
- Summary: Provides one-sentence purpose descriptors for the texture-array aggregation classes in src/texture.
6
+ Summary: Provides one-sentence purpose descriptors for the texture-array aggregation classes in src/resource/texture.
7
7
 
8
8
  <!-- class:CjsTextureArrayRes -->
9
9
  ## `CjsTextureArrayRes`
@@ -11,16 +11,16 @@ Summary: Provides one-sentence purpose descriptors for the texture-array aggrega
11
11
  Mutable runtime aggregate resource for an ordered texture-array request that coalesces per-layer path changes and invalidations so a resource manager or engine scheduler can prepare the corresponding immutable texture-array payload on a later frame.
12
12
 
13
13
  - Export: `@carbonenginejs/runtime-resource`
14
- - Source: `src/texture/CjsTextureArrayRes.js`
14
+ - Source: `src/resource/texture/CjsTextureArrayRes.js`
15
15
  - Visibility: Public
16
16
  - Kind: Original CarbonEngineJS class
17
17
 
18
- <!-- class:CjsTextureParameterProxy -->
19
- ## `CjsTextureParameterProxy`
18
+ <!-- class:CjsTextureArrayResParameterProxy -->
19
+ ## `CjsTextureArrayResParameterProxy`
20
20
 
21
- Texture-parameter facade for one array layer that mirrors the public path API while delegating storage, invalidation, readiness, and adapter ownership to its parent `CjsTextureArrayRes`, carrying no shader metadata or backend objects itself.
21
+ `CjsTextureArrayRes`-owned parameter facade for one array layer that mirrors the public path API while delegating storage, invalidation, readiness, and adapter ownership to its parent, carrying no shader metadata or backend objects itself.
22
22
 
23
23
  - Export: `@carbonenginejs/runtime-resource`
24
- - Source: `src/texture/CjsTextureParameterProxy.js`
24
+ - Source: `src/resource/texture/CjsTextureArrayResParameterProxy.js`
25
25
  - Visibility: Public
26
26
  - Kind: Original CarbonEngineJS class
@@ -40,6 +40,23 @@ ordinary ownership removals preserve the handle's last resource state;
40
40
  `PURGED` is reserved for successful policy eviction through inactivity or
41
41
  byte pressure.
42
42
 
43
+ `PURGED` is not terminal for the handle. Purge deletes the payload, but the
44
+ handle revives itself: `IsGood()` renews activity through `KeepAlive()`, and
45
+ `KeepAlive()` reloads a purged resource along the ordinary first-load path. A
46
+ consumer therefore never learns that a purge happened and never manages
47
+ retention itself - it asks whether the resource is good, and that question is
48
+ what keeps it, or brings it back.
49
+
50
+ Liveness follows visibility. Something being drawn is asked about every frame
51
+ and stays live; something that stops being drawn stops being renewed, ages out,
52
+ and has its memory reclaimed; when it is drawn again the next `IsGood()`
53
+ restores it. `Reload()` is bounded by `maxReloadAttempts` precisely because the
54
+ render path calls this every frame, so one permanently missing resource cannot
55
+ become a retry storm. A reload refills the exact handle the consumer holds
56
+ rather than resolving whatever the manager currently caches for that path,
57
+ because a consumer holding a purged handle has no way to discover a
58
+ replacement.
59
+
43
60
  `Startup()` and `Shutdown()` are idempotent. `HasKey`, `Lookup`, `Delete`,
44
61
  `GetKeys`, `GetValues`, `GetSize`, `SetCacheSize`, `GetCacheSize`, `GetStats`,
45
62
  `TrimCache`, `ReplaceExpected`, `Clear`, and `ClearCached` provide the
@@ -15,7 +15,8 @@ BACKGROUND: deduplicated source load, limited by maxConcurrentLoads
15
15
  MAIN: reader/format conversion -> resource publication
16
16
  ```
17
17
 
18
- The main reader/format operation and publication are separate queue items.
18
+ Without worker execution, the main reader/format operation and publication
19
+ are separate queue items.
19
20
  `maxPrepareTime` is a per-pump budget in seconds limiting synchronous
20
21
  main-queue work started in one pump, and `maxPrepareItemsPerTick` can add an
21
22
  item-count limit. Promise-returning format work remains in flight without
@@ -42,6 +43,12 @@ The selected format class owns conversion to the promised CPU output.
42
43
  support, and it does not run backend realization. An engine consumes the
43
44
  published CPU resource afterward through its own explicit operation.
44
45
 
46
+ When worker loading is selected, a declared worker-safe format read runs on
47
+ the module worker rather than occupying a main-queue item. The guarded
48
+ publication item remains on the main queue. `GetPendingWorkers()` and
49
+ `IsLoading()` include unresolved worker requests, and a queued resource
50
+ operation keeps the worker descendant within its `Wait()` lineage.
51
+
45
52
  ## Queue controls
46
53
 
47
54
  Blue-compatible queue controls are exposed directly on `CjsResMan`:
@@ -98,5 +105,6 @@ registry.
98
105
  ## Related documentation
99
106
 
100
107
  - [Resource lifecycle concepts](../concepts/resource-lifecycle.md)
108
+ - [Browser worker execution](workers.md)
101
109
  - [MotherLode identity, cache, and retention](motherlode-cache.md)
102
110
  - [Format subpaths](../formats/README.md)
@@ -0,0 +1,135 @@
1
+ # Browser worker execution
2
+
3
+ Status: Evolving
4
+ Scope: `@carbonenginejs/runtime-resource`
5
+ Audience: Browser integrators and format maintainers
6
+ Summary: Defines worker-backed source and format execution while keeping resource publication and class-bearing results on the caller thread.
7
+
8
+ ## Enable worker execution
9
+
10
+ `CjsResMan` selects the bundled module-worker strategy by default and creates
11
+ the worker lazily on the first eligible source or format read:
12
+
13
+ ```js
14
+ import {
15
+ CjsResManFetchProvider,
16
+ CjsResMan
17
+ } from "@carbonenginejs/runtime-resource";
18
+ import { CjsWemFormat } from "@carbonenginejs/runtime-resource/formats/wem";
19
+
20
+ const resMan = new CjsResMan({
21
+ paths: {
22
+ res: "https://cdn.example.invalid/resources/"
23
+ },
24
+ source: new CjsResManFetchProvider(),
25
+ formats: [ CjsWemFormat ]
26
+ });
27
+ ```
28
+
29
+ Pass `useWorkerLoading: false` or call `UseWorkerLoading(false)` when a caller
30
+ requires deterministic main-thread execution.
31
+
32
+ The default worker entry is resolved relative to the published
33
+ `CjsResManWorkerLoader` module. A browser wrapper may instead inject an
34
+ existing Worker-compatible object, a `workerFactory`, or a `workerUrl` through
35
+ the `workerLoader` constructor option:
36
+
37
+ ```js
38
+ const resMan = new CjsResMan({
39
+ source,
40
+ workerLoader: {
41
+ workerFactory: (url, options) => new Worker(url, options)
42
+ },
43
+ useWorkerLoading: true
44
+ });
45
+ ```
46
+
47
+ Failure to create the worker leaves unsupported and later operations on the
48
+ main-thread fallback. A fatal worker error rejects requests already assigned
49
+ to that worker, disables it, and leaves future reads able to fall back.
50
+
51
+ ## Source reads
52
+
53
+ A source opts into worker execution by implementing:
54
+
55
+ ```js
56
+ CreateWorkerRequest(sourcePath, options) {
57
+ return {
58
+ operation: "source.fetch",
59
+ payload,
60
+ signal,
61
+ transfer
62
+ };
63
+ }
64
+ ```
65
+
66
+ Returning `null` selects the main-thread fallback for that read.
67
+ `CjsResMan` resolves the resource path to a URL before invoking a URL-backed
68
+ provider. `CjsResManFetchProvider` implements the worker contract for its
69
+ normal global `fetch` path and returns `ArrayBuffer` data using transfer
70
+ ownership. An injected fetch implementation remains on the caller thread
71
+ unless its provider is explicitly created with `{ worker: true }`.
72
+ Structural sources that do not declare `requiresUrl` continue to receive the
73
+ normalized resource path.
74
+
75
+ Fetch request options may include ordinary headers, including an HTTP `Range`
76
+ header. Range capability, status interpretation, and the identity of an
77
+ offset-backed logical resource remain provider policy; `CjsResMan` does not
78
+ invent offset semantics.
79
+
80
+ ## Format reads
81
+
82
+ A clone-safe format opts in with a static worker declaration:
83
+
84
+ ```js
85
+ static worker = Object.freeze({
86
+ module: import.meta.url,
87
+ exportName: "CjsExampleFormat"
88
+ });
89
+ ```
90
+
91
+ The worker dynamically imports that exact module and invokes its static
92
+ `readAsync`/`read` operation, falling back to an instance
93
+ `ReadAsync`/`Read` operation when required. BNK and WEM are worker-enabled.
94
+ Black `json` and `payload` outputs are worker-enabled; Black document/runtime
95
+ outputs remain on the caller thread because structured cloning would discard
96
+ their class identity.
97
+
98
+ A declaration may restrict clone-safe outputs:
99
+
100
+ ```js
101
+ static worker = Object.freeze({
102
+ module: import.meta.url,
103
+ exportName: "CjsExampleFormat",
104
+ outputTypes: Object.freeze([ "json", "payload" ]),
105
+ defaultOutput: "json"
106
+ });
107
+ ```
108
+
109
+ Format options containing functions, symbols, non-plain instances, cycles, or
110
+ caller-supplied class constructors do not cross the worker boundary.
111
+
112
+ ## Queues and ownership
113
+
114
+ Worker-safe format reading runs outside the main preparation queue. Its
115
+ resource-operation root remains visible to `Wait()`, and
116
+ `GetPendingWorkers()`/`IsLoading()` include unresolved worker requests. Once
117
+ the reader settles, guarded resource publication is still enqueued on the
118
+ main queue.
119
+
120
+ Format input is cloned by default. This preserves source-cache and
121
+ multi-output ownership at the cost of a copy. A format may declare
122
+ `transferInput: true` only when its caller guarantees exclusive ownership of a
123
+ complete `ArrayBuffer`; transferring detaches the caller's buffer. Result
124
+ ArrayBuffers and typed-array backing stores are transferred back
125
+ automatically.
126
+
127
+ The bundled strategy currently owns one module worker. Asynchronous fetches
128
+ may overlap within it, while synchronous CPU readers are serialized by that
129
+ worker's event loop.
130
+
131
+ ## Related documentation
132
+
133
+ - [Queues, publication, and the Wait fence](queues.md)
134
+ - [MotherLode identity, cache, and retention](motherlode-cache.md)
135
+ - [Wwise BNK/WEM formats](../formats/wwise.md)