@carbonenginejs/runtime-resource 0.20.0 → 0.22.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 (306) hide show
  1. package/NOTICE +6 -0
  2. package/dist/CjsResMan.js +1374 -1318
  3. package/dist/CjsResMan.js.map +1 -1
  4. package/dist/format/CjsFormat.js +393 -164
  5. package/dist/format/CjsFormat.js.map +1 -1
  6. package/dist/format/CjsFormatStore.js +315 -0
  7. package/dist/format/CjsFormatStore.js.map +1 -0
  8. package/dist/format/CjsResourceProbe.js +66 -234
  9. package/dist/format/CjsResourceProbe.js.map +1 -1
  10. package/dist/format/payloadContract.js +47 -6
  11. package/dist/format/payloadContract.js.map +1 -1
  12. package/dist/formats/black/CjsBlackFormat.js +23 -6
  13. package/dist/formats/black/CjsBlackFormat.js.map +1 -1
  14. package/dist/formats/bnk/CjsBnkFormat.js +122 -120
  15. package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
  16. package/dist/formats/bnk/core/helpers.js +5 -15
  17. package/dist/formats/bnk/core/helpers.js.map +1 -1
  18. package/dist/formats/cmf/CjsCmfFormat.js +31 -14
  19. package/dist/formats/cmf/CjsCmfFormat.js.map +1 -1
  20. package/dist/formats/dds/CjsDdsFormat.js +29 -19
  21. package/dist/formats/dds/CjsDdsFormat.js.map +1 -1
  22. package/dist/formats/dds/core/helpers.js +4 -5
  23. package/dist/formats/dds/core/helpers.js.map +1 -1
  24. package/dist/formats/dxbc/CjsDxbcFormat.js +15 -13
  25. package/dist/formats/dxbc/CjsDxbcFormat.js.map +1 -1
  26. package/dist/formats/fbx/CjsFbxFormat.js +27 -19
  27. package/dist/formats/fbx/CjsFbxFormat.js.map +1 -1
  28. package/dist/formats/fbx/core/helpers.js +4 -4
  29. package/dist/formats/fbx/core/helpers.js.map +1 -1
  30. package/dist/formats/flac/CjsFlacFormat.js +19 -17
  31. package/dist/formats/flac/CjsFlacFormat.js.map +1 -1
  32. package/dist/formats/flac/core/helpers.js +5 -11
  33. package/dist/formats/flac/core/helpers.js.map +1 -1
  34. package/dist/formats/fsd/32/CjsFsd32Format.js +55 -0
  35. package/dist/formats/fsd/32/CjsFsd32Format.js.map +1 -0
  36. package/dist/formats/fsd/32/index.js +2 -0
  37. package/dist/formats/fsd/32/index.js.map +1 -0
  38. package/dist/formats/fsd/64/CjsFsd64Format.js +119 -0
  39. package/dist/formats/fsd/64/CjsFsd64Format.js.map +1 -0
  40. package/dist/formats/fsd/64/core/CjsFsd64Binary.js +393 -0
  41. package/dist/formats/fsd/64/core/CjsFsd64Binary.js.map +1 -0
  42. package/dist/formats/fsd/64/core/CjsFsd64Reader.js +138 -0
  43. package/dist/formats/fsd/64/core/CjsFsd64Reader.js.map +1 -0
  44. package/dist/formats/fsd/64/core/CjsFsd64SchemaDecoder.js +389 -0
  45. package/dist/formats/fsd/64/core/CjsFsd64SchemaDecoder.js.map +1 -0
  46. package/dist/formats/fsd/64/core/CjsFsd64SchemaReader.js +43 -0
  47. package/dist/formats/fsd/64/core/CjsFsd64SchemaReader.js.map +1 -0
  48. package/dist/formats/fsd/64/core/fsd64Records.js +60 -0
  49. package/dist/formats/fsd/64/core/fsd64Records.js.map +1 -0
  50. package/dist/formats/fsd/64/index.js +7 -0
  51. package/dist/formats/fsd/64/index.js.map +1 -0
  52. package/dist/formats/fsd/64/readers/CjsFsd64ReaderSetCharacterStaticData.js +33 -0
  53. package/dist/formats/fsd/64/readers/CjsFsd64ReaderSetCharacterStaticData.js.map +1 -0
  54. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAgentTypes.js +35 -0
  55. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAgentTypes.js.map +1 -0
  56. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAgentsInSpace.js +50 -0
  57. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAgentsInSpace.js.map +1 -0
  58. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAncestries.js +75 -0
  59. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAncestries.js.map +1 -0
  60. package/dist/formats/fsd/64/readers/CjsFsd64SchemaArchetypes.js +57 -0
  61. package/dist/formats/fsd/64/readers/CjsFsd64SchemaArchetypes.js.map +1 -0
  62. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAudioMetadata.js +201 -0
  63. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAudioMetadata.js.map +1 -0
  64. package/dist/formats/fsd/64/readers/CjsFsd64SchemaBloodlines.js +73 -0
  65. package/dist/formats/fsd/64/readers/CjsFsd64SchemaBloodlines.js.map +1 -0
  66. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCategories.js +53 -0
  67. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCategories.js.map +1 -0
  68. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterAvatarBehaviors.js +44 -0
  69. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterAvatarBehaviors.js.map +1 -0
  70. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterColorLocations.js +38 -0
  71. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterColorLocations.js.map +1 -0
  72. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterColorNames.js +34 -0
  73. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterColorNames.js.map +1 -0
  74. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterModifierLocations.js +34 -0
  75. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterModifierLocations.js.map +1 -0
  76. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterPortraitResources.js +44 -0
  77. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterPortraitResources.js.map +1 -0
  78. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterResources.js +81 -0
  79. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterResources.js.map +1 -0
  80. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterSculptingLocations.js +34 -0
  81. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterSculptingLocations.js.map +1 -0
  82. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCompressibleTypes.js +41 -0
  83. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCompressibleTypes.js.map +1 -0
  84. package/dist/formats/fsd/64/readers/CjsFsd64SchemaContrabandTypes.js +63 -0
  85. package/dist/formats/fsd/64/readers/CjsFsd64SchemaContrabandTypes.js.map +1 -0
  86. package/dist/formats/fsd/64/readers/CjsFsd64SchemaControlTowerResources.js +76 -0
  87. package/dist/formats/fsd/64/readers/CjsFsd64SchemaControlTowerResources.js.map +1 -0
  88. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationActivities.js +38 -0
  89. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationActivities.js.map +1 -0
  90. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationRoleGroups.js +74 -0
  91. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationRoleGroups.js.map +1 -0
  92. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationRoles.js +59 -0
  93. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationRoles.js.map +1 -0
  94. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaAttributeCategories.js +46 -0
  95. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaAttributeCategories.js.map +1 -0
  96. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaAttributes.js +133 -0
  97. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaAttributes.js.map +1 -0
  98. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaEffects.js +236 -0
  99. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaEffects.js.map +1 -0
  100. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaUnits.js +60 -0
  101. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaUnits.js.map +1 -0
  102. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDynamicItemAttributes.js +95 -0
  103. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDynamicItemAttributes.js.map +1 -0
  104. package/dist/formats/fsd/64/readers/CjsFsd64SchemaEpicArcs.js +106 -0
  105. package/dist/formats/fsd/64/readers/CjsFsd64SchemaEpicArcs.js.map +1 -0
  106. package/dist/formats/fsd/64/readers/CjsFsd64SchemaExpertSystems.js +86 -0
  107. package/dist/formats/fsd/64/readers/CjsFsd64SchemaExpertSystems.js.map +1 -0
  108. package/dist/formats/fsd/64/readers/CjsFsd64SchemaFactions.js +117 -0
  109. package/dist/formats/fsd/64/readers/CjsFsd64SchemaFactions.js.map +1 -0
  110. package/dist/formats/fsd/64/readers/CjsFsd64SchemaGraphicIds.js +70 -0
  111. package/dist/formats/fsd/64/readers/CjsFsd64SchemaGraphicIds.js.map +1 -0
  112. package/dist/formats/fsd/64/readers/CjsFsd64SchemaGraphicMaterialSets.js +173 -0
  113. package/dist/formats/fsd/64/readers/CjsFsd64SchemaGraphicMaterialSets.js.map +1 -0
  114. package/dist/formats/fsd/64/readers/CjsFsd64SchemaGroups.js +77 -0
  115. package/dist/formats/fsd/64/readers/CjsFsd64SchemaGroups.js.map +1 -0
  116. package/dist/formats/fsd/64/readers/CjsFsd64SchemaIcons.js +62 -0
  117. package/dist/formats/fsd/64/readers/CjsFsd64SchemaIcons.js.map +1 -0
  118. package/dist/formats/fsd/64/readers/CjsFsd64SchemaMarketGroups.js +63 -0
  119. package/dist/formats/fsd/64/readers/CjsFsd64SchemaMarketGroups.js.map +1 -0
  120. package/dist/formats/fsd/64/readers/CjsFsd64SchemaMetaGroups.js +86 -0
  121. package/dist/formats/fsd/64/readers/CjsFsd64SchemaMetaGroups.js.map +1 -0
  122. package/dist/formats/fsd/64/readers/CjsFsd64SchemaNpcCorporationDivisions.js +72 -0
  123. package/dist/formats/fsd/64/readers/CjsFsd64SchemaNpcCorporationDivisions.js.map +1 -0
  124. package/dist/formats/fsd/64/readers/CjsFsd64SchemaNpcCorporations.js +326 -0
  125. package/dist/formats/fsd/64/readers/CjsFsd64SchemaNpcCorporations.js.map +1 -0
  126. package/dist/formats/fsd/64/readers/CjsFsd64SchemaPaperdolls.js +279 -0
  127. package/dist/formats/fsd/64/readers/CjsFsd64SchemaPaperdolls.js.map +1 -0
  128. package/dist/formats/fsd/64/readers/CjsFsd64SchemaRaces.js +64 -0
  129. package/dist/formats/fsd/64/readers/CjsFsd64SchemaRaces.js.map +1 -0
  130. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSchoolMap.js +40 -0
  131. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSchoolMap.js.map +1 -0
  132. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSchools.js +113 -0
  133. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSchools.js.map +1 -0
  134. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkillPlans.js +130 -0
  135. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkillPlans.js.map +1 -0
  136. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentCategories.js +38 -0
  137. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentCategories.js.map +1 -0
  138. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentPointValues.js +45 -0
  139. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentPointValues.js.map +1 -0
  140. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentRarities.js +44 -0
  141. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentRarities.js.map +1 -0
  142. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponents.js +163 -0
  143. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponents.js.map +1 -0
  144. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotCategories.js +37 -0
  145. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotCategories.js.map +1 -0
  146. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotConfigurations.js +77 -0
  147. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotConfigurations.js.map +1 -0
  148. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotNames.js +37 -0
  149. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotNames.js.map +1 -0
  150. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlots.js +74 -0
  151. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlots.js.map +1 -0
  152. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrTierThresholds.js +44 -0
  153. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrTierThresholds.js.map +1 -0
  154. package/dist/formats/fsd/64/readers/CjsFsd64SchemaStationOperations.js +120 -0
  155. package/dist/formats/fsd/64/readers/CjsFsd64SchemaStationOperations.js.map +1 -0
  156. package/dist/formats/fsd/64/readers/CjsFsd64SchemaStationServices.js +49 -0
  157. package/dist/formats/fsd/64/readers/CjsFsd64SchemaStationServices.js.map +1 -0
  158. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeDogma.js +73 -0
  159. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeDogma.js.map +1 -0
  160. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeLists.js +122 -0
  161. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeLists.js.map +1 -0
  162. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeMaterials.js +83 -0
  163. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeMaterials.js.map +1 -0
  164. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypes.js +194 -0
  165. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypes.js.map +1 -0
  166. package/dist/formats/fsd/64/readers/index.js +58 -0
  167. package/dist/formats/fsd/64/readers/index.js.map +1 -0
  168. package/dist/formats/fsd/CjsFsdFormat.js +62 -0
  169. package/dist/formats/fsd/CjsFsdFormat.js.map +1 -0
  170. package/dist/formats/fsd/index.js +9 -0
  171. package/dist/formats/fsd/index.js.map +1 -0
  172. package/dist/formats/gif/CjsGifFormat.js +26 -16
  173. package/dist/formats/gif/CjsGifFormat.js.map +1 -1
  174. package/dist/formats/gif/core/helpers.js +6 -18
  175. package/dist/formats/gif/core/helpers.js.map +1 -1
  176. package/dist/formats/gltf/CjsGltfFormat.js +25 -13
  177. package/dist/formats/gltf/CjsGltfFormat.js.map +1 -1
  178. package/dist/formats/gr2/CjsGr2Format.js +27 -6
  179. package/dist/formats/gr2/CjsGr2Format.js.map +1 -1
  180. package/dist/formats/hlsl/CjsHlslFormat.js +20 -16
  181. package/dist/formats/hlsl/CjsHlslFormat.js.map +1 -1
  182. package/dist/formats/hlsl/core/analysis.js +1 -1
  183. package/dist/formats/index.js +5 -0
  184. package/dist/formats/index.js.map +1 -1
  185. package/dist/formats/jpeg/CjsJpegFormat.js +26 -19
  186. package/dist/formats/jpeg/CjsJpegFormat.js.map +1 -1
  187. package/dist/formats/jpeg/core/helpers.js +6 -15
  188. package/dist/formats/jpeg/core/helpers.js.map +1 -1
  189. package/dist/formats/jpeg/core/jpeg.js +0 -3
  190. package/dist/formats/jpeg/core/jpeg.js.map +1 -1
  191. package/dist/formats/mp3/CjsMp3Format.js +19 -19
  192. package/dist/formats/mp3/CjsMp3Format.js.map +1 -1
  193. package/dist/formats/mp3/core/helpers.js +5 -11
  194. package/dist/formats/mp3/core/helpers.js.map +1 -1
  195. package/dist/formats/mp4/CjsMp4Format.js +20 -19
  196. package/dist/formats/mp4/CjsMp4Format.js.map +1 -1
  197. package/dist/formats/mp4/core/helpers.js +6 -15
  198. package/dist/formats/mp4/core/helpers.js.map +1 -1
  199. package/dist/formats/obj/CjsObjFormat.js +25 -12
  200. package/dist/formats/obj/CjsObjFormat.js.map +1 -1
  201. package/dist/formats/ogg/CjsOggFormat.js +26 -17
  202. package/dist/formats/ogg/CjsOggFormat.js.map +1 -1
  203. package/dist/formats/ogg/core/helpers.js +5 -16
  204. package/dist/formats/ogg/core/helpers.js.map +1 -1
  205. package/dist/formats/pickle/CjsPickleFormat.js +64 -5
  206. package/dist/formats/pickle/CjsPickleFormat.js.map +1 -1
  207. package/dist/formats/png/CjsPngFormat.js +28 -19
  208. package/dist/formats/png/CjsPngFormat.js.map +1 -1
  209. package/dist/formats/png/core/helpers.js +5 -14
  210. package/dist/formats/png/core/helpers.js.map +1 -1
  211. package/dist/formats/red/CjsRedFormat.js +19 -5
  212. package/dist/formats/red/CjsRedFormat.js.map +1 -1
  213. package/dist/formats/schemabound/CjsSchemaBoundFormat.js +48 -38
  214. package/dist/formats/schemabound/CjsSchemaBoundFormat.js.map +1 -1
  215. package/dist/formats/sqlite/CjsSqliteFormat.js +49 -41
  216. package/dist/formats/sqlite/CjsSqliteFormat.js.map +1 -1
  217. package/dist/formats/static/CjsStaticFormat.js +15 -57
  218. package/dist/formats/static/CjsStaticFormat.js.map +1 -1
  219. package/dist/formats/static/staticContainers.js +6 -6
  220. package/dist/formats/static/staticContainers.js.map +1 -1
  221. package/dist/formats/stl/CjsStlFormat.js +25 -12
  222. package/dist/formats/stl/CjsStlFormat.js.map +1 -1
  223. package/dist/formats/tga/CjsTgaFormat.js +26 -19
  224. package/dist/formats/tga/CjsTgaFormat.js.map +1 -1
  225. package/dist/formats/tga/core/helpers.js +7 -22
  226. package/dist/formats/tga/core/helpers.js.map +1 -1
  227. package/dist/formats/wav/CjsWavFormat.js +26 -19
  228. package/dist/formats/wav/CjsWavFormat.js.map +1 -1
  229. package/dist/formats/wav/core/helpers.js +7 -16
  230. package/dist/formats/wav/core/helpers.js.map +1 -1
  231. package/dist/formats/webgl/CjsWebglFormat.js +11 -13
  232. package/dist/formats/webgl/CjsWebglFormat.js.map +1 -1
  233. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js +31 -1
  234. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  235. package/dist/formats/webgl/core/readGlslEffectContainer.js +8 -8
  236. package/dist/formats/webgl/core/readGlslEffectContainer.js.map +1 -1
  237. package/dist/formats/webgpu/CjsWebgpuFormat.js +11 -5
  238. package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  239. package/dist/formats/webm/CjsWebmFormat.js +20 -19
  240. package/dist/formats/webm/CjsWebmFormat.js.map +1 -1
  241. package/dist/formats/webm/core/helpers.js +6 -15
  242. package/dist/formats/webm/core/helpers.js.map +1 -1
  243. package/dist/formats/webp/CjsWebpFormat.js +19 -17
  244. package/dist/formats/webp/CjsWebpFormat.js.map +1 -1
  245. package/dist/formats/webp/core/helpers.js +5 -11
  246. package/dist/formats/webp/core/helpers.js.map +1 -1
  247. package/dist/formats/wem/CjsWemFormat.js +128 -141
  248. package/dist/formats/wem/CjsWemFormat.js.map +1 -1
  249. package/dist/formats/wem/core/helpers.js +1 -114
  250. package/dist/formats/wem/core/helpers.js.map +1 -1
  251. package/dist/formats/wem/core/{resolve.js → probeCodecSupport.js} +11 -18
  252. package/dist/formats/wem/core/probeCodecSupport.js.map +1 -0
  253. package/dist/formats/yaml/CjsYamlFormat.js +20 -5
  254. package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
  255. package/dist/generated/index.js +2 -0
  256. package/dist/generated/index.js.map +1 -0
  257. package/dist/generated/resources/Tr2RaycastGeometryRes.js +34 -0
  258. package/dist/generated/resources/Tr2RaycastGeometryRes.js.map +1 -0
  259. package/dist/generated/resources/index.js +2 -0
  260. package/dist/generated/resources/index.js.map +1 -0
  261. package/dist/index.js +3 -1
  262. package/dist/index.js.map +1 -1
  263. package/dist/resource/CjsResource.js +134 -0
  264. package/dist/resource/CjsResource.js.map +1 -1
  265. package/dist/resource/ResourceRequirement.js +42 -0
  266. package/dist/resource/ResourceRequirement.js.map +1 -0
  267. package/dist/resource/Tr2LightProfileRes.js +2 -1
  268. package/dist/resource/Tr2LightProfileRes.js.map +1 -1
  269. package/dist/resource/geometry/TriGeometryRes.js +34 -7
  270. package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
  271. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js +184 -7
  272. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -1
  273. package/dist/resource/geometry/granny/TriGrannyRes.js +20 -8
  274. package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -1
  275. package/dist/resource/index.js +1 -0
  276. package/dist/resource/index.js.map +1 -1
  277. package/dist/resource/resourceBoundary.js +24 -1
  278. package/dist/resource/resourceBoundary.js.map +1 -1
  279. package/dist/resource/shader/Tr2EffectRes.js +2 -1
  280. package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
  281. package/dist/resource/texture/CjsTextureArrayRes.js +2 -1
  282. package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
  283. package/dist/resource/texture/Tr2ImageRes.js +2 -1
  284. package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
  285. package/dist/resource/texture/TriTextureRes.js +40 -2
  286. package/dist/resource/texture/TriTextureRes.js.map +1 -1
  287. package/docs/architecture.md +121 -116
  288. package/docs/concepts/format-capabilities.md +90 -0
  289. package/docs/formats/README.md +14 -6
  290. package/docs/formats/fsd.md +104 -0
  291. package/docs/formats/gr2.md +1 -1
  292. package/docs/formats/hlsl/reference/api.md +6 -4
  293. package/docs/formats/provenance.md +18 -0
  294. package/docs/formats/schemabound.md +10 -4
  295. package/docs/formats/static.md +26 -26
  296. package/docs/formats/webgpu/reference/api.md +4 -3
  297. package/docs/reference/classes/core.md +22 -2
  298. package/docs/reference/classes/formats.md +643 -1
  299. package/docs/reference/classes/resources.md +463 -453
  300. package/docs/reference/queues.md +205 -194
  301. package/docs/roadmap.md +14 -18
  302. package/format-notices/fsd/LICENSE +21 -0
  303. package/format-notices/fsd/NOTICE +11 -0
  304. package/package.json +70 -64
  305. package/dist/formats/wem/core/resolve.js.map +0 -1
  306. package/docs/concepts/format-type-resolution.md +0 -79
