@carbonenginejs/runtime-resource 0.12.2 → 0.13.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.
- package/LICENSE +21 -21
- package/NOTICE +32 -32
- package/README.md +129 -108
- package/dist/CjsMotherLode.js +1271 -1271
- package/dist/CjsResMan.js +3858 -3494
- package/dist/CjsResMan.js.map +1 -1
- package/dist/CjsResManFetchProvider.js +94 -94
- package/dist/CjsResManWorkQueue.js +301 -301
- package/dist/_virtual/_rollupPluginBabelHelpers.js +150 -150
- package/dist/format/CjsBlueReader.js +358 -358
- package/dist/format/CjsByteReader.js +310 -310
- package/dist/format/CjsByteWriter.js +242 -242
- package/dist/format/CjsFormat.js +223 -223
- package/dist/format/CjsFormatError.js +41 -41
- package/dist/format/CjsReader.js +22 -22
- package/dist/format/CjsResourceProbe.js +279 -279
- package/dist/format/CjsStringTable.js +268 -268
- package/dist/format/carbonEffect/CjsCarbonEffectReader.js +408 -361
- package/dist/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -1
- package/dist/format/carbonEffect/CjsCarbonEffectWriter.js +373 -373
- package/dist/format/carbonEffect/buildCarbonEffectContainer.js +182 -0
- package/dist/format/carbonEffect/buildCarbonEffectContainer.js.map +1 -0
- package/dist/format/carbonEffect/carbonEffectBackendBlock.js +321 -427
- package/dist/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -1
- package/dist/format/carbonEffect/carbonEffectRecords.js +1147 -955
- package/dist/format/carbonEffect/carbonEffectRecords.js.map +1 -1
- package/dist/format/carbonEffect/carbonEffectResourceTransform.js +197 -0
- package/dist/format/carbonEffect/carbonEffectResourceTransform.js.map +1 -0
- package/dist/format/compareUtf8.js +36 -36
- package/dist/format/effect/effectBodyInventory.js +146 -0
- package/dist/format/effect/effectBodyInventory.js.map +1 -0
- package/dist/format/effect/effectPermutationGraph.js +257 -257
- package/dist/format/effect/effectPermutationGraph.js.map +1 -1
- package/dist/format/effect/sha256.js +114 -114
- package/dist/format/index.js +11 -11
- package/dist/format/payloadContract.js +193 -193
- package/dist/formats/black/CjsBlackFormat.js +310 -292
- package/dist/formats/black/CjsBlackFormat.js.map +1 -1
- package/dist/formats/black/core/CjsBlackBinaryReader.js +260 -260
- package/dist/formats/black/core/CjsBlackPropertyReaders.js +448 -448
- package/dist/formats/black/core/CjsBlackReader.js +764 -764
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js +540 -540
- package/dist/formats/black/core/black-schema-v1-2026-07-23.json.js +4 -4
- package/dist/formats/black/core/blackConstants.js +7 -7
- package/dist/formats/black/core/blackDefinitions.js +10 -10
- package/dist/formats/black/core/blackEnums.js +6 -6
- package/dist/formats/black/core/blackSchema.js +3 -3
- package/dist/formats/black/core/blackVersion.js +22 -22
- package/dist/formats/black/core/helpers.js +199 -199
- package/dist/formats/black/core/schema.js +4 -4
- package/dist/formats/black/index.js +2 -2
- package/dist/formats/bnk/CjsBnkFormat.js +175 -156
- package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/formats/bnk/core/busNodes.js +252 -0
- package/dist/formats/bnk/core/busNodes.js.map +1 -0
- package/dist/formats/bnk/core/effectNodes.js +147 -0
- package/dist/formats/bnk/core/effectNodes.js.map +1 -0
- package/dist/formats/bnk/core/eventAction.js +416 -305
- package/dist/formats/bnk/core/eventAction.js.map +1 -1
- package/dist/formats/bnk/core/globalSettings.js +215 -0
- package/dist/formats/bnk/core/globalSettings.js.map +1 -0
- package/dist/formats/bnk/core/graph.js +137 -137
- package/dist/formats/bnk/core/helpers.js +512 -480
- package/dist/formats/bnk/core/helpers.js.map +1 -1
- package/dist/formats/bnk/core/musicNodes.js +533 -509
- package/dist/formats/bnk/core/musicNodes.js.map +1 -1
- package/dist/formats/bnk/core/nodeBase.js +553 -532
- package/dist/formats/bnk/core/nodeBase.js.map +1 -1
- package/dist/formats/bnk/core/sfxNodes.js +632 -632
- package/dist/formats/bnk/core/soundbanksInfo.js +209 -209
- package/dist/formats/bnk/index.js +2 -2
- package/dist/formats/cmf/CjsCmfFormat.js +497 -497
- package/dist/formats/cmf/core/binary.js +194 -194
- package/dist/formats/cmf/core/buffers.js +237 -237
- package/dist/formats/cmf/core/constants.js +47 -47
- package/dist/formats/cmf/core/gr2Anim.js +453 -453
- package/dist/formats/cmf/core/helpers.js +318 -318
- package/dist/formats/cmf/core/pack.js +276 -276
- package/dist/formats/cmf/core/schema.js +374 -374
- package/dist/formats/cmf/core/shared.js +277 -277
- package/dist/formats/cmf/core/writer.js +571 -571
- package/dist/formats/cmf/index.js +2 -2
- package/dist/formats/dds/CjsDdsFormat.js +200 -200
- package/dist/formats/dds/core/bc6h.js +298 -298
- package/dist/formats/dds/core/bc7.js +272 -272
- package/dist/formats/dds/core/helpers.js +862 -862
- package/dist/formats/dds/index.js +2 -2
- package/dist/formats/dxbc/CjsDxbcFormat.js +142 -142
- package/dist/formats/dxbc/core/DxbcReader.js +266 -266
- package/dist/formats/dxbc/core/container.js +169 -169
- package/dist/formats/dxbc/core/decoder.js +789 -789
- package/dist/formats/dxbc/core/errors.js +19 -19
- package/dist/formats/dxbc/core/helpers.js +220 -220
- package/dist/formats/dxbc/core/opcodes.js +45 -45
- package/dist/formats/dxbc/core/program.js +91 -91
- package/dist/formats/dxbc/core/signature.js +172 -172
- package/dist/formats/dxbc/index.js +2 -2
- package/dist/formats/fbx/CjsFbxFormat.js +266 -266
- package/dist/formats/fbx/core/helpers.js +3932 -3932
- package/dist/formats/fbx/index.js +2 -2
- package/dist/formats/flac/CjsFlacFormat.js +142 -142
- package/dist/formats/flac/core/helpers.js +315 -315
- package/dist/formats/flac/index.js +2 -2
- package/dist/formats/gif/CjsGifFormat.js +141 -141
- package/dist/formats/gif/core/helpers.js +380 -380
- package/dist/formats/gif/index.js +2 -2
- package/dist/formats/gltf/CjsGltfFormat.js +290 -290
- package/dist/formats/gltf/core/helpers.js +307 -307
- package/dist/formats/gltf/core/json.js +79 -79
- package/dist/formats/gltf/core/parser.js +679 -679
- package/dist/formats/gltf/core/targets.js +173 -173
- package/dist/formats/gltf/index.js +2 -2
- package/dist/formats/gr2/CjsGr2Format.js +289 -289
- package/dist/formats/gr2/core/bitknit2.js +282 -282
- package/dist/formats/gr2/core/curves.js +1047 -1047
- package/dist/formats/gr2/core/gsf.js +72 -72
- package/dist/formats/gr2/core/helpers.js +352 -352
- package/dist/formats/gr2/core/json.js +622 -622
- package/dist/formats/gr2/core/oodle1.js +388 -388
- package/dist/formats/gr2/core/tangents.js +48 -48
- package/dist/formats/gr2/core/targets.js +361 -361
- package/dist/formats/gr2/index.js +2 -2
- package/dist/formats/hlsl/CjsHlslFormat.js +254 -254
- package/dist/formats/hlsl/core/HlslBinaryUtils.js +15 -15
- package/dist/formats/hlsl/core/HlslEffectReadError.js +19 -19
- package/dist/formats/hlsl/core/HlslEffectStateManager.js +130 -130
- package/dist/formats/hlsl/core/HlslRenderStateSetup.js +37 -37
- package/dist/formats/hlsl/core/HlslResourceSetDescription.js +94 -94
- package/dist/formats/hlsl/core/HlslShaderBytecode.js +44 -44
- package/dist/formats/hlsl/core/analysis.js +51 -51
- package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js +850 -781
- package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -1
- package/dist/formats/hlsl/core/detailMapFamily.js +128 -0
- package/dist/formats/hlsl/core/detailMapFamily.js.map +1 -0
- package/dist/formats/hlsl/core/helpers.js +270 -270
- package/dist/formats/hlsl/core/json.js +284 -284
- package/dist/formats/hlsl/core/localLightFamily.js +133 -0
- package/dist/formats/hlsl/core/localLightFamily.js.map +1 -0
- package/dist/formats/hlsl/core/metadata.js +327 -327
- package/dist/formats/hlsl/core/render-states.js +280 -280
- package/dist/formats/hlsl/core/tr2/HlslRenderContextEnum.js +43 -43
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +320 -314
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -1
- package/dist/formats/hlsl/core/tr2/resources/HlslShaderPermutation.js +33 -33
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js +416 -416
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectConstant.js +40 -40
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js +62 -742
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js.map +1 -1
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectLibrary.js +52 -52
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectParameterAnnotation.js +38 -38
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectResource.js +50 -50
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +86 -86
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectTechnique.js +31 -31
- package/dist/formats/hlsl/core/tr2/shader/HlslPass.js +42 -42
- package/dist/formats/hlsl/core/tr2/shader/HlslSamplerDescription.js +55 -55
- package/dist/formats/hlsl/core/tr2/shader/HlslSamplerSetup.js +29 -29
- package/dist/formats/hlsl/core/tr2/shader/HlslShader.js +220 -220
- package/dist/formats/hlsl/core/tr2/shader/HlslShaderOption.js +30 -30
- package/dist/formats/hlsl/index.js +3 -3
- package/dist/formats/index.js +33 -31
- package/dist/formats/index.js.map +1 -1
- package/dist/formats/jpeg/CjsJpegFormat.js +212 -212
- package/dist/formats/jpeg/core/helpers.js +402 -402
- package/dist/formats/jpeg/core/jpeg.js +480 -480
- package/dist/formats/jpeg/index.js +2 -2
- package/dist/formats/mp3/CjsMp3Format.js +197 -197
- package/dist/formats/mp3/core/helpers.js +375 -375
- package/dist/formats/mp3/index.js +2 -2
- package/dist/formats/mp4/CjsMp4Format.js +197 -197
- package/dist/formats/mp4/core/helpers.js +484 -484
- package/dist/formats/mp4/index.js +2 -2
- package/dist/formats/obj/CjsObjFormat.js +253 -253
- package/dist/formats/obj/core/helpers.js +573 -573
- package/dist/formats/obj/core/json.js +64 -64
- package/dist/formats/obj/core/parser.js +321 -321
- package/dist/formats/obj/index.js +2 -2
- package/dist/formats/ogg/CjsOggFormat.js +143 -143
- package/dist/formats/ogg/core/helpers.js +410 -410
- package/dist/formats/ogg/core/imdct.js +178 -178
- package/dist/formats/ogg/core/vorbis.js +1017 -1017
- package/dist/formats/ogg/index.js +2 -2
- package/dist/formats/pickle/CjsPickleFormat.js +214 -0
- package/dist/formats/pickle/CjsPickleFormat.js.map +1 -0
- package/dist/formats/pickle/core/CjsPickleProtocol0Reader.js +551 -0
- package/dist/formats/pickle/core/CjsPickleProtocol0Reader.js.map +1 -0
- package/dist/formats/pickle/index.js +2 -0
- package/dist/formats/pickle/index.js.map +1 -0
- package/dist/formats/png/CjsPngFormat.js +201 -201
- package/dist/formats/png/core/helpers.js +635 -635
- package/dist/formats/png/index.js +2 -2
- package/dist/formats/red/CjsRedFormat.js +263 -263
- package/dist/formats/red/core/CjsRedReader.js +246 -246
- package/dist/formats/red/core/blackDefinitions.js +3 -3
- package/dist/formats/red/core/helpers.js +158 -158
- package/dist/formats/red/core/redGraph.js +71 -68
- package/dist/formats/red/core/redGraph.js.map +1 -1
- package/dist/formats/red/core/schema.js +4 -4
- package/dist/formats/red/index.js +2 -2
- package/dist/formats/stl/CjsStlFormat.js +365 -365
- package/dist/formats/stl/core/helpers.js +261 -261
- package/dist/formats/stl/core/json.js +51 -51
- package/dist/formats/stl/core/stl.js +642 -642
- package/dist/formats/stl/core/targets.js +173 -173
- package/dist/formats/stl/index.js +2 -2
- package/dist/formats/tga/CjsTgaFormat.js +197 -197
- package/dist/formats/tga/core/helpers.js +493 -493
- package/dist/formats/tga/index.js +2 -2
- package/dist/formats/wav/CjsWavFormat.js +198 -198
- package/dist/formats/wav/core/helpers.js +365 -365
- package/dist/formats/wav/index.js +2 -2
- package/dist/formats/webgl/CjsWebglFormat.js +199 -221
- package/dist/formats/webgl/CjsWebglFormat.js.map +1 -1
- package/dist/formats/webgl/core/buildGlslEffectContainer.js +70 -0
- package/dist/formats/webgl/core/buildGlslEffectContainer.js.map +1 -0
- package/dist/formats/webgl/core/effectPackage.js +900 -792
- package/dist/formats/webgl/core/effectPackage.js.map +1 -1
- package/dist/formats/webgl/core/errors.js +27 -27
- package/dist/formats/webgl/core/errors.js.map +1 -1
- package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js +2820 -2678
- package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
- package/dist/formats/webgl/core/glsl/DxbcGlslHelpers.js +89 -89
- package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +486 -428
- package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -1
- package/dist/formats/webgl/core/glsl/packedLightFixups.js +98 -0
- package/dist/formats/webgl/core/glsl/packedLightFixups.js.map +1 -0
- package/dist/formats/webgl/core/glslBackendBlock.js +552 -0
- package/dist/formats/webgl/core/glslBackendBlock.js.map +1 -0
- package/dist/formats/webgl/core/glslBackendBodySet.js +243 -0
- package/dist/formats/webgl/core/glslBackendBodySet.js.map +1 -0
- package/dist/formats/webgl/core/{cewgCompleteness.js → glslEffectCompleteness.js} +85 -81
- package/dist/formats/webgl/core/glslEffectCompleteness.js.map +1 -0
- package/dist/formats/webgl/core/helpers.js +167 -306
- package/dist/formats/webgl/core/helpers.js.map +1 -1
- package/dist/formats/webgl/core/inspectGlslEffectContainer.js +122 -0
- package/dist/formats/webgl/core/inspectGlslEffectContainer.js.map +1 -0
- package/dist/formats/webgl/core/readGlslEffectContainer.js +303 -0
- package/dist/formats/webgl/core/readGlslEffectContainer.js.map +1 -0
- package/dist/formats/webgl/index.js +2 -2
- package/dist/formats/webgpu/CjsWebgpuFormat.js +357 -357
- package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
- package/dist/formats/webgpu/core/buildCarbonEffectContainer.js +89 -197
- package/dist/formats/webgpu/core/buildCarbonEffectContainer.js.map +1 -1
- package/dist/formats/webgpu/core/{cewgpu/CewgpuContainer.js → carbonWebgpu/CarbonWebgpuContainer.js} +354 -368
- package/dist/formats/webgpu/core/carbonWebgpu/CarbonWebgpuContainer.js.map +1 -0
- package/dist/formats/webgpu/core/{cewgpu → carbonWebgpu}/containerViews.js +355 -355
- package/dist/formats/webgpu/core/carbonWebgpu/containerViews.js.map +1 -0
- package/dist/formats/webgpu/core/{cewgpu → carbonWebgpu}/validateContainer.js +90 -90
- package/dist/formats/webgpu/core/carbonWebgpu/validateContainer.js.map +1 -0
- package/dist/formats/webgpu/core/effectAnalysis.js +82 -82
- package/dist/formats/webgpu/core/effectBackendBodySet.js +289 -289
- package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -1
- package/dist/formats/webgpu/core/errors.js +20 -20
- package/dist/formats/webgpu/core/errors.js.map +1 -1
- package/dist/formats/webgpu/core/helpers.js +443 -443
- package/dist/formats/webgpu/core/helpers.js.map +1 -1
- package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +212 -212
- package/dist/formats/webgpu/core/ir/buildControlFlow.js +220 -220
- package/dist/formats/webgpu/core/ir/indexableTemps.js +137 -137
- package/dist/formats/webgpu/core/ir/inferValueTypes.js +449 -449
- package/dist/formats/webgpu/core/ir/lowerDxbcToIr.js +494 -494
- package/dist/formats/webgpu/core/ir/resolveRegisterFlow.js +177 -177
- package/dist/formats/webgpu/core/ir/sourceLanes.js +61 -61
- package/dist/formats/webgpu/core/packageEffect.js +381 -385
- package/dist/formats/webgpu/core/packageEffect.js.map +1 -1
- package/dist/formats/webgpu/core/packageEffectSelection.js +164 -164
- package/dist/formats/webgpu/core/packageEffectSelection.js.map +1 -1
- package/dist/formats/webgpu/core/packageMetadata.js +17 -17
- package/dist/formats/webgpu/core/schema.js +4 -4
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +263 -263
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +172 -172
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +320 -320
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/emitWgsl.js +356 -356
- package/dist/formats/webgpu/core/wgsl/hoistEscapingValues.js +77 -77
- package/dist/formats/webgpu/core/wgsl/lowerBindingLayout.js +451 -451
- package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +735 -735
- package/dist/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +457 -457
- package/dist/formats/webgpu/core/wgsl/lowerFragmentProgram.js +1572 -1572
- package/dist/formats/webgpu/core/wgsl/lowerMergeHistogramsComputeProgram.js +659 -659
- package/dist/formats/webgpu/core/wgsl/lowerParticleClearComputePrograms.js +734 -734
- package/dist/formats/webgpu/core/wgsl/lowerParticleEmitComputeProgram.js +583 -583
- package/dist/formats/webgpu/core/wgsl/lowerSkinVerticesComputeProgram.js +621 -621
- package/dist/formats/webgpu/core/wgsl/lowerSortComputeProgram.js +824 -824
- package/dist/formats/webgpu/core/wgsl/lowerSortInnerComputeProgram.js +697 -697
- package/dist/formats/webgpu/core/wgsl/lowerSortStepComputeProgram.js +559 -559
- package/dist/formats/webgpu/core/wgsl/lowerVertexProgram.js +1328 -1328
- package/dist/formats/webgpu/core/wgsl/particleEmitSemanticDigest.js +110 -110
- package/dist/formats/webgpu/core/wgsl/precisionControls.js +55 -55
- package/dist/formats/webgpu/core/wgsl/selectionPlans.js +717 -717
- package/dist/formats/webgpu/core/wgsl/uniformity.js +78 -78
- package/dist/formats/webgpu/core/wgsl/validateExactComputeIr.js +196 -196
- package/dist/formats/webgpu/core/wgsl/validateHandleOperand.js +37 -37
- package/dist/formats/webgpu/index.js +2 -2
- package/dist/formats/webm/CjsWebmFormat.js +197 -197
- package/dist/formats/webm/core/helpers.js +572 -572
- package/dist/formats/webm/index.js +2 -2
- package/dist/formats/webp/CjsWebpFormat.js +140 -140
- package/dist/formats/webp/core/helpers.js +237 -237
- package/dist/formats/webp/index.js +2 -2
- package/dist/formats/wem/CjsWemFormat.js +250 -250
- package/dist/formats/wem/core/bitStream.js +261 -261
- package/dist/formats/wem/core/codebookLibrary.js +164 -164
- package/dist/formats/wem/core/helpers.js +437 -437
- package/dist/formats/wem/core/packedCodebooksAotuv603.js +30 -30
- package/dist/formats/wem/core/ptadpcm.js +77 -77
- package/dist/formats/wem/core/resolve.js +121 -121
- package/dist/formats/wem/core/wemToOgg.js +485 -485
- package/dist/formats/wem/index.js +2 -2
- package/dist/formats/yaml/CjsYamlFormat.js +134 -134
- package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
- package/dist/formats/yaml/core/CjsYamlReader.js +400 -402
- package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -1
- package/dist/formats/yaml/core/helpers.js +196 -170
- package/dist/formats/yaml/core/helpers.js.map +1 -1
- package/dist/formats/yaml/index.js +2 -2
- package/dist/index.js +64 -62
- package/dist/index.js.map +1 -1
- package/dist/resource/CjsLoadingObject.js +19 -0
- package/dist/resource/CjsLoadingObject.js.map +1 -0
- package/dist/resource/CjsResource.js +801 -797
- package/dist/resource/CjsResource.js.map +1 -1
- package/dist/resource/ResourceHandlerMode.js +14 -0
- package/dist/resource/ResourceHandlerMode.js.map +1 -0
- package/dist/resource/Tr2LightProfileRes.js +32 -32
- package/dist/resource/audio/AudioGeometryResData.js +47 -47
- package/dist/resource/audio/CjsAudioBufferRes.js +86 -86
- package/dist/resource/audio/CjsAudioRes.js +213 -213
- package/dist/resource/audio/index.js +4 -4
- package/dist/resource/geometry/MeshDecalData.js +37 -37
- package/dist/resource/geometry/MeshDecalLodData.js +34 -34
- package/dist/resource/geometry/TriGeometryRes.js +675 -675
- package/dist/resource/geometry/TriGeometryResAreaData.js +59 -59
- package/dist/resource/geometry/TriGeometryResJointData.js +38 -38
- package/dist/resource/geometry/TriGeometryResLodData.js +88 -88
- package/dist/resource/geometry/TriGeometryResMeshData.js +63 -63
- package/dist/resource/geometry/TriGeometryResSkeletonData.js +34 -34
- package/dist/resource/geometry/TriJointBinding.js +38 -38
- package/dist/resource/geometry/TriMorphTargetGeometryConstants.js +46 -46
- package/dist/resource/geometry/TriRtGeometryConstants.js +88 -88
- package/dist/resource/geometry/granny/GStateBindingCallbackData.js +31 -31
- package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js +60 -60
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js +36 -36
- package/dist/resource/geometry/granny/TriGrannyRes.js +35 -35
- package/dist/resource/geometry/granny/enums.js +10 -10
- package/dist/resource/geometry/granny/index.js +6 -6
- package/dist/resource/geometry/index.js +17 -17
- package/dist/resource/index.js +54 -52
- package/dist/resource/index.js.map +1 -1
- package/dist/resource/resourceBoundary.js +64 -64
- package/dist/resource/shader/Tr2EffectRes.js +336 -431
- package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
- package/dist/resource/shader/Tr2MaterialArea.js +31 -31
- package/dist/resource/shader/Tr2MaterialMesh.js +27 -27
- package/dist/resource/shader/Tr2MaterialRes.js +31 -31
- package/dist/resource/shader/Tr2Shader.js +283 -261
- package/dist/resource/shader/Tr2Shader.js.map +1 -1
- package/dist/resource/shader/Tr2ShaderPermutation.js +43 -43
- package/dist/resource/shader/index.js +17 -17
- package/dist/resource/shader/reflection/Tr2EffectConstant.js +143 -135
- package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectDefine.js +30 -30
- package/dist/resource/shader/reflection/Tr2EffectDescription.js +114 -109
- package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js +168 -147
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +125 -105
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectResource.js +120 -86
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js +372 -241
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js +78 -68
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2Pass.js +168 -111
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
- package/dist/resource/shader/reflection/carbonRecordFields.js +159 -0
- package/dist/resource/shader/reflection/carbonRecordFields.js.map +1 -0
- package/dist/resource/shader/reflection/shaderStage.js +22 -0
- package/dist/resource/shader/reflection/shaderStage.js.map +1 -0
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js +135 -77
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
- package/dist/resource/texture/CjsTextureArrayRes.js +472 -472
- package/dist/resource/texture/CjsTextureArrayResParameterProxy.js +179 -179
- package/dist/resource/texture/Tr2ImageRes.js +120 -120
- package/dist/resource/texture/Tr2TextureLodManager.js +82 -82
- package/dist/resource/texture/Tr2TextureLodUpdateRequest.js +37 -37
- package/dist/resource/texture/Tr2TexturePackChannel.js +37 -37
- package/dist/resource/texture/Tr2TexturePipeline.js +54 -54
- package/dist/resource/texture/Tr2TexturePipelineParams.js +34 -34
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +40 -40
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +22 -22
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +34 -34
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +31 -31
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js +43 -43
- package/dist/resource/texture/TriTextureRes.js +359 -359
- package/dist/resource/texture/index.js +15 -15
- package/dist/resource/texture/texturePipelineBehavior.js +308 -308
- package/dist/worker/CjsResManMainThreadLoader.js +89 -87
- package/dist/worker/CjsResManMainThreadLoader.js.map +1 -1
- package/dist/worker/CjsResManWorker.js +218 -217
- package/dist/worker/CjsResManWorker.js.map +1 -1
- package/dist/worker/CjsResManWorkerLoader.js +437 -434
- package/dist/worker/CjsResManWorkerLoader.js.map +1 -1
- package/dist/worker/protocol.js +12 -12
- package/docs/README.md +98 -98
- package/docs/architecture.md +118 -109
- package/docs/concepts/resource-lifecycle.md +226 -225
- package/docs/concepts/shader-resource-model.md +111 -114
- package/docs/concepts/writing-an-engine-adapter.md +115 -115
- package/docs/formats/README.md +138 -136
- package/docs/formats/carbon-effect-container.md +553 -452
- package/docs/formats/dxbc/README.md +68 -68
- package/docs/formats/dxbc/architecture.md +80 -80
- package/docs/formats/dxbc/reference/api.md +77 -77
- package/docs/formats/dxbc/reference/classes/README.md +9 -9
- package/docs/formats/dxbc/reference/decoded-output.md +122 -122
- package/docs/formats/gr2.md +160 -160
- package/docs/formats/hlsl/README.md +54 -54
- package/docs/formats/hlsl/architecture.md +65 -67
- package/docs/formats/hlsl/guides/hydrating-json-output.md +60 -62
- package/docs/formats/hlsl/guides/reading-effects.md +64 -64
- package/docs/formats/hlsl/reference/advanced-analysis.md +61 -66
- package/docs/formats/hlsl/reference/api.md +92 -98
- package/docs/formats/hlsl/reference/classes/README.md +11 -11
- package/docs/formats/hlsl/reference/json-graph.md +97 -100
- package/docs/formats/pickle.md +82 -0
- package/docs/formats/provenance.md +196 -196
- package/docs/formats/stl.md +37 -37
- package/docs/formats/webgl/README.md +115 -57
- package/docs/formats/webgl/architecture.md +69 -70
- package/docs/formats/webgl/carbon-constant-layouts.md +326 -326
- package/docs/formats/webgl/decl-io.md +1234 -1234
- package/docs/formats/webgl/memory-structured.md +890 -871
- package/docs/formats/webgl/reference/classes/README.md +9 -9
- package/docs/formats/webgl/texture-sample.md +964 -964
- package/docs/formats/webgpu/README.md +84 -84
- package/docs/formats/webgpu/architecture.md +95 -96
- package/docs/formats/webgpu/formats/{cewgpu.md → carbon-webgpu.md} +215 -216
- package/docs/formats/webgpu/guides/effect-packaging.md +189 -191
- package/docs/formats/webgpu/reference/api.md +196 -197
- package/docs/formats/webgpu/reference/classes/README.md +9 -9
- package/docs/formats/webgpu/reference/wgsl-compatibility.md +1546 -1543
- package/docs/formats/wwise.md +146 -85
- package/docs/reference/classes/README.md +35 -35
- package/docs/reference/classes/audio.md +30 -30
- package/docs/reference/classes/core.md +216 -206
- package/docs/reference/classes/dropped.md +46 -46
- package/docs/reference/classes/formats.md +944 -952
- package/docs/reference/classes/resources.md +456 -456
- package/docs/reference/classes/texture.md +26 -26
- package/docs/reference/events.md +117 -117
- package/docs/reference/motherlode-cache.md +275 -275
- package/docs/reference/queues.md +194 -110
- package/docs/reference/reload.md +107 -107
- package/docs/reference/texture-arrays.md +113 -113
- package/docs/reference/texture-pipeline.md +53 -53
- package/docs/reference/workers.md +142 -135
- package/docs/roadmap.md +150 -150
- package/format-notices/black/LICENSE +21 -21
- package/format-notices/black/NOTICE +47 -47
- package/format-notices/bnk/LICENSE +21 -21
- package/format-notices/bnk/NOTICE +21 -21
- package/format-notices/cmf/LICENSE +21 -21
- package/format-notices/cmf/NOTICE +36 -36
- package/format-notices/dds/LICENSE +21 -21
- package/format-notices/dds/NOTICE +14 -14
- package/format-notices/dxbc/LICENSE +21 -21
- package/format-notices/dxbc/NOTICE +20 -20
- package/format-notices/fbx/LICENSE +21 -21
- package/format-notices/fbx/NOTICE +14 -14
- package/format-notices/flac/LICENSE +21 -21
- package/format-notices/flac/NOTICE +14 -14
- package/format-notices/gif/LICENSE +21 -21
- package/format-notices/gif/NOTICE +14 -14
- package/format-notices/gltf/LICENSE +21 -21
- package/format-notices/gltf/NOTICE +27 -27
- package/format-notices/gr2/LICENSE +21 -21
- package/format-notices/gr2/NOTICE +60 -60
- package/format-notices/gr2/THIRD-PARTY-NOTICES.md +93 -93
- package/format-notices/hlsl/LICENSE +21 -21
- package/format-notices/hlsl/NOTICE +25 -25
- package/format-notices/jpeg/LICENSE +21 -21
- package/format-notices/jpeg/NOTICE +14 -14
- package/format-notices/mp3/LICENSE +21 -21
- package/format-notices/mp3/NOTICE +14 -14
- package/format-notices/mp4/LICENSE +21 -21
- package/format-notices/mp4/NOTICE +14 -14
- package/format-notices/obj/LICENSE +21 -21
- package/format-notices/obj/NOTICE +26 -26
- package/format-notices/ogg/LICENSE +21 -21
- package/format-notices/ogg/NOTICE +28 -28
- package/format-notices/png/LICENSE +21 -21
- package/format-notices/png/NOTICE +14 -14
- package/format-notices/red/LICENSE +21 -21
- package/format-notices/red/NOTICE +31 -31
- package/format-notices/stl/LICENSE +21 -21
- package/format-notices/stl/NOTICE +21 -21
- package/format-notices/tga/LICENSE +21 -21
- package/format-notices/tga/NOTICE +14 -14
- package/format-notices/wav/LICENSE +21 -21
- package/format-notices/wav/NOTICE +14 -14
- package/format-notices/webgl/LICENSE +21 -21
- package/format-notices/webgl/NOTICE +35 -35
- package/format-notices/webgpu/LICENSE +21 -21
- package/format-notices/webgpu/NOTICE +31 -31
- package/format-notices/webm/LICENSE +21 -21
- package/format-notices/webm/NOTICE +14 -14
- package/format-notices/webp/LICENSE +21 -21
- package/format-notices/webp/NOTICE +14 -14
- package/format-notices/wem/LICENSE +57 -57
- package/format-notices/wem/NOTICE +33 -33
- package/format-notices/yaml/LICENSE +21 -21
- package/format-notices/yaml/NOTICE +44 -44
- package/package.json +63 -63
- package/dist/format/carbonEffect/carbonDescriptionFromPortable.js +0 -372
- package/dist/format/carbonEffect/carbonDescriptionFromPortable.js.map +0 -1
- package/dist/format/effect/effectReflectionPackage.js +0 -636
- package/dist/format/effect/effectReflectionPackage.js.map +0 -1
- package/dist/formats/hlsl/core/HlslReader.js +0 -16
- package/dist/formats/hlsl/core/HlslReader.js.map +0 -1
- package/dist/formats/hlsl/core/portableReflection.js +0 -848
- package/dist/formats/hlsl/core/portableReflection.js.map +0 -1
- package/dist/formats/hlsl/portable.js +0 -2
- package/dist/formats/hlsl/portable.js.map +0 -1
- package/dist/formats/webgl/core/cewg/CewgPackage.js +0 -340
- package/dist/formats/webgl/core/cewg/CewgPackage.js.map +0 -1
- package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js +0 -104
- package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js.map +0 -1
- package/dist/formats/webgl/core/cewg/binary.js +0 -19
- package/dist/formats/webgl/core/cewg/binary.js.map +0 -1
- package/dist/formats/webgl/core/cewgCompleteness.js.map +0 -1
- package/dist/formats/webgl/core/effectPackageValidation.js +0 -331
- package/dist/formats/webgl/core/effectPackageValidation.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/containerViews.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/validateContainer.js.map +0 -1
- package/dist/resource/shader/portable.js +0 -33
- package/dist/resource/shader/portable.js.map +0 -1
- package/docs/formats/hlsl/reference/portable-reflection.md +0 -141
- package/docs/formats/webgl/effect-reflection.md +0 -127
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { WwiseCursor, boundedCount, readPositioning, readAux, finite, readInitialRtpcs, readStateChunk } from './nodeBase.js';
|
|
2
|
+
|
|
3
|
+
// Exact Wwise v150 Audio Bus and Auxiliary Bus decoding. The HIRC payload
|
|
4
|
+
// supplied by inspect() starts after the object id. Records preserve authored
|
|
5
|
+
// routing, bus policy, ducking, effect references, metadata, RTPCs, and state
|
|
6
|
+
// without assigning runtime mixing or plug-in semantics.
|
|
7
|
+
|
|
8
|
+
const SUPPORTED_VERSION = 150;
|
|
9
|
+
const AUDIO_BUS_TYPE = 8;
|
|
10
|
+
const AUXILIARY_BUS_TYPE = 18;
|
|
11
|
+
const BUS_VOLUME_PROPERTY_ID = 0x04;
|
|
12
|
+
const MAKE_UP_GAIN_PROPERTY_ID = 0x05;
|
|
13
|
+
const OUTPUT_BUS_VOLUME_PROPERTY_ID = 0x0d;
|
|
14
|
+
const FINITE_GAIN_PROPERTY_IDS = new Set([BUS_VOLUME_PROPERTY_ID, MAKE_UP_GAIN_PROPERTY_ID, OUTPUT_BUS_VOLUME_PROPERTY_ID]);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Decodes one complete v150 Audio or Auxiliary Bus body.
|
|
18
|
+
*
|
|
19
|
+
* @param {Uint8Array} payload Entry payload view from `inspect()`.
|
|
20
|
+
* @param {object} [options] Bank-version qualification.
|
|
21
|
+
* @returns {object|null} Typed bus body, or null when it is invalid.
|
|
22
|
+
*/
|
|
23
|
+
function parseBusNode(payload, {
|
|
24
|
+
bankVersion = SUPPORTED_VERSION
|
|
25
|
+
} = {}) {
|
|
26
|
+
if (!(payload instanceof Uint8Array) || Number(bankVersion) !== SUPPORTED_VERSION || payload.byteLength < 5) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const cursor = new WwiseCursor(payload);
|
|
31
|
+
const overrideBusId = cursor.u32();
|
|
32
|
+
let outputDeviceId = null;
|
|
33
|
+
if (overrideBusId === 0) {
|
|
34
|
+
outputDeviceId = cursor.u32();
|
|
35
|
+
}
|
|
36
|
+
const propertyCount = boundedCount(cursor.u8(), cursor.remaining, 5, 255);
|
|
37
|
+
const ids = [];
|
|
38
|
+
const seen = new Set();
|
|
39
|
+
const properties = [];
|
|
40
|
+
for (let index = 0; index < propertyCount; index++) {
|
|
41
|
+
ids.push(cursor.u8());
|
|
42
|
+
}
|
|
43
|
+
for (const id of ids) {
|
|
44
|
+
if (seen.has(id)) return null;
|
|
45
|
+
seen.add(id);
|
|
46
|
+
const rawValue = cursor.u32();
|
|
47
|
+
const valueBytes = new ArrayBuffer(4);
|
|
48
|
+
const valueView = new DataView(valueBytes);
|
|
49
|
+
valueView.setUint32(0, rawValue, true);
|
|
50
|
+
const floatValue = valueView.getFloat32(0, true);
|
|
51
|
+
if (FINITE_GAIN_PROPERTY_IDS.has(id) && !Number.isFinite(floatValue)) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
properties.push({
|
|
55
|
+
id,
|
|
56
|
+
rawValue,
|
|
57
|
+
floatValue
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const prefixByteLength = cursor.at;
|
|
61
|
+
const positioning = readPositioning(cursor);
|
|
62
|
+
const aux = readAux(cursor);
|
|
63
|
+
const policyFlags = cursor.u8();
|
|
64
|
+
const maxInstances = cursor.u16();
|
|
65
|
+
const channelConfigRaw = cursor.u32();
|
|
66
|
+
const hdrFlags = cursor.u8();
|
|
67
|
+
const recoveryTime = cursor.s32();
|
|
68
|
+
const maxDuckVolume = finite(cursor.f32());
|
|
69
|
+
const ducks = ReadDucks(cursor);
|
|
70
|
+
const fx = ReadEffects(cursor);
|
|
71
|
+
const metadata = ReadMetadata(cursor);
|
|
72
|
+
const rtpcs = readInitialRtpcs(cursor);
|
|
73
|
+
const state = readStateChunk(cursor);
|
|
74
|
+
if (cursor.remaining !== 0) return null;
|
|
75
|
+
const gainValue = id => properties.find(property => property.id === id)?.floatValue ?? null;
|
|
76
|
+
return {
|
|
77
|
+
overrideBusId,
|
|
78
|
+
outputDeviceId,
|
|
79
|
+
properties,
|
|
80
|
+
busVolume: gainValue(BUS_VOLUME_PROPERTY_ID),
|
|
81
|
+
makeUpGain: gainValue(MAKE_UP_GAIN_PROPERTY_ID),
|
|
82
|
+
outputBusVolume: gainValue(OUTPUT_BUS_VOLUME_PROPERTY_ID),
|
|
83
|
+
prefixByteLength,
|
|
84
|
+
positioning,
|
|
85
|
+
aux,
|
|
86
|
+
policy: {
|
|
87
|
+
flags: policyFlags,
|
|
88
|
+
killNewest: Boolean(policyFlags & 0x01),
|
|
89
|
+
useVirtualBehavior: Boolean(policyFlags & 0x02),
|
|
90
|
+
ignoreParentMaxInstances: Boolean(policyFlags & 0x04),
|
|
91
|
+
backgroundMusic: Boolean(policyFlags & 0x08),
|
|
92
|
+
maxInstances
|
|
93
|
+
},
|
|
94
|
+
channelConfig: {
|
|
95
|
+
raw: channelConfigRaw,
|
|
96
|
+
channelCount: channelConfigRaw & 0xff,
|
|
97
|
+
configType: channelConfigRaw >>> 8 & 0x0f,
|
|
98
|
+
channelMask: channelConfigRaw >>> 12
|
|
99
|
+
},
|
|
100
|
+
hdr: {
|
|
101
|
+
flags: hdrFlags,
|
|
102
|
+
enabled: Boolean(hdrFlags & 0x01),
|
|
103
|
+
exponentialRelease: Boolean(hdrFlags & 0x02)
|
|
104
|
+
},
|
|
105
|
+
recoveryTime,
|
|
106
|
+
maxDuckVolume,
|
|
107
|
+
ducks,
|
|
108
|
+
fx,
|
|
109
|
+
metadata,
|
|
110
|
+
rtpcs,
|
|
111
|
+
state,
|
|
112
|
+
byteLength: cursor.at
|
|
113
|
+
};
|
|
114
|
+
} catch {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function ReadDucks(cursor) {
|
|
119
|
+
const count = boundedCount(cursor.u32(), cursor.remaining, 18, 65535);
|
|
120
|
+
const ducks = [];
|
|
121
|
+
for (let index = 0; index < count; index++) {
|
|
122
|
+
const busId = cursor.u32();
|
|
123
|
+
const volume = finite(cursor.f32());
|
|
124
|
+
const fadeOutTime = cursor.s32();
|
|
125
|
+
const fadeInTime = cursor.s32();
|
|
126
|
+
const curve = cursor.u8();
|
|
127
|
+
const targetPropertyId = cursor.u8();
|
|
128
|
+
if (curve > 9) {
|
|
129
|
+
throw new RangeError("invalid v150 Wwise duck curve");
|
|
130
|
+
}
|
|
131
|
+
ducks.push({
|
|
132
|
+
busId,
|
|
133
|
+
volume,
|
|
134
|
+
fadeOutTime,
|
|
135
|
+
fadeInTime,
|
|
136
|
+
curve,
|
|
137
|
+
targetPropertyId
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return ducks;
|
|
141
|
+
}
|
|
142
|
+
function ReadEffects(cursor) {
|
|
143
|
+
const count = boundedCount(cursor.u8(), cursor.remaining, 6, 255);
|
|
144
|
+
const bypassAllRaw = count ? cursor.u8() : 0;
|
|
145
|
+
const slots = [];
|
|
146
|
+
for (let index = 0; index < count; index++) {
|
|
147
|
+
const slot = cursor.u8();
|
|
148
|
+
const fxId = cursor.u32();
|
|
149
|
+
const flags = cursor.u8();
|
|
150
|
+
slots.push({
|
|
151
|
+
index: slot,
|
|
152
|
+
fxId,
|
|
153
|
+
flags,
|
|
154
|
+
bypass: Boolean(flags & 0x01),
|
|
155
|
+
shareSet: Boolean(flags & 0x02)
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
bypassAllRaw,
|
|
160
|
+
bypassAll: Boolean(bypassAllRaw),
|
|
161
|
+
slots
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function ReadMetadata(cursor) {
|
|
165
|
+
const count = boundedCount(cursor.u8(), cursor.remaining, 6, 255);
|
|
166
|
+
const slots = [];
|
|
167
|
+
for (let index = 0; index < count; index++) {
|
|
168
|
+
const slot = cursor.u8();
|
|
169
|
+
const fxId = cursor.u32();
|
|
170
|
+
const shareSetRaw = cursor.u8();
|
|
171
|
+
slots.push({
|
|
172
|
+
index: slot,
|
|
173
|
+
fxId,
|
|
174
|
+
shareSetRaw,
|
|
175
|
+
shareSet: Boolean(shareSetRaw)
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
slots
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Decodes every v150 Audio and Auxiliary Bus across inspected banks.
|
|
185
|
+
*
|
|
186
|
+
* @param {Array<object>|object} inspections Related `CjsBnkFormat.inspect()` results.
|
|
187
|
+
* @returns {{buses: Map<number, object>, diagnostics: object}} Typed bus catalog and failures.
|
|
188
|
+
*/
|
|
189
|
+
function busNodesFromBanks(inspections) {
|
|
190
|
+
const banks = Array.isArray(inspections) ? inspections : [inspections];
|
|
191
|
+
const buses = new Map();
|
|
192
|
+
const failed = [];
|
|
193
|
+
const duplicates = [];
|
|
194
|
+
const unsupportedVersions = [];
|
|
195
|
+
let parsed = 0;
|
|
196
|
+
for (const inspection of banks) {
|
|
197
|
+
const bank = inspection?.source || "";
|
|
198
|
+
const bankVersion = Number(inspection?.bankVersion) >>> 0;
|
|
199
|
+
if (bankVersion !== SUPPORTED_VERSION) {
|
|
200
|
+
unsupportedVersions.push({
|
|
201
|
+
bank,
|
|
202
|
+
version: bankVersion
|
|
203
|
+
});
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
for (const entry of inspection?.hirc ?? []) {
|
|
207
|
+
if (entry.type !== AUDIO_BUS_TYPE && entry.type !== AUXILIARY_BUS_TYPE) {
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
const decoded = parseBusNode(entry.payload, {
|
|
211
|
+
bankVersion
|
|
212
|
+
});
|
|
213
|
+
const type = entry.type === AUDIO_BUS_TYPE ? "audio-bus" : "auxiliary-bus";
|
|
214
|
+
if (!decoded) {
|
|
215
|
+
failed.push({
|
|
216
|
+
bank,
|
|
217
|
+
version: bankVersion,
|
|
218
|
+
type,
|
|
219
|
+
id: entry.id,
|
|
220
|
+
reason: "invalid v150 bus body"
|
|
221
|
+
});
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
if (buses.has(entry.id)) {
|
|
225
|
+
duplicates.push({
|
|
226
|
+
id: entry.id,
|
|
227
|
+
previousBank: buses.get(entry.id).bank,
|
|
228
|
+
bank
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
parsed++;
|
|
232
|
+
buses.set(entry.id, {
|
|
233
|
+
id: entry.id,
|
|
234
|
+
bank,
|
|
235
|
+
type,
|
|
236
|
+
...decoded
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
buses,
|
|
242
|
+
diagnostics: {
|
|
243
|
+
parsed,
|
|
244
|
+
failed,
|
|
245
|
+
duplicates,
|
|
246
|
+
unsupportedVersions
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export { busNodesFromBanks, parseBusNode };
|
|
252
|
+
//# sourceMappingURL=busNodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"busNodes.js","sources":["../../../../../src/formats/bnk/core/busNodes.js"],"sourcesContent":["// Exact Wwise v150 Audio Bus and Auxiliary Bus decoding. The HIRC payload\n// supplied by inspect() starts after the object id. Records preserve authored\n// routing, bus policy, ducking, effect references, metadata, RTPCs, and state\n// without assigning runtime mixing or plug-in semantics.\n\nimport {\n boundedCount,\n finite,\n readAux,\n readInitialRtpcs,\n readPositioning,\n readStateChunk,\n WwiseCursor,\n} from \"./nodeBase.js\";\n\nconst SUPPORTED_VERSION = 150;\nconst AUDIO_BUS_TYPE = 8;\nconst AUXILIARY_BUS_TYPE = 18;\nconst BUS_VOLUME_PROPERTY_ID = 0x04;\nconst MAKE_UP_GAIN_PROPERTY_ID = 0x05;\nconst OUTPUT_BUS_VOLUME_PROPERTY_ID = 0x0d;\nconst FINITE_GAIN_PROPERTY_IDS = new Set([\n BUS_VOLUME_PROPERTY_ID,\n MAKE_UP_GAIN_PROPERTY_ID,\n OUTPUT_BUS_VOLUME_PROPERTY_ID,\n]);\n\n/**\n * Decodes one complete v150 Audio or Auxiliary Bus body.\n *\n * @param {Uint8Array} payload Entry payload view from `inspect()`.\n * @param {object} [options] Bank-version qualification.\n * @returns {object|null} Typed bus body, or null when it is invalid.\n */\nexport function parseBusNode(\n payload,\n { bankVersion = SUPPORTED_VERSION } = {},\n)\n{\n if (!(payload instanceof Uint8Array)\n || Number(bankVersion) !== SUPPORTED_VERSION\n || payload.byteLength < 5)\n {\n return null;\n }\n\n try\n {\n const cursor = new WwiseCursor(payload);\n const overrideBusId = cursor.u32();\n let outputDeviceId = null;\n\n if (overrideBusId === 0)\n {\n outputDeviceId = cursor.u32();\n }\n\n const propertyCount = boundedCount(\n cursor.u8(),\n cursor.remaining,\n 5,\n 255,\n );\n const ids = [];\n const seen = new Set();\n const properties = [];\n\n for (let index = 0; index < propertyCount; index++)\n {\n ids.push(cursor.u8());\n }\n\n for (const id of ids)\n {\n if (seen.has(id)) return null;\n seen.add(id);\n\n const rawValue = cursor.u32();\n const valueBytes = new ArrayBuffer(4);\n const valueView = new DataView(valueBytes);\n\n valueView.setUint32(0, rawValue, true);\n const floatValue = valueView.getFloat32(0, true);\n\n if (FINITE_GAIN_PROPERTY_IDS.has(id)\n && !Number.isFinite(floatValue))\n {\n return null;\n }\n\n properties.push({ id, rawValue, floatValue });\n }\n\n const prefixByteLength = cursor.at;\n const positioning = readPositioning(cursor);\n const aux = readAux(cursor);\n const policyFlags = cursor.u8();\n const maxInstances = cursor.u16();\n const channelConfigRaw = cursor.u32();\n const hdrFlags = cursor.u8();\n const recoveryTime = cursor.s32();\n const maxDuckVolume = finite(cursor.f32());\n const ducks = ReadDucks(cursor);\n const fx = ReadEffects(cursor);\n const metadata = ReadMetadata(cursor);\n const rtpcs = readInitialRtpcs(cursor);\n const state = readStateChunk(cursor);\n\n if (cursor.remaining !== 0) return null;\n\n const gainValue = id => properties.find(\n property => property.id === id,\n )?.floatValue ?? null;\n\n return {\n overrideBusId,\n outputDeviceId,\n properties,\n busVolume: gainValue(BUS_VOLUME_PROPERTY_ID),\n makeUpGain: gainValue(MAKE_UP_GAIN_PROPERTY_ID),\n outputBusVolume: gainValue(OUTPUT_BUS_VOLUME_PROPERTY_ID),\n prefixByteLength,\n positioning,\n aux,\n policy: {\n flags: policyFlags,\n killNewest: Boolean(policyFlags & 0x01),\n useVirtualBehavior: Boolean(policyFlags & 0x02),\n ignoreParentMaxInstances: Boolean(policyFlags & 0x04),\n backgroundMusic: Boolean(policyFlags & 0x08),\n maxInstances,\n },\n channelConfig: {\n raw: channelConfigRaw,\n channelCount: channelConfigRaw & 0xff,\n configType: (channelConfigRaw >>> 8) & 0x0f,\n channelMask: channelConfigRaw >>> 12,\n },\n hdr: {\n flags: hdrFlags,\n enabled: Boolean(hdrFlags & 0x01),\n exponentialRelease: Boolean(hdrFlags & 0x02),\n },\n recoveryTime,\n maxDuckVolume,\n ducks,\n fx,\n metadata,\n rtpcs,\n state,\n byteLength: cursor.at,\n };\n }\n catch\n {\n return null;\n }\n}\n\nfunction ReadDucks(cursor)\n{\n const count = boundedCount(cursor.u32(), cursor.remaining, 18, 65535);\n const ducks = [];\n\n for (let index = 0; index < count; index++)\n {\n const busId = cursor.u32();\n const volume = finite(cursor.f32());\n const fadeOutTime = cursor.s32();\n const fadeInTime = cursor.s32();\n const curve = cursor.u8();\n const targetPropertyId = cursor.u8();\n\n if (curve > 9)\n {\n throw new RangeError(\"invalid v150 Wwise duck curve\");\n }\n\n ducks.push({\n busId,\n volume,\n fadeOutTime,\n fadeInTime,\n curve,\n targetPropertyId,\n });\n }\n\n return ducks;\n}\n\nfunction ReadEffects(cursor)\n{\n const count = boundedCount(cursor.u8(), cursor.remaining, 6, 255);\n const bypassAllRaw = count ? cursor.u8() : 0;\n const slots = [];\n\n for (let index = 0; index < count; index++)\n {\n const slot = cursor.u8();\n const fxId = cursor.u32();\n const flags = cursor.u8();\n\n slots.push({\n index: slot,\n fxId,\n flags,\n bypass: Boolean(flags & 0x01),\n shareSet: Boolean(flags & 0x02),\n });\n }\n\n return {\n bypassAllRaw,\n bypassAll: Boolean(bypassAllRaw),\n slots,\n };\n}\n\nfunction ReadMetadata(cursor)\n{\n const count = boundedCount(cursor.u8(), cursor.remaining, 6, 255);\n const slots = [];\n\n for (let index = 0; index < count; index++)\n {\n const slot = cursor.u8();\n const fxId = cursor.u32();\n const shareSetRaw = cursor.u8();\n\n slots.push({\n index: slot,\n fxId,\n shareSetRaw,\n shareSet: Boolean(shareSetRaw),\n });\n }\n\n return { slots };\n}\n\n/**\n * Decodes every v150 Audio and Auxiliary Bus across inspected banks.\n *\n * @param {Array<object>|object} inspections Related `CjsBnkFormat.inspect()` results.\n * @returns {{buses: Map<number, object>, diagnostics: object}} Typed bus catalog and failures.\n */\nexport function busNodesFromBanks(inspections)\n{\n const banks = Array.isArray(inspections) ? inspections : [ inspections ];\n const buses = new Map();\n const failed = [];\n const duplicates = [];\n const unsupportedVersions = [];\n let parsed = 0;\n\n for (const inspection of banks)\n {\n const bank = inspection?.source || \"\";\n const bankVersion = Number(inspection?.bankVersion) >>> 0;\n\n if (bankVersion !== SUPPORTED_VERSION)\n {\n unsupportedVersions.push({ bank, version: bankVersion });\n continue;\n }\n\n for (const entry of inspection?.hirc ?? [])\n {\n if (entry.type !== AUDIO_BUS_TYPE\n && entry.type !== AUXILIARY_BUS_TYPE)\n {\n continue;\n }\n\n const decoded = parseBusNode(entry.payload, { bankVersion });\n const type = entry.type === AUDIO_BUS_TYPE\n ? \"audio-bus\"\n : \"auxiliary-bus\";\n\n if (!decoded)\n {\n failed.push({\n bank,\n version: bankVersion,\n type,\n id: entry.id,\n reason: \"invalid v150 bus body\",\n });\n continue;\n }\n if (buses.has(entry.id))\n {\n duplicates.push({\n id: entry.id,\n previousBank: buses.get(entry.id).bank,\n bank,\n });\n }\n\n parsed++;\n buses.set(entry.id, {\n id: entry.id,\n bank,\n type,\n ...decoded,\n });\n }\n }\n\n return {\n buses,\n diagnostics: {\n parsed,\n failed,\n duplicates,\n unsupportedVersions,\n },\n };\n}\n"],"names":["SUPPORTED_VERSION","AUDIO_BUS_TYPE","AUXILIARY_BUS_TYPE","BUS_VOLUME_PROPERTY_ID","MAKE_UP_GAIN_PROPERTY_ID","OUTPUT_BUS_VOLUME_PROPERTY_ID","FINITE_GAIN_PROPERTY_IDS","Set","parseBusNode","payload","bankVersion","Uint8Array","Number","byteLength","cursor","WwiseCursor","overrideBusId","u32","outputDeviceId","propertyCount","boundedCount","u8","remaining","ids","seen","properties","index","push","id","has","add","rawValue","valueBytes","ArrayBuffer","valueView","DataView","setUint32","floatValue","getFloat32","isFinite","prefixByteLength","at","positioning","readPositioning","aux","readAux","policyFlags","maxInstances","u16","channelConfigRaw","hdrFlags","recoveryTime","s32","maxDuckVolume","finite","f32","ducks","ReadDucks","fx","ReadEffects","metadata","ReadMetadata","rtpcs","readInitialRtpcs","state","readStateChunk","gainValue","find","property","busVolume","makeUpGain","outputBusVolume","policy","flags","killNewest","Boolean","useVirtualBehavior","ignoreParentMaxInstances","backgroundMusic","channelConfig","raw","channelCount","configType","channelMask","hdr","enabled","exponentialRelease","count","busId","volume","fadeOutTime","fadeInTime","curve","targetPropertyId","RangeError","bypassAllRaw","slots","slot","fxId","bypass","shareSet","bypassAll","shareSetRaw","busNodesFromBanks","inspections","banks","Array","isArray","buses","Map","failed","duplicates","unsupportedVersions","parsed","inspection","bank","source","version","entry","hirc","type","decoded","reason","previousBank","get","set","diagnostics"],"mappings":";;AAAA;AACA;AACA;AACA;;AAYA,MAAMA,iBAAiB,GAAG,GAAG;AAC7B,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,kBAAkB,GAAG,EAAE;AAC7B,MAAMC,sBAAsB,GAAG,IAAI;AACnC,MAAMC,wBAAwB,GAAG,IAAI;AACrC,MAAMC,6BAA6B,GAAG,IAAI;AAC1C,MAAMC,wBAAwB,GAAG,IAAIC,GAAG,CAAC,CACrCJ,sBAAsB,EACtBC,wBAAwB,EACxBC,6BAA6B,CAChC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,YAAYA,CACxBC,OAAO,EACP;AAAEC,EAAAA,WAAW,GAAGV;AAAkB,CAAC,GAAG,EAAE,EAE5C;AACI,EAAA,IAAI,EAAES,OAAO,YAAYE,UAAU,CAAC,IAC7BC,MAAM,CAACF,WAAW,CAAC,KAAKV,iBAAiB,IACzCS,OAAO,CAACI,UAAU,GAAG,CAAC,EAC7B;AACI,IAAA,OAAO,IAAI;AACf,EAAA;EAEA,IACA;AACI,IAAA,MAAMC,MAAM,GAAG,IAAIC,WAAW,CAACN,OAAO,CAAC;AACvC,IAAA,MAAMO,aAAa,GAAGF,MAAM,CAACG,GAAG,EAAE;IAClC,IAAIC,cAAc,GAAG,IAAI;IAEzB,IAAIF,aAAa,KAAK,CAAC,EACvB;AACIE,MAAAA,cAAc,GAAGJ,MAAM,CAACG,GAAG,EAAE;AACjC,IAAA;AAEA,IAAA,MAAME,aAAa,GAAGC,YAAY,CAC9BN,MAAM,CAACO,EAAE,EAAE,EACXP,MAAM,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AAK,CAACgB,GAAG,CAACN,KAAK,CAAC1F,EAAE,CAAC,CAACuF,IAAI;AACtCA,UAAAA;AACJ,SAAC,CAAC;AACN,MAAA;AAEAF,MAAAA,MAAM,EAAE;AACRL,MAAAA,KAAK,CAACiB,GAAG,CAACP,KAAK,CAAC1F,EAAE,EAAE;QAChBA,EAAE,EAAE0F,KAAK,CAAC1F,EAAE;QACZuF,IAAI;QACJK,IAAI;QACJ,GAAGC;AACP,OAAC,CAAC;AACN,IAAA;AACJ,EAAA;EAEA,OAAO;IACHb,KAAK;AACLkB,IAAAA,WAAW,EAAE;MACTb,MAAM;MACNH,MAAM;MACNC,UAAU;AACVC,MAAAA;AACJ;GACH;AACL;;;;"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { WwiseCursor, boundedCount, readInitialRtpcs, readStateChunk, finite } from './nodeBase.js';
|
|
2
|
+
|
|
3
|
+
// Exact generic Wwise v150 Fx ShareSet and Fx Custom object decoding. Plug-in
|
|
4
|
+
// parameter blocks remain opaque bytes; the resource layer preserves identity,
|
|
5
|
+
// media, RTPC, state, and property records without interpreting DSP behavior.
|
|
6
|
+
|
|
7
|
+
const SUPPORTED_VERSION = 150;
|
|
8
|
+
const FX_SHARE_SET_TYPE = 16;
|
|
9
|
+
const FX_CUSTOM_TYPE = 17;
|
|
10
|
+
const NO_PLUGIN_ID = 0xffffffff;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Decodes one complete v150 Fx ShareSet or Fx Custom body.
|
|
14
|
+
*
|
|
15
|
+
* @param {Uint8Array} payload Entry payload view from `inspect()`.
|
|
16
|
+
* @param {object} [options] Bank-version qualification.
|
|
17
|
+
* @returns {object|null} Typed effect body, or null when it is invalid.
|
|
18
|
+
*/
|
|
19
|
+
function parseEffectNode(payload, {
|
|
20
|
+
bankVersion = SUPPORTED_VERSION
|
|
21
|
+
} = {}) {
|
|
22
|
+
if (!(payload instanceof Uint8Array) || Number(bankVersion) !== SUPPORTED_VERSION || payload.byteLength < 4) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const cursor = new WwiseCursor(payload);
|
|
27
|
+
const pluginId = cursor.u32();
|
|
28
|
+
let parameterBlock = payload.subarray(cursor.at, cursor.at);
|
|
29
|
+
if (pluginId !== 0 && pluginId !== NO_PLUGIN_ID) {
|
|
30
|
+
const parameterByteLength = cursor.u32();
|
|
31
|
+
cursor.ensure(parameterByteLength);
|
|
32
|
+
parameterBlock = payload.subarray(cursor.at, cursor.at + parameterByteLength);
|
|
33
|
+
cursor.at += parameterByteLength;
|
|
34
|
+
}
|
|
35
|
+
const mediaCount = boundedCount(cursor.u8(), cursor.remaining, 5, 255);
|
|
36
|
+
const media = [];
|
|
37
|
+
for (let index = 0; index < mediaCount; index++) {
|
|
38
|
+
media.push({
|
|
39
|
+
index: cursor.u8(),
|
|
40
|
+
sourceId: cursor.u32()
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const rtpcs = readInitialRtpcs(cursor);
|
|
44
|
+
const state = readStateChunk(cursor);
|
|
45
|
+
const propertyCount = boundedCount(cursor.u16(), cursor.remaining, 6, 65535);
|
|
46
|
+
const propertyValues = [];
|
|
47
|
+
for (let index = 0; index < propertyCount; index++) {
|
|
48
|
+
const propertyId = cursor.variable();
|
|
49
|
+
const accumulation = cursor.u8();
|
|
50
|
+
const value = finite(cursor.f32());
|
|
51
|
+
if (accumulation > 6) {
|
|
52
|
+
throw new RangeError("invalid v150 effect accumulation");
|
|
53
|
+
}
|
|
54
|
+
propertyValues.push({
|
|
55
|
+
propertyId,
|
|
56
|
+
accumulation,
|
|
57
|
+
value
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (cursor.remaining !== 0) return null;
|
|
61
|
+
return {
|
|
62
|
+
pluginId,
|
|
63
|
+
pluginType: pluginId & 0x0f,
|
|
64
|
+
companyId: pluginId >>> 4 & 0x0fff,
|
|
65
|
+
pluginClassId: pluginId >>> 16,
|
|
66
|
+
parameterBlock,
|
|
67
|
+
media,
|
|
68
|
+
rtpcs,
|
|
69
|
+
state,
|
|
70
|
+
propertyValues,
|
|
71
|
+
byteLength: cursor.at
|
|
72
|
+
};
|
|
73
|
+
} catch {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Decodes every v150 Fx ShareSet and Fx Custom across inspected banks.
|
|
80
|
+
*
|
|
81
|
+
* @param {Array<object>|object} inspections Related `CjsBnkFormat.inspect()` results.
|
|
82
|
+
* @returns {{effects: Map<number, object>, diagnostics: object}} Typed effect catalog and failures.
|
|
83
|
+
*/
|
|
84
|
+
function effectNodesFromBanks(inspections) {
|
|
85
|
+
const banks = Array.isArray(inspections) ? inspections : [inspections];
|
|
86
|
+
const effects = new Map();
|
|
87
|
+
const failed = [];
|
|
88
|
+
const duplicates = [];
|
|
89
|
+
const unsupportedVersions = [];
|
|
90
|
+
let parsed = 0;
|
|
91
|
+
for (const inspection of banks) {
|
|
92
|
+
const bank = inspection?.source || "";
|
|
93
|
+
const bankVersion = Number(inspection?.bankVersion) >>> 0;
|
|
94
|
+
if (bankVersion !== SUPPORTED_VERSION) {
|
|
95
|
+
unsupportedVersions.push({
|
|
96
|
+
bank,
|
|
97
|
+
version: bankVersion
|
|
98
|
+
});
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
for (const entry of inspection?.hirc ?? []) {
|
|
102
|
+
if (entry.type !== FX_SHARE_SET_TYPE && entry.type !== FX_CUSTOM_TYPE) {
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
const decoded = parseEffectNode(entry.payload, {
|
|
106
|
+
bankVersion
|
|
107
|
+
});
|
|
108
|
+
const type = entry.type === FX_SHARE_SET_TYPE ? "effect-share-set" : "effect-custom";
|
|
109
|
+
if (!decoded) {
|
|
110
|
+
failed.push({
|
|
111
|
+
bank,
|
|
112
|
+
version: bankVersion,
|
|
113
|
+
type,
|
|
114
|
+
id: entry.id,
|
|
115
|
+
reason: "invalid v150 effect body"
|
|
116
|
+
});
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (effects.has(entry.id)) {
|
|
120
|
+
duplicates.push({
|
|
121
|
+
id: entry.id,
|
|
122
|
+
previousBank: effects.get(entry.id).bank,
|
|
123
|
+
bank
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
parsed++;
|
|
127
|
+
effects.set(entry.id, {
|
|
128
|
+
id: entry.id,
|
|
129
|
+
bank,
|
|
130
|
+
type,
|
|
131
|
+
...decoded
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
effects,
|
|
137
|
+
diagnostics: {
|
|
138
|
+
parsed,
|
|
139
|
+
failed,
|
|
140
|
+
duplicates,
|
|
141
|
+
unsupportedVersions
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { effectNodesFromBanks, parseEffectNode };
|
|
147
|
+
//# sourceMappingURL=effectNodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effectNodes.js","sources":["../../../../../src/formats/bnk/core/effectNodes.js"],"sourcesContent":["// Exact generic Wwise v150 Fx ShareSet and Fx Custom object decoding. Plug-in\n// parameter blocks remain opaque bytes; the resource layer preserves identity,\n// media, RTPC, state, and property records without interpreting DSP behavior.\n\nimport {\n boundedCount,\n finite,\n readInitialRtpcs,\n readStateChunk,\n WwiseCursor,\n} from \"./nodeBase.js\";\n\nconst SUPPORTED_VERSION = 150;\nconst FX_SHARE_SET_TYPE = 16;\nconst FX_CUSTOM_TYPE = 17;\nconst NO_PLUGIN_ID = 0xffffffff;\n\n/**\n * Decodes one complete v150 Fx ShareSet or Fx Custom body.\n *\n * @param {Uint8Array} payload Entry payload view from `inspect()`.\n * @param {object} [options] Bank-version qualification.\n * @returns {object|null} Typed effect body, or null when it is invalid.\n */\nexport function parseEffectNode(\n payload,\n { bankVersion = SUPPORTED_VERSION } = {},\n)\n{\n if (!(payload instanceof Uint8Array)\n || Number(bankVersion) !== SUPPORTED_VERSION\n || payload.byteLength < 4)\n {\n return null;\n }\n\n try\n {\n const cursor = new WwiseCursor(payload);\n const pluginId = cursor.u32();\n let parameterBlock = payload.subarray(cursor.at, cursor.at);\n\n if (pluginId !== 0 && pluginId !== NO_PLUGIN_ID)\n {\n const parameterByteLength = cursor.u32();\n\n cursor.ensure(parameterByteLength);\n parameterBlock = payload.subarray(\n cursor.at,\n cursor.at + parameterByteLength,\n );\n cursor.at += parameterByteLength;\n }\n\n const mediaCount = boundedCount(\n cursor.u8(),\n cursor.remaining,\n 5,\n 255,\n );\n const media = [];\n\n for (let index = 0; index < mediaCount; index++)\n {\n media.push({\n index: cursor.u8(),\n sourceId: cursor.u32(),\n });\n }\n\n const rtpcs = readInitialRtpcs(cursor);\n const state = readStateChunk(cursor);\n const propertyCount = boundedCount(\n cursor.u16(),\n cursor.remaining,\n 6,\n 65535,\n );\n const propertyValues = [];\n\n for (let index = 0; index < propertyCount; index++)\n {\n const propertyId = cursor.variable();\n const accumulation = cursor.u8();\n const value = finite(cursor.f32());\n\n if (accumulation > 6)\n {\n throw new RangeError(\"invalid v150 effect accumulation\");\n }\n\n propertyValues.push({ propertyId, accumulation, value });\n }\n\n if (cursor.remaining !== 0) return null;\n\n return {\n pluginId,\n pluginType: pluginId & 0x0f,\n companyId: (pluginId >>> 4) & 0x0fff,\n pluginClassId: pluginId >>> 16,\n parameterBlock,\n media,\n rtpcs,\n state,\n propertyValues,\n byteLength: cursor.at,\n };\n }\n catch\n {\n return null;\n }\n}\n\n/**\n * Decodes every v150 Fx ShareSet and Fx Custom across inspected banks.\n *\n * @param {Array<object>|object} inspections Related `CjsBnkFormat.inspect()` results.\n * @returns {{effects: Map<number, object>, diagnostics: object}} Typed effect catalog and failures.\n */\nexport function effectNodesFromBanks(inspections)\n{\n const banks = Array.isArray(inspections) ? inspections : [ inspections ];\n const effects = new Map();\n const failed = [];\n const duplicates = [];\n const unsupportedVersions = [];\n let parsed = 0;\n\n for (const inspection of banks)\n {\n const bank = inspection?.source || \"\";\n const bankVersion = Number(inspection?.bankVersion) >>> 0;\n\n if (bankVersion !== SUPPORTED_VERSION)\n {\n unsupportedVersions.push({ bank, version: bankVersion });\n continue;\n }\n\n for (const entry of inspection?.hirc ?? [])\n {\n if (entry.type !== FX_SHARE_SET_TYPE\n && entry.type !== FX_CUSTOM_TYPE)\n {\n continue;\n }\n\n const decoded = parseEffectNode(entry.payload, { bankVersion });\n const type = entry.type === FX_SHARE_SET_TYPE\n ? \"effect-share-set\"\n : \"effect-custom\";\n\n if (!decoded)\n {\n failed.push({\n bank,\n version: bankVersion,\n type,\n id: entry.id,\n reason: \"invalid v150 effect body\",\n });\n continue;\n }\n if (effects.has(entry.id))\n {\n duplicates.push({\n id: entry.id,\n previousBank: effects.get(entry.id).bank,\n bank,\n });\n }\n\n parsed++;\n effects.set(entry.id, {\n id: entry.id,\n bank,\n type,\n ...decoded,\n });\n }\n }\n\n return {\n effects,\n diagnostics: {\n parsed,\n failed,\n duplicates,\n unsupportedVersions,\n },\n };\n}\n"],"names":["SUPPORTED_VERSION","FX_SHARE_SET_TYPE","FX_CUSTOM_TYPE","NO_PLUGIN_ID","parseEffectNode","payload","bankVersion","Uint8Array","Number","byteLength","cursor","WwiseCursor","pluginId","u32","parameterBlock","subarray","at","parameterByteLength","ensure","mediaCount","boundedCount","u8","remaining","media","index","push","sourceId","rtpcs","readInitialRtpcs","state","readStateChunk","propertyCount","u16","propertyValues","propertyId","variable","accumulation","value","finite","f32","RangeError","pluginType","companyId","pluginClassId","effectNodesFromBanks","inspections","banks","Array","isArray","effects","Map","failed","duplicates","unsupportedVersions","parsed","inspection","bank","source","version","entry","hirc","type","decoded","id","reason","has","previousBank","get","set","diagnostics"],"mappings":";;AAAA;AACA;AACA;;AAUA,MAAMA,iBAAiB,GAAG,GAAG;AAC7B,MAAMC,i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