@carbonenginejs/runtime-resource 0.12.1 → 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tr2EffectRes.js","sources":["../../../../src/resource/shader/Tr2EffectRes.js"],"sourcesContent":["// Source: trinity/trinity/Resources/Tr2EffectRes.h\n// Source: trinity/trinity/Resources/Tr2EffectRes.cpp\n// Source: trinity/trinity/Resources/Tr2EffectRes_Blue.cpp\nimport { CjsSchema, carbon, impl, type } from \"@carbonenginejs/runtime-utils/schema\";\nimport { CjsResource } from \"../CjsResource.js\";\nimport { validateResourcePayload } from \"../resourceBoundary.js\";\nimport { Tr2Shader } from \"./Tr2Shader.js\";\n\nconst globalEffectOptions = [];\nconst SHA256 = /^[0-9a-f]{64}$/u;\nconst UINT8_MAX = 0xff;\nconst UINT32_MAX = 0xffffffff;\nconst MAX_EFFECT_PERMUTATIONS = 0x10000;\n\n/**\n * Tr2EffectRes resource record.\n *\n * This stores effect/shader payload facts. Engine-gpu decides shader module,\n * pipeline, bind group, and sampler realization.\n */\nexport class Tr2EffectRes extends CjsResource\n{\n\n #shaders = new Map();\n\n /** Creates a Tr2EffectRes with caller-provided initial state. */\n constructor(values = null)\n {\n super();\n this.SetValues(values || {}, {\n markDirty: false,\n skipUpdate: true,\n skipEvents: true\n });\n }\n\n /**\n * Attach a plain shader/effect payload.\n *\n * @param {object|null} payload\n * @param {object|null} options\n * @returns {Tr2EffectRes}\n */\n SetPayload(payload = null, options = null)\n {\n if (payload === null)\n {\n this.#shaders.clear();\n super.SetPayload(null);\n return this;\n }\n validateResourcePayload(\n \"Tr2EffectRes\",\n payload,\n validateEffectPayload\n );\n this.#shaders.clear();\n super.SetPayload(payload);\n this.SetValues(options || {});\n return this;\n }\n\n /**\n * Select and hydrate one canonical shader from the complete permutation\n * graph exposed by a CEWG/CEWGPU raw package.\n *\n * Global options have Carbon-compatible precedence over caller options.\n * Unknown option values retain the authored default.\n *\n * @param {Array<object>|Map<string,string>} options Local name/value choices.\n * @param {number|null} count Number of local entries to consider.\n * @returns {Tr2Shader|null} Selected device-free shader reflection.\n */\n GetShader(options = [], count = null)\n {\n const axes = getPermutationAxes(this.GetPayload());\n if (!axes.length)\n {\n const portableIndex = Tr2Shader.isPortableReflection(this.GetPayload())\n ? this.GetPayload().permutationIndex\n : 0;\n return this.GetShaderByIndex(portableIndex);\n }\n const localOptions = normalizeShaderOptions(options);\n const localCount = Number.isSafeInteger(count)\n ? Math.max(0, Math.min(count, localOptions.length))\n : localOptions.length;\n let multiplier = 1;\n let index = 0;\n\n for (const axis of axes)\n {\n let selectedIndex = axis.defaultOption;\n const globalOption = globalEffectOptions.find(\n option => option.name === axis.name\n );\n if (globalOption)\n {\n const requestedIndex = axis.options.indexOf(globalOption.value);\n if (requestedIndex >= 0)\n {\n selectedIndex = requestedIndex;\n }\n }\n else\n {\n for (let optionIndex = 0; optionIndex < localCount; optionIndex += 1)\n {\n const localOption = localOptions[optionIndex];\n if (localOption.name !== axis.name)\n {\n continue;\n }\n const requestedIndex = axis.options.indexOf(localOption.value);\n if (requestedIndex >= 0)\n {\n selectedIndex = requestedIndex;\n }\n }\n }\n\n index += selectedIndex * multiplier;\n multiplier *= axis.options.length;\n }\n\n return this.GetShaderByIndex(index);\n }\n\n /**\n * Hydrate one exact permutation-table index and cache the resulting runtime\n * graph for this payload.\n *\n * @param {number} index Exact permutation index.\n * @returns {Tr2Shader|null} Canonical shader or null when reflection is absent.\n */\n GetShaderByIndex(index)\n {\n if (!Number.isSafeInteger(index) || index < 0)\n {\n throw new TypeError(\n \"Tr2EffectRes shader index must be a non-negative safe integer\"\n );\n }\n if (this.#shaders.has(index))\n {\n return this.#shaders.get(index);\n }\n\n const payload = this.GetPayload();\n const variantCount = getPermutationVariantCount(payload);\n if (variantCount !== null && index >= variantCount)\n {\n return null;\n }\n\n const portable = getPortableReflection(payload, index);\n if (!portable)\n {\n return null;\n }\n if (portable.permutationIndex !== index)\n {\n throw new Error(\n `Portable effect reflection index ${portable.permutationIndex} does not match requested index ${index}`\n );\n }\n\n const shader = Tr2Shader.fromPortable(portable);\n this.#shaders.set(index, shader);\n return shader;\n }\n\n /**\n * Return a small JSON-friendly permutation description.\n *\n * @returns {Array<*>}\n */\n GetPermutationDescription()\n {\n const payload = this.GetPayload();\n const axes = getPermutationAxes(payload);\n if (!axes.length && Array.isArray(payload?.permutations))\n {\n return payload.permutations.map(permutation => ({ ...permutation }));\n }\n return axes.map(axis => ({\n name: axis.name,\n options: [ ...axis.options ],\n defaultOption: axis.defaultOption,\n description: axis.description,\n type: axis.type\n }));\n }\n\n /**\n * Drop hydrated shader graphs while retaining the validated CPU payload.\n */\n ReleaseResources()\n {\n this.#shaders.clear();\n }\n\n /** Release the payload and every shader graph hydrated from it. */\n ReleasePayload()\n {\n this.#shaders.clear();\n return super.ReleasePayload();\n }\n\n static payload = \"shader\";\n\n}\n\n/**\n * Merge Carbon-style global effect option overrides.\n *\n * An empty value removes the override. Existing Tr2EffectRes shader caches\n * remain valid objects; callers rebuild effects to request the new selection.\n *\n * @param {Array<object>|Map<string,string>} changes Option changes.\n */\nexport function ModifyGlobalEffectOptions(changes = [])\n{\n for (const change of normalizeShaderOptions(changes))\n {\n const index = globalEffectOptions.findIndex(\n option => option.name === change.name\n );\n if (!change.value)\n {\n if (index >= 0)\n {\n globalEffectOptions.splice(index, 1);\n }\n }\n else if (index >= 0)\n {\n globalEffectOptions[index] = change;\n }\n else\n {\n globalEffectOptions.push(change);\n }\n }\n}\n\n/**\n * Return an owned snapshot of the current global option overrides.\n *\n * @returns {Array<{name:string,value:string}>} Global option choices.\n */\nexport function GetGlobalEffectOptions()\n{\n return globalEffectOptions.map(option => ({ ...option }));\n}\n\nfunction validateEffectPayload(payload)\n{\n const graph = payload.permutationGraph;\n if (graph !== null && graph !== undefined)\n {\n validatePermutationGraph(graph);\n }\n else if (Array.isArray(payload.permutations))\n {\n if (payload.permutations.every(permutation =>\n Array.isArray(permutation?.options)))\n {\n payload.permutations.forEach(normalizePermutationAxis);\n }\n else\n {\n validateLegacyPermutationDescription(payload.permutations);\n }\n }\n else if (!Tr2Shader.isPortableReflection(payload))\n {\n throw new TypeError(\n \"Tr2EffectRes payload requires a complete permutation graph, permutations array, or one portable reflection\"\n );\n }\n\n if (Array.isArray(payload.portableReflections))\n {\n const expectedCount = getPermutationVariantCount(payload);\n if (expectedCount !== null\n && payload.portableReflections.length !== expectedCount)\n {\n throw new Error(\n \"Tr2EffectRes portable reflection count disagrees with its permutations\"\n );\n }\n payload.portableReflections.forEach((reflection, index) =>\n {\n if (!Tr2Shader.isPortableReflection(reflection)\n || reflection.permutationIndex !== index)\n {\n throw new Error(\n `Tr2EffectRes portable reflection ${index} is malformed`\n );\n }\n });\n }\n}\n\nfunction validateLegacyPermutationDescription(permutations)\n{\n for (const [ index, permutation ] of permutations.entries())\n {\n if (!permutation\n || typeof permutation !== \"object\"\n || Array.isArray(permutation)\n || typeof permutation.name !== \"string\"\n || !permutation.name)\n {\n throw new TypeError(\n `Tr2EffectRes legacy permutation ${index} is malformed`\n );\n }\n }\n}\n\nfunction validatePermutationGraph(graph)\n{\n if (!graph || typeof graph !== \"object\" || Array.isArray(graph)\n || graph.format !== \"CJS_EFFECT_PERMUTATION_GRAPH\"\n || graph.formatVersion !== 1\n || !graph.coverage || typeof graph.coverage !== \"object\"\n || Array.isArray(graph.coverage)\n || graph.coverage.permutations !== \"complete\"\n || graph.coverage.bodies !== \"identity-only\"\n || graph.coverage.reflection !== \"absent\"\n || !Array.isArray(graph.axes)\n || !Array.isArray(graph.variants)\n || !Array.isArray(graph.bodies))\n {\n throw new TypeError(\n \"Tr2EffectRes requires CJS_EFFECT_PERMUTATION_GRAPH version 1\"\n );\n }\n\n const axisNames = new Set();\n const axes = graph.axes.map((axis, index) =>\n validatePermutationAxis(axis, index, axisNames));\n const expectedCount = getPermutationProduct(axes);\n if (graph.variants.length !== expectedCount\n || !graph.bodies.length\n || graph.bodies.length > graph.variants.length)\n {\n throw new Error(\n \"Tr2EffectRes permutation graph requires complete variants and bodies\"\n );\n }\n\n const bodies = new Map();\n const bodyDigests = new Set();\n graph.bodies.forEach((body, bodyIndex) =>\n {\n if (!body || typeof body !== \"object\" || Array.isArray(body)\n || typeof body.key !== \"string\" || !body.key\n || body.key !== body.key.trim()\n || !Number.isSafeInteger(body.byteLength) || body.byteLength < 1\n || body.byteLength > UINT32_MAX\n || typeof body.sha256 !== \"string\" || !SHA256.test(body.sha256)\n || bodies.has(body.key)\n || bodyDigests.has(body.sha256))\n {\n throw new Error(\n `Tr2EffectRes permutation body ${bodyIndex} is malformed or duplicated`\n );\n }\n bodyDigests.add(body.sha256);\n bodies.set(body.key, {\n byteLength: body.byteLength,\n references: 0\n });\n });\n\n const bodyKeyBySourceRecord = new Map();\n const sourceRecords = [];\n graph.variants.forEach((variant, permutationIndex) =>\n {\n const expectedOptions = decodePermutationOptions(permutationIndex, axes);\n if (!variant || typeof variant !== \"object\" || Array.isArray(variant)\n || variant.permutationIndex !== permutationIndex\n || !Array.isArray(variant.optionIndices)\n || variant.optionIndices.length !== expectedOptions.length\n || variant.optionIndices.some((value, index) =>\n value !== expectedOptions[index])\n || typeof variant.bodyKey !== \"string\"\n || !bodies.has(variant.bodyKey))\n {\n throw new Error(\n `Tr2EffectRes permutation variant ${permutationIndex} is malformed`\n );\n }\n\n const sourceRecord = validatePermutationSourceRecord(\n variant.sourceRecord,\n permutationIndex\n );\n const body = bodies.get(variant.bodyKey);\n if (sourceRecord.byteLength !== body.byteLength)\n {\n throw new Error(\n `Tr2EffectRes permutation variant ${permutationIndex} body length disagrees`\n );\n }\n const recordKey = `${sourceRecord.offset}:${sourceRecord.byteLength}`;\n const existingBodyKey = bodyKeyBySourceRecord.get(recordKey);\n if (existingBodyKey && existingBodyKey !== variant.bodyKey)\n {\n throw new Error(\n `Tr2EffectRes source record ${recordKey} maps to multiple bodies`\n );\n }\n bodyKeyBySourceRecord.set(recordKey, variant.bodyKey);\n sourceRecords.push(sourceRecord);\n body.references += 1;\n });\n\n validateDisjointPermutationRecords(sourceRecords);\n for (const [ bodyKey, body ] of bodies)\n {\n if (!body.references)\n {\n throw new Error(\n `Tr2EffectRes permutation body ${bodyKey} is unreferenced`\n );\n }\n }\n}\n\nfunction validatePermutationAxis(axis, index, names)\n{\n if (!axis || typeof axis !== \"object\" || Array.isArray(axis)\n || axis.index !== index\n || typeof axis.name !== \"string\" || !axis.name\n || axis.name !== axis.name.trim() || names.has(axis.name)\n || !Array.isArray(axis.options) || !axis.options.length\n || axis.options.length > UINT8_MAX\n || !Number.isSafeInteger(axis.defaultOption)\n || axis.defaultOption < 0\n || axis.defaultOption >= axis.options.length\n || typeof axis.description !== \"string\"\n || !Number.isSafeInteger(axis.type)\n || axis.type < 0 || axis.type > UINT8_MAX)\n {\n throw new Error(\n `Tr2EffectRes permutation axis ${index} is malformed or duplicated`\n );\n }\n names.add(axis.name);\n const options = new Set();\n for (const option of axis.options)\n {\n if (typeof option !== \"string\" || !option\n || option !== option.trim() || options.has(option))\n {\n throw new Error(\n `Tr2EffectRes permutation axis ${index} options are malformed`\n );\n }\n options.add(option);\n }\n return normalizePermutationAxis(axis);\n}\n\nfunction getPermutationProduct(axes)\n{\n let product = 1;\n for (const axis of axes)\n {\n product *= axis.options.length;\n if (!Number.isSafeInteger(product)\n || product < 1\n || product > MAX_EFFECT_PERMUTATIONS)\n {\n throw new Error(\n \"Tr2EffectRes permutation count exceeds the implementation limit\"\n );\n }\n }\n return product;\n}\n\nfunction decodePermutationOptions(permutationIndex, axes)\n{\n let value = permutationIndex;\n return axes.map(axis =>\n {\n const optionIndex = value % axis.options.length;\n value = Math.floor(value / axis.options.length);\n return optionIndex;\n });\n}\n\nfunction validatePermutationSourceRecord(record, permutationIndex)\n{\n const offset = record?.offset;\n const byteLength = record?.byteLength;\n const end = offset + byteLength;\n if (!record || typeof record !== \"object\" || Array.isArray(record)\n || !Number.isSafeInteger(offset) || offset < 0 || offset > UINT32_MAX\n || !Number.isSafeInteger(byteLength) || byteLength < 1\n || byteLength > UINT32_MAX\n || !Number.isSafeInteger(end)\n || end > UINT32_MAX + 1)\n {\n throw new Error(\n `Tr2EffectRes permutation variant ${permutationIndex} source record is malformed`\n );\n }\n return { offset, byteLength };\n}\n\nfunction validateDisjointPermutationRecords(records)\n{\n const unique = new Map();\n for (const record of records)\n {\n const key = `${record.offset}:${record.byteLength}`;\n if (!unique.has(key))\n {\n unique.set(key, {\n offset: record.offset,\n end: record.offset + record.byteLength\n });\n }\n }\n const ordered = Array.from(unique.values()).sort((left, right) =>\n left.offset - right.offset || left.end - right.end);\n for (let index = 1; index < ordered.length; index += 1)\n {\n if (ordered[index].offset < ordered[index - 1].end)\n {\n throw new Error(\n \"Tr2EffectRes permutation source body records partially overlap\"\n );\n }\n }\n}\n\nfunction getPermutationAxes(payload)\n{\n if (!payload)\n {\n return [];\n }\n if (payload.permutationGraph)\n {\n return payload.permutationGraph.axes.map(normalizePermutationAxis);\n }\n if (Array.isArray(payload.permutations)\n && payload.permutations.every(permutation =>\n Array.isArray(permutation?.options)))\n {\n return payload.permutations.map(normalizePermutationAxis);\n }\n return [];\n}\n\nfunction normalizePermutationAxis(axis)\n{\n if (!axis || typeof axis !== \"object\" || Array.isArray(axis)\n || typeof axis.name !== \"string\" || !axis.name\n || !Array.isArray(axis.options) || !axis.options.length\n || axis.options.some(option => typeof option !== \"string\" || !option)\n || !Number.isSafeInteger(axis.defaultOption)\n || axis.defaultOption < 0\n || axis.defaultOption >= axis.options.length)\n {\n throw new TypeError(\"Tr2EffectRes permutation axis is malformed\");\n }\n return {\n name: axis.name,\n options: [ ...axis.options ],\n defaultOption: axis.defaultOption,\n description: String(axis.description ?? \"\"),\n type: Number(axis.type ?? 0)\n };\n}\n\nfunction getPermutationVariantCount(payload)\n{\n if (Array.isArray(payload?.permutationGraph?.variants))\n {\n return payload.permutationGraph.variants.length;\n }\n const axes = getPermutationAxes(payload);\n if (axes.length)\n {\n return axes.reduce((count, axis) => count * axis.options.length, 1);\n }\n return null;\n}\n\nfunction getPortableReflection(payload, index)\n{\n if (!payload)\n {\n return null;\n }\n if (typeof payload.GetPortableEffectReflection === \"function\")\n {\n return payload.GetPortableEffectReflection(index);\n }\n if (typeof payload.getPortableEffectReflection === \"function\")\n {\n return payload.getPortableEffectReflection(index);\n }\n if (Tr2Shader.isPortableReflection(payload))\n {\n return index === payload.permutationIndex ? payload : null;\n }\n if (Array.isArray(payload.portableReflections))\n {\n return payload.portableReflections[index] ?? null;\n }\n return null;\n}\n\nfunction normalizeShaderOptions(options)\n{\n if (options instanceof Map)\n {\n return Array.from(options, ([ name, value ]) => ({\n name: String(name),\n value: String(value)\n }));\n }\n if (!Array.isArray(options))\n {\n return [];\n }\n return options.map(option => ({\n name: String(option?.name ?? \"\"),\n value: String(option?.value ?? \"\")\n }));\n}\n\n// Declared imperatively rather than with decorators, so this module stays\n// plain ESM that loads from source without a transform. The decorator\n// expressions are reused verbatim, so the registered metadata is identical.\n// Statics belong in `methods`: decorateMethod targets the prototype and\n// would register a static as an instance field.\nCjsSchema.define(Tr2EffectRes, {\n className: \"Tr2EffectRes\",\n family: \"resources\",\n methods: {\n GetShader: [ carbon.method, impl.adapted, impl.reason(\"Carbon reads the selected body directly from compiled effect bytes and registers renderer handles; CarbonEngineJS hydrates the format package's validated portable reflection without realizing GPU state.\") ],\n GetShaderByIndex: [ impl.custom, impl.reason(\"Carbon selects compiled bodies through GetShader; CarbonEngineJS exposes exact package-index hydration for deterministic package consumers and tests.\") ],\n GetPermutationDescription: [ carbon.method, impl.adapted, impl.reason(\"Carbon exposes a Python tuple through Blue; CarbonEngineJS returns a JSON-friendly plain axis description.\") ],\n ReleaseResources: [ carbon.method, impl.adapted, impl.reason(\"Backend resources are engine-owned; the resource-side release clears only hydrated device-free shader graphs.\") ]\n }\n});\n"],"names":["globalEffectOptions","SHA256","UINT8_MAX","UINT32_MAX","MAX_EFFECT_PERMUTATIONS","Tr2EffectRes","CjsResource","Map","constructor","values","SetValues","markDirty","skipUpdate","skipEvents","SetPayload","payload","options","clear","validateResourcePayload","validateEffectPayload","GetShader","count","axes","getPermutationAxes","GetPayload","length","portableIndex","Tr2Shader","isPortableReflection","permutationIndex","GetShaderByIndex","localOptions","normalizeShaderOptions","localCount","Number","isSafeInteger","Math","max","min","multiplier","index","axis","selectedIndex","defaultOption","globalOption","find","option","name","requestedIndex","indexOf","value","optionIndex","localOption","TypeError","has","get","variantCount","getPermutationVariantCount","portable","getPortableReflection","Error","shader","fromPortable","set","GetPermutationDescription","Array","isArray","permutations","map","permutation","description","type","ReleaseResources","ReleasePayload","ModifyGlobalEffectOptions","changes","change","findIndex","splice","push","GetGlobalEffectOptions","graph","permutationGraph","undefined","validatePermutationGraph","every","forEach","normalizePermutationAxis","validateLegacyPermutationDescription","portableReflections","expectedCount","reflection","entries","format","formatVersion","coverage","bodies","variants","axisNames","Set","validatePermutationAxis","getPermutationProduct","bodyDigests","body","bodyIndex","key","trim","byteLength","sha256","test","add","references","bodyKeyBySourceRecord","sourceRecords","variant","expectedOptions","decodePermutationOptions","optionIndices","some","bodyKey","sourceRecord","validatePermutationSourceRecord","recordKey","offset","existingBodyKey","validateDisjointPermutationRecords","names","product","floor","record","end","records","unique","ordered","from","sort","left","right","String","reduce","GetPortableEffectReflection","getPortableEffectReflection","CjsSchema","define","className","family","methods","carbon","method","impl","adapted","reason","custom"],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C,GAAC,CAAC,CAAC;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA4F,SAAS,CAACC,MAAM,CAAC1I,YAAY,EAAE;AAC7B2I,EAAAA,SAAS,EAAE,cAAc;AACzBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,OAAO,EAAE;AACP9H,IAAAA,SAAS,EAAE,CAAE+H,MAAM,CAACC,MAAM,EAAEC,IAAI,CAACC,OAAO,EAAED,IAAI,CAACE,MAAM,CAAC,4MAA4M,CAAC,CAAE;AACrQzH,IAAAA,gBAAgB,EAAE,CAAEuH,IAAI,CAACG,MAAM,EAAEH,IAAI,CAACE,MAAM,CAAC,uJAAuJ,CAAC,CAAE;AACvMvF,IAAAA,yBAAyB,EAAE,CAAEmF,MAAM,CAACC,MAAM,EAAEC,IAAI,CAACC,OAAO,EAAED,IAAI,CAACE,MAAM,CAAC,4GAA4G,CAAC,CAAE;AACrL/E,IAAAA,gBAAgB,EAAE,CAAE2E,MAAM,CAACC,MAAM,EAAEC,IAAI,CAACC,OAAO,EAAED,IAAI,CAACE,MAAM,CAAC,+GAA+G,CAAC;AAC/K;AACF,CAAC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Tr2EffectRes.js","sources":["../../../../src/resource/shader/Tr2EffectRes.js"],"sourcesContent":["// Source: trinity/trinity/Resources/Tr2EffectRes.h\n// Source: trinity/trinity/Resources/Tr2EffectRes.cpp\n// Source: trinity/trinity/Resources/Tr2EffectRes_Blue.cpp\nimport { CjsSchema, carbon, impl, type } from \"@carbonenginejs/runtime-utils/schema\";\nimport { CjsResource } from \"../CjsResource.js\";\nimport { validateResourcePayload } from \"../resourceBoundary.js\";\nimport { CjsCarbonEffectReader } from \"../../format/carbonEffect/CjsCarbonEffectReader.js\";\nimport { Tr2Shader } from \"./Tr2Shader.js\";\n\nconst globalEffectOptions = [];\n\n/**\n * Tr2EffectRes resource record.\n *\n * This stores effect/shader payload facts. Engine-gpu decides shader module,\n * pipeline, bind group, and sampler realization.\n */\nexport class Tr2EffectRes extends CjsResource\n{\n\n #shaders = new Map();\n\n #reader = null;\n\n /**\n * Read a Carbon effect container and take ownership of its reader.\n *\n * Carbon's `DoLoad` (`Tr2EffectRes.cpp:137`) does exactly this work: it clears\n * the previous state, then fills `m_version`, the string table, the permutation\n * axes and the offset table from the file, and stops there. Bodies are read\n * later, one at a time, by `GetShader`. The one difference is where the bytes\n * come from — Carbon locks its own data stream, and this takes them as an\n * argument.\n *\n * The container is parsed once, here: version, arena, permutation axes and\n * offset table. Bodies are not. Each one is decoded on first request and\n * memoised, by seeking the retained reader rather than re-reading the header —\n * a container with 512 permutations that renders two of them parses two bodies.\n *\n * The reader is retained rather than discarded because a body cannot be read\n * without it: strings are offsets into the container's arena, which lives in\n * the header this method consumed.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} data Container bytes.\n * @param {object|null} options Model values applied after the read.\n * @returns {Tr2EffectRes}\n */\n DoLoad(data, options = null)\n {\n const reader = new CjsCarbonEffectReader(data);\n this.#shaders.clear();\n this.#reader = reader;\n super.SetPayload({\n permutations: reader.permutations.map(axis => ({\n name: axis.name.value,\n options: axis.options.map(option => option.value),\n defaultOption: axis.defaultOption,\n description: axis.description.value,\n type: axis.type\n }))\n });\n this.SetValues(options || {});\n return this;\n }\n\n /** Creates a Tr2EffectRes with caller-provided initial state. */\n constructor(values = null)\n {\n super();\n this.SetValues(values || {}, {\n markDirty: false,\n skipUpdate: true,\n skipEvents: true\n });\n }\n\n /**\n * Attach a plain shader/effect payload.\n *\n * @param {object|null} payload\n * @param {object|null} options\n * @returns {Tr2EffectRes}\n */\n SetPayload(payload = null, options = null)\n {\n if (payload === null)\n {\n this.#shaders.clear();\n this.#reader = null;\n super.SetPayload(null);\n return this;\n }\n validateResourcePayload(\n \"Tr2EffectRes\",\n payload,\n validateEffectPayload\n );\n this.#shaders.clear();\n this.#reader = null;\n super.SetPayload(payload);\n this.SetValues(options || {});\n return this;\n }\n\n /**\n * Select and hydrate one canonical shader from the complete permutation\n * graph exposed by a Carbon WebGL/Carbon WebGPU raw package.\n *\n * Global options have Carbon-compatible precedence over caller options.\n * Unknown option values retain the authored default.\n *\n * @param {Array<object>|Map<string,string>} options Local name/value choices.\n * @param {number|null} count Number of local entries to consider.\n * @returns {Tr2Shader|null} Selected device-free shader reflection.\n */\n GetShader(options = [], count = null)\n {\n const axes = getPermutationAxes(this.GetPayload());\n const localOptions = normalizeShaderOptions(options);\n const localCount = Number.isSafeInteger(count)\n ? Math.max(0, Math.min(count, localOptions.length))\n : localOptions.length;\n let multiplier = 1;\n let index = 0;\n\n for (const axis of axes)\n {\n let selectedIndex = axis.defaultOption;\n const globalOption = globalEffectOptions.find(\n option => option.name === axis.name\n );\n if (globalOption)\n {\n const requestedIndex = axis.options.indexOf(globalOption.value);\n if (requestedIndex >= 0)\n {\n selectedIndex = requestedIndex;\n }\n }\n else\n {\n for (let optionIndex = 0; optionIndex < localCount; optionIndex += 1)\n {\n const localOption = localOptions[optionIndex];\n if (localOption.name !== axis.name)\n {\n continue;\n }\n const requestedIndex = axis.options.indexOf(localOption.value);\n if (requestedIndex >= 0)\n {\n selectedIndex = requestedIndex;\n }\n }\n }\n\n index += selectedIndex * multiplier;\n multiplier *= axis.options.length;\n }\n\n return this.GetShaderByIndex(index);\n }\n\n /**\n * Hydrate one exact permutation-table index and cache the resulting runtime\n * graph for this payload.\n *\n * @param {number} index Exact permutation index.\n * @returns {Tr2Shader|null} Canonical shader or null when reflection is absent.\n */\n GetShaderByIndex(index)\n {\n if (!Number.isSafeInteger(index) || index < 0)\n {\n throw new TypeError(\n \"Tr2EffectRes shader index must be a non-negative safe integer\"\n );\n }\n if (this.#shaders.has(index))\n {\n return this.#shaders.get(index);\n }\n\n const payload = this.GetPayload();\n const variantCount = getPermutationVariantCount(payload);\n if (variantCount !== null && index >= variantCount)\n {\n return null;\n }\n\n if (!this.#reader)\n {\n return null;\n }\n\n const shader = Tr2Shader.fromCarbonBinary(this.#reader, index);\n this.#shaders.set(index, shader);\n return shader;\n }\n\n /**\n * Return a small JSON-friendly permutation description.\n *\n * @returns {Array<*>}\n */\n GetPermutationDescription()\n {\n const payload = this.GetPayload();\n const axes = getPermutationAxes(payload);\n if (!axes.length && Array.isArray(payload?.permutations))\n {\n return payload.permutations.map(permutation => ({ ...permutation }));\n }\n return axes.map(axis => ({\n name: axis.name,\n options: [ ...axis.options ],\n defaultOption: axis.defaultOption,\n description: axis.description,\n type: axis.type\n }));\n }\n\n /**\n * Drop hydrated shader graphs while retaining the validated CPU payload.\n */\n ReleaseResources()\n {\n this.#shaders.clear();\n }\n\n /** Release the payload and every shader graph hydrated from it. */\n ReleasePayload()\n {\n this.#shaders.clear();\n this.#reader = null;\n return super.ReleasePayload();\n }\n\n static payload = \"shader\";\n\n}\n\n/**\n * Validate an attached permutation payload.\n *\n * Carbon has no equivalent: it fills `m_permutations` from the file and never\n * accepts one from a caller. This exists only so an attached payload cannot\n * silently produce a wrong permutation index, and it checks the one thing the\n * index arithmetic depends on - that every axis has options and a default that\n * addresses one of them.\n *\n * @param {object} payload Attached payload.\n */\nfunction validateEffectPayload(payload)\n{\n if (!Array.isArray(payload.permutations))\n {\n throw new TypeError(\n \"Tr2EffectRes payload requires a permutations array\"\n );\n }\n payload.permutations.forEach(normalizePermutationAxis);\n}\n\n/**\n * The permutation axes an attached payload declares.\n *\n * @param {object|null} payload Attached payload.\n * @returns {Array<object>} Normalized axes, empty when there are none.\n */\nfunction getPermutationAxes(payload)\n{\n if (!Array.isArray(payload?.permutations))\n {\n return [];\n }\n return payload.permutations.map(normalizePermutationAxis);\n}\n\n/**\n * Normalize and validate one permutation axis.\n *\n * @param {object} axis Candidate axis.\n * @returns {object} Owned, validated axis.\n */\nfunction normalizePermutationAxis(axis)\n{\n if (!axis || typeof axis !== \"object\" || Array.isArray(axis)\n || typeof axis.name !== \"string\" || !axis.name\n || !Array.isArray(axis.options) || !axis.options.length\n || axis.options.some(option => typeof option !== \"string\" || !option)\n || !Number.isSafeInteger(axis.defaultOption)\n || axis.defaultOption < 0\n || axis.defaultOption >= axis.options.length)\n {\n throw new TypeError(\"Tr2EffectRes permutation axis is malformed\");\n }\n return {\n name: axis.name,\n options: [ ...axis.options ],\n defaultOption: axis.defaultOption,\n description: String(axis.description ?? \"\"),\n type: Number(axis.type ?? 0)\n };\n}\n\n/**\n * The number of permutations the axes describe - the product of their option\n * counts, which is also the number of offset-table rows a dense container has.\n *\n * @param {object|null} payload Attached payload.\n * @returns {number|null} Permutation count, or null when no axes are declared.\n */\nfunction getPermutationVariantCount(payload)\n{\n const axes = getPermutationAxes(payload);\n if (!axes.length)\n {\n return null;\n }\n return axes.reduce((count, axis) => count * axis.options.length, 1);\n}\n\n/**\n * Return an owned snapshot of the current global option overrides.\n *\n * Carbon returns a const reference to the live vector; a JS caller cannot be\n * held to that, so this copies rather than exposing the array for mutation.\n *\n * @returns {Array<{name:string,value:string}>} Global option choices.\n */\nexport function GetGlobalEffectOptions()\n{\n return globalEffectOptions.map(option => ({ ...option }));\n}\n\n/**\n * Merge Carbon-style global effect option overrides.\n *\n * An empty value removes the override. Existing Tr2EffectRes shader caches\n * remain valid objects; callers rebuild effects to request the new selection.\n *\n * @param {Array<object>|Map<string,string>} changes Option changes.\n */\nexport function ModifyGlobalEffectOptions(changes = [])\n{\n for (const change of normalizeShaderOptions(changes))\n {\n const index = globalEffectOptions.findIndex(\n option => option.name === change.name\n );\n if (!change.value)\n {\n if (index >= 0)\n {\n globalEffectOptions.splice(index, 1);\n }\n }\n else if (index >= 0)\n {\n globalEffectOptions[index] = change;\n }\n else\n {\n globalEffectOptions.push(change);\n }\n }\n}\n\nfunction normalizeShaderOptions(options)\n{\n if (options instanceof Map)\n {\n return Array.from(options, ([ name, value ]) => ({\n name: String(name),\n value: String(value)\n }));\n }\n if (!Array.isArray(options))\n {\n return [];\n }\n return options.map(option => ({\n name: String(option?.name ?? \"\"),\n value: String(option?.value ?? \"\")\n }));\n}\n\n// Declared imperatively rather than with decorators, so this module stays\n// plain ESM that loads from source without a transform. The decorator\n// expressions are reused verbatim, so the registered metadata is identical.\n// Statics belong in `methods`: decorateMethod targets the prototype and\n// would register a static as an instance field.\nCjsSchema.define(Tr2EffectRes, {\n className: \"Tr2EffectRes\",\n family: \"resources\",\n methods: {\n GetShader: [ carbon.method, impl.adapted, impl.reason(\"Carbon reads the selected body from the compiled effect bytes and registers renderer handles; CarbonEngineJS reads the same bytes and stops at the device-free graph, leaving GPU realization to the engine.\") ],\n GetShaderByIndex: [ impl.custom, impl.reason(\"Carbon selects compiled bodies through GetShader; CarbonEngineJS exposes exact package-index hydration for deterministic package consumers and tests.\") ],\n GetPermutationDescription: [ carbon.method, impl.adapted, impl.reason(\"Carbon exposes a Python tuple through Blue; CarbonEngineJS returns a JSON-friendly plain axis description.\") ],\n ReleaseResources: [ carbon.method, impl.adapted, impl.reason(\"Backend resources are engine-owned; the resource-side release clears only hydrated device-free shader graphs.\") ]\n }\n});\n"],"names":["globalEffectOptions","Tr2EffectRes","CjsResource","Map","DoLoad","data","options","reader","CjsCarbonEffectReader","clear","SetPayload","permutations","map","axis","name","value","option","defaultOption","description","type","SetValues","constructor","values","markDirty","skipUpdate","skipEvents","payload","validateResourcePayload","validateEffectPayload","GetShader","count","axes","getPermutationAxes","GetPayload","localOptions","normalizeShaderOptions","localCount","Number","isSafeInteger","Math","max","min","length","multiplier","index","selectedIndex","globalOption","find","requestedIndex","indexOf","optionIndex","localOption","GetShaderByIndex","TypeError","has","get","variantCount","getPermutationVariantCount","shader","Tr2Shader","fromCarbonBinary","set","GetPermutationDescription","Array","isArray","permutation","ReleaseResources","ReleasePayload","forEach","normalizePermutationAxis","some","String","reduce","GetGlobalEffectOptions","ModifyGlobalEffectOptions","changes","change","findIndex","splice","push","from","CjsSchema","define","className","family","methods","carbon","method","impl","adapted","reason","custom"],"mappings":";;;;;;AAAA;AACA;AACA;AAOA,MAAMA,mBAAmB,GAAG,EAAE;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACO,MAA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BF,IAAI,EAAEyD,MAAM,CAACvD,MAAM,EAAEF,IAAI,IAAI,EAAE,CAAC;AAChCC,IAAAA,KAAK,EAAEwD,MAAM,CAACvD,MAAM,EAAED,KAAK,IAAI,EAAE;AACnC,GAAC,CAAC,CAAC;AACL;;AAEA;AACA;AACA;AACA;AACA;AACAkE,SAAS,CAACC,MAAM,CAACjF,YAAY,EAAE;AAC7BkF,EAAAA,SAAS,EAAE,cAAc;AACzBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,OAAO,EAAE;AACPxD,IAAAA,SAAS,EAAE,CAAEyD,MAAM,CAACC,MAAM,EAAEC,IAAI,CAACC,OAAO,EAAED,IAAI,CAACE,MAAM,CAAC,8MAA8M,CAAC,CAAE;AACvQtC,IAAAA,gBAAgB,EAAE,CAAEoC,IAAI,CAACG,MAAM,EAAEH,IAAI,CAACE,MAAM,CAAC,uJAAuJ,CAAC,CAAE;AACvM5B,IAAAA,yBAAyB,EAAE,CAAEwB,MAAM,CAACC,MAAM,EAAEC,IAAI,CAACC,OAAO,EAAED,IAAI,CAACE,MAAM,CAAC,4GAA4G,CAAC,CAAE;AACrLxB,IAAAA,gBAAgB,EAAE,CAAEoB,MAAM,CAACC,MAAM,EAAEC,IAAI,CAACC,OAAO,EAAED,IAAI,CAACE,MAAM,CAAC,+GAA+G,CAAC;AAC/K;AACF,CAAC,CAAC;;;;"}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { CjsSchema, io, type } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
-
import { CjsModel } from '@carbonenginejs/runtime-utils/model';
|
|
3
|
-
|
|
4
|
-
// Source: trinity/trinity/Resources/Tr2MaterialRes.h
|
|
5
|
-
// Schema: format-carbon resources/Tr2MaterialArea.json; maintained by runtime-resource.
|
|
6
|
-
|
|
1
|
+
import { CjsSchema, io, type } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
+
import { CjsModel } from '@carbonenginejs/runtime-utils/model';
|
|
3
|
+
|
|
4
|
+
// Source: trinity/trinity/Resources/Tr2MaterialRes.h
|
|
5
|
+
// Schema: format-carbon resources/Tr2MaterialArea.json; maintained by runtime-resource.
|
|
6
|
+
|
|
7
7
|
/**
|
|
8
8
|
* Associates one material-area metatype with its persisted parameter store.
|
|
9
9
|
*
|
|
10
10
|
* The record describes resource data and does not own shader bindings or
|
|
11
11
|
* backend material realization.
|
|
12
|
-
*/
|
|
13
|
-
class Tr2MaterialArea extends CjsModel {
|
|
14
|
-
/** Persisted material parameter-store reference. */
|
|
15
|
-
material = null;
|
|
16
|
-
|
|
17
|
-
/** Authored material-area metatype. */
|
|
18
|
-
metatype = "";
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Declared imperatively rather than with decorators, so this module stays
|
|
22
|
-
// plain ESM that loads from source without a transform. The decorator
|
|
23
|
-
// expressions are reused verbatim, so the registered metadata is identical.
|
|
24
|
-
// Statics belong in `methods`: decorateMethod targets the prototype and
|
|
25
|
-
// would register a static as an instance field.
|
|
26
|
-
CjsSchema.define(Tr2MaterialArea, {
|
|
27
|
-
className: "Tr2MaterialArea",
|
|
28
|
-
family: "resources",
|
|
29
|
-
fields: {
|
|
30
|
-
material: [io.persist, type.objectRef("Tr2MaterialParameterStore")],
|
|
31
|
-
metatype: [io.persist, type.string]
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export { Tr2MaterialArea };
|
|
36
|
-
//# sourceMappingURL=Tr2MaterialArea.js.map
|
|
12
|
+
*/
|
|
13
|
+
class Tr2MaterialArea extends CjsModel {
|
|
14
|
+
/** Persisted material parameter-store reference. */
|
|
15
|
+
material = null;
|
|
16
|
+
|
|
17
|
+
/** Authored material-area metatype. */
|
|
18
|
+
metatype = "";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Declared imperatively rather than with decorators, so this module stays
|
|
22
|
+
// plain ESM that loads from source without a transform. The decorator
|
|
23
|
+
// expressions are reused verbatim, so the registered metadata is identical.
|
|
24
|
+
// Statics belong in `methods`: decorateMethod targets the prototype and
|
|
25
|
+
// would register a static as an instance field.
|
|
26
|
+
CjsSchema.define(Tr2MaterialArea, {
|
|
27
|
+
className: "Tr2MaterialArea",
|
|
28
|
+
family: "resources",
|
|
29
|
+
fields: {
|
|
30
|
+
material: [io.persist, type.objectRef("Tr2MaterialParameterStore")],
|
|
31
|
+
metatype: [io.persist, type.string]
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export { Tr2MaterialArea };
|
|
36
|
+
//# sourceMappingURL=Tr2MaterialArea.js.map
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { CjsSchema, io, type } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
-
import { CjsModel } from '@carbonenginejs/runtime-utils/model';
|
|
3
|
-
|
|
4
|
-
// Source: trinity/trinity/Resources/Tr2MaterialRes.h
|
|
5
|
-
// Schema: format-carbon resources/Tr2MaterialMesh.json; maintained by runtime-resource.
|
|
6
|
-
|
|
1
|
+
import { CjsSchema, io, type } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
+
import { CjsModel } from '@carbonenginejs/runtime-utils/model';
|
|
3
|
+
|
|
4
|
+
// Source: trinity/trinity/Resources/Tr2MaterialRes.h
|
|
5
|
+
// Schema: format-carbon resources/Tr2MaterialMesh.json; maintained by runtime-resource.
|
|
6
|
+
|
|
7
7
|
/**
|
|
8
8
|
* Holds the persisted material-area dictionary for one material mesh.
|
|
9
9
|
*
|
|
10
10
|
* Area lookup remains resource metadata; engines decide how the selected
|
|
11
11
|
* material becomes backend draw state.
|
|
12
|
-
*/
|
|
13
|
-
class Tr2MaterialMesh extends CjsModel {
|
|
14
|
-
/** Persisted dictionary of material areas. */
|
|
15
|
-
areas = null;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Declared imperatively rather than with decorators, so this module stays
|
|
19
|
-
// plain ESM that loads from source without a transform. The decorator
|
|
20
|
-
// expressions are reused verbatim, so the registered metadata is identical.
|
|
21
|
-
// Statics belong in `methods`: decorateMethod targets the prototype and
|
|
22
|
-
// would register a static as an instance field.
|
|
23
|
-
CjsSchema.define(Tr2MaterialMesh, {
|
|
24
|
-
className: "Tr2MaterialMesh",
|
|
25
|
-
family: "resources",
|
|
26
|
-
fields: {
|
|
27
|
-
areas: [io.persist, type.objectRef("Tr2MaterialAreaDict")]
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export { Tr2MaterialMesh };
|
|
32
|
-
//# sourceMappingURL=Tr2MaterialMesh.js.map
|
|
12
|
+
*/
|
|
13
|
+
class Tr2MaterialMesh extends CjsModel {
|
|
14
|
+
/** Persisted dictionary of material areas. */
|
|
15
|
+
areas = null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Declared imperatively rather than with decorators, so this module stays
|
|
19
|
+
// plain ESM that loads from source without a transform. The decorator
|
|
20
|
+
// expressions are reused verbatim, so the registered metadata is identical.
|
|
21
|
+
// Statics belong in `methods`: decorateMethod targets the prototype and
|
|
22
|
+
// would register a static as an instance field.
|
|
23
|
+
CjsSchema.define(Tr2MaterialMesh, {
|
|
24
|
+
className: "Tr2MaterialMesh",
|
|
25
|
+
family: "resources",
|
|
26
|
+
fields: {
|
|
27
|
+
areas: [io.persist, type.objectRef("Tr2MaterialAreaDict")]
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export { Tr2MaterialMesh };
|
|
32
|
+
//# sourceMappingURL=Tr2MaterialMesh.js.map
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { CjsSchema, io, type } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
-
import { CjsModel } from '@carbonenginejs/runtime-utils/model';
|
|
3
|
-
|
|
4
|
-
// Source: trinity/trinity/Resources/Tr2MaterialRes.h
|
|
5
|
-
// Schema: format-carbon resources/Tr2MaterialRes.json; maintained by runtime-resource.
|
|
6
|
-
|
|
1
|
+
import { CjsSchema, io, type } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
+
import { CjsModel } from '@carbonenginejs/runtime-utils/model';
|
|
3
|
+
|
|
4
|
+
// Source: trinity/trinity/Resources/Tr2MaterialRes.h
|
|
5
|
+
// Schema: format-carbon resources/Tr2MaterialRes.json; maintained by runtime-resource.
|
|
6
|
+
|
|
7
7
|
/**
|
|
8
8
|
* Root persisted material record containing its authored name and material
|
|
9
9
|
* mesh dictionary.
|
|
10
10
|
*
|
|
11
11
|
* It owns the serializable material description, not device shaders,
|
|
12
12
|
* descriptor bindings, or pipelines.
|
|
13
|
-
*/
|
|
14
|
-
class Tr2MaterialRes extends CjsModel {
|
|
15
|
-
/** Persisted dictionary of material meshes. */
|
|
16
|
-
meshes = null;
|
|
17
|
-
|
|
18
|
-
/** Authored material name. */
|
|
19
|
-
name = "";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Declared imperatively rather than with decorators, so this module stays
|
|
23
|
-
// plain ESM that loads from source without a transform. The decorator
|
|
24
|
-
// expressions are reused verbatim, so the registered metadata is identical.
|
|
25
|
-
// Statics belong in `methods`: decorateMethod targets the prototype and
|
|
26
|
-
// would register a static as an instance field.
|
|
27
|
-
CjsSchema.define(Tr2MaterialRes, {
|
|
28
|
-
className: "Tr2MaterialRes",
|
|
29
|
-
family: "resources",
|
|
30
|
-
fields: {
|
|
31
|
-
meshes: [io.persist, type.objectRef("Tr2MaterialMeshDict")],
|
|
32
|
-
name: [io.persist, type.string]
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export { Tr2MaterialRes };
|
|
37
|
-
//# sourceMappingURL=Tr2MaterialRes.js.map
|
|
13
|
+
*/
|
|
14
|
+
class Tr2MaterialRes extends CjsModel {
|
|
15
|
+
/** Persisted dictionary of material meshes. */
|
|
16
|
+
meshes = null;
|
|
17
|
+
|
|
18
|
+
/** Authored material name. */
|
|
19
|
+
name = "";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Declared imperatively rather than with decorators, so this module stays
|
|
23
|
+
// plain ESM that loads from source without a transform. The decorator
|
|
24
|
+
// expressions are reused verbatim, so the registered metadata is identical.
|
|
25
|
+
// Statics belong in `methods`: decorateMethod targets the prototype and
|
|
26
|
+
// would register a static as an instance field.
|
|
27
|
+
CjsSchema.define(Tr2MaterialRes, {
|
|
28
|
+
className: "Tr2MaterialRes",
|
|
29
|
+
family: "resources",
|
|
30
|
+
fields: {
|
|
31
|
+
meshes: [io.persist, type.objectRef("Tr2MaterialMeshDict")],
|
|
32
|
+
name: [io.persist, type.string]
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { Tr2MaterialRes };
|
|
37
|
+
//# sourceMappingURL=Tr2MaterialRes.js.map
|