@@ -244,14 +244,14 @@ function readGlslEffectContainer(input, values = {}) {
244
244
  // not - an additive pass writing alpha 0 disappears
245
245
  // completely under a src-alpha blend.
246
246
  //
247
- // `states`, not `renderStates`. Carbon's `Tr2Pass`
248
- // reserves `renderStates` for the `unsigned int`
249
- // handle `RegisterRenderStateSetup` hands back
250
- // (Tr2EffectDescription.h:205), and calls the pairs
251
- // themselves `states` - as do the WebGPU analysis
252
- // passes and both of ccpwgl's legacy readers. This
253
- // path never registers anything, so it carries the
254
- // list and no handle rather than inventing a number.
247
+ // `states`, not `renderStates`. In the shipped format a
248
+ // pass reserves `renderStates` for the integer handle a
249
+ // registered state setup is identified by, and calls
250
+ // the {state, value} pairs themselves `states` - as do
251
+ // the WebGPU analysis passes and both of ccpwgl's
252
+ // legacy readers. This path registers nothing, so it
253
+ // carries the list and no handle rather than inventing
254
+ // a number.
255
255
  states: pass.renderStates ?? [],
256
256
  // The pass's transforms, so a rule can ask whether a
257
257
  // description resource was merged away rather than lost.
@@ -1 +1 @@
1
- {"version":3,"file":"readGlslEffectContainer.js","sources":["../../../../../src/formats/webgl/core/readGlslEffectContainer.js"],"sourcesContent":["import { CjsCarbonEffectReader } from \"../../../format/carbonEffect/CjsCarbonEffectReader.js\";\nimport { readGlslBackendBlock } from \"./glslBackendBlock.js\";\nimport {\n CARBON_BACKEND_ENGINE_ID,\n peekBackendEngineId\n} from \"../../../format/carbonEffect/backendEngineId.js\";\nimport { hlslShaderStageName } from \"../../hlsl/core/tr2/HlslRenderContextEnum.js\";\nimport { runtimeDescriptionFromCarbon } from \"../../hlsl/core/carbonDescriptionToRuntime.js\";\nimport { HlslEffectBindingManifest } from \"../../hlsl/core/tr2/shader/HlslEffectBindingManifest.js\";\n\n/**\n * Decodes a WebGL effect container into the stage/shader records the\n * completeness rules consume.\n *\n * This exists so the rules run from container bytes alone. The alternative was\n * to hand them the in-memory translation, which works inside `buildEffectPackage`\n * and nowhere else — the validator reads a finished file and has no translation\n * in scope. That would have cost the validator its completeness check while\n * still requiring a decoder to produce the programs it compiles in a browser, so\n * it was strictly more work for strictly less checking.\n *\n * The vocabulary is deliberately the one the rules already speak — `stages` with\n * pass coordinates, `shaders` with source and a translation verdict. The rules\n * are about the translation, not about how it was stored, so retargeting them\n * meant changing where the records come from and nothing about what they mean.\n *\n * **What the wire cannot tell you.** `buildCarbonEffectContainer` stores a body\n * the translator could not lower as its full pass tree with zero-length\n * programs; the *reason* it failed stays in the in-memory build result and is\n * never written. So a shader decoded from bytes reports `ok: false` with\n * \"no program was stored\" and nothing more specific. That is the honest answer:\n * a file on disk does not know why a translation failed months ago. Callers that\n * do know — `buildEffectPackage`, at build time — keep their specific\n * diagnostics by feeding the rules their own records instead.\n */\n\n/** The verdict a stage carrying no stored program gets. */\nconst NO_PROGRAM_REASON = \"no program was stored\";\n\n/**\n * Derives the per-stage binding manifests for one body through the one\n * manifest builder the source path uses.\n *\n * This replaces a hand-built reshape of the wire records into the manifest\n * vocabulary. That copy had already diverged from the real manifest once —\n * `isAutoregister` was silently dropped, making every resource look\n * user-settable — which is the whole argument against a second producer: two\n * hand-maintained spellings of one reflection drift, and the drift is exactly\n * the kind of bug that draws, links and renders black without an error. The\n * record tree now flows through `runtimeDescriptionFromCarbon` — the\n * corpus-proven adapter the runtime read path uses — and\n * `HlslEffectBindingManifest`, so the container read and the build-time\n * package derive their manifests from the same code.\n *\n * No `bytecodeFor` is supplied: program text lives in the shader records this\n * reader emits, so the manifest's `shaderBytecode` stays null rather than\n * duplicating every program into the reflection.\n *\n * @param {object} description Decoded Carbon description record tree.\n * @param {number} version Container data version.\n * @param {string} source Source name for diagnostics.\n * @returns {Map<string, object>} Manifest stage records keyed by\n * `technique.passN.stageName`.\n */\nfunction bodyManifestStages(description, version, source)\n{\n const runtime = runtimeDescriptionFromCarbon(description, {\n effectName: source,\n version\n });\n const manifest = HlslEffectBindingManifest.fromEffectDescription(runtime).toJSON();\n return new Map(manifest.stages.map((stage) => [\n `${stage.techniqueName}.pass${stage.passIndex}.${stage.stageName}`,\n stage\n ]));\n}\n\n/**\n * Decodes one pass's backend block, tolerating a pass that has none.\n *\n * @param {object} pass Decoded pass record.\n * @param {string} passKey Enclosing pass key.\n * @param {string} source Source name for error details.\n * @returns {object} Per-stage backend data, keyed by stage name.\n */\nfunction backendStages(pass, passKey, source)\n{\n if (!pass.backendBlock?.size) return { stages: {}, transforms: [] };\n\n // A block belonging to another backend is not an error here. The container\n // is Carbon-shaped whatever it targets, and loading it must not depend on\n // being able to use its programs - a dx11 container loads and simply cannot\n // be executed by this library. Report no backend data and let prepare fail\n // where the backend actually matters.\n const engineId = peekBackendEngineId(pass.backendBlock.bytes);\n if (engineId !== CARBON_BACKEND_ENGINE_ID.webgl2)\n {\n return { stages: {}, transforms: [], foreignEngineId: engineId };\n }\n\n const block = readGlslBackendBlock(pass.backendBlock.bytes, { layoutKey: passKey, source });\n return { stages: block.stages ?? {}, transforms: block.transforms ?? [] };\n}\n\n/**\n * Decodes container bytes into stage and shader records.\n *\n * Bodies are decoded once each rather than once per permutation row: rows alias\n * onto shared bodies, and a rule that saw the same body 4,096 times would report\n * 4,096 identical incomplete passes.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container payload.\n * @param {object} [values] Read values.\n * @param {string} [values.source] Source name, for diagnostics.\n * @returns {{stages:object[], shaders:object[], recordCount:number, bodyCount:number}}\n * Stage graph in the completeness rules' vocabulary.\n */\nexport function readGlslEffectContainer(input, values = {})\n{\n const source = values.source ?? \"memory\";\n const reader = new CjsCarbonEffectReader(input, { source });\n\n const stages = [];\n const shaders = [];\n const bodyKeyByOffset = new Map();\n\n // Every permutation index that resolves to each body.\n //\n // This is the bridge a caller actually needs, and the only one that is\n // sound. `bodyKey` here is this reader's own ordinal spelling; the\n // permutation graph mints `body${N}` for the same body, and the two are not\n // merely spelled differently — the graph dedupes by content (SHA-256 plus\n // byte equality) while this reader dedupes by source-record offset. Those\n // partitions coincide only because the container writer aliases\n // byte-identical bodies onto one offset, which is a property of the writer\n // rather than a contract.\n //\n // So a consumer must never map between the two by string surgery on either\n // spelling, and must not assume the two ordinal sequences agree. It holds a\n // permutation index; this gives it the body directly.\n const permutationIndicesByOffset = new Map();\n\n for (let index = 0; index < reader.records.length; index += 1)\n {\n const { offset } = reader.records[index];\n const seen = permutationIndicesByOffset.get(offset);\n if (seen) seen.push(index);\n else permutationIndicesByOffset.set(offset, [ index ]);\n }\n\n // Distinct program texts share one shader record, so `shaders` counts unique\n // translations the way the chunk package's shader table did. Empty stages are\n // deliberately *not* pooled: each keeps its own record so a report can name\n // every pass that is missing a program rather than one shared \"absent\".\n //\n // The pool key is the program text *and* the backend reflection that came\n // with it, not the text alone. A pooled record carries the bindings and\n // stage inputs of whichever stage was seen first, and\n // `validateShaderRuntimeContract` judges the emitted GLSL against them — so\n // pooling on text alone would let two stages with identical source but\n // different reflection be checked against the wrong metadata, silently. It\n // is unlikely that identical GLSL ever carries different reflection, which\n // is exactly why it would not be noticed.\n const shaderKeyByIdentity = new Map();\n\n for (let index = 0; index < reader.records.length; index += 1)\n {\n const { offset } = reader.records[index];\n if (bodyKeyByOffset.has(offset)) continue;\n\n const bodyKey = `body_${bodyKeyByOffset.size}`;\n bodyKeyByOffset.set(offset, bodyKey);\n\n const description = reader.readDescription(index, { backend: true });\n const manifestStages = bodyManifestStages(description, reader.version, source);\n\n for (const technique of description.techniques)\n {\n const techniqueName = technique.name.value;\n for (const [ passIndex, pass ] of technique.passes.entries())\n {\n const passKey = `${techniqueName}.pass${passIndex}`;\n const { stages: backend, transforms } = backendStages(\n pass,\n passKey,\n source\n );\n\n for (const stage of pass.stages)\n {\n const name = hlslShaderStageName(stage.type);\n const stageKey = `${bodyKey}.${passKey}.${name}`;\n const stageBackend = backend[name] ?? {};\n\n let shaderKey;\n if (stage.shaderData?.size)\n {\n const code = new TextDecoder().decode(stage.shaderData.bytes);\n const identity = `${JSON.stringify([\n stageBackend.bindings ?? [],\n stageBackend.stageInputs ?? [],\n stageBackend.computeFragment ?? null\n ])} ${code}`;\n const pooled = shaderKeyByIdentity.get(identity);\n if (pooled)\n {\n shaderKey = pooled;\n }\n else\n {\n shaderKey = `shader_${shaderKeyByIdentity.size}`;\n shaderKeyByIdentity.set(identity, shaderKey);\n shaders.push({\n key: shaderKey,\n stageName: name,\n source: code,\n hlsl2webgl: { ok: true },\n bindings: stageBackend.bindings ?? [],\n stageInputs: stageBackend.stageInputs ?? [],\n ...(stageBackend.computeFragment\n ? { computeFragment: stageBackend.computeFragment }\n : {})\n });\n }\n }\n else\n {\n shaderKey = `${stageKey}.absent`;\n shaders.push({\n key: shaderKey,\n stageName: name,\n source: \"\",\n hlsl2webgl: { ok: false, reason: NO_PROGRAM_REASON },\n bindings: stageBackend.bindings ?? [],\n stageInputs: stageBackend.stageInputs ?? []\n });\n }\n\n stages.push({\n key: stageKey,\n bodyKey,\n techniqueName,\n passIndex,\n stageName: name,\n stageType: stage.type,\n shaderKey,\n manifest: manifestStages.get(`${passKey}.${name}`) ?? null,\n // The pass's D3D render states, verbatim from the\n // description. They are not reflection and nothing in\n // the GLSL implies them, so a consumer that only reads\n // programs and bindings renders every effect with\n // whatever state the previous draw happened to leave\n // set. That is invisible for an effect whose states\n // match the ambient ones and total for one whose do\n // not - an additive pass writing alpha 0 disappears\n // completely under a src-alpha blend.\n //\n // `states`, not `renderStates`. Carbon's `Tr2Pass`\n // reserves `renderStates` for the `unsigned int`\n // handle `RegisterRenderStateSetup` hands back\n // (Tr2EffectDescription.h:205), and calls the pairs\n // themselves `states` - as do the WebGPU analysis\n // passes and both of ccpwgl's legacy readers. This\n // path never registers anything, so it carries the\n // list and no handle rather than inventing a number.\n states: pass.renderStates ?? [],\n // The pass's transforms, so a rule can ask whether a\n // description resource was merged away rather than lost.\n transforms\n });\n }\n }\n }\n }\n\n // Ordered by first appearance, matching `bodyKey`'s ordinal.\n const bodies = [];\n for (const [ offset, key ] of bodyKeyByOffset)\n {\n bodies.push({\n key,\n permutationIndices: Object.freeze(permutationIndicesByOffset.get(offset) ?? [])\n });\n }\n\n return {\n stages,\n shaders,\n bodies,\n recordCount: reader.records.length,\n bodyCount: bodyKeyByOffset.size\n };\n}\n\nexport default readGlslEffectContainer;\n"],"names":["NO_PROGRAM_REASON","bodyManifestStages","description","version","source","runtime","runtimeDescriptionFromCarbon","effectName","manifest","HlslEffectBindingManifest","fromEffectDescription","toJSON","Map","stages","map","stage","techniqueName","passIndex","stageName","backendStages","pass","passKey","backendBlock","size","transforms","engineId","peekBackendEngineId","bytes","CARBON_BACKEND_ENGINE_ID","webgl2","foreignEngineId","block","readGlslBackendBlock","layoutKey","readGlslEffectContainer","input","values","reader","CjsCarbonEffectReader","shaders","bodyKeyByOffset","permutationIndicesByOffset","index","records","length","offset","seen","get","push","set","shaderKeyByIdentity","has","bodyKey","readDescription","backend","manifestStages","technique","techniques","name","value","passes","entries","hlslShaderStageName","type","stageKey","stageBackend","shaderKey","shaderData","code","TextDecoder","decode","identity","JSON","stringify","bindings","stageInputs","computeFragment","pooled","key","hlsl2webgl","ok","reason","stageType","states","renderStates","bodies","permutationIndices","Object","freeze","recordCount","bodyCount"],"mappings":";;;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMA,iBAAiB,GAAG,uBAAuB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,kBAAkBA,CAACC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EACxD;AACI,EAAA,MAAMC,OAAO,GAAGC,4BAA4B,CAACJ,WAAW,EAAE;AACtDK,IAAAA,UAAU,EAAEH,MAAM;AAClBD,IAAAA;AACJ,GAAC,CAAC;EACF,MAAMK,QAAQ,GAAGC,yBAAyB,CAACC,qBAAqB,CAACL,OAAO,CAA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AM;IAClC8C,SAAS,EAAElD,eAAe,CAACjB;GAC9B;AACL;;;;"}
1
+ {"version":3,"file":"readGlslEffectContainer.js","sources":["../../../../../src/formats/webgl/core/readGlslEffectContainer.js"],"sourcesContent":["import { CjsCarbonEffectReader } from \"../../../format/carbonEffect/CjsCarbonEffectReader.js\";\nimport { readGlslBackendBlock } from \"./glslBackendBlock.js\";\nimport {\n CARBON_BACKEND_ENGINE_ID,\n peekBackendEngineId\n} from \"../../../format/carbonEffect/backendEngineId.js\";\nimport { hlslShaderStageName } from \"../../hlsl/core/tr2/HlslRenderContextEnum.js\";\nimport { runtimeDescriptionFromCarbon } from \"../../hlsl/core/carbonDescriptionToRuntime.js\";\nimport { HlslEffectBindingManifest } from \"../../hlsl/core/tr2/shader/HlslEffectBindingManifest.js\";\n\n/**\n * Decodes a WebGL effect container into the stage/shader records the\n * completeness rules consume.\n *\n * This exists so the rules run from container bytes alone. The alternative was\n * to hand them the in-memory translation, which works inside `buildEffectPackage`\n * and nowhere else — the validator reads a finished file and has no translation\n * in scope. That would have cost the validator its completeness check while\n * still requiring a decoder to produce the programs it compiles in a browser, so\n * it was strictly more work for strictly less checking.\n *\n * The vocabulary is deliberately the one the rules already speak — `stages` with\n * pass coordinates, `shaders` with source and a translation verdict. The rules\n * are about the translation, not about how it was stored, so retargeting them\n * meant changing where the records come from and nothing about what they mean.\n *\n * **What the wire cannot tell you.** `buildCarbonEffectContainer` stores a body\n * the translator could not lower as its full pass tree with zero-length\n * programs; the *reason* it failed stays in the in-memory build result and is\n * never written. So a shader decoded from bytes reports `ok: false` with\n * \"no program was stored\" and nothing more specific. That is the honest answer:\n * a file on disk does not know why a translation failed months ago. Callers that\n * do know — `buildEffectPackage`, at build time — keep their specific\n * diagnostics by feeding the rules their own records instead.\n */\n\n/** The verdict a stage carrying no stored program gets. */\nconst NO_PROGRAM_REASON = \"no program was stored\";\n\n/**\n * Derives the per-stage binding manifests for one body through the one\n * manifest builder the source path uses.\n *\n * This replaces a hand-built reshape of the wire records into the manifest\n * vocabulary. That copy had already diverged from the real manifest once —\n * `isAutoregister` was silently dropped, making every resource look\n * user-settable — which is the whole argument against a second producer: two\n * hand-maintained spellings of one reflection drift, and the drift is exactly\n * the kind of bug that draws, links and renders black without an error. The\n * record tree now flows through `runtimeDescriptionFromCarbon` — the\n * corpus-proven adapter the runtime read path uses — and\n * `HlslEffectBindingManifest`, so the container read and the build-time\n * package derive their manifests from the same code.\n *\n * No `bytecodeFor` is supplied: program text lives in the shader records this\n * reader emits, so the manifest's `shaderBytecode` stays null rather than\n * duplicating every program into the reflection.\n *\n * @param {object} description Decoded Carbon description record tree.\n * @param {number} version Container data version.\n * @param {string} source Source name for diagnostics.\n * @returns {Map<string, object>} Manifest stage records keyed by\n * `technique.passN.stageName`.\n */\nfunction bodyManifestStages(description, version, source)\n{\n const runtime = runtimeDescriptionFromCarbon(description, {\n effectName: source,\n version\n });\n const manifest = HlslEffectBindingManifest.fromEffectDescription(runtime).toJSON();\n return new Map(manifest.stages.map((stage) => [\n `${stage.techniqueName}.pass${stage.passIndex}.${stage.stageName}`,\n stage\n ]));\n}\n\n/**\n * Decodes one pass's backend block, tolerating a pass that has none.\n *\n * @param {object} pass Decoded pass record.\n * @param {string} passKey Enclosing pass key.\n * @param {string} source Source name for error details.\n * @returns {object} Per-stage backend data, keyed by stage name.\n */\nfunction backendStages(pass, passKey, source)\n{\n if (!pass.backendBlock?.size) return { stages: {}, transforms: [] };\n\n // A block belonging to another backend is not an error here. The container\n // is Carbon-shaped whatever it targets, and loading it must not depend on\n // being able to use its programs - a dx11 container loads and simply cannot\n // be executed by this library. Report no backend data and let prepare fail\n // where the backend actually matters.\n const engineId = peekBackendEngineId(pass.backendBlock.bytes);\n if (engineId !== CARBON_BACKEND_ENGINE_ID.webgl2)\n {\n return { stages: {}, transforms: [], foreignEngineId: engineId };\n }\n\n const block = readGlslBackendBlock(pass.backendBlock.bytes, { layoutKey: passKey, source });\n return { stages: block.stages ?? {}, transforms: block.transforms ?? [] };\n}\n\n/**\n * Decodes container bytes into stage and shader records.\n *\n * Bodies are decoded once each rather than once per permutation row: rows alias\n * onto shared bodies, and a rule that saw the same body 4,096 times would report\n * 4,096 identical incomplete passes.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container payload.\n * @param {object} [values] Read values.\n * @param {string} [values.source] Source name, for diagnostics.\n * @returns {{stages:object[], shaders:object[], recordCount:number, bodyCount:number}}\n * Stage graph in the completeness rules' vocabulary.\n */\nexport function readGlslEffectContainer(input, values = {})\n{\n const source = values.source ?? \"memory\";\n const reader = new CjsCarbonEffectReader(input, { source });\n\n const stages = [];\n const shaders = [];\n const bodyKeyByOffset = new Map();\n\n // Every permutation index that resolves to each body.\n //\n // This is the bridge a caller actually needs, and the only one that is\n // sound. `bodyKey` here is this reader's own ordinal spelling; the\n // permutation graph mints `body${N}` for the same body, and the two are not\n // merely spelled differently — the graph dedupes by content (SHA-256 plus\n // byte equality) while this reader dedupes by source-record offset. Those\n // partitions coincide only because the container writer aliases\n // byte-identical bodies onto one offset, which is a property of the writer\n // rather than a contract.\n //\n // So a consumer must never map between the two by string surgery on either\n // spelling, and must not assume the two ordinal sequences agree. It holds a\n // permutation index; this gives it the body directly.\n const permutationIndicesByOffset = new Map();\n\n for (let index = 0; index < reader.records.length; index += 1)\n {\n const { offset } = reader.records[index];\n const seen = permutationIndicesByOffset.get(offset);\n if (seen) seen.push(index);\n else permutationIndicesByOffset.set(offset, [ index ]);\n }\n\n // Distinct program texts share one shader record, so `shaders` counts unique\n // translations the way the chunk package's shader table did. Empty stages are\n // deliberately *not* pooled: each keeps its own record so a report can name\n // every pass that is missing a program rather than one shared \"absent\".\n //\n // The pool key is the program text *and* the backend reflection that came\n // with it, not the text alone. A pooled record carries the bindings and\n // stage inputs of whichever stage was seen first, and\n // `validateShaderRuntimeContract` judges the emitted GLSL against them — so\n // pooling on text alone would let two stages with identical source but\n // different reflection be checked against the wrong metadata, silently. It\n // is unlikely that identical GLSL ever carries different reflection, which\n // is exactly why it would not be noticed.\n const shaderKeyByIdentity = new Map();\n\n for (let index = 0; index < reader.records.length; index += 1)\n {\n const { offset } = reader.records[index];\n if (bodyKeyByOffset.has(offset)) continue;\n\n const bodyKey = `body_${bodyKeyByOffset.size}`;\n bodyKeyByOffset.set(offset, bodyKey);\n\n const description = reader.readDescription(index, { backend: true });\n const manifestStages = bodyManifestStages(description, reader.version, source);\n\n for (const technique of description.techniques)\n {\n const techniqueName = technique.name.value;\n for (const [ passIndex, pass ] of technique.passes.entries())\n {\n const passKey = `${techniqueName}.pass${passIndex}`;\n const { stages: backend, transforms } = backendStages(\n pass,\n passKey,\n source\n );\n\n for (const stage of pass.stages)\n {\n const name = hlslShaderStageName(stage.type);\n const stageKey = `${bodyKey}.${passKey}.${name}`;\n const stageBackend = backend[name] ?? {};\n\n let shaderKey;\n if (stage.shaderData?.size)\n {\n const code = new TextDecoder().decode(stage.shaderData.bytes);\n const identity = `${JSON.stringify([\n stageBackend.bindings ?? [],\n stageBackend.stageInputs ?? [],\n stageBackend.computeFragment ?? null\n ])} ${code}`;\n const pooled = shaderKeyByIdentity.get(identity);\n if (pooled)\n {\n shaderKey = pooled;\n }\n else\n {\n shaderKey = `shader_${shaderKeyByIdentity.size}`;\n shaderKeyByIdentity.set(identity, shaderKey);\n shaders.push({\n key: shaderKey,\n stageName: name,\n source: code,\n hlsl2webgl: { ok: true },\n bindings: stageBackend.bindings ?? [],\n stageInputs: stageBackend.stageInputs ?? [],\n ...(stageBackend.computeFragment\n ? { computeFragment: stageBackend.computeFragment }\n : {})\n });\n }\n }\n else\n {\n shaderKey = `${stageKey}.absent`;\n shaders.push({\n key: shaderKey,\n stageName: name,\n source: \"\",\n hlsl2webgl: { ok: false, reason: NO_PROGRAM_REASON },\n bindings: stageBackend.bindings ?? [],\n stageInputs: stageBackend.stageInputs ?? []\n });\n }\n\n stages.push({\n key: stageKey,\n bodyKey,\n techniqueName,\n passIndex,\n stageName: name,\n stageType: stage.type,\n shaderKey,\n manifest: manifestStages.get(`${passKey}.${name}`) ?? null,\n // The pass's D3D render states, verbatim from the\n // description. They are not reflection and nothing in\n // the GLSL implies them, so a consumer that only reads\n // programs and bindings renders every effect with\n // whatever state the previous draw happened to leave\n // set. That is invisible for an effect whose states\n // match the ambient ones and total for one whose do\n // not - an additive pass writing alpha 0 disappears\n // completely under a src-alpha blend.\n //\n // `states`, not `renderStates`. In the shipped format a\n // pass reserves `renderStates` for the integer handle a\n // registered state setup is identified by, and calls\n // the {state, value} pairs themselves `states` - as do\n // the WebGPU analysis passes and both of ccpwgl's\n // legacy readers. This path registers nothing, so it\n // carries the list and no handle rather than inventing\n // a number.\n states: pass.renderStates ?? [],\n // The pass's transforms, so a rule can ask whether a\n // description resource was merged away rather than lost.\n transforms\n });\n }\n }\n }\n }\n\n // Ordered by first appearance, matching `bodyKey`'s ordinal.\n const bodies = [];\n for (const [ offset, key ] of bodyKeyByOffset)\n {\n bodies.push({\n key,\n permutationIndices: Object.freeze(permutationIndicesByOffset.get(offset) ?? [])\n });\n }\n\n return {\n stages,\n shaders,\n bodies,\n recordCount: reader.records.length,\n bodyCount: bodyKeyByOffset.size\n };\n}\n\nexport default readGlslEffectContainer;\n"],"names":["NO_PROGRAM_REASON","bodyManifestStages","description","version","source","runtime","runtimeDescriptionFromCarbon","effectName","manifest","HlslEffectBindingManifest","fromEffectDescription","toJSON","Map","stages","map","stage","techniqueName","passIndex","stageName","backendStages","pass","passKey","backendBlock","size","transforms","engineId","peekBackendEngineId","bytes","CARBON_BACKEND_ENGINE_ID","webgl2","foreignEngineId","block","readGlslBackendBlock","layoutKey","readGlslEffectContainer","input","values","reader","CjsCarbonEffectReader","shaders","bodyKeyByOffset","permutationIndicesByOffset","index","records","length","offset","seen","get","push","set","shaderKeyByIdentity","has","bodyKey","readDescription","backend","manifestStages","technique","techniques","name","value","passes","entries","hlslShaderStageName","type","stageKey","stageBackend","shaderKey","shaderData","code","TextDecoder","decode","identity","JSON","stringify","bindings","stageInputs","computeFragment","pooled","key","hlsl2webgl","ok","reason","stageType","states","renderStates","bodies","permutationIndices","Object","freeze","recordCount","bodyCount"],"mappings":";;;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMA,iBAAiB,GAAG,uBAAuB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,kBAAkBA,CAACC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EACxD;AACI,EAAA,MAAMC,OAAO,GAAGC,4BAA4B,CAACJ,WAAW,EAAE;AACtDK,IAAAA,UAAU,EAAEH,MAAM;AAClBD,IAAAA;AACJ,GAAC,CAAC;EACF,MAAMK,QAAQ,GAAGC,yBAAyB,CAACC,qBAAqB,CAACL,OAAO,CAAC,CAACM,MAAM,EAAE;AAClF,EAAA,OAAO,IAAIC,GAAG,CAACJ,QAAQ,CAACK,MAAM,CAACC,GAAG,CAAEC,KAAK,IAAK,CAC1C,CAAA,EAAGA,KAAK,CAACC,aAAa,CAAA,KAAA,EAAQD,KAAK,CAACE,SAAS,CAAA,CAAA,EAAIF,KAAK,CAACG,SAAS,CAAA,CAAE,EAClEH,KAAK,CACR,CAAC,CAAC;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASI,aAAaA,CAACC,IAAI,EAAEC,OAAO,EAAEjB,MAAM,EAC5C;AACI,EAAA,IAAI,CAACgB,IAAI,CAACE,YAAY,EAAEC,IAAI,EAAE,OAAO;IAAEV,MAAM,EAAE,EAAE;AAAEW,IAAAA,UAAU,EAAE;GAAI;;AAEnE;AACA;AACA;AACA;AACA;EACA,MAAMC,QAAQ,GAAGC,mBAAmB,CAACN,IAAI,CAACE,YAAY,CAAC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I;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAyB,YAAAA,MAAM,EAAE/D,IAAI,CAACgE,YAAY,IAAI,EAAE;AAC/B;AACA;AACA5D,YAAAA;AACJ,WAAC,CAAC;AACN,QAAA;AACJ,MAAA;AACJ,IAAA;AACJ,EAAA;;AAEA;EACA,MAAM6D,MAAM,GAAG,EAAE;EACjB,KAAK,MAAM,CAAExC,MAAM,EAAEiC,GAAG,CAAE,IAAItC,eAAe,EAC7C;IACI6C,MAAM,CAACrC,IAAI,CAAC;MACR8B,GAAG;AACHQ,MAAAA,kBAAkB,EAAEC,MAAM,CAACC,MAAM,CAAC/C,0BAA0B,CAACM,GAAG,CAACF,MAAM,CAAC,IAAI,EAAE;AAClF,KAAC,CAAC;AACN,EAAA;EAEA,OAAO;IACHhC,MAAM;IACN0B,OAAO;IACP8C,MAAM;AACNI,IAAAA,WAAW,EAAEpD,MAAM,CAACM,OAAO,CAACC,MAAM;IAClC8C,SAAS,EAAElD,eAAe,CAACjB;GAC9B;AACL;;;;"}
@@ -1,3 +1,4 @@
1
+ import { CjsFormat } from '../../format/CjsFormat.js';
1
2
  import { CLASS_KEYS } from './core/schema.js';
2
3
  import { lowerDxbcToIr } from './core/ir/lowerDxbcToIr.js';
3
4
  import { buildWgsl } from './core/wgsl/emitWgsl.js';
@@ -18,7 +19,7 @@ const FORMAT_NAME = "CjsWebgpuFormat";
18
19
  * bounded DXBC-to-WGSL profiles. Broader shader-semantic coverage remains an
19
20
  * explicit qualification ladder.
20
21
  */
21
- class CjsWebgpuFormat {
22
+ class CjsWebgpuFormat extends CjsFormat {
22
23
  #emit = DEFAULT_VALUES.emit;
23
24
  #source = DEFAULT_VALUES.source;
24
25
  #decodeInstructions = DEFAULT_VALUES.decodeInstructions;
@@ -32,6 +33,7 @@ class CjsWebgpuFormat {
32
33
  * @param {object} [options] Default format values.
33
34
  */
34
35
  constructor(options = {}) {
36
+ super();
35
37
  this.SetValues(options);
36
38
  }
37
39
 
@@ -341,11 +343,15 @@ class CjsWebgpuFormat {
341
343
  }
342
344
  static OUTPUT_JSON = OUTPUT_JSON;
343
345
  static CLASS_KEYS = CLASS_KEYS;
344
- static type = Object.freeze(["shader"]);
346
+ static id = "webgpu";
345
347
  static mediaTypes = Object.freeze(["shader"]);
346
- static inputTypes = Object.freeze(["carbonwebgpu"]);
347
- static outputTypes = Object.freeze([OUTPUT_JSON]);
348
- static implementationStatus = "partial";
348
+ static outputs = CjsFormat.defineOutputs({
349
+ json: {
350
+ default: true,
351
+ decoded: true
352
+ }
353
+ });
354
+ static extensions = Object.freeze([".carbonwebgpu"]);
349
355
  static format = CARBON_WEBGPU_FORMAT;
350
356
  static analysisFormat = CARBON_WEBGPU_ANALYSIS_FORMAT;
351
357
  static packageVersion = FORMAT_WEBGPU_PACKAGE_VERSION;
@@ -1 +1 @@
1
- {"version":3,"file":"CjsWebgpuFormat.js","sources":["../../../../src/formats/webgpu/CjsWebgpuFormat.js"],"sourcesContent":["import { CLASS_KEYS } from \"./core/schema.js\";\r\nimport { lowerDxbcToIr } from \"./core/ir/lowerDxbcToIr.js\";\r\nimport { buildWgsl } from \"./core/wgsl/emitWgsl.js\";\r\nimport { buildWgslBindingPlan } from \"./core/wgsl/buildWgslBindingPlan.js\";\r\nimport { buildWgslSet } from \"./core/wgsl/buildWgslSet.js\";\r\nimport { buildEffectPackage } from \"./core/packageEffect.js\";\r\nimport { FORMAT_WEBGPU_PACKAGE_VERSION } from \"./core/packageMetadata.js\";\r\nimport {\r\n CARBON_WEBGPU_ANALYSIS_FORMAT,\r\n CARBON_WEBGPU_FORMAT,\r\n DEFAULT_VALUES,\r\n OUTPUT_JSON,\r\n analyzeEffectWithValues,\r\n inspectWithValues,\r\n isCarbonWebgpu,\r\n normalizeValues,\r\n readWithValues,\r\n toJsonValue,\r\n validateClass,\r\n validateClassKey\r\n} from \"./core/helpers.js\";\r\n\r\nconst FORMAT_NAME = \"CjsWebgpuFormat\";\r\n\r\n/**\r\n * CarbonEngineJS-facing format surface for `.carbonwebgpu` WebGPU packages, plus an\r\n * offline effect-analysis helper built on the runtime-resource HLSL and DXBC\r\n * format subpaths.\r\n *\r\n * The package owns read/build, normalized shader analysis, and the current\r\n * bounded DXBC-to-WGSL profiles. Broader shader-semantic coverage remains an\r\n * explicit qualification ladder.\r\n */\r\nexport class CjsWebgpuFormat\r\n{\r\n #emit = DEFAULT_VALUES.emit;\r\n #source = DEFAULT_VALUES.source;\r\n #decodeInstructions = DEFAULT_VALUES.decodeInstructions;\r\n #permutation = DEFAULT_VALUES.permutation;\r\n #schema = DEFAULT_VALUES.schema;\r\n #classes = {};\r\n\r\n /**\r\n * Create a reusable format profile.\r\n *\r\n * @param {object} [options] Default format values.\r\n */\r\n constructor(options = {})\r\n {\r\n this.SetValues(options);\r\n }\r\n\r\n /**\r\n * Set format values for this reusable profile.\r\n *\r\n * @param {object} [options] Values to merge into the profile.\r\n * @returns {CjsWebgpuFormat} This format profile.\r\n */\r\n SetValues(options = {})\r\n {\r\n const values = normalizeValues(this.GetValues(), options, CLASS_KEYS, FORMAT_NAME);\r\n this.#emit = values.emit;\r\n this.#source = values.source;\r\n this.#decodeInstructions = values.decodeInstructions;\r\n this.#permutation = values.permutation;\r\n this.#schema = values.schema;\r\n this.#classes = values.classes;\r\n return this;\r\n }\r\n\r\n /**\r\n * Get this profile's current values, optionally with per-call overrides.\r\n *\r\n * @param {object} [options] Optional values to merge into a copy.\r\n * @returns {object} A copy of the effective values.\r\n */\r\n GetValues(options = {})\r\n {\r\n return normalizeValues({\r\n emit: this.#emit,\r\n source: this.#source,\r\n decodeInstructions: this.#decodeInstructions,\r\n permutation: this.#permutation,\r\n schema: this.#schema,\r\n classes: this.#classes\r\n }, options, CLASS_KEYS, FORMAT_NAME);\r\n }\r\n\r\n /**\r\n * Set multiple node-class constructors for this profile.\r\n *\r\n * @param {object} [classes] Map of node class keys to constructors.\r\n * @returns {CjsWebgpuFormat} This format profile.\r\n */\r\n SetClasses(classes = {})\r\n {\r\n return this.SetValues({ classes });\r\n }\r\n\r\n /**\r\n * Set one node-class constructor for this profile.\r\n *\r\n * @param {string} type Node class key.\r\n * @param {Function|null|undefined} Class constructor to use, or nullish to delete.\r\n * @returns {CjsWebgpuFormat} This format profile.\r\n */\r\n SetClass(type, Class)\r\n {\r\n validateClassKey(CLASS_KEYS, type, FORMAT_NAME);\r\n if (Class === null || Class === undefined)\r\n {\r\n delete this.#classes[type];\r\n return this;\r\n }\r\n\r\n validateClass(CLASS_KEYS, type, Class, FORMAT_NAME);\r\n this.#classes = { ...this.#classes, [type]: Class };\r\n return this;\r\n }\r\n\r\n /**\r\n * Get a configured node-class constructor.\r\n *\r\n * @param {string} type Node class key.\r\n * @returns {Function|undefined} The registered constructor, if any.\r\n */\r\n GetClass(type)\r\n {\r\n validateClassKey(CLASS_KEYS, type, FORMAT_NAME);\r\n return this.#classes[type];\r\n }\r\n\r\n /**\r\n * Whether this format profile has a constructor registered for a node key.\r\n *\r\n * @param {string} type Node class key.\r\n * @returns {boolean} True when a constructor is registered.\r\n */\r\n HasClass(type)\r\n {\r\n return !!this.GetClass(type);\r\n }\r\n\r\n /**\r\n * Read a Carbon WebGPU package with this profile's values.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain JSON data: the container-backed views plus the complete backend body set.\r\n */\r\n Read(input, options = {})\r\n {\r\n return readWithValues(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Inspect a Carbon WebGPU package without building the full JSON shape.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain summary data.\r\n */\r\n Inspect(input, options = {})\r\n {\r\n return inspectWithValues(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Analyzes one compiled effect payload into a normalized WebGPU-facing\r\n * document using the current profile's values.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Tr2 effect bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain JSON-compatible analysis data.\r\n */\r\n AnalyzeEffect(input, options = {})\r\n {\r\n return analyzeEffectWithValues(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Builds a Carbon WebGPU package with complete version-15 source reflection and\r\n * selected-body WebGPU output from compiled Tr2 effect bytes.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\r\n * @param {object} [options] Source, body-mode, permutation, and stage-selection policy.\r\n * @returns {object} Package bytes plus inspection and provenance documents.\r\n */\r\n BuildEffect(input, options = {})\r\n {\r\n const values = this.GetValues();\r\n\r\n return buildEffectPackage(input, {\r\n source: values.source,\r\n permutation: values.permutation,\r\n ...options\r\n });\r\n }\r\n\r\n /**\r\n * Lowers DXBC bytes or decoded instructions into the front-end shader IR.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC input.\r\n * @param {object} [options] IR provenance options.\r\n * @returns {object} Frozen shader IR program.\r\n */\r\n BuildShaderIr(input, options = {})\r\n {\r\n return lowerDxbcToIr(input, options);\r\n }\r\n\r\n /**\r\n * Emits WGSL for the currently supported typed shader slice.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC or shader IR.\r\n * @param {object} [options] Source/provenance options.\r\n * @returns {object} Frozen WGSL shader descriptor.\r\n */\r\n BuildWgsl(input, options = {})\r\n {\r\n return buildWgsl(input, options);\r\n }\r\n\r\n /**\r\n * Assign one canonical numeric binding layout across shader stages in a pass.\r\n * Unshared D3D tuples remain stage-scoped unless shared explicitly.\r\n *\r\n * @param {object[]} programs Complete CJS shader IR stage set for one pass.\r\n * @param {object} [options] Pass-level binding policy.\r\n * @param {string[]} [options.sharedIdentities] Compatible D3D identities\r\n * confirmed to represent one resource across stages.\r\n * @returns {object} Frozen CJS_WGSL_BINDING_PLAN document.\r\n */\r\n BuildWgslBindingPlan(programs, options = {})\r\n {\r\n return buildWgslBindingPlan(programs, options);\r\n }\r\n\r\n /**\r\n * Assembles emitted shader descriptors into a portable WGSL set.\r\n *\r\n * @param {object[]} entries Canonically keyed emitted shader descriptors.\r\n * @returns {object} Frozen CJS_WGSL_SET document.\r\n */\r\n BuildWgslSet(entries)\r\n {\r\n return buildWgslSet(entries);\r\n }\r\n\r\n /**\r\n * Convert format output to JSON-compatible data.\r\n *\r\n * @param {any} value Format output to convert.\r\n * @returns {any} Plain JSON-compatible data.\r\n */\r\n ToJSON(value)\r\n {\r\n return toJsonValue(value);\r\n }\r\n\r\n /**\r\n * Static payload sniff. Static methods use camelCase by convention.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.\r\n * @returns {boolean} True when the payload has Carbon's version-15 shape.\r\n */\r\n static isCarbonWebgpu(input)\r\n {\r\n return isCarbonWebgpu(input);\r\n }\r\n\r\n /**\r\n * Static one-shot read.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain JSON data: the container-backed views plus the complete backend body set.\r\n */\r\n static read(input, options = {})\r\n {\r\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, options, CLASS_KEYS, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static one-shot inspection.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain summary data.\r\n */\r\n static inspect(input, options = {})\r\n {\r\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, options, CLASS_KEYS, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static one-shot effect analysis.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Tr2 effect bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain JSON-compatible analysis data.\r\n */\r\n static analyzeEffect(input, options = {})\r\n {\r\n return analyzeEffectWithValues(input, normalizeValues(DEFAULT_VALUES, options, CLASS_KEYS, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static selected-body Carbon WebGPU builder.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\r\n * @param {object} [options] Source, body-mode, permutation, and stage-selection policy.\r\n * @returns {object} Package bytes plus inspection and provenance documents.\r\n */\r\n static buildEffect(input, options = {})\r\n {\r\n return buildEffectPackage(input, options);\r\n }\r\n\r\n /**\r\n * Static DXBC-to-front-end-IR helper.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC input.\r\n * @param {object} [options] IR provenance options.\r\n * @returns {object} Frozen shader IR program.\r\n */\r\n static buildShaderIr(input, options = {})\r\n {\r\n return lowerDxbcToIr(input, options);\r\n }\r\n\r\n /**\r\n * Static WGSL emission helper for the currently supported typed slice.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC or shader IR.\r\n * @param {object} [options] Source/provenance options.\r\n * @returns {object} Frozen WGSL shader descriptor.\r\n */\r\n static buildWgsl(input, options = {})\r\n {\r\n return buildWgsl(input, options);\r\n }\r\n\r\n /**\r\n * Static pass-global WGSL binding-plan helper. Unshared D3D tuples remain\r\n * stage-scoped unless listed in options.sharedIdentities.\r\n *\r\n * @param {object[]} programs Complete CJS shader IR stage set for one pass.\r\n * @param {object} [options] Pass-level binding policy.\r\n * @param {string[]} [options.sharedIdentities] Compatible D3D identities\r\n * confirmed to represent one resource across stages.\r\n * @returns {object} Frozen CJS_WGSL_BINDING_PLAN document.\r\n */\r\n static buildWgslBindingPlan(programs, options = {})\r\n {\r\n return buildWgslBindingPlan(programs, options);\r\n }\r\n\r\n /**\r\n * Static WGSL-set assembly helper.\r\n *\r\n * @param {object[]} entries Canonically keyed emitted shader descriptors.\r\n * @returns {object} Frozen CJS_WGSL_SET document.\r\n */\r\n static buildWgslSet(entries)\r\n {\r\n return buildWgslSet(entries);\r\n }\r\n\r\n /**\r\n * Static JSON-compatible conversion.\r\n *\r\n * @param {any} value Format output to convert.\r\n * @returns {any} Plain JSON-compatible data.\r\n */\r\n static toJSON(value)\r\n {\r\n return toJsonValue(value);\r\n }\r\n\r\n static OUTPUT_JSON = OUTPUT_JSON;\r\n static CLASS_KEYS = CLASS_KEYS;\r\n static type = Object.freeze([ \"shader\" ]);\r\n static mediaTypes = Object.freeze([ \"shader\" ]);\r\n static inputTypes = Object.freeze([ \"carbonwebgpu\" ]);\r\n static outputTypes = Object.freeze([ OUTPUT_JSON ]);\r\n static implementationStatus = \"partial\";\r\n static format = CARBON_WEBGPU_FORMAT;\r\n static analysisFormat = CARBON_WEBGPU_ANALYSIS_FORMAT;\r\n static packageVersion = FORMAT_WEBGPU_PACKAGE_VERSION;\r\n}\r\n\r\nexport default CjsWebgpuFormat;\r\n"],"names":["FORMAT_NAME","CjsWebgpuFormat","DEFAULT_VALUES","emit","source","decodeInstructions","permutation","schema","constructor","options","SetValues","values","normalizeValues","GetValues","CLASS_KEYS","classes","SetClasses","SetClass","type","Class","validateClassKey","undefined","validateClass","GetClass","HasClass","Read","input","readWithValues","Inspect","inspectWithValues","AnalyzeEffect","analyzeEffectWithValues","BuildEffect","buildEffectPackage","BuildShaderIr","lowerDxbcToIr","BuildWgsl","buildWgsl","BuildWgslBindingPlan","programs","buildWgslBindingPlan","BuildWgslSet","entries","buildWgslSet","ToJSON","value","toJsonValue","isCarbonWebgpu","read","inspect","analyzeEffect","buildEffect","buildShaderIr","toJSON","OUTPUT_JSON","Object","freeze","mediaTypes","inputTypes","outputTypes","implementationStatus","format","CARBON_WEBGPU_FORMAT","analysisFormat","CARBON_WEBGPU_ANALYSIS_FORMAT","packageVersion","FORMAT_WEBGPU_PACKAGE_VERSION"],"mappings":";;;;;;;;;AAsBA,MAAMA,WAAW,GAAG,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,CAACC,MAAM,CAAC,CAAE,QAAQ,CAAE,CAAC;EAC/C,OAAOE,UAAU,GAAGH,MAAM,CAACC,MAAM,CAAC,CAAE,cAAc,CAAE,CAAC;EACrD,OAAOG,WAAW,GAAGJ,MAAM,CAACC,MAAM,CAAC,CAAEF,WAAW,CAAE,CAAC;EACnD,OAAOM,oBAAoB,GAAG,SAAS;EACvC,OAAOC,MAAM,GAAGC,oBAAoB;EACpC,OAAOC,cAAc,GAAGC,6BAA6B;EACrD,OAAOC,cAAc,GAAGC,6BAA6B;AACzD;;;;"}
1
+ {"version":3,"file":"CjsWebgpuFormat.js","sources":["../../../../src/formats/webgpu/CjsWebgpuFormat.js"],"sourcesContent":["import { CjsFormat } from \"../../format/CjsFormat.js\";\nimport { CLASS_KEYS } from \"./core/schema.js\";\r\nimport { lowerDxbcToIr } from \"./core/ir/lowerDxbcToIr.js\";\r\nimport { buildWgsl } from \"./core/wgsl/emitWgsl.js\";\r\nimport { buildWgslBindingPlan } from \"./core/wgsl/buildWgslBindingPlan.js\";\r\nimport { buildWgslSet } from \"./core/wgsl/buildWgslSet.js\";\r\nimport { buildEffectPackage } from \"./core/packageEffect.js\";\r\nimport { FORMAT_WEBGPU_PACKAGE_VERSION } from \"./core/packageMetadata.js\";\r\nimport {\r\n CARBON_WEBGPU_ANALYSIS_FORMAT,\r\n CARBON_WEBGPU_FORMAT,\r\n DEFAULT_VALUES,\r\n OUTPUT_JSON,\r\n analyzeEffectWithValues,\r\n inspectWithValues,\r\n isCarbonWebgpu,\r\n normalizeValues,\r\n readWithValues,\r\n toJsonValue,\r\n validateClass,\r\n validateClassKey\r\n} from \"./core/helpers.js\";\r\n\r\nconst FORMAT_NAME = \"CjsWebgpuFormat\";\r\n\r\n/**\r\n * CarbonEngineJS-facing format surface for `.carbonwebgpu` WebGPU packages, plus an\r\n * offline effect-analysis helper built on the runtime-resource HLSL and DXBC\r\n * format subpaths.\r\n *\r\n * The package owns read/build, normalized shader analysis, and the current\r\n * bounded DXBC-to-WGSL profiles. Broader shader-semantic coverage remains an\r\n * explicit qualification ladder.\r\n */\r\nexport class CjsWebgpuFormat extends CjsFormat\r\n{\r\n #emit = DEFAULT_VALUES.emit;\r\n #source = DEFAULT_VALUES.source;\r\n #decodeInstructions = DEFAULT_VALUES.decodeInstructions;\r\n #permutation = DEFAULT_VALUES.permutation;\r\n #schema = DEFAULT_VALUES.schema;\r\n #classes = {};\r\n\r\n /**\r\n * Create a reusable format profile.\r\n *\r\n * @param {object} [options] Default format values.\r\n */\r\n constructor(options = {})\r\n {\r\n super();\r\n this.SetValues(options);\r\n }\r\n\r\n /**\r\n * Set format values for this reusable profile.\r\n *\r\n * @param {object} [options] Values to merge into the profile.\r\n * @returns {CjsWebgpuFormat} This format profile.\r\n */\r\n SetValues(options = {})\r\n {\r\n const values = normalizeValues(this.GetValues(), options, CLASS_KEYS, FORMAT_NAME);\r\n this.#emit = values.emit;\r\n this.#source = values.source;\r\n this.#decodeInstructions = values.decodeInstructions;\r\n this.#permutation = values.permutation;\r\n this.#schema = values.schema;\r\n this.#classes = values.classes;\r\n return this;\r\n }\r\n\r\n /**\r\n * Get this profile's current values, optionally with per-call overrides.\r\n *\r\n * @param {object} [options] Optional values to merge into a copy.\r\n * @returns {object} A copy of the effective values.\r\n */\r\n GetValues(options = {})\r\n {\r\n return normalizeValues({\r\n emit: this.#emit,\r\n source: this.#source,\r\n decodeInstructions: this.#decodeInstructions,\r\n permutation: this.#permutation,\r\n schema: this.#schema,\r\n classes: this.#classes\r\n }, options, CLASS_KEYS, FORMAT_NAME);\r\n }\r\n\r\n /**\r\n * Set multiple node-class constructors for this profile.\r\n *\r\n * @param {object} [classes] Map of node class keys to constructors.\r\n * @returns {CjsWebgpuFormat} This format profile.\r\n */\r\n SetClasses(classes = {})\r\n {\r\n return this.SetValues({ classes });\r\n }\r\n\r\n /**\r\n * Set one node-class constructor for this profile.\r\n *\r\n * @param {string} type Node class key.\r\n * @param {Function|null|undefined} Class constructor to use, or nullish to delete.\r\n * @returns {CjsWebgpuFormat} This format profile.\r\n */\r\n SetClass(type, Class)\r\n {\r\n validateClassKey(CLASS_KEYS, type, FORMAT_NAME);\r\n if (Class === null || Class === undefined)\r\n {\r\n delete this.#classes[type];\r\n return this;\r\n }\r\n\r\n validateClass(CLASS_KEYS, type, Class, FORMAT_NAME);\r\n this.#classes = { ...this.#classes, [type]: Class };\r\n return this;\r\n }\r\n\r\n /**\r\n * Get a configured node-class constructor.\r\n *\r\n * @param {string} type Node class key.\r\n * @returns {Function|undefined} The registered constructor, if any.\r\n */\r\n GetClass(type)\r\n {\r\n validateClassKey(CLASS_KEYS, type, FORMAT_NAME);\r\n return this.#classes[type];\r\n }\r\n\r\n /**\r\n * Whether this format profile has a constructor registered for a node key.\r\n *\r\n * @param {string} type Node class key.\r\n * @returns {boolean} True when a constructor is registered.\r\n */\r\n HasClass(type)\r\n {\r\n return !!this.GetClass(type);\r\n }\r\n\r\n /**\r\n * Read a Carbon WebGPU package with this profile's values.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain JSON data: the container-backed views plus the complete backend body set.\r\n */\r\n Read(input, options = {})\r\n {\r\n return readWithValues(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Inspect a Carbon WebGPU package without building the full JSON shape.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain summary data.\r\n */\r\n Inspect(input, options = {})\r\n {\r\n return inspectWithValues(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Analyzes one compiled effect payload into a normalized WebGPU-facing\r\n * document using the current profile's values.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Tr2 effect bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain JSON-compatible analysis data.\r\n */\r\n AnalyzeEffect(input, options = {})\r\n {\r\n return analyzeEffectWithValues(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Builds a Carbon WebGPU package with complete version-15 source reflection and\r\n * selected-body WebGPU output from compiled Tr2 effect bytes.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\r\n * @param {object} [options] Source, body-mode, permutation, and stage-selection policy.\r\n * @returns {object} Package bytes plus inspection and provenance documents.\r\n */\r\n BuildEffect(input, options = {})\r\n {\r\n const values = this.GetValues();\r\n\r\n return buildEffectPackage(input, {\r\n source: values.source,\r\n permutation: values.permutation,\r\n ...options\r\n });\r\n }\r\n\r\n /**\r\n * Lowers DXBC bytes or decoded instructions into the front-end shader IR.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC input.\r\n * @param {object} [options] IR provenance options.\r\n * @returns {object} Frozen shader IR program.\r\n */\r\n BuildShaderIr(input, options = {})\r\n {\r\n return lowerDxbcToIr(input, options);\r\n }\r\n\r\n /**\r\n * Emits WGSL for the currently supported typed shader slice.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC or shader IR.\r\n * @param {object} [options] Source/provenance options.\r\n * @returns {object} Frozen WGSL shader descriptor.\r\n */\r\n BuildWgsl(input, options = {})\r\n {\r\n return buildWgsl(input, options);\r\n }\r\n\r\n /**\r\n * Assign one canonical numeric binding layout across shader stages in a pass.\r\n * Unshared D3D tuples remain stage-scoped unless shared explicitly.\r\n *\r\n * @param {object[]} programs Complete CJS shader IR stage set for one pass.\r\n * @param {object} [options] Pass-level binding policy.\r\n * @param {string[]} [options.sharedIdentities] Compatible D3D identities\r\n * confirmed to represent one resource across stages.\r\n * @returns {object} Frozen CJS_WGSL_BINDING_PLAN document.\r\n */\r\n BuildWgslBindingPlan(programs, options = {})\r\n {\r\n return buildWgslBindingPlan(programs, options);\r\n }\r\n\r\n /**\r\n * Assembles emitted shader descriptors into a portable WGSL set.\r\n *\r\n * @param {object[]} entries Canonically keyed emitted shader descriptors.\r\n * @returns {object} Frozen CJS_WGSL_SET document.\r\n */\r\n BuildWgslSet(entries)\r\n {\r\n return buildWgslSet(entries);\r\n }\r\n\r\n /**\r\n * Convert format output to JSON-compatible data.\r\n *\r\n * @param {any} value Format output to convert.\r\n * @returns {any} Plain JSON-compatible data.\r\n */\r\n ToJSON(value)\r\n {\r\n return toJsonValue(value);\r\n }\r\n\r\n /**\r\n * Static payload sniff. Static methods use camelCase by convention.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.\r\n * @returns {boolean} True when the payload has Carbon's version-15 shape.\r\n */\r\n static isCarbonWebgpu(input)\r\n {\r\n return isCarbonWebgpu(input);\r\n }\r\n\r\n /**\r\n * Static one-shot read.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain JSON data: the container-backed views plus the complete backend body set.\r\n */\r\n static read(input, options = {})\r\n {\r\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, options, CLASS_KEYS, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static one-shot inspection.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Carbon WebGPU package bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain summary data.\r\n */\r\n static inspect(input, options = {})\r\n {\r\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, options, CLASS_KEYS, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static one-shot effect analysis.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Tr2 effect bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain JSON-compatible analysis data.\r\n */\r\n static analyzeEffect(input, options = {})\r\n {\r\n return analyzeEffectWithValues(input, normalizeValues(DEFAULT_VALUES, options, CLASS_KEYS, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static selected-body Carbon WebGPU builder.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\r\n * @param {object} [options] Source, body-mode, permutation, and stage-selection policy.\r\n * @returns {object} Package bytes plus inspection and provenance documents.\r\n */\r\n static buildEffect(input, options = {})\r\n {\r\n return buildEffectPackage(input, options);\r\n }\r\n\r\n /**\r\n * Static DXBC-to-front-end-IR helper.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC input.\r\n * @param {object} [options] IR provenance options.\r\n * @returns {object} Frozen shader IR program.\r\n */\r\n static buildShaderIr(input, options = {})\r\n {\r\n return lowerDxbcToIr(input, options);\r\n }\r\n\r\n /**\r\n * Static WGSL emission helper for the currently supported typed slice.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC or shader IR.\r\n * @param {object} [options] Source/provenance options.\r\n * @returns {object} Frozen WGSL shader descriptor.\r\n */\r\n static buildWgsl(input, options = {})\r\n {\r\n return buildWgsl(input, options);\r\n }\r\n\r\n /**\r\n * Static pass-global WGSL binding-plan helper. Unshared D3D tuples remain\r\n * stage-scoped unless listed in options.sharedIdentities.\r\n *\r\n * @param {object[]} programs Complete CJS shader IR stage set for one pass.\r\n * @param {object} [options] Pass-level binding policy.\r\n * @param {string[]} [options.sharedIdentities] Compatible D3D identities\r\n * confirmed to represent one resource across stages.\r\n * @returns {object} Frozen CJS_WGSL_BINDING_PLAN document.\r\n */\r\n static buildWgslBindingPlan(programs, options = {})\r\n {\r\n return buildWgslBindingPlan(programs, options);\r\n }\r\n\r\n /**\r\n * Static WGSL-set assembly helper.\r\n *\r\n * @param {object[]} entries Canonically keyed emitted shader descriptors.\r\n * @returns {object} Frozen CJS_WGSL_SET document.\r\n */\r\n static buildWgslSet(entries)\r\n {\r\n return buildWgslSet(entries);\r\n }\r\n\r\n /**\r\n * Static JSON-compatible conversion.\r\n *\r\n * @param {any} value Format output to convert.\r\n * @returns {any} Plain JSON-compatible data.\r\n */\r\n static toJSON(value)\r\n {\r\n return toJsonValue(value);\r\n }\r\n\r\n static OUTPUT_JSON = OUTPUT_JSON;\r\n static CLASS_KEYS = CLASS_KEYS;\r\n static id = \"webgpu\";\n static mediaTypes = Object.freeze([ \"shader\" ]);\n static outputs = CjsFormat.defineOutputs({\n json: { default: true, decoded: true }\n });\n static extensions = Object.freeze([ \".carbonwebgpu\" ]);\n static format = CARBON_WEBGPU_FORMAT;\r\n static analysisFormat = CARBON_WEBGPU_ANALYSIS_FORMAT;\r\n static packageVersion = FORMAT_WEBGPU_PACKAGE_VERSION;\r\n}\r\n\r\nexport default CjsWebgpuFormat;\r\n"],"names":["FORMAT_NAME","CjsWebgpuFormat","CjsFormat","DEFAULT_VALUES","emit","source","decodeInstructions","permutation","schema","constructor","options","SetValues","values","normalizeValues","GetValues","CLASS_KEYS","classes","SetClasses","SetClass","type","Class","validateClassKey","undefined","validateClass","GetClass","HasClass","Read","input","readWithValues","Inspect","inspectWithValues","AnalyzeEffect","analyzeEffectWithValues","BuildEffect","buildEffectPackage","BuildShaderIr","lowerDxbcToIr","BuildWgsl","buildWgsl","BuildWgslBindingPlan","programs","buildWgslBindingPlan","BuildWgslSet","entries","buildWgslSet","ToJSON","value","toJsonValue","isCarbonWebgpu","read","inspect","analyzeEffect","buildEffect","buildShaderIr","toJSON","OUTPUT_JSON","id","mediaTypes","Object","freeze","outputs","defineOutputs","json","default","decoded","extensions","format","CARBON_WEBGPU_FORMAT","analysisFormat","CARBON_WEBGPU_ANALYSIS_FORMAT","packageVersion","FORMAT_WEBGPU_PACKAGE_VERSION"],"mappings":";;;;;;;;;;AAuBA,MAAMA,WAAW,GAAG,iBAAiB;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,SAASC,SAAS,CAC9C;AACI,EAAA,KAAK,GAAGC,cAAc,CAACC,IAAI;AAC3B,EAAA,OAAO,GAAGD,cAAc,CAACE,MAAM;AAC/B,EAAA,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;AACzC,GAAC,CAAC;EACF,OAAOC,UAAU,GAAGP,MAAM,CAACC,MAAM,CAAC,CAAE,eAAe,CAAE,CAAC;EACtD,OAAOO,MAAM,GAAGC,oBAAoB;EACpC,OAAOC,cAAc,GAAGC,6BAA6B;EACrD,OAAOC,cAAc,GAAGC,6BAA6B;AACzD;;;;"}
@@ -1,4 +1,5 @@
1
- import { DEFAULT_VALUES, normalizeValues, readWithValues, inspectWithValues, isSupportedWithValues, toJsonValue, isWebM, toBytes, OUTPUT_JSON, OUTPUT_RAW, OUTPUT_VIDEO } from './core/helpers.js';
1
+ import { CjsFormat } from '../../format/CjsFormat.js';
2
+ import { DEFAULT_VALUES, normalizeValues, readWithValues, inspectWithValues, toJsonValue, probeSupportWithValues, isWebM, toBytes, OUTPUT_JSON, OUTPUT_RAW, OUTPUT_VIDEO } from './core/helpers.js';
2
3
 
3
4
  const FORMAT_NAME = "CjsWebmFormat";
4
5
 
@@ -7,7 +8,7 @@ const FORMAT_NAME = "CjsWebmFormat";
7
8
  * structure and emits raw bytes, debug JSON, or a container-only video
8
9
  * payload with codec and duration summaries but no frame decoding.
9
10
  */
10
- class CjsWebmFormat {
11
+ class CjsWebmFormat extends CjsFormat {
11
12
  #values = DEFAULT_VALUES;
12
13
 
13
14
  /**
@@ -16,6 +17,7 @@ class CjsWebmFormat {
16
17
  * @param {object} [options] Default read/inspect options.
17
18
  */
18
19
  constructor(options = {}) {
20
+ super();
19
21
  this.SetValues(options);
20
22
  }
21
23
 
@@ -79,17 +81,6 @@ class CjsWebmFormat {
79
81
  return inspectWithValues(input, this.GetValues(options), "webm");
80
82
  }
81
83
 
82
- /**
83
- * Report whether WebM input and requested output variants are supported.
84
- *
85
- * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.
86
- * @param {object} [options] Per-call values.
87
- * @returns {object} Support/probe report.
88
- */
89
- IsSupported(input, options = {}) {
90
- return isSupportedWithValues(input, this.GetValues(options), "webm");
91
- }
92
-
93
84
  /**
94
85
  * Convert format output into JSON-compatible debug data.
95
86
  *
@@ -146,8 +137,8 @@ class CjsWebmFormat {
146
137
  * @param {object} [options] Probe options.
147
138
  * @returns {object} Support/probe report.
148
139
  */
149
- static isSupported(input, options = {}) {
150
- return isSupportedWithValues(input, normalizeValues(DEFAULT_VALUES, {
140
+ static probeSupport(input, options = {}) {
141
+ return probeSupportWithValues(input, normalizeValues(DEFAULT_VALUES, {
151
142
  inputType: "webm",
152
143
  ...options
153
144
  }, FORMAT_NAME), "webm");
@@ -186,11 +177,21 @@ class CjsWebmFormat {
186
177
  JSON: OUTPUT_JSON
187
178
  });
188
179
  static OUTPUT_WEBM_JSON = "webmJson";
189
- static type = Object.freeze(["video"]);
180
+ static id = "webm";
190
181
  static mediaTypes = Object.freeze(["video"]);
191
- static inputTypes = Object.freeze(["webm"]);
192
- static outputTypes = Object.freeze([OUTPUT_VIDEO]);
193
- static debugOutputTypes = Object.freeze(["webmJson", OUTPUT_RAW]);
182
+ static outputs = CjsFormat.defineOutputs({
183
+ video: {},
184
+ webmJson: {
185
+ role: "debug",
186
+ probes: ["webmJson", "raw"]
187
+ },
188
+ raw: {
189
+ role: "debug",
190
+ default: true,
191
+ passthrough: true
192
+ }
193
+ });
194
+ static extensions = Object.freeze([".webm"]);
194
195
  }
195
196
 
196
197
  export { CjsWebmFormat };
@@ -1 +1 @@
1
- {"version":3,"file":"CjsWebmFormat.js","sources":["../../../../src/formats/webm/CjsWebmFormat.js"],"sourcesContent":["import {\n DEFAULT_VALUES,\n OUTPUT_JSON,\n OUTPUT_RAW,\n OUTPUT_VIDEO,\n inspectWithValues,\n isSupportedWithValues,\n isWebM,\n normalizeValues,\n readWithValues,\n toBytes,\n toJsonValue\n} from \"./core/helpers.js\";\n\nconst FORMAT_NAME = \"CjsWebmFormat\";\n\n/**\n * WebM container format profile that inspects EBML segment and track\n * structure and emits raw bytes, debug JSON, or a container-only video\n * payload with codec and duration summaries but no frame decoding.\n */\nexport class CjsWebmFormat\n{\n #values = DEFAULT_VALUES;\n\n /**\n * Create a reusable WebM format profile.\n *\n * @param {object} [options] Default read/inspect options.\n */\n constructor(options = {})\n {\n this.SetValues(options);\n }\n\n /**\n * Merge options into this profile.\n *\n * @param {object} [options] Values to merge.\n * @returns {CjsWebmFormat} This format profile.\n */\n SetValues(options = {})\n {\n this.#values = normalizeValues(this.#values, { inputType: \"webm\", ...options }, FORMAT_NAME);\n return this;\n }\n\n /**\n * Get normalized profile values with optional per-call overrides.\n *\n * @param {object} [options] Per-call values.\n * @returns {object} Normalized read values.\n */\n GetValues(options = {})\n {\n return normalizeValues(this.#values, { inputType: \"webm\", ...options }, FORMAT_NAME);\n }\n\n /**\n * Read WebM bytes with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} GPU-free raw/debug payload for the selected emit target.\n */\n Read(input, options = {})\n {\n return readWithValues(input, this.GetValues(options), \"webm\");\n }\n\n /**\n * Read WebM bytes asynchronously with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Per-call values.\n * @returns {Promise<object>} GPU-free raw/debug payload for the selected emit target.\n */\n async ReadAsync(input, options = {})\n {\n return this.Read(input, options);\n }\n\n /**\n * Inspect WebM bytes without decoding media samples.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} WebM container metadata.\n */\n Inspect(input, options = {})\n {\n return inspectWithValues(input, this.GetValues(options), \"webm\");\n }\n\n /**\n * Report whether WebM input and requested output variants are supported.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} Support/probe report.\n */\n IsSupported(input, options = {})\n {\n return isSupportedWithValues(input, this.GetValues(options), \"webm\");\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n ToJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * One-shot WebM read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Read options.\n * @returns {object} GPU-free raw/debug payload for the selected emit target.\n */\n static read(input, options = {})\n {\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"webm\", ...options }, FORMAT_NAME), \"webm\");\n }\n\n /**\n * One-shot asynchronous WebM read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Read options.\n * @returns {Promise<object>} GPU-free raw/debug payload for the selected emit target.\n */\n static async readAsync(input, options = {})\n {\n return CjsWebmFormat.read(input, options);\n }\n\n /**\n * One-shot WebM inspection.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Inspect options.\n * @returns {object} WebM container metadata.\n */\n static inspect(input, options = {})\n {\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"webm\", ...options }, FORMAT_NAME), \"webm\");\n }\n\n /**\n * One-shot WebM support probe.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Probe options.\n * @returns {object} Support/probe report.\n */\n static isSupported(input, options = {})\n {\n return isSupportedWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"webm\", ...options }, FORMAT_NAME), \"webm\");\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * Test whether bytes look like a WebM file.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Candidate WebM bytes.\n * @returns {boolean} True when the EBML signature is present.\n */\n static isWebM(input)\n {\n try\n {\n return isWebM(toBytes(input));\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Emit targets for this format (canonical frozen enum).\n */\n static Output = Object.freeze({\n VIDEO: OUTPUT_VIDEO,\n RAW: OUTPUT_RAW,\n JSON: OUTPUT_JSON\n });\n\n static OUTPUT_WEBM_JSON = \"webmJson\";\n\n static type = Object.freeze([ \"video\" ]);\n\n static mediaTypes = Object.freeze([ \"video\" ]);\n\n static inputTypes = Object.freeze([ \"webm\" ]);\n\n static outputTypes = Object.freeze([ OUTPUT_VIDEO ]);\n\n static debugOutputTypes = Object.freeze([ \"webmJson\", OUTPUT_RAW ]);\n}\n\nexport default CjsWebmFormat;\n"],"names":["FORMAT_NAME","CjsWebmFormat","DEFAULT_VALUES","constructor","options","SetValues","normalizeValues","inputType","GetValues","Read","input","readWithValues","ReadAsync","Inspect","inspectWithValues","IsSupported","isSupportedWithValues","ToJSON","value","toJsonValue","read","readAsync","inspect","isSupported","toJSON","isWebM","toBytes","Output","Object","freeze","VIDEO","OUTPUT_VIDEO","RAW","OUTPUT_RAW","JSON","OUTPUT_JSON","OUTPUT_WEBM_JSON","type","mediaTypes","inputTypes","outputTypes","debugOutputTypes"],"mappings":";;AAcA,MAAMA,WAAW,GAAG,eAAe;;AAEnC;AACA;AACA;AACA;AACA;AACO,MAAMC,aAAa,CAC1B;EACI,OAAO,GAAGC,cAAc;;AAExB;AACJ;AACA;AACA;AACA;AACIC,EAAAA,WAAWA,CAACC,OAAO,GAAG,EAAE,EACxB;AACI,IAAA,IAAI,CAACC,SAAS,CAACD,OAAO,CAAC;AAC3B,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACIC,EAAAA,SAASA,CAACD,OAAO,GAAG,EAAE,EACtB;IACI,IAAI,CAAC,OAAO,GAAGE,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE;AAAEC,MAAAA,SAAS,EAAE,MAAM;MAAE,GAAGH;KAAS,EAAEJ,WAAW,CAAC;AAC5F,IAAA,OAAO,IAAI;AACf,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACIQ,EAAAA,SAASA,CAACJ,OAAO,GAAG,EAAE,EACtB;AACI,IAAA,OAAOE,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE;AAAEC,MAAA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AK,EAAEC,YAAY;AACnBC,IAAAA,GAAG,EAAEC,UAAU;AACfC,IAAAA,IAAI,EAAEC;AACV,GAAC,CAAC;EAEF,OAAOC,gBAAgB,GAAG,UAAU;EAEpC,OAAOC,IAAI,GAAGT,MAAM,CAACC,MAAM,CAAC,CAAE,OAAO,CAAE,CAAC;EAExC,OAAOS,UAAU,GAAGV,MAAM,CAACC,MAAM,CAAC,CAAE,OAAO,CAAE,CAAC;EAE9C,OAAOU,UAAU,GAAGX,MAAM,CAACC,MAAM,CAAC,CAAE,MAAM,CAAE,CAAC;EAE7C,OAAOW,WAAW,GAAGZ,MAAM,CAACC,MAAM,CAAC,CAAEE,YAAY,CAAE,CAAC;EAEpD,OAAOU,gBAAgB,GAAGb,MAAM,CAACC,MAAM,CAAC,CAAE,UAAU,EAAEI,UAAU,CAAE,CAAC;AACvE;;;;"}
1
+ {"version":3,"file":"CjsWebmFormat.js","sources":["../../../../src/formats/webm/CjsWebmFormat.js"],"sourcesContent":["import { CjsFormat } from \"../../format/CjsFormat.js\";\nimport {\n DEFAULT_VALUES,\n OUTPUT_JSON,\n OUTPUT_RAW,\n OUTPUT_VIDEO,\n inspectWithValues,\n probeSupportWithValues,\n isWebM,\n normalizeValues,\n readWithValues,\n toBytes,\n toJsonValue\n} from \"./core/helpers.js\";\n\nconst FORMAT_NAME = \"CjsWebmFormat\";\n\n/**\n * WebM container format profile that inspects EBML segment and track\n * structure and emits raw bytes, debug JSON, or a container-only video\n * payload with codec and duration summaries but no frame decoding.\n */\nexport class CjsWebmFormat extends CjsFormat\n{\n #values = DEFAULT_VALUES;\n\n /**\n * Create a reusable WebM format profile.\n *\n * @param {object} [options] Default read/inspect options.\n */\n constructor(options = {})\n {\n super();\n this.SetValues(options);\n }\n\n /**\n * Merge options into this profile.\n *\n * @param {object} [options] Values to merge.\n * @returns {CjsWebmFormat} This format profile.\n */\n SetValues(options = {})\n {\n this.#values = normalizeValues(this.#values, { inputType: \"webm\", ...options }, FORMAT_NAME);\n return this;\n }\n\n /**\n * Get normalized profile values with optional per-call overrides.\n *\n * @param {object} [options] Per-call values.\n * @returns {object} Normalized read values.\n */\n GetValues(options = {})\n {\n return normalizeValues(this.#values, { inputType: \"webm\", ...options }, FORMAT_NAME);\n }\n\n /**\n * Read WebM bytes with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} GPU-free raw/debug payload for the selected emit target.\n */\n Read(input, options = {})\n {\n return readWithValues(input, this.GetValues(options), \"webm\");\n }\n\n /**\n * Read WebM bytes asynchronously with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Per-call values.\n * @returns {Promise<object>} GPU-free raw/debug payload for the selected emit target.\n */\n async ReadAsync(input, options = {})\n {\n return this.Read(input, options);\n }\n\n /**\n * Inspect WebM bytes without decoding media samples.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} WebM container metadata.\n */\n Inspect(input, options = {})\n {\n return inspectWithValues(input, this.GetValues(options), \"webm\");\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n ToJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * One-shot WebM read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Read options.\n * @returns {object} GPU-free raw/debug payload for the selected emit target.\n */\n static read(input, options = {})\n {\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"webm\", ...options }, FORMAT_NAME), \"webm\");\n }\n\n /**\n * One-shot asynchronous WebM read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Read options.\n * @returns {Promise<object>} GPU-free raw/debug payload for the selected emit target.\n */\n static async readAsync(input, options = {})\n {\n return CjsWebmFormat.read(input, options);\n }\n\n /**\n * One-shot WebM inspection.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Inspect options.\n * @returns {object} WebM container metadata.\n */\n static inspect(input, options = {})\n {\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"webm\", ...options }, FORMAT_NAME), \"webm\");\n }\n\n /**\n * One-shot WebM support probe.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input WebM bytes.\n * @param {object} [options] Probe options.\n * @returns {object} Support/probe report.\n */\n static probeSupport(input, options = {})\n {\n return probeSupportWithValues(input, normalizeValues(DEFAULT_VALUES, { inputType: \"webm\", ...options }, FORMAT_NAME), \"webm\");\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * Test whether bytes look like a WebM file.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Candidate WebM bytes.\n * @returns {boolean} True when the EBML signature is present.\n */\n static isWebM(input)\n {\n try\n {\n return isWebM(toBytes(input));\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Emit targets for this format (canonical frozen enum).\n */\n static Output = Object.freeze({\n VIDEO: OUTPUT_VIDEO,\n RAW: OUTPUT_RAW,\n JSON: OUTPUT_JSON\n });\n\n static OUTPUT_WEBM_JSON = \"webmJson\";\n\n static id = \"webm\";\n\n static mediaTypes = Object.freeze([ \"video\" ]);\n\n static outputs = CjsFormat.defineOutputs({\n\n video: { },\n\n webmJson: { role: \"debug\", probes: [ \"webmJson\", \"raw\" ] },\n\n raw: { role: \"debug\", default: true, passthrough: true }\n\n });\n\n static extensions = Object.freeze([ \".webm\" ]);\n}\n\nexport default CjsWebmFormat;\n"],"names":["FORMAT_NAME","CjsWebmFormat","CjsFormat","DEFAULT_VALUES","constructor","options","SetValues","normalizeValues","inputType","GetValues","Read","input","readWithValues","ReadAsync","Inspect","inspectWithValues","ToJSON","value","toJsonValue","read","readAsync","inspect","probeSupport","probeSupportWithValues","toJSON","isWebM","toBytes","Output","Object","freeze","VIDEO","OUTPUT_VIDEO","RAW","OUTPUT_RAW","JSON","OUTPUT_JSON","OUTPUT_WEBM_JSON","id","mediaTypes","outputs","defineOutputs","video","webmJson","role","probes","raw","default","passthrough","extensions"],"mappings":";;;AAeA,MAAMA,WAAW,GAAG,eAAe;;AAEnC;AACA;AACA;AACA;AACA;AACO,MAAMC,aAAa,SAASC,SAAS,CAC5C;EACI,OAAO,GAAGC,cAAc;;AAExB;AACJ;AACA;AACA;AACA;AACIC,EAAAA,WAAWA,CAACC,OAAO,GAAG,EAAE,EACxB;AACI,IAAA,KAAK,EAAE;AACP,IAAA,IAAI,CAACC,SAAS,CAACD,OAAO,CAAC;AAC3B,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACIC,EAAAA,SAASA,CAACD,OAAO,GAAG,EAAE,EACtB;IACI,IAAI,CAAC,OAAO,GAAGE,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE;AAAEC,MAAAA,SAAS,EAAE,MAAM;MAAE,GAAGH;KAAS,EAAEL,WAAW,CAAC;AAC5F,IAAA,OAAO,IAAI;AACf,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACIS,EAAAA,SAASA,CAACJ,OAAO,GAAG,EAAE,EACtB;AACI,IAAA,OAAOE,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE;AAAEC,MAAAA,SAAS,EAAE,MAAM;MAAE,GAAGH;KAAS,EAAEL,WAAW,CAAC;AACxF,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACIU,EAAAA,IAAIA,CAACC,KAAK,EAAEN,OAAO,GAAG,EAAE,EACxB;AACI,IAAA,OAAOO,cAAc,CAACD,KAAK,EAAE,IAAI,CAACF,SAAS,CAACJ,OAAO,CAAC,EAAE,MAAM,CAAC;AACjE,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,MAAMQ,SAASA,CAACF,KAAK,EA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GAAC,CAAC;EAEF,OAAOC,UAAU,GAAGpB,MAAM,CAACC,MAAM,CAAC,CAAE,OAAO,CAAE,CAAC;AAClD;;;;"}
@@ -63,7 +63,7 @@ function inspectWithValues(input, values = DEFAULT_VALUES, expectedType = "") {
63
63
  * Reports whether input is supported under normalized format options for the
64
64
  * WebM format reader.
65
65
  */
66
- function isSupportedWithValues(input, values = DEFAULT_VALUES, expectedType = "") {
66
+ function probeSupportWithValues(input, values = DEFAULT_VALUES, expectedType = "") {
67
67
  try {
68
68
  const metadata = inspectWithValues(input, values, expectedType);
69
69
  const codecs = getTrackCodecSummary(metadata);
@@ -73,7 +73,7 @@ function isSupportedWithValues(input, values = DEFAULT_VALUES, expectedType = ""
73
73
  source: values.source || "buffer",
74
74
  supported: metadata.sourceFormat ? "partial" : "none",
75
75
  confidence: metadata.sourceFormat ? 1 : 0,
76
- preferred: "container",
76
+ preferredOutput: "video",
77
77
  reason: metadata.sourceFormat ? "Container/header recognized." : "Unrecognized video format.",
78
78
  metadata,
79
79
  variants: [{
@@ -81,10 +81,7 @@ function isSupportedWithValues(input, values = DEFAULT_VALUES, expectedType = ""
81
81
  payloadType: "raw",
82
82
  codec: metadata.sourceFormat,
83
83
  mimeType,
84
- supported: true,
85
- containerOnly: true,
86
- isDecoded: false,
87
- frameDecodeSupported: false
84
+ supported: true
88
85
  }, {
89
86
  kind: "container",
90
87
  payloadType: "video",
@@ -93,10 +90,7 @@ function isSupportedWithValues(input, values = DEFAULT_VALUES, expectedType = ""
93
90
  codecs: codecs.codecs,
94
91
  videoCodecs: codecs.videoCodecs,
95
92
  audioCodecs: codecs.audioCodecs,
96
- supported: true,
97
- containerOnly: true,
98
- isDecoded: false,
99
- frameDecodeSupported: false
93
+ supported: true
100
94
  }, {
101
95
  kind: "decoded",
102
96
  payloadType: "video-frame",
@@ -113,7 +107,7 @@ function isSupportedWithValues(input, values = DEFAULT_VALUES, expectedType = ""
113
107
  source: values.source || "buffer",
114
108
  supported: "none",
115
109
  confidence: 0,
116
- preferred: "",
110
+ preferredOutput: "",
117
111
  reason: error.message,
118
112
  metadata: null,
119
113
  variants: [],
@@ -144,9 +138,6 @@ function readWithValues(input, values = DEFAULT_VALUES, expectedType = "") {
144
138
  sourceFormat: "webm",
145
139
  container: metadata.container,
146
140
  mimeType,
147
- containerOnly: true,
148
- isDecoded: false,
149
- frameDecodeSupported: false,
150
141
  codecs: codecs.codecs,
151
142
  videoCodecs: codecs.videoCodecs,
152
143
  audioCodecs: codecs.audioCodecs,
@@ -568,5 +559,5 @@ function fourCc(bytes, offset) {
568
559
  return String.fromCharCode(bytes[offset] || 0, bytes[offset + 1] || 0, bytes[offset + 2] || 0, bytes[offset + 3] || 0);
569
560
  }
570
561
 
571
- export { DEFAULT_VALUES, OUTPUT_JSON, OUTPUT_RAW, OUTPUT_VIDEO, inspectBytes, inspectWithValues, isMP4, isSupportedWithValues, isWebM, normalizeEmit, normalizeValues, readWithValues, toBytes, toJsonValue };
562
+ export { DEFAULT_VALUES, OUTPUT_JSON, OUTPUT_RAW, OUTPUT_VIDEO, inspectBytes, inspectWithValues, isMP4, isWebM, normalizeEmit, normalizeValues, probeSupportWithValues, readWithValues, toBytes, toJsonValue };
572
563
  //# sourceMappingURL=helpers.js.map