@carbonenginejs/runtime-resource 0.19.2 → 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 (308) 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 +90 -12
  234. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  235. package/dist/formats/webgl/core/helpers.js +2 -2
  236. package/dist/formats/webgl/core/helpers.js.map +1 -1
  237. package/dist/formats/webgl/core/readGlslEffectContainer.js +8 -8
  238. package/dist/formats/webgl/core/readGlslEffectContainer.js.map +1 -1
  239. package/dist/formats/webgpu/CjsWebgpuFormat.js +11 -5
  240. package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  241. package/dist/formats/webm/CjsWebmFormat.js +20 -19
  242. package/dist/formats/webm/CjsWebmFormat.js.map +1 -1
  243. package/dist/formats/webm/core/helpers.js +6 -15
  244. package/dist/formats/webm/core/helpers.js.map +1 -1
  245. package/dist/formats/webp/CjsWebpFormat.js +19 -17
  246. package/dist/formats/webp/CjsWebpFormat.js.map +1 -1
  247. package/dist/formats/webp/core/helpers.js +5 -11
  248. package/dist/formats/webp/core/helpers.js.map +1 -1
  249. package/dist/formats/wem/CjsWemFormat.js +128 -141
  250. package/dist/formats/wem/CjsWemFormat.js.map +1 -1
  251. package/dist/formats/wem/core/helpers.js +1 -114
  252. package/dist/formats/wem/core/helpers.js.map +1 -1
  253. package/dist/formats/wem/core/{resolve.js → probeCodecSupport.js} +11 -18
  254. package/dist/formats/wem/core/probeCodecSupport.js.map +1 -0
  255. package/dist/formats/yaml/CjsYamlFormat.js +20 -5
  256. package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
  257. package/dist/generated/index.js +2 -0
  258. package/dist/generated/index.js.map +1 -0
  259. package/dist/generated/resources/Tr2RaycastGeometryRes.js +34 -0
  260. package/dist/generated/resources/Tr2RaycastGeometryRes.js.map +1 -0
  261. package/dist/generated/resources/index.js +2 -0
  262. package/dist/generated/resources/index.js.map +1 -0
  263. package/dist/index.js +3 -1
  264. package/dist/index.js.map +1 -1
  265. package/dist/resource/CjsResource.js +134 -0
  266. package/dist/resource/CjsResource.js.map +1 -1
  267. package/dist/resource/ResourceRequirement.js +42 -0
  268. package/dist/resource/ResourceRequirement.js.map +1 -0
  269. package/dist/resource/Tr2LightProfileRes.js +2 -1
  270. package/dist/resource/Tr2LightProfileRes.js.map +1 -1
  271. package/dist/resource/geometry/TriGeometryRes.js +34 -7
  272. package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
  273. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js +184 -7
  274. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -1
  275. package/dist/resource/geometry/granny/TriGrannyRes.js +20 -8
  276. package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -1
  277. package/dist/resource/index.js +1 -0
  278. package/dist/resource/index.js.map +1 -1
  279. package/dist/resource/resourceBoundary.js +24 -1
  280. package/dist/resource/resourceBoundary.js.map +1 -1
  281. package/dist/resource/shader/Tr2EffectRes.js +2 -1
  282. package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
  283. package/dist/resource/texture/CjsTextureArrayRes.js +2 -1
  284. package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
  285. package/dist/resource/texture/Tr2ImageRes.js +2 -1
  286. package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
  287. package/dist/resource/texture/TriTextureRes.js +40 -2
  288. package/dist/resource/texture/TriTextureRes.js.map +1 -1
  289. package/docs/architecture.md +121 -116
  290. package/docs/concepts/format-capabilities.md +90 -0
  291. package/docs/formats/README.md +14 -6
  292. package/docs/formats/fsd.md +104 -0
  293. package/docs/formats/gr2.md +1 -1
  294. package/docs/formats/hlsl/reference/api.md +6 -4
  295. package/docs/formats/provenance.md +18 -0
  296. package/docs/formats/schemabound.md +10 -4
  297. package/docs/formats/static.md +26 -26
  298. package/docs/formats/webgpu/reference/api.md +4 -3
  299. package/docs/reference/classes/core.md +22 -2
  300. package/docs/reference/classes/formats.md +643 -1
  301. package/docs/reference/classes/resources.md +463 -453
  302. package/docs/reference/queues.md +205 -194
  303. package/docs/roadmap.md +14 -18
  304. package/format-notices/fsd/LICENSE +21 -0
  305. package/format-notices/fsd/NOTICE +11 -0
  306. package/package.json +70 -64
  307. package/dist/formats/wem/core/resolve.js.map +0 -1
  308. package/docs/concepts/format-type-resolution.md +0 -79
