@carbonenginejs/runtime-resource 0.9.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +3 -2
- package/README.md +47 -6
- package/dist/CjsMotherLode.js +88 -88
- package/dist/CjsMotherLode.js.map +1 -1
- package/dist/CjsResMan.js +717 -228
- package/dist/CjsResMan.js.map +1 -1
- package/dist/CjsResManFetchProvider.js +94 -0
- package/dist/CjsResManFetchProvider.js.map +1 -0
- package/dist/{CjsResManQueue.js → CjsResManWorkQueue.js} +112 -25
- package/dist/CjsResManWorkQueue.js.map +1 -0
- package/dist/format/CjsBlueReader.js +89 -0
- package/dist/format/CjsBlueReader.js.map +1 -1
- package/dist/format/CjsFormat.js +42 -16
- package/dist/format/CjsFormat.js.map +1 -1
- package/dist/format/CjsReader.js +4 -0
- package/dist/format/CjsReader.js.map +1 -1
- package/dist/format/CjsResourceProbe.js +2 -0
- package/dist/format/CjsResourceProbe.js.map +1 -1
- package/dist/format/effect/effectPermutationGraph.js +257 -0
- package/dist/format/effect/effectPermutationGraph.js.map +1 -0
- package/dist/format/effect/effectReflectionPackage.js +636 -0
- package/dist/format/effect/effectReflectionPackage.js.map +1 -0
- package/dist/format/effect/sha256.js +114 -0
- package/dist/format/effect/sha256.js.map +1 -0
- package/dist/format/payloadContract.js +20 -0
- package/dist/format/payloadContract.js.map +1 -1
- package/dist/formats/black/CjsBlackFormat.js +15 -1
- package/dist/formats/black/CjsBlackFormat.js.map +1 -1
- package/dist/formats/black/core/CjsBlackBinaryReader.js +103 -0
- package/dist/formats/black/core/CjsBlackBinaryReader.js.map +1 -1
- package/dist/formats/black/core/CjsBlackPropertyReaders.js +61 -0
- package/dist/formats/black/core/CjsBlackPropertyReaders.js.map +1 -1
- package/dist/formats/black/core/CjsBlackReader.js +125 -0
- package/dist/formats/black/core/CjsBlackReader.js.map +1 -1
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js +103 -0
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js.map +1 -1
- package/dist/formats/black/core/helpers.js +17 -0
- package/dist/formats/black/core/helpers.js.map +1 -1
- package/dist/formats/bnk/CjsBnkFormat.js +8 -0
- package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/formats/bnk/core/helpers.js +20 -0
- package/dist/formats/bnk/core/helpers.js.map +1 -1
- package/dist/formats/bnk/core/musicNodes.js +40 -3
- package/dist/formats/bnk/core/musicNodes.js.map +1 -1
- package/dist/formats/bnk/core/soundbanksInfo.js +2 -0
- package/dist/formats/bnk/core/soundbanksInfo.js.map +1 -1
- package/dist/formats/cmf/core/binary.js +71 -0
- package/dist/formats/cmf/core/binary.js.map +1 -1
- package/dist/formats/cmf/core/buffers.js +4 -0
- package/dist/formats/cmf/core/buffers.js.map +1 -1
- package/dist/formats/cmf/core/helpers.js +31 -0
- package/dist/formats/cmf/core/helpers.js.map +1 -1
- package/dist/formats/cmf/core/schema.js +10 -0
- package/dist/formats/cmf/core/schema.js.map +1 -1
- package/dist/formats/cmf/core/shared.js +9 -0
- package/dist/formats/cmf/core/shared.js.map +1 -1
- package/dist/formats/cmf/core/writer.js +54 -0
- package/dist/formats/cmf/core/writer.js.map +1 -1
- package/dist/formats/dds/core/bc6h.js +10 -0
- package/dist/formats/dds/core/bc6h.js.map +1 -1
- package/dist/formats/dds/core/bc7.js +16 -0
- package/dist/formats/dds/core/bc7.js.map +1 -1
- package/dist/formats/dds/core/helpers.js +47 -0
- package/dist/formats/dds/core/helpers.js.map +1 -1
- package/dist/formats/dxbc/CjsDxbcFormat.js +142 -0
- package/dist/formats/dxbc/CjsDxbcFormat.js.map +1 -0
- package/dist/formats/dxbc/core/DxbcReader.js +266 -0
- package/dist/formats/dxbc/core/DxbcReader.js.map +1 -0
- package/dist/formats/dxbc/core/container.js +169 -0
- package/dist/formats/dxbc/core/container.js.map +1 -0
- package/dist/formats/dxbc/core/decoder.js +789 -0
- package/dist/formats/dxbc/core/decoder.js.map +1 -0
- package/dist/formats/dxbc/core/errors.js +19 -0
- package/dist/formats/dxbc/core/errors.js.map +1 -0
- package/dist/formats/dxbc/core/helpers.js +220 -0
- package/dist/formats/dxbc/core/helpers.js.map +1 -0
- package/dist/formats/dxbc/core/opcodes.js +45 -0
- package/dist/formats/dxbc/core/opcodes.js.map +1 -0
- package/dist/formats/dxbc/core/program.js +91 -0
- package/dist/formats/dxbc/core/program.js.map +1 -0
- package/dist/formats/dxbc/core/signature.js +172 -0
- package/dist/formats/dxbc/core/signature.js.map +1 -0
- package/dist/formats/dxbc/index.js +2 -0
- package/dist/formats/dxbc/index.js.map +1 -0
- package/dist/formats/fbx/core/helpers.js +21 -0
- package/dist/formats/fbx/core/helpers.js.map +1 -1
- package/dist/formats/flac/CjsFlacFormat.js +49 -0
- package/dist/formats/flac/CjsFlacFormat.js.map +1 -1
- package/dist/formats/flac/core/helpers.js +20 -0
- package/dist/formats/flac/core/helpers.js.map +1 -1
- package/dist/formats/gif/CjsGifFormat.js +49 -0
- package/dist/formats/gif/CjsGifFormat.js.map +1 -1
- package/dist/formats/gif/core/helpers.js +20 -0
- package/dist/formats/gif/core/helpers.js.map +1 -1
- package/dist/formats/gltf/core/helpers.js +15 -0
- package/dist/formats/gltf/core/helpers.js.map +1 -1
- package/dist/formats/gltf/core/parser.js +13 -0
- package/dist/formats/gltf/core/parser.js.map +1 -1
- package/dist/formats/gltf/core/targets.js +10 -0
- package/dist/formats/gltf/core/targets.js.map +1 -1
- package/dist/formats/gr2/core/bitknit2.js +2 -0
- package/dist/formats/gr2/core/bitknit2.js.map +1 -1
- package/dist/formats/gr2/core/helpers.js +20 -0
- package/dist/formats/gr2/core/helpers.js.map +1 -1
- package/dist/formats/gr2/core/targets.js +10 -0
- package/dist/formats/gr2/core/targets.js.map +1 -1
- package/dist/formats/hlsl/CjsHlslFormat.js +254 -0
- package/dist/formats/hlsl/CjsHlslFormat.js.map +1 -0
- package/dist/formats/hlsl/core/HlslBinaryUtils.js +15 -0
- package/dist/formats/hlsl/core/HlslBinaryUtils.js.map +1 -0
- package/dist/formats/hlsl/core/HlslEffectReadError.js +19 -0
- package/dist/formats/hlsl/core/HlslEffectReadError.js.map +1 -0
- package/dist/formats/hlsl/core/HlslEffectStateManager.js +130 -0
- package/dist/formats/hlsl/core/HlslEffectStateManager.js.map +1 -0
- package/dist/formats/hlsl/core/HlslReader.js +266 -0
- package/dist/formats/hlsl/core/HlslReader.js.map +1 -0
- package/dist/formats/hlsl/core/HlslRenderStateSetup.js +37 -0
- package/dist/formats/hlsl/core/HlslRenderStateSetup.js.map +1 -0
- package/dist/formats/hlsl/core/HlslResourceSetDescription.js +94 -0
- package/dist/formats/hlsl/core/HlslResourceSetDescription.js.map +1 -0
- package/dist/formats/hlsl/core/HlslShaderBytecode.js +44 -0
- package/dist/formats/hlsl/core/HlslShaderBytecode.js.map +1 -0
- package/dist/formats/hlsl/core/analysis.js +51 -0
- package/dist/formats/hlsl/core/analysis.js.map +1 -0
- package/dist/formats/hlsl/core/helpers.js +270 -0
- package/dist/formats/hlsl/core/helpers.js.map +1 -0
- package/dist/formats/hlsl/core/json.js +284 -0
- package/dist/formats/hlsl/core/json.js.map +1 -0
- package/dist/formats/hlsl/core/metadata.js +327 -0
- package/dist/formats/hlsl/core/metadata.js.map +1 -0
- package/dist/formats/hlsl/core/portableReflection.js +848 -0
- package/dist/formats/hlsl/core/portableReflection.js.map +1 -0
- package/dist/formats/hlsl/core/render-states.js +280 -0
- package/dist/formats/hlsl/core/render-states.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/HlslRenderContextEnum.js +43 -0
- package/dist/formats/hlsl/core/tr2/HlslRenderContextEnum.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +294 -0
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/resources/HlslShaderPermutation.js +33 -0
- package/dist/formats/hlsl/core/tr2/resources/HlslShaderPermutation.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js +416 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectConstant.js +40 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectConstant.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js +742 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectLibrary.js +52 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectLibrary.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectParameterAnnotation.js +38 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectParameterAnnotation.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectResource.js +50 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectResource.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +86 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectTechnique.js +31 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectTechnique.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslPass.js +42 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslPass.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslSamplerDescription.js +55 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslSamplerDescription.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslSamplerSetup.js +29 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslSamplerSetup.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslShader.js +220 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslShader.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslShaderOption.js +30 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslShaderOption.js.map +1 -0
- package/dist/formats/hlsl/index.js +2 -0
- package/dist/formats/hlsl/index.js.map +1 -0
- package/dist/formats/hlsl/portable.js +2 -0
- package/dist/formats/hlsl/portable.js.map +1 -0
- package/dist/formats/index.js +4 -0
- package/dist/formats/index.js.map +1 -1
- package/dist/formats/jpeg/core/helpers.js +52 -0
- package/dist/formats/jpeg/core/helpers.js.map +1 -1
- package/dist/formats/jpeg/core/jpeg.js +93 -0
- package/dist/formats/jpeg/core/jpeg.js.map +1 -1
- package/dist/formats/mp3/core/helpers.js +37 -0
- package/dist/formats/mp3/core/helpers.js.map +1 -1
- package/dist/formats/mp4/core/helpers.js +35 -0
- package/dist/formats/mp4/core/helpers.js.map +1 -1
- package/dist/formats/ogg/CjsOggFormat.js +49 -0
- package/dist/formats/ogg/CjsOggFormat.js.map +1 -1
- package/dist/formats/ogg/core/helpers.js +23 -0
- package/dist/formats/ogg/core/helpers.js.map +1 -1
- package/dist/formats/ogg/core/vorbis.js +13 -0
- package/dist/formats/ogg/core/vorbis.js.map +1 -1
- package/dist/formats/png/core/helpers.js +52 -0
- package/dist/formats/png/core/helpers.js.map +1 -1
- package/dist/formats/red/CjsRedFormat.js +2 -0
- package/dist/formats/red/CjsRedFormat.js.map +1 -1
- package/dist/formats/red/core/CjsRedReader.js +52 -0
- package/dist/formats/red/core/CjsRedReader.js.map +1 -1
- package/dist/formats/red/core/helpers.js +19 -0
- package/dist/formats/red/core/helpers.js.map +1 -1
- package/dist/formats/stl/core/stl.js +8 -0
- package/dist/formats/stl/core/stl.js.map +1 -1
- package/dist/formats/stl/core/targets.js +10 -0
- package/dist/formats/stl/core/targets.js.map +1 -1
- package/dist/formats/tga/core/helpers.js +47 -0
- package/dist/formats/tga/core/helpers.js.map +1 -1
- package/dist/formats/wav/core/helpers.js +37 -0
- package/dist/formats/wav/core/helpers.js.map +1 -1
- package/dist/formats/webgl/CjsWebglFormat.js +221 -0
- package/dist/formats/webgl/CjsWebglFormat.js.map +1 -0
- package/dist/formats/webgl/core/cewg/CewgPackage.js +339 -0
- package/dist/formats/webgl/core/cewg/CewgPackage.js.map +1 -0
- package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js +104 -0
- package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js.map +1 -0
- package/dist/formats/webgl/core/cewg/binary.js +101 -0
- package/dist/formats/webgl/core/cewg/binary.js.map +1 -0
- package/dist/formats/webgl/core/cewgCompleteness.js +81 -0
- package/dist/formats/webgl/core/cewgCompleteness.js.map +1 -0
- package/dist/formats/webgl/core/effectPackage.js +789 -0
- package/dist/formats/webgl/core/effectPackage.js.map +1 -0
- package/dist/formats/webgl/core/effectPackageValidation.js +331 -0
- package/dist/formats/webgl/core/effectPackageValidation.js.map +1 -0
- package/dist/formats/webgl/core/errors.js +27 -0
- package/dist/formats/webgl/core/errors.js.map +1 -0
- package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js +2678 -0
- package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -0
- package/dist/formats/webgl/core/glsl/DxbcGlslHelpers.js +89 -0
- package/dist/formats/webgl/core/glsl/DxbcGlslHelpers.js.map +1 -0
- package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +428 -0
- package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -0
- package/dist/formats/webgl/core/helpers.js +306 -0
- package/dist/formats/webgl/core/helpers.js.map +1 -0
- package/dist/formats/webgl/index.js +2 -0
- package/dist/formats/webgl/index.js.map +1 -0
- package/dist/formats/webgpu/CjsWebgpuFormat.js +376 -0
- package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js +415 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js +100 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/binary.js +93 -0
- package/dist/formats/webgpu/core/cewgpu/binary.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/tags.js +17 -0
- package/dist/formats/webgpu/core/cewgpu/tags.js.map +1 -0
- package/dist/formats/webgpu/core/effectAnalysis.js +82 -0
- package/dist/formats/webgpu/core/effectAnalysis.js.map +1 -0
- package/dist/formats/webgpu/core/effectBackendBodySet.js +305 -0
- package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -0
- package/dist/formats/webgpu/core/effectPackageValidation.js +1078 -0
- package/dist/formats/webgpu/core/effectPackageValidation.js.map +1 -0
- package/dist/formats/webgpu/core/errors.js +20 -0
- package/dist/formats/webgpu/core/errors.js.map +1 -0
- package/dist/formats/webgpu/core/helpers.js +448 -0
- package/dist/formats/webgpu/core/helpers.js.map +1 -0
- package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +223 -0
- package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js.map +1 -0
- package/dist/formats/webgpu/core/ir/buildControlFlow.js +220 -0
- package/dist/formats/webgpu/core/ir/buildControlFlow.js.map +1 -0
- package/dist/formats/webgpu/core/ir/indexableTemps.js +137 -0
- package/dist/formats/webgpu/core/ir/indexableTemps.js.map +1 -0
- package/dist/formats/webgpu/core/ir/inferValueTypes.js +454 -0
- package/dist/formats/webgpu/core/ir/inferValueTypes.js.map +1 -0
- package/dist/formats/webgpu/core/ir/lowerDxbcToIr.js +494 -0
- package/dist/formats/webgpu/core/ir/lowerDxbcToIr.js.map +1 -0
- package/dist/formats/webgpu/core/ir/resolveRegisterFlow.js +177 -0
- package/dist/formats/webgpu/core/ir/resolveRegisterFlow.js.map +1 -0
- package/dist/formats/webgpu/core/ir/sourceLanes.js +61 -0
- package/dist/formats/webgpu/core/ir/sourceLanes.js.map +1 -0
- package/dist/formats/webgpu/core/packageEffect.js +300 -0
- package/dist/formats/webgpu/core/packageEffect.js.map +1 -0
- package/dist/formats/webgpu/core/packageEffectSelection.js +164 -0
- package/dist/formats/webgpu/core/packageEffectSelection.js.map +1 -0
- package/dist/formats/webgpu/core/packageMetadata.js +8 -0
- package/dist/formats/webgpu/core/packageMetadata.js.map +1 -0
- package/dist/formats/webgpu/core/schema.js +4 -0
- package/dist/formats/webgpu/core/schema.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +275 -0
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +182 -0
- package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +324 -0
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/emitWgsl.js +356 -0
- package/dist/formats/webgpu/core/wgsl/emitWgsl.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/hoistEscapingValues.js +77 -0
- package/dist/formats/webgpu/core/wgsl/hoistEscapingValues.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerBindingLayout.js +451 -0
- package/dist/formats/webgpu/core/wgsl/lowerBindingLayout.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +754 -0
- package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +457 -0
- package/dist/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerFragmentProgram.js +1572 -0
- package/dist/formats/webgpu/core/wgsl/lowerFragmentProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerMergeHistogramsComputeProgram.js +659 -0
- package/dist/formats/webgpu/core/wgsl/lowerMergeHistogramsComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerParticleClearComputePrograms.js +734 -0
- package/dist/formats/webgpu/core/wgsl/lowerParticleClearComputePrograms.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerParticleEmitComputeProgram.js +583 -0
- package/dist/formats/webgpu/core/wgsl/lowerParticleEmitComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerSkinVerticesComputeProgram.js +621 -0
- package/dist/formats/webgpu/core/wgsl/lowerSkinVerticesComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerSortComputeProgram.js +824 -0
- package/dist/formats/webgpu/core/wgsl/lowerSortComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerSortInnerComputeProgram.js +697 -0
- package/dist/formats/webgpu/core/wgsl/lowerSortInnerComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerSortStepComputeProgram.js +559 -0
- package/dist/formats/webgpu/core/wgsl/lowerSortStepComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerVertexProgram.js +1328 -0
- package/dist/formats/webgpu/core/wgsl/lowerVertexProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/particleEmitSemanticDigest.js +110 -0
- package/dist/formats/webgpu/core/wgsl/particleEmitSemanticDigest.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/precisionControls.js +55 -0
- package/dist/formats/webgpu/core/wgsl/precisionControls.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/selectionPlans.js +758 -0
- package/dist/formats/webgpu/core/wgsl/selectionPlans.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/uniformity.js +78 -0
- package/dist/formats/webgpu/core/wgsl/uniformity.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/validateExactComputeIr.js +196 -0
- package/dist/formats/webgpu/core/wgsl/validateExactComputeIr.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/validateHandleOperand.js +37 -0
- package/dist/formats/webgpu/core/wgsl/validateHandleOperand.js.map +1 -0
- package/dist/formats/webgpu/index.js +2 -0
- package/dist/formats/webgpu/index.js.map +1 -0
- package/dist/formats/webm/core/helpers.js +35 -0
- package/dist/formats/webm/core/helpers.js.map +1 -1
- package/dist/formats/webp/CjsWebpFormat.js +49 -0
- package/dist/formats/webp/CjsWebpFormat.js.map +1 -1
- package/dist/formats/webp/core/helpers.js +23 -0
- package/dist/formats/webp/core/helpers.js.map +1 -1
- package/dist/formats/wem/CjsWemFormat.js +8 -0
- package/dist/formats/wem/CjsWemFormat.js.map +1 -1
- package/dist/formats/wem/core/bitStream.js +2 -0
- package/dist/formats/wem/core/bitStream.js.map +1 -1
- package/dist/formats/wem/core/helpers.js +20 -0
- package/dist/formats/wem/core/helpers.js.map +1 -1
- package/dist/formats/yaml/CjsYamlFormat.js +45 -0
- package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
- package/dist/formats/yaml/core/CjsYamlReader.js +91 -0
- package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -1
- package/dist/formats/yaml/core/helpers.js +10 -0
- package/dist/formats/yaml/core/helpers.js.map +1 -1
- package/dist/index.js +56 -43
- package/dist/index.js.map +1 -1
- package/dist/{CjsResource.js → resource/CjsResource.js} +232 -17
- package/dist/resource/CjsResource.js.map +1 -0
- package/dist/{resources → resource}/Tr2LightProfileRes.js +4 -3
- package/dist/resource/Tr2LightProfileRes.js.map +1 -0
- package/dist/{resources → resource/audio}/AudioGeometryResData.js +1 -1
- package/dist/resource/audio/AudioGeometryResData.js.map +1 -0
- package/dist/resource/audio/CjsAudioBufferRes.js +86 -0
- package/dist/resource/audio/CjsAudioBufferRes.js.map +1 -0
- package/dist/resource/audio/CjsAudioRes.js +213 -0
- package/dist/resource/audio/CjsAudioRes.js.map +1 -0
- package/dist/resource/audio/index.js +4 -0
- package/dist/resource/audio/index.js.map +1 -0
- package/dist/{resources → resource/geometry}/MeshDecalData.js +1 -1
- package/dist/resource/geometry/MeshDecalData.js.map +1 -0
- package/dist/{resources → resource/geometry}/MeshDecalLodData.js +1 -1
- package/dist/resource/geometry/MeshDecalLodData.js.map +1 -0
- package/dist/resource/geometry/TriGeometryRes.js +656 -0
- package/dist/resource/geometry/TriGeometryRes.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResAreaData.js +1 -1
- package/dist/resource/geometry/TriGeometryResAreaData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResJointData.js +1 -1
- package/dist/resource/geometry/TriGeometryResJointData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResLodData.js +1 -1
- package/dist/resource/geometry/TriGeometryResLodData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResMeshData.js +1 -1
- package/dist/resource/geometry/TriGeometryResMeshData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResSkeletonData.js +1 -1
- package/dist/resource/geometry/TriGeometryResSkeletonData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriJointBinding.js +1 -1
- package/dist/resource/geometry/TriJointBinding.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriMorphTargetGeometryConstants.js +1 -1
- package/dist/resource/geometry/TriMorphTargetGeometryConstants.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriRtGeometryConstants.js +1 -1
- package/dist/resource/geometry/TriRtGeometryConstants.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/GStateBindingCallbackData.js +1 -1
- package/dist/resource/geometry/granny/GStateBindingCallbackData.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/Tr2GrannyIntersectionResult.js +1 -1
- package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/Tr2GrannyStateRes.js +6 -5
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/TriGrannyRes.js +6 -5
- package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/enums.js +1 -9
- package/dist/resource/geometry/granny/enums.js.map +1 -0
- package/dist/resource/geometry/granny/index.js +6 -0
- package/dist/resource/geometry/granny/index.js.map +1 -0
- package/dist/resource/geometry/index.js +17 -0
- package/dist/resource/geometry/index.js.map +1 -0
- package/dist/resource/index.js +52 -0
- package/dist/resource/index.js.map +1 -0
- package/dist/resource/resourceBoundary.js +64 -0
- package/dist/resource/resourceBoundary.js.map +1 -0
- package/dist/resource/shader/Tr2EffectRes.js +429 -0
- package/dist/resource/shader/Tr2EffectRes.js.map +1 -0
- package/dist/resource/shader/Tr2MaterialArea.js +34 -0
- package/dist/resource/shader/Tr2MaterialArea.js.map +1 -0
- package/dist/resource/shader/Tr2MaterialMesh.js +30 -0
- package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -0
- package/dist/resource/shader/Tr2MaterialRes.js +35 -0
- package/dist/resource/shader/Tr2MaterialRes.js.map +1 -0
- package/dist/resource/shader/Tr2Shader.js +256 -0
- package/dist/resource/shader/Tr2Shader.js.map +1 -0
- package/dist/resource/shader/Tr2ShaderPermutation.js +47 -0
- package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -0
- package/dist/resource/shader/index.js +17 -0
- package/dist/resource/shader/index.js.map +1 -0
- package/dist/resource/shader/portable.js +33 -0
- package/dist/resource/shader/portable.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectConstant.js +135 -0
- package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectDefine.js +28 -0
- package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectDescription.js +107 -0
- package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js +145 -0
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +103 -0
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectResource.js +84 -0
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js +239 -0
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js +66 -0
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2Pass.js +109 -0
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -0
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js +75 -0
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -0
- package/dist/{texture → resource/texture}/CjsTextureArrayRes.js +83 -6
- package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -0
- package/dist/{texture/CjsTextureParameterProxy.js → resource/texture/CjsTextureArrayResParameterProxy.js} +56 -10
- package/dist/resource/texture/CjsTextureArrayResParameterProxy.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2ImageRes.js +6 -4
- package/dist/resource/texture/Tr2ImageRes.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TextureLodManager.js +3 -1
- package/dist/resource/texture/Tr2TextureLodManager.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TextureLodUpdateRequest.js +1 -1
- package/dist/resource/texture/Tr2TextureLodUpdateRequest.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePackChannel.js +1 -1
- package/dist/resource/texture/Tr2TexturePackChannel.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipeline.js +6 -4
- package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineParams.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineParams.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepCompress.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepGenerateMips.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepLimitSize.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepLoad.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepPack.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -0
- package/dist/{resources → resource/texture}/TriTextureRes.js +42 -26
- package/dist/resource/texture/TriTextureRes.js.map +1 -0
- package/dist/resource/texture/index.js +15 -0
- package/dist/resource/texture/index.js.map +1 -0
- package/dist/{resources → resource/texture}/texturePipelineBehavior.js +59 -59
- package/dist/resource/texture/texturePipelineBehavior.js.map +1 -0
- package/dist/worker/CjsResManMainThreadLoader.js +87 -0
- package/dist/worker/CjsResManMainThreadLoader.js.map +1 -0
- package/dist/worker/CjsResManWorker.js +217 -0
- package/dist/worker/CjsResManWorker.js.map +1 -0
- package/dist/worker/CjsResManWorkerLoader.js +434 -0
- package/dist/worker/CjsResManWorkerLoader.js.map +1 -0
- package/dist/worker/protocol.js +12 -0
- package/dist/worker/protocol.js.map +1 -0
- package/docs/README.md +16 -3
- package/docs/architecture.md +39 -16
- package/docs/concepts/resource-lifecycle.md +2 -1
- package/docs/formats/README.md +8 -0
- package/docs/formats/provenance.md +11 -3
- package/docs/reference/classes/README.md +6 -4
- package/docs/reference/classes/audio.md +30 -0
- package/docs/reference/classes/core.md +31 -11
- package/docs/reference/classes/formats.md +440 -0
- package/docs/reference/classes/resources.md +151 -41
- package/docs/reference/classes/texture.md +7 -7
- package/docs/reference/motherlode-cache.md +17 -0
- package/docs/reference/queues.md +9 -1
- package/docs/reference/workers.md +135 -0
- package/docs/roadmap.md +27 -1
- package/format-notices/dxbc/LICENSE +21 -0
- package/format-notices/dxbc/NOTICE +20 -0
- package/format-notices/hlsl/LICENSE +21 -0
- package/format-notices/hlsl/NOTICE +25 -0
- package/format-notices/webgl/LICENSE +21 -0
- package/format-notices/webgl/NOTICE +35 -0
- package/format-notices/webgpu/LICENSE +21 -0
- package/format-notices/webgpu/NOTICE +31 -0
- package/package.json +13 -1
- package/dist/CjsResManQueue.js.map +0 -1
- package/dist/CjsResource.js.map +0 -1
- package/dist/CjsResourceSource.js +0 -68
- package/dist/CjsResourceSource.js.map +0 -1
- package/dist/resourcePath.js +0 -18
- package/dist/resourcePath.js.map +0 -1
- package/dist/resourceStates.js +0 -9
- package/dist/resourceStates.js.map +0 -1
- package/dist/resources/AudioGeometryResData.js.map +0 -1
- package/dist/resources/GStateBindingCallbackData.js.map +0 -1
- package/dist/resources/MeshDecalData.js.map +0 -1
- package/dist/resources/MeshDecalLodData.js.map +0 -1
- package/dist/resources/Tr2EffectRes.js +0 -71
- package/dist/resources/Tr2EffectRes.js.map +0 -1
- package/dist/resources/Tr2GrannyIntersectionResult.js.map +0 -1
- package/dist/resources/Tr2GrannyStateRes.js.map +0 -1
- package/dist/resources/Tr2ImageRes.js.map +0 -1
- package/dist/resources/Tr2LightProfileRes.js.map +0 -1
- package/dist/resources/Tr2MaterialArea.js +0 -34
- package/dist/resources/Tr2MaterialArea.js.map +0 -1
- package/dist/resources/Tr2MaterialMesh.js +0 -31
- package/dist/resources/Tr2MaterialMesh.js.map +0 -1
- package/dist/resources/Tr2MaterialRes.js +0 -34
- package/dist/resources/Tr2MaterialRes.js.map +0 -1
- package/dist/resources/Tr2ShaderPermutation.js +0 -43
- package/dist/resources/Tr2ShaderPermutation.js.map +0 -1
- package/dist/resources/Tr2TextureLodManager.js.map +0 -1
- package/dist/resources/Tr2TextureLodUpdateRequest.js.map +0 -1
- package/dist/resources/Tr2TexturePackChannel.js.map +0 -1
- package/dist/resources/Tr2TexturePipeline.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineParams.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepCompress.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepGenerateMips.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepLimitSize.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepLoad.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepPack.js.map +0 -1
- package/dist/resources/TriGeometryRes.js +0 -239
- package/dist/resources/TriGeometryRes.js.map +0 -1
- package/dist/resources/TriGeometryResAreaData.js.map +0 -1
- package/dist/resources/TriGeometryResJointData.js.map +0 -1
- package/dist/resources/TriGeometryResLodData.js.map +0 -1
- package/dist/resources/TriGeometryResMeshData.js.map +0 -1
- package/dist/resources/TriGeometryResSkeletonData.js.map +0 -1
- package/dist/resources/TriGrannyRes.js.map +0 -1
- package/dist/resources/TriJointBinding.js.map +0 -1
- package/dist/resources/TriMorphTargetGeometryConstants.js.map +0 -1
- package/dist/resources/TriRtGeometryConstants.js.map +0 -1
- package/dist/resources/TriTextureRes.js.map +0 -1
- package/dist/resources/enums.js.map +0 -1
- package/dist/resources/resourceBoundary.js +0 -47
- package/dist/resources/resourceBoundary.js.map +0 -1
- package/dist/resources/texturePipelineBehavior.js.map +0 -1
- package/dist/texture/CjsTextureArrayRes.js.map +0 -1
- package/dist/texture/CjsTextureParameterProxy.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceBoundary.js","sources":["../../../src/resource/resourceBoundary.js"],"sourcesContent":["/**\n * Creates a coded error at a public resource API boundary for the resource\n * payload lifecycle.\n */\nexport function resourceBoundaryError(className, methodName, reason) {\n const error = new Error(`${className}.${methodName} is owned by engine adapters in CarbonEngineJS. ${reason || \"\"}`.trim());\n error.code = \"CJS_RESOURCE_ENGINE_BOUNDARY\";\n error.className = className;\n error.methodName = methodName;\n return error;\n}\n\n/**\n * Creates a coded error for an invalid resource payload for the resource payload\n * lifecycle.\n */\nexport function resourcePayloadError(className, reason, field = \"\", cause = null) {\n const location = field ? `${className} payload.${field}` : `${className} payload`;\n const error = new TypeError(`${location} is invalid. ${reason || \"\"}`.trim());\n error.code = \"CJS_RESOURCE_PAYLOAD_INVALID\";\n error.className = className;\n error.field = field;\n if (cause) error.cause = cause;\n return error;\n}\n\n/**\n * Validates that a resource payload is a plain object for the resource payload\n * lifecycle.\n */\nexport function assertResourcePayloadObject(className, payload) {\n if (!payload || typeof payload !== \"object\" || Array.isArray(payload)\n || payload instanceof ArrayBuffer || ArrayBuffer.isView(payload)) {\n throw resourcePayloadError(className, \"Expected a plain payload object.\");\n }\n return payload;\n}\n\n/**\n * Validates that a resource payload field is an array for the resource payload\n * lifecycle.\n */\nexport function assertResourcePayloadArray(className, payload, field) {\n if (!Array.isArray(payload[field])) {\n throw resourcePayloadError(className, \"Expected an array.\", field);\n }\n return payload[field];\n}\n\n/**\n * Validates a resource payload against the supplied field contract for the\n * resource payload lifecycle.\n */\nexport function validateResourcePayload(className, payload, validator) {\n assertResourcePayloadObject(className, payload);\n try {\n return validator(payload);\n } catch (cause) {\n if (cause?.code === \"CJS_RESOURCE_PAYLOAD_INVALID\") throw cause;\n throw resourcePayloadError(className, cause?.message || \"Validation failed.\", \"\", cause);\n }\n}\n"],"names":["resourceBoundaryError","className","methodName","reason","error","Error","trim","code","resourcePayloadError","field","cause","location","TypeError","assertResourcePayloadObject","payload","Array","isArray","ArrayBuffer","isView","assertResourcePayloadArray","validateResourcePayload","validator","message"],"mappings":"AAAA;AACA;AACA;AACA;AACO,SAASA,qBAAqBA,CAACC,SAAS,EAAEC,UAAU,EAAEC,MAAM,EAAE;AACnE,EAAA,MAAMC,KAAK,GAAG,IAAIC,KAAK,CAAC,CAAA,EAAGJ,SAAS,CAAA,CAAA,EAAIC,UAAU,CAAA,gDAAA,EAAmDC,MAAM,IAAI,EAAE,CAAA,CAAE,CAACG,IAAI,EAAE,CAAC;EAC3HF,KAAK,CAACG,IAAI,GAAG,8BAA8B;EAC3CH,K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AAC,CAAC,EAAE;AAClC,IAAA,MAAMD,oBAAoB,CAACP,SAAS,EAAE,oBAAoB,EAAEQ,KAAK,CAAC;AACpE,EAAA;EACA,OAAOK,OAAO,CAACL,KAAK,CAAC;AACvB;;AAEA;AACA;AACA;AACA;AACO,SAASW,uBAAuBA,CAACnB,SAAS,EAAEa,OAAO,EAAEO,SAAS,EAAE;AACrER,EAAAA,2BAA2B,CAACZ,SAAS,EAAEa,OAAO,CAAC;EAC/C,IAAI;IACF,OAAOO,SAAS,CAACP,OAAO,CAAC;EAC3B,CAAC,CAAC,OAAOJ,KAAK,EAAE;AACd,IAAA,IAAIA,KAAK,EAAEH,IAAI,KAAK,8BAA8B,EAAE,MAAMG,KAAK;AAC/D,IAAA,MAAMF,oBAAoB,CAACP,SAAS,EAAES,KAAK,EAAEY,OAAO,IAAI,oBAAoB,EAAE,EAAE,EAAEZ,KAAK,CAAC;AAC1F,EAAA;AACF;;;;"}
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import { CjsSchema, carbon, impl } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
+
import { CjsResource as _CjsResource } from '../CjsResource.js';
|
|
3
|
+
import { validateResourcePayload } from '../resourceBoundary.js';
|
|
4
|
+
import { Tr2Shader } from './Tr2Shader.js';
|
|
5
|
+
|
|
6
|
+
// Source: trinity/trinity/Resources/Tr2EffectRes.h
|
|
7
|
+
// Source: trinity/trinity/Resources/Tr2EffectRes.cpp
|
|
8
|
+
// Source: trinity/trinity/Resources/Tr2EffectRes_Blue.cpp
|
|
9
|
+
const globalEffectOptions = [];
|
|
10
|
+
const SHA256 = /^[0-9a-f]{64}$/u;
|
|
11
|
+
const UINT8_MAX = 0xff;
|
|
12
|
+
const UINT32_MAX = 0xffffffff;
|
|
13
|
+
const MAX_EFFECT_PERMUTATIONS = 0x10000;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Tr2EffectRes resource record.
|
|
17
|
+
*
|
|
18
|
+
* This stores effect/shader payload facts. Engine-gpu decides shader module,
|
|
19
|
+
* pipeline, bind group, and sampler realization.
|
|
20
|
+
*/
|
|
21
|
+
class Tr2EffectRes extends _CjsResource {
|
|
22
|
+
#shaders = new Map();
|
|
23
|
+
|
|
24
|
+
/** Creates a Tr2EffectRes with caller-provided initial state. */
|
|
25
|
+
constructor(values = null) {
|
|
26
|
+
super();
|
|
27
|
+
this.SetValues(values || {}, {
|
|
28
|
+
markDirty: false,
|
|
29
|
+
skipUpdate: true,
|
|
30
|
+
skipEvents: true
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Attach a plain shader/effect payload.
|
|
36
|
+
*
|
|
37
|
+
* @param {object|null} payload
|
|
38
|
+
* @param {object|null} options
|
|
39
|
+
* @returns {Tr2EffectRes}
|
|
40
|
+
*/
|
|
41
|
+
SetPayload(payload = null, options = null) {
|
|
42
|
+
if (payload === null) {
|
|
43
|
+
this.#shaders.clear();
|
|
44
|
+
super.SetPayload(null);
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
validateResourcePayload("Tr2EffectRes", payload, validateEffectPayload);
|
|
48
|
+
this.#shaders.clear();
|
|
49
|
+
super.SetPayload(payload);
|
|
50
|
+
this.SetValues(options || {});
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Select and hydrate one canonical shader from the complete permutation
|
|
56
|
+
* graph exposed by a CEWG/CEWGPU raw package.
|
|
57
|
+
*
|
|
58
|
+
* Global options have Carbon-compatible precedence over caller options.
|
|
59
|
+
* Unknown option values retain the authored default.
|
|
60
|
+
*
|
|
61
|
+
* @param {Array<object>|Map<string,string>} options Local name/value choices.
|
|
62
|
+
* @param {number|null} count Number of local entries to consider.
|
|
63
|
+
* @returns {Tr2Shader|null} Selected device-free shader reflection.
|
|
64
|
+
*/
|
|
65
|
+
GetShader(options = [], count = null) {
|
|
66
|
+
const axes = getPermutationAxes(this.GetPayload());
|
|
67
|
+
if (!axes.length) {
|
|
68
|
+
const portableIndex = Tr2Shader.isPortableReflection(this.GetPayload()) ? this.GetPayload().permutationIndex : 0;
|
|
69
|
+
return this.GetShaderByIndex(portableIndex);
|
|
70
|
+
}
|
|
71
|
+
const localOptions = normalizeShaderOptions(options);
|
|
72
|
+
const localCount = Number.isSafeInteger(count) ? Math.max(0, Math.min(count, localOptions.length)) : localOptions.length;
|
|
73
|
+
let multiplier = 1;
|
|
74
|
+
let index = 0;
|
|
75
|
+
for (const axis of axes) {
|
|
76
|
+
let selectedIndex = axis.defaultOption;
|
|
77
|
+
const globalOption = globalEffectOptions.find(option => option.name === axis.name);
|
|
78
|
+
if (globalOption) {
|
|
79
|
+
const requestedIndex = axis.options.indexOf(globalOption.value);
|
|
80
|
+
if (requestedIndex >= 0) {
|
|
81
|
+
selectedIndex = requestedIndex;
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
for (let optionIndex = 0; optionIndex < localCount; optionIndex += 1) {
|
|
85
|
+
const localOption = localOptions[optionIndex];
|
|
86
|
+
if (localOption.name !== axis.name) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const requestedIndex = axis.options.indexOf(localOption.value);
|
|
90
|
+
if (requestedIndex >= 0) {
|
|
91
|
+
selectedIndex = requestedIndex;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
index += selectedIndex * multiplier;
|
|
96
|
+
multiplier *= axis.options.length;
|
|
97
|
+
}
|
|
98
|
+
return this.GetShaderByIndex(index);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Hydrate one exact permutation-table index and cache the resulting runtime
|
|
103
|
+
* graph for this payload.
|
|
104
|
+
*
|
|
105
|
+
* @param {number} index Exact permutation index.
|
|
106
|
+
* @returns {Tr2Shader|null} Canonical shader or null when reflection is absent.
|
|
107
|
+
*/
|
|
108
|
+
GetShaderByIndex(index) {
|
|
109
|
+
if (!Number.isSafeInteger(index) || index < 0) {
|
|
110
|
+
throw new TypeError("Tr2EffectRes shader index must be a non-negative safe integer");
|
|
111
|
+
}
|
|
112
|
+
if (this.#shaders.has(index)) {
|
|
113
|
+
return this.#shaders.get(index);
|
|
114
|
+
}
|
|
115
|
+
const payload = this.GetPayload();
|
|
116
|
+
const variantCount = getPermutationVariantCount(payload);
|
|
117
|
+
if (variantCount !== null && index >= variantCount) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
const portable = getPortableReflection(payload, index);
|
|
121
|
+
if (!portable) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
if (portable.permutationIndex !== index) {
|
|
125
|
+
throw new Error(`Portable effect reflection index ${portable.permutationIndex} does not match requested index ${index}`);
|
|
126
|
+
}
|
|
127
|
+
const shader = Tr2Shader.fromPortable(portable);
|
|
128
|
+
this.#shaders.set(index, shader);
|
|
129
|
+
return shader;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Return a small JSON-friendly permutation description.
|
|
134
|
+
*
|
|
135
|
+
* @returns {Array<*>}
|
|
136
|
+
*/
|
|
137
|
+
GetPermutationDescription() {
|
|
138
|
+
const payload = this.GetPayload();
|
|
139
|
+
const axes = getPermutationAxes(payload);
|
|
140
|
+
if (!axes.length && Array.isArray(payload?.permutations)) {
|
|
141
|
+
return payload.permutations.map(permutation => ({
|
|
142
|
+
...permutation
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
return axes.map(axis => ({
|
|
146
|
+
name: axis.name,
|
|
147
|
+
options: [...axis.options],
|
|
148
|
+
defaultOption: axis.defaultOption,
|
|
149
|
+
description: axis.description,
|
|
150
|
+
type: axis.type
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Drop hydrated shader graphs while retaining the validated CPU payload.
|
|
156
|
+
*/
|
|
157
|
+
ReleaseResources() {
|
|
158
|
+
this.#shaders.clear();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** Release the payload and every shader graph hydrated from it. */
|
|
162
|
+
ReleasePayload() {
|
|
163
|
+
this.#shaders.clear();
|
|
164
|
+
return super.ReleasePayload();
|
|
165
|
+
}
|
|
166
|
+
static payload = "shader";
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Merge Carbon-style global effect option overrides.
|
|
171
|
+
*
|
|
172
|
+
* An empty value removes the override. Existing Tr2EffectRes shader caches
|
|
173
|
+
* remain valid objects; callers rebuild effects to request the new selection.
|
|
174
|
+
*
|
|
175
|
+
* @param {Array<object>|Map<string,string>} changes Option changes.
|
|
176
|
+
*/
|
|
177
|
+
function ModifyGlobalEffectOptions(changes = []) {
|
|
178
|
+
for (const change of normalizeShaderOptions(changes)) {
|
|
179
|
+
const index = globalEffectOptions.findIndex(option => option.name === change.name);
|
|
180
|
+
if (!change.value) {
|
|
181
|
+
if (index >= 0) {
|
|
182
|
+
globalEffectOptions.splice(index, 1);
|
|
183
|
+
}
|
|
184
|
+
} else if (index >= 0) {
|
|
185
|
+
globalEffectOptions[index] = change;
|
|
186
|
+
} else {
|
|
187
|
+
globalEffectOptions.push(change);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Return an owned snapshot of the current global option overrides.
|
|
194
|
+
*
|
|
195
|
+
* @returns {Array<{name:string,value:string}>} Global option choices.
|
|
196
|
+
*/
|
|
197
|
+
function GetGlobalEffectOptions() {
|
|
198
|
+
return globalEffectOptions.map(option => ({
|
|
199
|
+
...option
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
202
|
+
function validateEffectPayload(payload) {
|
|
203
|
+
const graph = payload.permutationGraph;
|
|
204
|
+
if (graph !== null && graph !== undefined) {
|
|
205
|
+
validatePermutationGraph(graph);
|
|
206
|
+
} else if (Array.isArray(payload.permutations)) {
|
|
207
|
+
if (payload.permutations.every(permutation => Array.isArray(permutation?.options))) {
|
|
208
|
+
payload.permutations.forEach(normalizePermutationAxis);
|
|
209
|
+
} else {
|
|
210
|
+
validateLegacyPermutationDescription(payload.permutations);
|
|
211
|
+
}
|
|
212
|
+
} else if (!Tr2Shader.isPortableReflection(payload)) {
|
|
213
|
+
throw new TypeError("Tr2EffectRes payload requires a complete permutation graph, permutations array, or one portable reflection");
|
|
214
|
+
}
|
|
215
|
+
if (Array.isArray(payload.portableReflections)) {
|
|
216
|
+
const expectedCount = getPermutationVariantCount(payload);
|
|
217
|
+
if (expectedCount !== null && payload.portableReflections.length !== expectedCount) {
|
|
218
|
+
throw new Error("Tr2EffectRes portable reflection count disagrees with its permutations");
|
|
219
|
+
}
|
|
220
|
+
payload.portableReflections.forEach((reflection, index) => {
|
|
221
|
+
if (!Tr2Shader.isPortableReflection(reflection) || reflection.permutationIndex !== index) {
|
|
222
|
+
throw new Error(`Tr2EffectRes portable reflection ${index} is malformed`);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function validateLegacyPermutationDescription(permutations) {
|
|
228
|
+
for (const [index, permutation] of permutations.entries()) {
|
|
229
|
+
if (!permutation || typeof permutation !== "object" || Array.isArray(permutation) || typeof permutation.name !== "string" || !permutation.name) {
|
|
230
|
+
throw new TypeError(`Tr2EffectRes legacy permutation ${index} is malformed`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function validatePermutationGraph(graph) {
|
|
235
|
+
if (!graph || typeof graph !== "object" || Array.isArray(graph) || graph.format !== "CJS_EFFECT_PERMUTATION_GRAPH" || graph.formatVersion !== 1 || !graph.coverage || typeof graph.coverage !== "object" || Array.isArray(graph.coverage) || graph.coverage.permutations !== "complete" || graph.coverage.bodies !== "identity-only" || graph.coverage.reflection !== "absent" || !Array.isArray(graph.axes) || !Array.isArray(graph.variants) || !Array.isArray(graph.bodies)) {
|
|
236
|
+
throw new TypeError("Tr2EffectRes requires CJS_EFFECT_PERMUTATION_GRAPH version 1");
|
|
237
|
+
}
|
|
238
|
+
const axisNames = new Set();
|
|
239
|
+
const axes = graph.axes.map((axis, index) => validatePermutationAxis(axis, index, axisNames));
|
|
240
|
+
const expectedCount = getPermutationProduct(axes);
|
|
241
|
+
if (graph.variants.length !== expectedCount || !graph.bodies.length || graph.bodies.length > graph.variants.length) {
|
|
242
|
+
throw new Error("Tr2EffectRes permutation graph requires complete variants and bodies");
|
|
243
|
+
}
|
|
244
|
+
const bodies = new Map();
|
|
245
|
+
const bodyDigests = new Set();
|
|
246
|
+
graph.bodies.forEach((body, bodyIndex) => {
|
|
247
|
+
if (!body || typeof body !== "object" || Array.isArray(body) || typeof body.key !== "string" || !body.key || body.key !== body.key.trim() || !Number.isSafeInteger(body.byteLength) || body.byteLength < 1 || body.byteLength > UINT32_MAX || typeof body.sha256 !== "string" || !SHA256.test(body.sha256) || bodies.has(body.key) || bodyDigests.has(body.sha256)) {
|
|
248
|
+
throw new Error(`Tr2EffectRes permutation body ${bodyIndex} is malformed or duplicated`);
|
|
249
|
+
}
|
|
250
|
+
bodyDigests.add(body.sha256);
|
|
251
|
+
bodies.set(body.key, {
|
|
252
|
+
byteLength: body.byteLength,
|
|
253
|
+
references: 0
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
const bodyKeyBySourceRecord = new Map();
|
|
257
|
+
const sourceRecords = [];
|
|
258
|
+
graph.variants.forEach((variant, permutationIndex) => {
|
|
259
|
+
const expectedOptions = decodePermutationOptions(permutationIndex, axes);
|
|
260
|
+
if (!variant || typeof variant !== "object" || Array.isArray(variant) || variant.permutationIndex !== permutationIndex || !Array.isArray(variant.optionIndices) || variant.optionIndices.length !== expectedOptions.length || variant.optionIndices.some((value, index) => value !== expectedOptions[index]) || typeof variant.bodyKey !== "string" || !bodies.has(variant.bodyKey)) {
|
|
261
|
+
throw new Error(`Tr2EffectRes permutation variant ${permutationIndex} is malformed`);
|
|
262
|
+
}
|
|
263
|
+
const sourceRecord = validatePermutationSourceRecord(variant.sourceRecord, permutationIndex);
|
|
264
|
+
const body = bodies.get(variant.bodyKey);
|
|
265
|
+
if (sourceRecord.byteLength !== body.byteLength) {
|
|
266
|
+
throw new Error(`Tr2EffectRes permutation variant ${permutationIndex} body length disagrees`);
|
|
267
|
+
}
|
|
268
|
+
const recordKey = `${sourceRecord.offset}:${sourceRecord.byteLength}`;
|
|
269
|
+
const existingBodyKey = bodyKeyBySourceRecord.get(recordKey);
|
|
270
|
+
if (existingBodyKey && existingBodyKey !== variant.bodyKey) {
|
|
271
|
+
throw new Error(`Tr2EffectRes source record ${recordKey} maps to multiple bodies`);
|
|
272
|
+
}
|
|
273
|
+
bodyKeyBySourceRecord.set(recordKey, variant.bodyKey);
|
|
274
|
+
sourceRecords.push(sourceRecord);
|
|
275
|
+
body.references += 1;
|
|
276
|
+
});
|
|
277
|
+
validateDisjointPermutationRecords(sourceRecords);
|
|
278
|
+
for (const [bodyKey, body] of bodies) {
|
|
279
|
+
if (!body.references) {
|
|
280
|
+
throw new Error(`Tr2EffectRes permutation body ${bodyKey} is unreferenced`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
function validatePermutationAxis(axis, index, names) {
|
|
285
|
+
if (!axis || typeof axis !== "object" || Array.isArray(axis) || axis.index !== index || typeof axis.name !== "string" || !axis.name || axis.name !== axis.name.trim() || names.has(axis.name) || !Array.isArray(axis.options) || !axis.options.length || axis.options.length > UINT8_MAX || !Number.isSafeInteger(axis.defaultOption) || axis.defaultOption < 0 || axis.defaultOption >= axis.options.length || typeof axis.description !== "string" || !Number.isSafeInteger(axis.type) || axis.type < 0 || axis.type > UINT8_MAX) {
|
|
286
|
+
throw new Error(`Tr2EffectRes permutation axis ${index} is malformed or duplicated`);
|
|
287
|
+
}
|
|
288
|
+
names.add(axis.name);
|
|
289
|
+
const options = new Set();
|
|
290
|
+
for (const option of axis.options) {
|
|
291
|
+
if (typeof option !== "string" || !option || option !== option.trim() || options.has(option)) {
|
|
292
|
+
throw new Error(`Tr2EffectRes permutation axis ${index} options are malformed`);
|
|
293
|
+
}
|
|
294
|
+
options.add(option);
|
|
295
|
+
}
|
|
296
|
+
return normalizePermutationAxis(axis);
|
|
297
|
+
}
|
|
298
|
+
function getPermutationProduct(axes) {
|
|
299
|
+
let product = 1;
|
|
300
|
+
for (const axis of axes) {
|
|
301
|
+
product *= axis.options.length;
|
|
302
|
+
if (!Number.isSafeInteger(product) || product < 1 || product > MAX_EFFECT_PERMUTATIONS) {
|
|
303
|
+
throw new Error("Tr2EffectRes permutation count exceeds the implementation limit");
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return product;
|
|
307
|
+
}
|
|
308
|
+
function decodePermutationOptions(permutationIndex, axes) {
|
|
309
|
+
let value = permutationIndex;
|
|
310
|
+
return axes.map(axis => {
|
|
311
|
+
const optionIndex = value % axis.options.length;
|
|
312
|
+
value = Math.floor(value / axis.options.length);
|
|
313
|
+
return optionIndex;
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
function validatePermutationSourceRecord(record, permutationIndex) {
|
|
317
|
+
const offset = record?.offset;
|
|
318
|
+
const byteLength = record?.byteLength;
|
|
319
|
+
const end = offset + byteLength;
|
|
320
|
+
if (!record || typeof record !== "object" || Array.isArray(record) || !Number.isSafeInteger(offset) || offset < 0 || offset > UINT32_MAX || !Number.isSafeInteger(byteLength) || byteLength < 1 || byteLength > UINT32_MAX || !Number.isSafeInteger(end) || end > UINT32_MAX + 1) {
|
|
321
|
+
throw new Error(`Tr2EffectRes permutation variant ${permutationIndex} source record is malformed`);
|
|
322
|
+
}
|
|
323
|
+
return {
|
|
324
|
+
offset,
|
|
325
|
+
byteLength
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
function validateDisjointPermutationRecords(records) {
|
|
329
|
+
const unique = new Map();
|
|
330
|
+
for (const record of records) {
|
|
331
|
+
const key = `${record.offset}:${record.byteLength}`;
|
|
332
|
+
if (!unique.has(key)) {
|
|
333
|
+
unique.set(key, {
|
|
334
|
+
offset: record.offset,
|
|
335
|
+
end: record.offset + record.byteLength
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
const ordered = Array.from(unique.values()).sort((left, right) => left.offset - right.offset || left.end - right.end);
|
|
340
|
+
for (let index = 1; index < ordered.length; index += 1) {
|
|
341
|
+
if (ordered[index].offset < ordered[index - 1].end) {
|
|
342
|
+
throw new Error("Tr2EffectRes permutation source body records partially overlap");
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
function getPermutationAxes(payload) {
|
|
347
|
+
if (!payload) {
|
|
348
|
+
return [];
|
|
349
|
+
}
|
|
350
|
+
if (payload.permutationGraph) {
|
|
351
|
+
return payload.permutationGraph.axes.map(normalizePermutationAxis);
|
|
352
|
+
}
|
|
353
|
+
if (Array.isArray(payload.permutations) && payload.permutations.every(permutation => Array.isArray(permutation?.options))) {
|
|
354
|
+
return payload.permutations.map(normalizePermutationAxis);
|
|
355
|
+
}
|
|
356
|
+
return [];
|
|
357
|
+
}
|
|
358
|
+
function normalizePermutationAxis(axis) {
|
|
359
|
+
if (!axis || typeof axis !== "object" || Array.isArray(axis) || typeof axis.name !== "string" || !axis.name || !Array.isArray(axis.options) || !axis.options.length || axis.options.some(option => typeof option !== "string" || !option) || !Number.isSafeInteger(axis.defaultOption) || axis.defaultOption < 0 || axis.defaultOption >= axis.options.length) {
|
|
360
|
+
throw new TypeError("Tr2EffectRes permutation axis is malformed");
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
name: axis.name,
|
|
364
|
+
options: [...axis.options],
|
|
365
|
+
defaultOption: axis.defaultOption,
|
|
366
|
+
description: String(axis.description ?? ""),
|
|
367
|
+
type: Number(axis.type ?? 0)
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
function getPermutationVariantCount(payload) {
|
|
371
|
+
if (Array.isArray(payload?.permutationGraph?.variants)) {
|
|
372
|
+
return payload.permutationGraph.variants.length;
|
|
373
|
+
}
|
|
374
|
+
const axes = getPermutationAxes(payload);
|
|
375
|
+
if (axes.length) {
|
|
376
|
+
return axes.reduce((count, axis) => count * axis.options.length, 1);
|
|
377
|
+
}
|
|
378
|
+
return null;
|
|
379
|
+
}
|
|
380
|
+
function getPortableReflection(payload, index) {
|
|
381
|
+
if (!payload) {
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
if (typeof payload.GetPortableEffectReflection === "function") {
|
|
385
|
+
return payload.GetPortableEffectReflection(index);
|
|
386
|
+
}
|
|
387
|
+
if (typeof payload.getPortableEffectReflection === "function") {
|
|
388
|
+
return payload.getPortableEffectReflection(index);
|
|
389
|
+
}
|
|
390
|
+
if (Tr2Shader.isPortableReflection(payload)) {
|
|
391
|
+
return index === payload.permutationIndex ? payload : null;
|
|
392
|
+
}
|
|
393
|
+
if (Array.isArray(payload.portableReflections)) {
|
|
394
|
+
return payload.portableReflections[index] ?? null;
|
|
395
|
+
}
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
function normalizeShaderOptions(options) {
|
|
399
|
+
if (options instanceof Map) {
|
|
400
|
+
return Array.from(options, ([name, value]) => ({
|
|
401
|
+
name: String(name),
|
|
402
|
+
value: String(value)
|
|
403
|
+
}));
|
|
404
|
+
}
|
|
405
|
+
if (!Array.isArray(options)) {
|
|
406
|
+
return [];
|
|
407
|
+
}
|
|
408
|
+
return options.map(option => ({
|
|
409
|
+
name: String(option?.name ?? ""),
|
|
410
|
+
value: String(option?.value ?? "")
|
|
411
|
+
}));
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Declared imperatively rather than with decorators, so this module stays
|
|
415
|
+
// plain ESM that loads from source without a transform. The decorator
|
|
416
|
+
// expressions are reused verbatim, so the registered metadata is identical.
|
|
417
|
+
// Statics belong in `methods`: decorateMethod targets the prototype and
|
|
418
|
+
// would register a static as an instance field.
|
|
419
|
+
CjsSchema.define(Tr2EffectRes, {
|
|
420
|
+
className: "Tr2EffectRes",
|
|
421
|
+
family: "resources"
|
|
422
|
+
});
|
|
423
|
+
CjsSchema.decorateMethod(Tr2EffectRes, "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."));
|
|
424
|
+
CjsSchema.decorateMethod(Tr2EffectRes, "GetShaderByIndex", impl.custom, impl.reason("Carbon selects compiled bodies through GetShader; CarbonEngineJS exposes exact package-index hydration for deterministic package consumers and tests."));
|
|
425
|
+
CjsSchema.decorateMethod(Tr2EffectRes, "GetPermutationDescription", carbon.method, impl.adapted, impl.reason("Carbon exposes a Python tuple through Blue; CarbonEngineJS returns a JSON-friendly plain axis description."));
|
|
426
|
+
CjsSchema.decorateMethod(Tr2EffectRes, "ReleaseResources", carbon.method, impl.adapted, impl.reason("Backend resources are engine-owned; the resource-side release clears only hydrated device-free shader graphs."));
|
|
427
|
+
|
|
428
|
+
export { GetGlobalEffectOptions, ModifyGlobalEffectOptions, Tr2EffectRes };
|
|
429
|
+
//# sourceMappingURL=Tr2EffectRes.js.map
|
|
@@ -0,0 +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});\nCjsSchema.decorateMethod(Tr2EffectRes, \"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.\"));\nCjsSchema.decorateMethod(Tr2EffectRes, \"GetShaderByIndex\", impl.custom, impl.reason(\"Carbon selects compiled bodies through GetShader; CarbonEngineJS exposes exact package-index hydration for deterministic package consumers and tests.\"));\nCjsSchema.decorateMethod(Tr2EffectRes, \"GetPermutationDescription\", carbon.method, impl.adapted, impl.reason(\"Carbon exposes a Python tuple through Blue; CarbonEngineJS returns a JSON-friendly plain axis description.\"));\nCjsSchema.decorateMethod(Tr2EffectRes, \"ReleaseResources\", carbon.method, impl.adapted, impl.reason(\"Backend resources are engine-owned; the resource-side release clears only hydrated device-free shader graphs.\"));\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","decorateMethod","carbon","method","impl","adapted","reason","custom"],"mappings":";;;;;AAAA;AACA;AACA;AAMA,MAAMA,mBAAmB,GAAG,EAAE;AAC9B,MAAMC,MAAM,GAAG,iBAAiB;AAChC,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,UAAU,GAAG,UAAU;AAC7B,MAAMC,uBAAuB,GAAG,OAAO;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,SAASC,YAAW,CAC7C;AAEE,EAAA,QAAQ,GAAG,IAAIC,GAAG,EAAE;;AAEpB;AACAC,EAAAA,WAAWA,CAACC,MAAM,GAAG,IAAI,EACzB;AACE,IAAA,KAAK,EAAE;AACP,IAAA,IAAI,CAACC,SAAS,CAACD,MAAM,IAAI,EAAE,EAAE;AAC3BE,MAAAA,SAAS,EAAE,KAAK;AAChBC,MAAAA,UAAU,EAAE,IAAI;AAChBC,MAAAA,UAAU,EAAE;AACd,KAAC,CAAC;AACJ,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,UAAUA,CAACC,OAAO,GAAG,IAAI,EAAEC,OAAO,GAAG,IAAI,EACzC;IACE,IAAID,OAAO,KAAK,IAAI,EACpB;AACE,MAAA,IAAI,CAAC,QAAQ,CAACE,KAAK,EAAE;AACrB,MAAA,KAAK,CAACH,UAAU,CAAC,IAAI,CAAC;AACtB,MAAA,OAAO,IAAI;AACb,IAAA;AACAI,IAAAA,uBAAuB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/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
|
+
/**
|
|
8
|
+
* Associates one material-area metatype with its persisted parameter store.
|
|
9
|
+
*
|
|
10
|
+
* The record describes resource data and does not own shader bindings or
|
|
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
|
+
});
|
|
30
|
+
CjsSchema.decorateField(Tr2MaterialArea, "material", io.persist, type.objectRef("Tr2MaterialParameterStore"));
|
|
31
|
+
CjsSchema.decorateField(Tr2MaterialArea, "metatype", io.persist, type.string);
|
|
32
|
+
|
|
33
|
+
export { Tr2MaterialArea };
|
|
34
|
+
//# sourceMappingURL=Tr2MaterialArea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tr2MaterialArea.js","sources":["../../../../src/resource/shader/Tr2MaterialArea.js"],"sourcesContent":["// Source: trinity/trinity/Resources/Tr2MaterialRes.h\r\n// Schema: format-carbon resources/Tr2MaterialArea.json; maintained by runtime-resource.\r\nimport { CjsSchema, io, type } from \"@carbonenginejs/runtime-utils/schema\";\r\nimport { CjsModel } from \"@carbonenginejs/runtime-utils/model\";\r\n\r\n/**\r\n * Associates one material-area metatype with its persisted parameter store.\r\n *\r\n * The record describes resource data and does not own shader bindings or\r\n * backend material realization.\r\n */\r\nexport class Tr2MaterialArea extends CjsModel\r\n{\r\n\r\n /** Persisted material parameter-store reference. */\r\n material = null;\r\n\r\n /** Authored material-area metatype. */\r\n metatype = \"\";\r\n\r\n}\r\n\r\n// Declared imperatively rather than with decorators, so this module stays\r\n// plain ESM that loads from source without a transform. The decorator\r\n// expressions are reused verbatim, so the registered metadata is identical.\r\n// Statics belong in `methods`: decorateMethod targets the prototype and\r\n// would register a static as an instance field.\r\nCjsSchema.define(Tr2MaterialArea, {\r\n className: \"Tr2MaterialArea\",\r\n family: \"resources\"\r\n});\r\nCjsSchema.decorateField(Tr2MaterialArea, \"material\", io.persist, type.objectRef(\"Tr2MaterialParameterStore\"));\r\nCjsSchema.decorateField(Tr2MaterialArea, \"metatype\", io.persist, type.string);\r\n"],"names":["Tr2MaterialArea","CjsModel","material","metatype","CjsSchema","define","className","family","decorateField","io","persist","type","objectRef","string"],"mappings":";;;AAAA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,eAAe,SAASC,QAAQ,CAC7C;AAEE;AACAC,EAAAA,QAAQ,GAAG,IAAI;;AAEf;AACAC,EAAAA,QAAQ,GAAG,EAAE;AAEf;;AAEA;AACA;AACA;AACA;AACA;AACAC,SAAS,CAACC,MAAM,CAACL,eAAe,EAAE;AAChCM,EAAAA,SAAS,EAAE,iBAAiB;AAC5BC,EAAAA,MAAM,EAAE;AACV,CAAC,CAAC;AACFH,SAAS,CAACI,aAAa,CAACR,eAAe,EAAE,UAAU,EAAES,EAAE,CAACC,OAAO,EAAEC,IAAI,CAACC,SAAS,CAAC,2BAA2B,CAAC,CAAC;AAC7GR,SAAS,CAACI,aAAa,CAACR,eAAe,EAAE,UAAU,EAAES,EAAE,CAACC,OAAO,EAAEC,IAAI,CAACE,MAAM,CAAC;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* Holds the persisted material-area dictionary for one material mesh.
|
|
9
|
+
*
|
|
10
|
+
* Area lookup remains resource metadata; engines decide how the selected
|
|
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
|
+
});
|
|
27
|
+
CjsSchema.decorateField(Tr2MaterialMesh, "areas", io.persist, type.objectRef("Tr2MaterialAreaDict"));
|
|
28
|
+
|
|
29
|
+
export { Tr2MaterialMesh };
|
|
30
|
+
//# sourceMappingURL=Tr2MaterialMesh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tr2MaterialMesh.js","sources":["../../../../src/resource/shader/Tr2MaterialMesh.js"],"sourcesContent":["// Source: trinity/trinity/Resources/Tr2MaterialRes.h\r\n// Schema: format-carbon resources/Tr2MaterialMesh.json; maintained by runtime-resource.\r\nimport { CjsSchema, io, type } from \"@carbonenginejs/runtime-utils/schema\";\r\nimport { CjsModel } from \"@carbonenginejs/runtime-utils/model\";\r\n\r\n/**\r\n * Holds the persisted material-area dictionary for one material mesh.\r\n *\r\n * Area lookup remains resource metadata; engines decide how the selected\r\n * material becomes backend draw state.\r\n */\r\nexport class Tr2MaterialMesh extends CjsModel\r\n{\r\n\r\n /** Persisted dictionary of material areas. */\r\n areas = null;\r\n\r\n}\r\n\r\n// Declared imperatively rather than with decorators, so this module stays\r\n// plain ESM that loads from source without a transform. The decorator\r\n// expressions are reused verbatim, so the registered metadata is identical.\r\n// Statics belong in `methods`: decorateMethod targets the prototype and\r\n// would register a static as an instance field.\r\nCjsSchema.define(Tr2MaterialMesh, {\r\n className: \"Tr2MaterialMesh\",\r\n family: \"resources\"\r\n});\r\nCjsSchema.decorateField(Tr2MaterialMesh, \"areas\", io.persist, type.objectRef(\"Tr2MaterialAreaDict\"));\r\n"],"names":["Tr2MaterialMesh","CjsModel","areas","CjsSchema","define","className","family","decorateField","io","persist","type","objectRef"],"mappings":";;;AAAA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,eAAe,SAASC,QAAQ,CAC7C;AAEE;AACAC,EAAAA,KAAK,GAAG,IAAI;AAEd;;AAEA;AACA;AACA;AACA;AACA;AACAC,SAAS,CAACC,MAAM,CAACJ,eAAe,EAAE;AAChCK,EAAAA,SAAS,EAAE,iBAAiB;AAC5BC,EAAAA,MAAM,EAAE;AACV,CAAC,CAAC;AACFH,SAAS,CAACI,aAAa,CAACP,eAAe,EAAE,OAAO,EAAEQ,EAAE,CAACC,OAAO,EAAEC,IAAI,CAACC,SAAS,CAAC,qBAAqB,CAAC,CAAC;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* Root persisted material record containing its authored name and material
|
|
9
|
+
* mesh dictionary.
|
|
10
|
+
*
|
|
11
|
+
* It owns the serializable material description, not device shaders,
|
|
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
|
+
});
|
|
31
|
+
CjsSchema.decorateField(Tr2MaterialRes, "meshes", io.persist, type.objectRef("Tr2MaterialMeshDict"));
|
|
32
|
+
CjsSchema.decorateField(Tr2MaterialRes, "name", io.persist, type.string);
|
|
33
|
+
|
|
34
|
+
export { Tr2MaterialRes };
|
|
35
|
+
//# sourceMappingURL=Tr2MaterialRes.js.map
|