@@ -1,17 +1,9 @@
1
+ import { CjsFormat } from '../../format/CjsFormat.js';
1
2
  import { DEFAULT_VALUES, normalizeValues, emitGlslWithOptions, toJsonValue, isWebglEffectContainer, OUTPUT_JSON } from './core/helpers.js';
2
3
  import { buildEffectPackage } from './core/effectPackage.js';
3
4
  import { readGlslEffectContainer } from './core/readGlslEffectContainer.js';
4
5
  import { inspectGlslEffectContainer } from './core/inspectGlslEffectContainer.js';
5
6
 
6
- /**
7
- * Exposed CarbonEngineJS-facing WebGL format class.
8
- *
9
- * Keep this file small and reviewable: container decoding lives in
10
- * core/readGlslEffectContainer.js, summarising in
11
- * core/inspectGlslEffectContainer.js, the DXBC-to-GLSL ES 3.00 emitter under
12
- * core/glsl, and option normalization in core/helpers.js.
13
- */
14
-
15
7
  const FORMAT_NAME = "CjsWebglFormat";
16
8
 
17
9
  /**
@@ -26,7 +18,7 @@ const FORMAT_NAME = "CjsWebglFormat";
26
18
  * records; `Inspect` is a cheap structural summary; `BuildEffect` translates a
27
19
  * compiled Tr2 effect into one; `EmitGlsl` translates a single DXBC stage.
28
20
  */
29
- class CjsWebglFormat {
21
+ class CjsWebglFormat extends CjsFormat {
30
22
  #emit = DEFAULT_VALUES.emit;
31
23
  #source = DEFAULT_VALUES.source;
32
24
 
@@ -36,6 +28,7 @@ class CjsWebglFormat {
36
28
  * @param {object} [options] Default format values.
37
29
  */
38
30
  constructor(options = {}) {
31
+ super();
39
32
  this.SetValues(options);
40
33
  }
41
34
 
@@ -188,10 +181,15 @@ class CjsWebglFormat {
188
181
  return toJsonValue(value);
189
182
  }
190
183
  static OUTPUT_JSON = OUTPUT_JSON;
191
- static type = Object.freeze(["shader"]);
184
+ static id = "webgl";
192
185
  static mediaTypes = Object.freeze(["shader"]);
193
- static inputTypes = Object.freeze(["carbonwebgl"]);
194
- static outputTypes = Object.freeze([OUTPUT_JSON]);
186
+ static outputs = CjsFormat.defineOutputs({
187
+ json: {
188
+ default: true,
189
+ decoded: true
190
+ }
191
+ });
192
+ static extensions = Object.freeze([]);
195
193
  static packageVersion = "0.2.0";
196
194
  }
197
195
 
@@ -1 +1 @@
1
- {"version":3,"file":"CjsWebglFormat.js","sources":["../../../../src/formats/webgl/CjsWebglFormat.js"],"sourcesContent":["/**\n * Exposed CarbonEngineJS-facing WebGL format class.\n *\n * Keep this file small and reviewable: container decoding lives in\n * core/readGlslEffectContainer.js, summarising in\n * core/inspectGlslEffectContainer.js, the DXBC-to-GLSL ES 3.00 emitter under\n * core/glsl, and option normalization in core/helpers.js.\n */\n\nimport {\n DEFAULT_VALUES,\n OUTPUT_JSON,\n emitGlslWithOptions,\n isWebglEffectContainer,\n normalizeValues,\n toJsonValue\n} from \"./core/helpers.js\";\nimport { buildEffectPackage } from \"./core/effectPackage.js\";\nimport { readGlslEffectContainer } from \"./core/readGlslEffectContainer.js\";\nimport { inspectGlslEffectContainer } from \"./core/inspectGlslEffectContainer.js\";\n\nconst FORMAT_NAME = \"CjsWebglFormat\";\n\n/**\n * CarbonEngineJS-facing format surface for `.carbonwebgl` WebGL shader packages, and\n * a DXBC -> GLSL ES 3.00 emitter for the WebGL2 vertex/pixel/map-style-compute\n * stages ccpwgl targets.\n *\n * The Cjs prefix marks this as a JavaScript format/construction boundary. A\n * WebGL effect is a stock Carbon effect container whose stored programs are\n * GLSL ES 3.00 - the same file shape Carbon ships for its own backends, and the\n * same one WebGPU emits with WGSL. `Read` decodes one into stage and shader\n * records; `Inspect` is a cheap structural summary; `BuildEffect` translates a\n * compiled Tr2 effect into one; `EmitGlsl` translates a single DXBC stage.\n */\nexport class CjsWebglFormat\n{\n\n #emit = DEFAULT_VALUES.emit;\n #source = DEFAULT_VALUES.source;\n\n /**\n * Create a reusable format profile.\n *\n * @param {object} [options] Default format values.\n */\n constructor(options = {})\n {\n this.SetValues(options);\n }\n\n /**\n * Set format values for this reusable profile.\n *\n * @param {object} [options] Values to merge into the profile.\n * @returns {CjsWebglFormat} This format profile.\n */\n SetValues(options = {})\n {\n const values = normalizeValues(this.GetValues(), options, FORMAT_NAME);\n\n this.#emit = values.emit;\n this.#source = values.source;\n\n return this;\n }\n\n /**\n * Get this profile's current values, optionally with per-call overrides.\n *\n * @param {object} [options] Optional values to merge into a copy.\n * @returns {object} A copy of the effective values.\n */\n GetValues(options = {})\n {\n return normalizeValues({\n emit: this.#emit,\n source: this.#source\n }, options, FORMAT_NAME);\n }\n\n /**\n * Decode an effect container into stage and shader records.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Per-call value overrides.\n * @returns {object} Stage graph in the completeness rules' vocabulary.\n */\n Read(input, options = {})\n {\n return readGlslEffectContainer(input, this.GetValues(options));\n }\n\n /**\n * Summarise an effect container without decoding every body's records.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Per-call value overrides.\n * @returns {object} Plain summary data.\n */\n Inspect(input, options = {})\n {\n return inspectGlslEffectContainer(input, this.GetValues(options));\n }\n\n /**\n * Translates one DXBC vertex/pixel/map-style-compute stage into GLSL ES 3.00.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\n * @param {object} [options] Combined ccpwgl-profile/emit options. See {@link CjsWebglFormat.emitGlsl}.\n * @returns {object} GLSL text plus the IO contract the packaging layer records.\n */\n EmitGlsl(dxbcBytes, options = {})\n {\n return emitGlslWithOptions(dxbcBytes, options);\n }\n\n /**\n * Builds a complete effect container from compiled Tr2 effect bytes.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\n * @param {object} [options] Selection, provenance, and emitter policy.\n * @returns {object} Package bytes plus inspection and qualification records.\n */\n BuildEffect(input, options = {})\n {\n return buildEffectPackage(input, options);\n }\n\n /**\n * Instance JSON-compatible conversion.\n *\n * @param {any} value Format output to convert.\n * @returns {any} Plain JSON-compatible data.\n */\n ToJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * Static payload sniff. Static methods use camelCase by convention.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.\n * @returns {boolean} True when the payload has the container shape.\n */\n static isWebglEffectContainer(input)\n {\n return isWebglEffectContainer(input);\n }\n\n /**\n * Static one-shot container decode.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Format values.\n * @returns {object} Stage graph in the completeness rules' vocabulary.\n */\n static read(input, options = {})\n {\n return readGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Static one-shot inspection.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Format values.\n * @returns {object} Plain summary data.\n */\n static inspect(input, options = {})\n {\n return inspectGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Static one-shot DXBC-to-GLSL emission.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\n * @param {object} [options] Combined ccpwgl-profile/emit options: `constantBufferStyle`\n * (`\"array\"` (default) uniform `vec4[]` for ccpwgl's uniform4fv path, or `\"std140\"`),\n * `pixelConstantBufferRemap` (default `{ 0: 7 }`, pixel-stage cb slot renames),\n * `samplerName(register, stageName)` (naming function), `vertexStructuredCapacity`\n * (default 69, bone-array element capacity), `dataTextureWidth` (default 2048),\n * `pairVaryings` (per-call varying zero-fill list), `source` (per-call error-detail name).\n * @returns {object} GLSL text plus the IO contract the packaging layer records.\n */\n static emitGlsl(dxbcBytes, options = {})\n {\n return emitGlslWithOptions(dxbcBytes, options);\n }\n\n /**\n * Static whole-effect container builder.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\n * @param {object} [options] Selection, provenance, and emitter policy.\n * @returns {object} Package bytes plus inspection and qualification records.\n */\n static buildEffect(input, options = {})\n {\n return buildEffectPackage(input, options);\n }\n\n /**\n * Static JSON-compatible conversion.\n *\n * @param {any} value Format output to convert.\n * @returns {any} Plain JSON-compatible data.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n static OUTPUT_JSON = OUTPUT_JSON;\n static type = Object.freeze([ \"shader\" ]);\n static mediaTypes = Object.freeze([ \"shader\" ]);\n static inputTypes = Object.freeze([ \"carbonwebgl\" ]);\n static outputTypes = Object.freeze([ OUTPUT_JSON ]);\n static packageVersion = \"0.2.0\";\n\n}\n\nexport default CjsWebglFormat;\n"],"names":["FORMAT_NAME","CjsWebglFormat","DEFAULT_VALUES","emit","source","constructor","options","SetValues","values","normalizeValues","GetValues","Read","input","readGlslEffectContainer","Inspect","inspectGlslEffectContainer","EmitGlsl","dxbcBytes","emitGlslWithOptions","BuildEffect","buildEffectPackage","ToJSON","value","toJsonValue","isWebglEffectContainer","read","inspect","emitGlsl","buildEffect","toJSON","OUTPUT_JSON","type","Object","freeze","mediaTypes","inputTypes","outputTypes","packageVersion"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA,MAAMA,WAAW,GAAG,gBAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,CAC3B;AAEI,EAAA,KAAK,GAAGC,cAAc,CAACC,IAAI;AAC3B,EAAA,OAAO,GAAGD,cAAc,CAACE,MAAM;;AAE/B;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;AACI,IAAA,MAAME,MAAM,GAAGC,eAAe,CAAC,IAAI,CAACC,SAAS,EAAE,EAAEJ,OAAO,EAAEN,WAAW,CAAC;AAEtE,IAA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;EAC/C,OAAOE,UAAU,GAAGH,MAAM,CAACC,MAAM,CAAC,CAAE,aAAa,CAAE,CAAC;EACpD,OAAOG,WAAW,GAAGJ,MAAM,CAACC,MAAM,CAAC,CAAEH,WAAW,CAAE,CAAC;EACnD,OAAOO,cAAc,GAAG,OAAO;AAEnC;;;;"}
1
+ {"version":3,"file":"CjsWebglFormat.js","sources":["../../../../src/formats/webgl/CjsWebglFormat.js"],"sourcesContent":["import { CjsFormat } from \"../../format/CjsFormat.js\";\n/**\n * Exposed CarbonEngineJS-facing WebGL format class.\n *\n * Keep this file small and reviewable: container decoding lives in\n * core/readGlslEffectContainer.js, summarising in\n * core/inspectGlslEffectContainer.js, the DXBC-to-GLSL ES 3.00 emitter under\n * core/glsl, and option normalization in core/helpers.js.\n */\n\nimport {\n DEFAULT_VALUES,\n OUTPUT_JSON,\n emitGlslWithOptions,\n isWebglEffectContainer,\n normalizeValues,\n toJsonValue\n} from \"./core/helpers.js\";\nimport { buildEffectPackage } from \"./core/effectPackage.js\";\nimport { readGlslEffectContainer } from \"./core/readGlslEffectContainer.js\";\nimport { inspectGlslEffectContainer } from \"./core/inspectGlslEffectContainer.js\";\n\nconst FORMAT_NAME = \"CjsWebglFormat\";\n\n/**\n * CarbonEngineJS-facing format surface for `.carbonwebgl` WebGL shader packages, and\n * a DXBC -> GLSL ES 3.00 emitter for the WebGL2 vertex/pixel/map-style-compute\n * stages ccpwgl targets.\n *\n * The Cjs prefix marks this as a JavaScript format/construction boundary. A\n * WebGL effect is a stock Carbon effect container whose stored programs are\n * GLSL ES 3.00 - the same file shape Carbon ships for its own backends, and the\n * same one WebGPU emits with WGSL. `Read` decodes one into stage and shader\n * records; `Inspect` is a cheap structural summary; `BuildEffect` translates a\n * compiled Tr2 effect into one; `EmitGlsl` translates a single DXBC stage.\n */\nexport class CjsWebglFormat extends CjsFormat\n{\n\n #emit = DEFAULT_VALUES.emit;\n #source = DEFAULT_VALUES.source;\n\n /**\n * Create a reusable format profile.\n *\n * @param {object} [options] Default format values.\n */\n constructor(options = {})\n {\n super();\n this.SetValues(options);\n }\n\n /**\n * Set format values for this reusable profile.\n *\n * @param {object} [options] Values to merge into the profile.\n * @returns {CjsWebglFormat} This format profile.\n */\n SetValues(options = {})\n {\n const values = normalizeValues(this.GetValues(), options, FORMAT_NAME);\n\n this.#emit = values.emit;\n this.#source = values.source;\n\n return this;\n }\n\n /**\n * Get this profile's current values, optionally with per-call overrides.\n *\n * @param {object} [options] Optional values to merge into a copy.\n * @returns {object} A copy of the effective values.\n */\n GetValues(options = {})\n {\n return normalizeValues({\n emit: this.#emit,\n source: this.#source\n }, options, FORMAT_NAME);\n }\n\n /**\n * Decode an effect container into stage and shader records.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Per-call value overrides.\n * @returns {object} Stage graph in the completeness rules' vocabulary.\n */\n Read(input, options = {})\n {\n return readGlslEffectContainer(input, this.GetValues(options));\n }\n\n /**\n * Summarise an effect container without decoding every body's records.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Per-call value overrides.\n * @returns {object} Plain summary data.\n */\n Inspect(input, options = {})\n {\n return inspectGlslEffectContainer(input, this.GetValues(options));\n }\n\n /**\n * Translates one DXBC vertex/pixel/map-style-compute stage into GLSL ES 3.00.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\n * @param {object} [options] Combined ccpwgl-profile/emit options. See {@link CjsWebglFormat.emitGlsl}.\n * @returns {object} GLSL text plus the IO contract the packaging layer records.\n */\n EmitGlsl(dxbcBytes, options = {})\n {\n return emitGlslWithOptions(dxbcBytes, options);\n }\n\n /**\n * Builds a complete effect container from compiled Tr2 effect bytes.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\n * @param {object} [options] Selection, provenance, and emitter policy.\n * @returns {object} Package bytes plus inspection and qualification records.\n */\n BuildEffect(input, options = {})\n {\n return buildEffectPackage(input, options);\n }\n\n /**\n * Instance JSON-compatible conversion.\n *\n * @param {any} value Format output to convert.\n * @returns {any} Plain JSON-compatible data.\n */\n ToJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * Static payload sniff. Static methods use camelCase by convention.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.\n * @returns {boolean} True when the payload has the container shape.\n */\n static isWebglEffectContainer(input)\n {\n return isWebglEffectContainer(input);\n }\n\n /**\n * Static one-shot container decode.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Format values.\n * @returns {object} Stage graph in the completeness rules' vocabulary.\n */\n static read(input, options = {})\n {\n return readGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Static one-shot inspection.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Format values.\n * @returns {object} Plain summary data.\n */\n static inspect(input, options = {})\n {\n return inspectGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Static one-shot DXBC-to-GLSL emission.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\n * @param {object} [options] Combined ccpwgl-profile/emit options: `constantBufferStyle`\n * (`\"array\"` (default) uniform `vec4[]` for ccpwgl's uniform4fv path, or `\"std140\"`),\n * `pixelConstantBufferRemap` (default `{ 0: 7 }`, pixel-stage cb slot renames),\n * `samplerName(register, stageName)` (naming function), `vertexStructuredCapacity`\n * (default 69, bone-array element capacity), `dataTextureWidth` (default 2048),\n * `pairVaryings` (per-call varying zero-fill list), `source` (per-call error-detail name).\n * @returns {object} GLSL text plus the IO contract the packaging layer records.\n */\n static emitGlsl(dxbcBytes, options = {})\n {\n return emitGlslWithOptions(dxbcBytes, options);\n }\n\n /**\n * Static whole-effect container builder.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\n * @param {object} [options] Selection, provenance, and emitter policy.\n * @returns {object} Package bytes plus inspection and qualification records.\n */\n static buildEffect(input, options = {})\n {\n return buildEffectPackage(input, options);\n }\n\n /**\n * Static JSON-compatible conversion.\n *\n * @param {any} value Format output to convert.\n * @returns {any} Plain JSON-compatible data.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n static OUTPUT_JSON = OUTPUT_JSON;\n static id = \"webgl\";\n static mediaTypes = Object.freeze([ \"shader\" ]);\n static outputs = CjsFormat.defineOutputs({\n json: { default: true, decoded: true }\n });\n static extensions = Object.freeze([]);\n static packageVersion = \"0.2.0\";\n\n}\n\nexport default CjsWebglFormat;\n"],"names":["FORMAT_NAME","CjsWebglFormat","CjsFormat","DEFAULT_VALUES","emit","source","constructor","options","SetValues","values","normalizeValues","GetValues","Read","input","readGlslEffectContainer","Inspect","inspectGlslEffectContainer","EmitGlsl","dxbcBytes","emitGlslWithOptions","BuildEffect","buildEffectPackage","ToJSON","value","toJsonValue","isWebglEffectContainer","read","inspect","emitGlsl","buildEffect","toJSON","OUTPUT_JSON","id","mediaTypes","Object","freeze","outputs","defineOutputs","json","default","decoded","extensions","packageVersion"],"mappings":";;;;;;AAsBA,MAAMA,WAAW,GAAG,gBAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,SAASC,SAAS,CAC7C;AAEI,EAAA,KAAK,GAAGC,cAAc,CAACC,IAAI;AAC3B,EAAA,OAAO,GAAGD,cAAc,CAACE,MAAM;;AAE/B;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,EAC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OAAOC,UAAU,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAE,QAAQ,CAAE,CAAC;AAC/C,EAAA,OAAOC,OAAO,GAAGlC,SAAS,CAACmC,aAAa,CAAC;AACrCC,IAAAA,IAAI,EAAE;AAAEC,MAAAA,OAAO,EAAE,IAAI;AAAEC,MAAAA,OAAO,EAAE;AAAK;AACzC,GAAC,CAAC;AACF,EAAA,OAAOC,UAAU,GAAGP,MAAM,CAACC,MAAM,CAAC,EAAE,CAAC;EACrC,OAAOO,cAAc,GAAG,OAAO;AAEnC;;;;"}
@@ -133,8 +133,33 @@ class DxbcGlslEmitter {
133
133
  // into one array binding frees two texture units on shaders that
134
134
  // sit exactly on WebGL2's 16-unit limit.
135
135
  detailMapArrayRegisters: [],
136
+ // Which end of the source clip range is NEAR, and therefore which
137
+ // form the depth-range fixup takes.
138
+ //
139
+ // "reversed" (default) z_clip [w, 0] -> gl_Position.z = w - 2z
140
+ // "forward" z_clip [0, w] -> gl_Position.z = 2z - w
141
+ //
142
+ // The default is "reversed" because that is what the shaders this
143
+ // emitter translates were compiled against, and it is a property of
144
+ // the INPUT, not a preference of any one consumer. It is stated as
145
+ // an option rather than hard-coded for two reasons: the assumption
146
+ // is otherwise invisible in the output, and a future source may not
147
+ // share it. Deciding it here also means a consumer supplies a
148
+ // matching projection or gets inverted depth, which is a real
149
+ // coupling and better declared than implied.
150
+ //
151
+ // Switch to "forward" to A/B the convention against a forward-range
152
+ // projection. Expect an unbiased vertex to look identical either
153
+ // way - the fixup and the projection compose to the identity - and
154
+ // only shader-authored depth offsets to change sign. That is the
155
+ // whole observable difference, and it is what makes the wrong
156
+ // choice so hard to see.
157
+ depthRange: "reversed",
136
158
  ...options.profile
137
159
  };
160
+ if (this.profile.depthRange !== "reversed" && this.profile.depthRange !== "forward") {
161
+ throw new TypeError(`DxbcGlslEmitter: depthRange must be "reversed" or "forward", got ${JSON.stringify(this.profile.depthRange)}`);
162
+ }
138
163
  }
139
164
 
140
165
  /**
@@ -2957,11 +2982,37 @@ DxbcGlslEmitter.prototype._ldStructured = function _ldStructured(state, instruct
2957
2982
  });
2958
2983
  }
2959
2984
  const offsetDwords = offsetOperand.immediateValues[0].uint32 >> 2;
2960
- const element = state.formatter.sourceExpression(instruction.operands[1], {
2985
+ let element = state.formatter.sourceExpression(instruction.operands[1], {
2961
2986
  destMask: "x",
2962
2987
  as: "int"
2963
2988
  });
2964
2989
  const swizzle = resourceOperand.swizzle || "xyzw";
2990
+
2991
+ // `ld_structured` reads its address ONCE and writes every masked component
2992
+ // from that one read. This emitter scalarises the write into one assignment
2993
+ // per component and re-substitutes the address expression in each, so when
2994
+ // the destination register is also the address register, the second
2995
+ // component onwards reads the value the first assignment just stored.
2996
+ //
2997
+ // That is not hypothetical: it corrupts the bone-matrix fetch in every
2998
+ // skinned EVE hull shader. The address is `blendIndex + boneArrayBase`, the
2999
+ // destination is the same register, and the third matrix row overwrites it
3000
+ // mid-fetch - so rows 2 and 3 index the bone buffer with a matrix float
3001
+ // (~1e9) instead of a bone index. Verified across skinned_quadv5,
3002
+ // skinned_quaddetailv5 and skinned_quadheatv5: every vertex body of every
3003
+ // technique. Unskinned shaders never alias and are unaffected.
3004
+ //
3005
+ // Same hazard `movc` above already guards, handled the same way, and only
3006
+ // when it actually aliases so non-aliasing shaders emit byte-identical GLSL.
3007
+ const addressOperand = instruction.operands[1];
3008
+ const destOperand = instruction.operands[0];
3009
+ const aliasesAddress = addressOperand && destOperand && addressOperand.type === destOperand.type && addressOperand.registerIndex === destOperand.registerIndex;
3010
+ if (aliasesAddress) {
3011
+ this._line(state, "{");
3012
+ state.indent += 1;
3013
+ this._line(state, `int cjsSbAddr = ${element};`);
3014
+ element = "cjsSbAddr";
3015
+ }
2965
3016
  const widthMask = this.profile.dataTextureWidth - 1;
2966
3017
  const widthShift = Math.log2(this.profile.dataTextureWidth);
2967
3018
  const aligned = info.strideDwords % 4 === 0 && offsetDwords % 4 === 0;
@@ -3003,6 +3054,10 @@ DxbcGlslEmitter.prototype._ldStructured = function _ldStructured(state, instruct
3003
3054
  }
3004
3055
  this._line(state, `${this._destComponentRef(state, instruction.operands[0], target, component)} = ${value};`);
3005
3056
  }
3057
+ if (aliasesAddress) {
3058
+ state.indent -= 1;
3059
+ this._line(state, "}");
3060
+ }
3006
3061
  };
3007
3062
 
3008
3063
  /**
@@ -3129,6 +3184,18 @@ DxbcGlslEmitter.prototype._gather4Channel = function _gather4Channel(operand) {
3129
3184
  /**
3130
3185
  * Assembles the final GLSL text.
3131
3186
  */
3187
+ /**
3188
+ * The depth-range fixup emitted at the end of a vertex stage, by source range.
3189
+ *
3190
+ * Both entries map their range onto GL NDC [-1, 1] and both compose to the
3191
+ * identity with a projection of the matching form, so an unbiased vertex is
3192
+ * unchanged either way. See `profile.depthRange`.
3193
+ * @type {Object.<string,string>}
3194
+ */
3195
+ const DEPTH_RANGE_FIXUP = Object.freeze({
3196
+ reversed: "gl_Position.z = gl_Position.w - 2.0 * gl_Position.z;",
3197
+ forward: "gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;"
3198
+ });
3132
3199
  DxbcGlslEmitter.prototype._assemble = function _assemble(state) {
3133
3200
  const lines = ["#version 300 es"];
3134
3201
  if (state.isPixel || state.isCompute) {
@@ -3139,16 +3206,27 @@ DxbcGlslEmitter.prototype._assemble = function _assemble(state) {
3139
3206
  if (helperSource) {
3140
3207
  lines.push("", helperSource);
3141
3208
  }
3142
- // Vertex stages get the standard DX->GL depth-range fixup: EVE's
3143
- // projection matrices are D3D-style (z_clip in [0, w]), so the raw
3144
- // DXBC position would land in GL NDC [0, 1] instead of [-1, 1]
3145
- // halving depth precision and breaking every pixel-stage read of
3146
- // SV_Position.z (gl_FragCoord.z) and depth-encoding technique against
3147
- // the DX-convention values the shaders were compiled for. Remapping
3148
- // z after the translated body runs makes depth output, clipping and
3149
- // gl_FragCoord.z all match D3D semantics exactly. The body is wrapped
3150
- // in a helper so early `ret` (return) statements cannot skip the
3151
- // fixup.
3209
+ // Vertex stages get the depth-range fixup that turns a compiled shader's
3210
+ // clip z into GL's. These shaders are compiled against a REVERSED depth
3211
+ // range: z_clip runs [w, 0], near at w and far at 0, and `w - 2z` maps that
3212
+ // onto GL NDC [-1, 1].
3213
+ //
3214
+ // The reversal is observable in the shipped bodies themselves. Surface
3215
+ // decals add a small positive constant to clip z to lift themselves off the
3216
+ // hull they sit on, and a lift is only toward the camera on a reversed
3217
+ // axis.
3218
+ //
3219
+ // The caller MUST supply a reversed-D3D projection. Composed with one, this
3220
+ // is exactly the identity for an unbiased vertex, so the depth buffer keeps
3221
+ // conventional GL values and legacy shaders sharing it are unaffected. What
3222
+ // changes is the direction of any offset the shader authors ITSELF: the
3223
+ // decal family adds `+1e-5` to lift itself off the hull, which is toward
3224
+ // the camera only on a reversed axis. Hand it a forward-D3D projection and
3225
+ // every such offset inverts - decals sink INTO the hull by `2e-5/w`, an
3226
+ // error that grows as the camera closes in.
3227
+ //
3228
+ // The body is wrapped in a helper so early `ret` (return) statements cannot
3229
+ // skip the fixup.
3152
3230
  const writesPosition = [...state.outputNames.values()].includes("gl_Position");
3153
3231
  if (!state.isPixel && !state.isCompute && writesPosition) {
3154
3232
  lines.push("", "void dxbc_main() {");
@@ -3156,7 +3234,7 @@ DxbcGlslEmitter.prototype._assemble = function _assemble(state) {
3156
3234
  lines.push(` ${early}`);
3157
3235
  }
3158
3236
  lines.push(...state.bodyLines, "}");
3159
- lines.push("", "void main() {", " dxbc_main();", " gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;", "}");
3237
+ lines.push("", "void main() {", " dxbc_main();", ` ${DEPTH_RANGE_FIXUP[this.profile.depthRange]}`, "}");
3160
3238
  return `${lines.join("\n")}\n`;
3161
3239
  }
3162
3240
  lines.push("", "void main() {");