@carbonenginejs/runtime-resource 0.12.2 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/NOTICE +32 -32
- package/README.md +129 -108
- package/dist/CjsMotherLode.js +1271 -1271
- package/dist/CjsResMan.js +3858 -3494
- package/dist/CjsResMan.js.map +1 -1
- package/dist/CjsResManFetchProvider.js +94 -94
- package/dist/CjsResManWorkQueue.js +301 -301
- package/dist/_virtual/_rollupPluginBabelHelpers.js +150 -150
- package/dist/format/CjsBlueReader.js +358 -358
- package/dist/format/CjsByteReader.js +310 -310
- package/dist/format/CjsByteWriter.js +242 -242
- package/dist/format/CjsFormat.js +223 -223
- package/dist/format/CjsFormatError.js +41 -41
- package/dist/format/CjsReader.js +22 -22
- package/dist/format/CjsResourceProbe.js +279 -279
- package/dist/format/CjsStringTable.js +268 -268
- package/dist/format/carbonEffect/CjsCarbonEffectReader.js +408 -361
- package/dist/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -1
- package/dist/format/carbonEffect/CjsCarbonEffectWriter.js +373 -373
- package/dist/format/carbonEffect/buildCarbonEffectContainer.js +182 -0
- package/dist/format/carbonEffect/buildCarbonEffectContainer.js.map +1 -0
- package/dist/format/carbonEffect/carbonEffectBackendBlock.js +321 -427
- package/dist/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -1
- package/dist/format/carbonEffect/carbonEffectRecords.js +1147 -955
- package/dist/format/carbonEffect/carbonEffectRecords.js.map +1 -1
- package/dist/format/carbonEffect/carbonEffectResourceTransform.js +197 -0
- package/dist/format/carbonEffect/carbonEffectResourceTransform.js.map +1 -0
- package/dist/format/compareUtf8.js +36 -36
- package/dist/format/effect/effectBodyInventory.js +146 -0
- package/dist/format/effect/effectBodyInventory.js.map +1 -0
- package/dist/format/effect/effectPermutationGraph.js +257 -257
- package/dist/format/effect/effectPermutationGraph.js.map +1 -1
- package/dist/format/effect/sha256.js +114 -114
- package/dist/format/index.js +11 -11
- package/dist/format/payloadContract.js +193 -193
- package/dist/formats/black/CjsBlackFormat.js +310 -292
- package/dist/formats/black/CjsBlackFormat.js.map +1 -1
- package/dist/formats/black/core/CjsBlackBinaryReader.js +260 -260
- package/dist/formats/black/core/CjsBlackPropertyReaders.js +448 -448
- package/dist/formats/black/core/CjsBlackReader.js +764 -764
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js +540 -540
- package/dist/formats/black/core/black-schema-v1-2026-07-23.json.js +4 -4
- package/dist/formats/black/core/blackConstants.js +7 -7
- package/dist/formats/black/core/blackDefinitions.js +10 -10
- package/dist/formats/black/core/blackEnums.js +6 -6
- package/dist/formats/black/core/blackSchema.js +3 -3
- package/dist/formats/black/core/blackVersion.js +22 -22
- package/dist/formats/black/core/helpers.js +199 -199
- package/dist/formats/black/core/schema.js +4 -4
- package/dist/formats/black/index.js +2 -2
- package/dist/formats/bnk/CjsBnkFormat.js +175 -156
- package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/formats/bnk/core/busNodes.js +252 -0
- package/dist/formats/bnk/core/busNodes.js.map +1 -0
- package/dist/formats/bnk/core/effectNodes.js +147 -0
- package/dist/formats/bnk/core/effectNodes.js.map +1 -0
- package/dist/formats/bnk/core/eventAction.js +416 -305
- package/dist/formats/bnk/core/eventAction.js.map +1 -1
- package/dist/formats/bnk/core/globalSettings.js +215 -0
- package/dist/formats/bnk/core/globalSettings.js.map +1 -0
- package/dist/formats/bnk/core/graph.js +137 -137
- package/dist/formats/bnk/core/helpers.js +512 -480
- package/dist/formats/bnk/core/helpers.js.map +1 -1
- package/dist/formats/bnk/core/musicNodes.js +533 -509
- package/dist/formats/bnk/core/musicNodes.js.map +1 -1
- package/dist/formats/bnk/core/nodeBase.js +553 -532
- package/dist/formats/bnk/core/nodeBase.js.map +1 -1
- package/dist/formats/bnk/core/sfxNodes.js +632 -632
- package/dist/formats/bnk/core/soundbanksInfo.js +209 -209
- package/dist/formats/bnk/index.js +2 -2
- package/dist/formats/cmf/CjsCmfFormat.js +497 -497
- package/dist/formats/cmf/core/binary.js +194 -194
- package/dist/formats/cmf/core/buffers.js +237 -237
- package/dist/formats/cmf/core/constants.js +47 -47
- package/dist/formats/cmf/core/gr2Anim.js +453 -453
- package/dist/formats/cmf/core/helpers.js +318 -318
- package/dist/formats/cmf/core/pack.js +276 -276
- package/dist/formats/cmf/core/schema.js +374 -374
- package/dist/formats/cmf/core/shared.js +277 -277
- package/dist/formats/cmf/core/writer.js +571 -571
- package/dist/formats/cmf/index.js +2 -2
- package/dist/formats/dds/CjsDdsFormat.js +200 -200
- package/dist/formats/dds/core/bc6h.js +298 -298
- package/dist/formats/dds/core/bc7.js +272 -272
- package/dist/formats/dds/core/helpers.js +862 -862
- package/dist/formats/dds/index.js +2 -2
- package/dist/formats/dxbc/CjsDxbcFormat.js +142 -142
- package/dist/formats/dxbc/core/DxbcReader.js +266 -266
- package/dist/formats/dxbc/core/container.js +169 -169
- package/dist/formats/dxbc/core/decoder.js +789 -789
- package/dist/formats/dxbc/core/errors.js +19 -19
- package/dist/formats/dxbc/core/helpers.js +220 -220
- package/dist/formats/dxbc/core/opcodes.js +45 -45
- package/dist/formats/dxbc/core/program.js +91 -91
- package/dist/formats/dxbc/core/signature.js +172 -172
- package/dist/formats/dxbc/index.js +2 -2
- package/dist/formats/fbx/CjsFbxFormat.js +266 -266
- package/dist/formats/fbx/core/helpers.js +3932 -3932
- package/dist/formats/fbx/index.js +2 -2
- package/dist/formats/flac/CjsFlacFormat.js +142 -142
- package/dist/formats/flac/core/helpers.js +315 -315
- package/dist/formats/flac/index.js +2 -2
- package/dist/formats/gif/CjsGifFormat.js +141 -141
- package/dist/formats/gif/core/helpers.js +380 -380
- package/dist/formats/gif/index.js +2 -2
- package/dist/formats/gltf/CjsGltfFormat.js +290 -290
- package/dist/formats/gltf/core/helpers.js +307 -307
- package/dist/formats/gltf/core/json.js +79 -79
- package/dist/formats/gltf/core/parser.js +679 -679
- package/dist/formats/gltf/core/targets.js +173 -173
- package/dist/formats/gltf/index.js +2 -2
- package/dist/formats/gr2/CjsGr2Format.js +289 -289
- package/dist/formats/gr2/core/bitknit2.js +282 -282
- package/dist/formats/gr2/core/curves.js +1047 -1047
- package/dist/formats/gr2/core/gsf.js +72 -72
- package/dist/formats/gr2/core/helpers.js +352 -352
- package/dist/formats/gr2/core/json.js +622 -622
- package/dist/formats/gr2/core/oodle1.js +388 -388
- package/dist/formats/gr2/core/tangents.js +48 -48
- package/dist/formats/gr2/core/targets.js +361 -361
- package/dist/formats/gr2/index.js +2 -2
- package/dist/formats/hlsl/CjsHlslFormat.js +254 -254
- package/dist/formats/hlsl/core/HlslBinaryUtils.js +15 -15
- package/dist/formats/hlsl/core/HlslEffectReadError.js +19 -19
- package/dist/formats/hlsl/core/HlslEffectStateManager.js +130 -130
- package/dist/formats/hlsl/core/HlslRenderStateSetup.js +37 -37
- package/dist/formats/hlsl/core/HlslResourceSetDescription.js +94 -94
- package/dist/formats/hlsl/core/HlslShaderBytecode.js +44 -44
- package/dist/formats/hlsl/core/analysis.js +51 -51
- package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js +850 -781
- package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -1
- package/dist/formats/hlsl/core/detailMapFamily.js +128 -0
- package/dist/formats/hlsl/core/detailMapFamily.js.map +1 -0
- package/dist/formats/hlsl/core/helpers.js +270 -270
- package/dist/formats/hlsl/core/json.js +284 -284
- package/dist/formats/hlsl/core/localLightFamily.js +133 -0
- package/dist/formats/hlsl/core/localLightFamily.js.map +1 -0
- package/dist/formats/hlsl/core/metadata.js +327 -327
- package/dist/formats/hlsl/core/render-states.js +280 -280
- package/dist/formats/hlsl/core/tr2/HlslRenderContextEnum.js +43 -43
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +320 -314
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -1
- package/dist/formats/hlsl/core/tr2/resources/HlslShaderPermutation.js +33 -33
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js +416 -416
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectConstant.js +40 -40
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js +62 -742
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js.map +1 -1
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectLibrary.js +52 -52
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectParameterAnnotation.js +38 -38
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectResource.js +50 -50
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +86 -86
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectTechnique.js +31 -31
- package/dist/formats/hlsl/core/tr2/shader/HlslPass.js +42 -42
- package/dist/formats/hlsl/core/tr2/shader/HlslSamplerDescription.js +55 -55
- package/dist/formats/hlsl/core/tr2/shader/HlslSamplerSetup.js +29 -29
- package/dist/formats/hlsl/core/tr2/shader/HlslShader.js +220 -220
- package/dist/formats/hlsl/core/tr2/shader/HlslShaderOption.js +30 -30
- package/dist/formats/hlsl/index.js +3 -3
- package/dist/formats/index.js +33 -31
- package/dist/formats/index.js.map +1 -1
- package/dist/formats/jpeg/CjsJpegFormat.js +212 -212
- package/dist/formats/jpeg/core/helpers.js +402 -402
- package/dist/formats/jpeg/core/jpeg.js +480 -480
- package/dist/formats/jpeg/index.js +2 -2
- package/dist/formats/mp3/CjsMp3Format.js +197 -197
- package/dist/formats/mp3/core/helpers.js +375 -375
- package/dist/formats/mp3/index.js +2 -2
- package/dist/formats/mp4/CjsMp4Format.js +197 -197
- package/dist/formats/mp4/core/helpers.js +484 -484
- package/dist/formats/mp4/index.js +2 -2
- package/dist/formats/obj/CjsObjFormat.js +253 -253
- package/dist/formats/obj/core/helpers.js +573 -573
- package/dist/formats/obj/core/json.js +64 -64
- package/dist/formats/obj/core/parser.js +321 -321
- package/dist/formats/obj/index.js +2 -2
- package/dist/formats/ogg/CjsOggFormat.js +143 -143
- package/dist/formats/ogg/core/helpers.js +410 -410
- package/dist/formats/ogg/core/imdct.js +178 -178
- package/dist/formats/ogg/core/vorbis.js +1017 -1017
- package/dist/formats/ogg/index.js +2 -2
- package/dist/formats/pickle/CjsPickleFormat.js +214 -0
- package/dist/formats/pickle/CjsPickleFormat.js.map +1 -0
- package/dist/formats/pickle/core/CjsPickleProtocol0Reader.js +551 -0
- package/dist/formats/pickle/core/CjsPickleProtocol0Reader.js.map +1 -0
- package/dist/formats/pickle/index.js +2 -0
- package/dist/formats/pickle/index.js.map +1 -0
- package/dist/formats/png/CjsPngFormat.js +201 -201
- package/dist/formats/png/core/helpers.js +635 -635
- package/dist/formats/png/index.js +2 -2
- package/dist/formats/red/CjsRedFormat.js +263 -263
- package/dist/formats/red/core/CjsRedReader.js +246 -246
- package/dist/formats/red/core/blackDefinitions.js +3 -3
- package/dist/formats/red/core/helpers.js +158 -158
- package/dist/formats/red/core/redGraph.js +71 -68
- package/dist/formats/red/core/redGraph.js.map +1 -1
- package/dist/formats/red/core/schema.js +4 -4
- package/dist/formats/red/index.js +2 -2
- package/dist/formats/stl/CjsStlFormat.js +365 -365
- package/dist/formats/stl/core/helpers.js +261 -261
- package/dist/formats/stl/core/json.js +51 -51
- package/dist/formats/stl/core/stl.js +642 -642
- package/dist/formats/stl/core/targets.js +173 -173
- package/dist/formats/stl/index.js +2 -2
- package/dist/formats/tga/CjsTgaFormat.js +197 -197
- package/dist/formats/tga/core/helpers.js +493 -493
- package/dist/formats/tga/index.js +2 -2
- package/dist/formats/wav/CjsWavFormat.js +198 -198
- package/dist/formats/wav/core/helpers.js +365 -365
- package/dist/formats/wav/index.js +2 -2
- package/dist/formats/webgl/CjsWebglFormat.js +199 -221
- package/dist/formats/webgl/CjsWebglFormat.js.map +1 -1
- package/dist/formats/webgl/core/buildGlslEffectContainer.js +70 -0
- package/dist/formats/webgl/core/buildGlslEffectContainer.js.map +1 -0
- package/dist/formats/webgl/core/effectPackage.js +900 -792
- package/dist/formats/webgl/core/effectPackage.js.map +1 -1
- package/dist/formats/webgl/core/errors.js +27 -27
- package/dist/formats/webgl/core/errors.js.map +1 -1
- package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js +2820 -2678
- package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
- package/dist/formats/webgl/core/glsl/DxbcGlslHelpers.js +89 -89
- package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +486 -428
- package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -1
- package/dist/formats/webgl/core/glsl/packedLightFixups.js +98 -0
- package/dist/formats/webgl/core/glsl/packedLightFixups.js.map +1 -0
- package/dist/formats/webgl/core/glslBackendBlock.js +552 -0
- package/dist/formats/webgl/core/glslBackendBlock.js.map +1 -0
- package/dist/formats/webgl/core/glslBackendBodySet.js +243 -0
- package/dist/formats/webgl/core/glslBackendBodySet.js.map +1 -0
- package/dist/formats/webgl/core/{cewgCompleteness.js → glslEffectCompleteness.js} +85 -81
- package/dist/formats/webgl/core/glslEffectCompleteness.js.map +1 -0
- package/dist/formats/webgl/core/helpers.js +167 -306
- package/dist/formats/webgl/core/helpers.js.map +1 -1
- package/dist/formats/webgl/core/inspectGlslEffectContainer.js +122 -0
- package/dist/formats/webgl/core/inspectGlslEffectContainer.js.map +1 -0
- package/dist/formats/webgl/core/readGlslEffectContainer.js +303 -0
- package/dist/formats/webgl/core/readGlslEffectContainer.js.map +1 -0
- package/dist/formats/webgl/index.js +2 -2
- package/dist/formats/webgpu/CjsWebgpuFormat.js +357 -357
- package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
- package/dist/formats/webgpu/core/buildCarbonEffectContainer.js +89 -197
- package/dist/formats/webgpu/core/buildCarbonEffectContainer.js.map +1 -1
- package/dist/formats/webgpu/core/{cewgpu/CewgpuContainer.js → carbonWebgpu/CarbonWebgpuContainer.js} +354 -368
- package/dist/formats/webgpu/core/carbonWebgpu/CarbonWebgpuContainer.js.map +1 -0
- package/dist/formats/webgpu/core/{cewgpu → carbonWebgpu}/containerViews.js +355 -355
- package/dist/formats/webgpu/core/carbonWebgpu/containerViews.js.map +1 -0
- package/dist/formats/webgpu/core/{cewgpu → carbonWebgpu}/validateContainer.js +90 -90
- package/dist/formats/webgpu/core/carbonWebgpu/validateContainer.js.map +1 -0
- package/dist/formats/webgpu/core/effectAnalysis.js +82 -82
- package/dist/formats/webgpu/core/effectBackendBodySet.js +289 -289
- package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -1
- package/dist/formats/webgpu/core/errors.js +20 -20
- package/dist/formats/webgpu/core/errors.js.map +1 -1
- package/dist/formats/webgpu/core/helpers.js +443 -443
- package/dist/formats/webgpu/core/helpers.js.map +1 -1
- package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +212 -212
- package/dist/formats/webgpu/core/ir/buildControlFlow.js +220 -220
- package/dist/formats/webgpu/core/ir/indexableTemps.js +137 -137
- package/dist/formats/webgpu/core/ir/inferValueTypes.js +449 -449
- package/dist/formats/webgpu/core/ir/lowerDxbcToIr.js +494 -494
- package/dist/formats/webgpu/core/ir/resolveRegisterFlow.js +177 -177
- package/dist/formats/webgpu/core/ir/sourceLanes.js +61 -61
- package/dist/formats/webgpu/core/packageEffect.js +381 -385
- package/dist/formats/webgpu/core/packageEffect.js.map +1 -1
- package/dist/formats/webgpu/core/packageEffectSelection.js +164 -164
- package/dist/formats/webgpu/core/packageEffectSelection.js.map +1 -1
- package/dist/formats/webgpu/core/packageMetadata.js +17 -17
- package/dist/formats/webgpu/core/schema.js +4 -4
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +263 -263
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +172 -172
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +320 -320
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/emitWgsl.js +356 -356
- package/dist/formats/webgpu/core/wgsl/hoistEscapingValues.js +77 -77
- package/dist/formats/webgpu/core/wgsl/lowerBindingLayout.js +451 -451
- package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +735 -735
- package/dist/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +457 -457
- package/dist/formats/webgpu/core/wgsl/lowerFragmentProgram.js +1572 -1572
- package/dist/formats/webgpu/core/wgsl/lowerMergeHistogramsComputeProgram.js +659 -659
- package/dist/formats/webgpu/core/wgsl/lowerParticleClearComputePrograms.js +734 -734
- package/dist/formats/webgpu/core/wgsl/lowerParticleEmitComputeProgram.js +583 -583
- package/dist/formats/webgpu/core/wgsl/lowerSkinVerticesComputeProgram.js +621 -621
- package/dist/formats/webgpu/core/wgsl/lowerSortComputeProgram.js +824 -824
- package/dist/formats/webgpu/core/wgsl/lowerSortInnerComputeProgram.js +697 -697
- package/dist/formats/webgpu/core/wgsl/lowerSortStepComputeProgram.js +559 -559
- package/dist/formats/webgpu/core/wgsl/lowerVertexProgram.js +1328 -1328
- package/dist/formats/webgpu/core/wgsl/particleEmitSemanticDigest.js +110 -110
- package/dist/formats/webgpu/core/wgsl/precisionControls.js +55 -55
- package/dist/formats/webgpu/core/wgsl/selectionPlans.js +717 -717
- package/dist/formats/webgpu/core/wgsl/uniformity.js +78 -78
- package/dist/formats/webgpu/core/wgsl/validateExactComputeIr.js +196 -196
- package/dist/formats/webgpu/core/wgsl/validateHandleOperand.js +37 -37
- package/dist/formats/webgpu/index.js +2 -2
- package/dist/formats/webm/CjsWebmFormat.js +197 -197
- package/dist/formats/webm/core/helpers.js +572 -572
- package/dist/formats/webm/index.js +2 -2
- package/dist/formats/webp/CjsWebpFormat.js +140 -140
- package/dist/formats/webp/core/helpers.js +237 -237
- package/dist/formats/webp/index.js +2 -2
- package/dist/formats/wem/CjsWemFormat.js +250 -250
- package/dist/formats/wem/core/bitStream.js +261 -261
- package/dist/formats/wem/core/codebookLibrary.js +164 -164
- package/dist/formats/wem/core/helpers.js +437 -437
- package/dist/formats/wem/core/packedCodebooksAotuv603.js +30 -30
- package/dist/formats/wem/core/ptadpcm.js +77 -77
- package/dist/formats/wem/core/resolve.js +121 -121
- package/dist/formats/wem/core/wemToOgg.js +485 -485
- package/dist/formats/wem/index.js +2 -2
- package/dist/formats/yaml/CjsYamlFormat.js +134 -134
- package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
- package/dist/formats/yaml/core/CjsYamlReader.js +400 -402
- package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -1
- package/dist/formats/yaml/core/helpers.js +196 -170
- package/dist/formats/yaml/core/helpers.js.map +1 -1
- package/dist/formats/yaml/index.js +2 -2
- package/dist/index.js +64 -62
- package/dist/index.js.map +1 -1
- package/dist/resource/CjsLoadingObject.js +19 -0
- package/dist/resource/CjsLoadingObject.js.map +1 -0
- package/dist/resource/CjsResource.js +801 -797
- package/dist/resource/CjsResource.js.map +1 -1
- package/dist/resource/ResourceHandlerMode.js +14 -0
- package/dist/resource/ResourceHandlerMode.js.map +1 -0
- package/dist/resource/Tr2LightProfileRes.js +32 -32
- package/dist/resource/audio/AudioGeometryResData.js +47 -47
- package/dist/resource/audio/CjsAudioBufferRes.js +86 -86
- package/dist/resource/audio/CjsAudioRes.js +213 -213
- package/dist/resource/audio/index.js +4 -4
- package/dist/resource/geometry/MeshDecalData.js +37 -37
- package/dist/resource/geometry/MeshDecalLodData.js +34 -34
- package/dist/resource/geometry/TriGeometryRes.js +675 -675
- package/dist/resource/geometry/TriGeometryResAreaData.js +59 -59
- package/dist/resource/geometry/TriGeometryResJointData.js +38 -38
- package/dist/resource/geometry/TriGeometryResLodData.js +88 -88
- package/dist/resource/geometry/TriGeometryResMeshData.js +63 -63
- package/dist/resource/geometry/TriGeometryResSkeletonData.js +34 -34
- package/dist/resource/geometry/TriJointBinding.js +38 -38
- package/dist/resource/geometry/TriMorphTargetGeometryConstants.js +46 -46
- package/dist/resource/geometry/TriRtGeometryConstants.js +88 -88
- package/dist/resource/geometry/granny/GStateBindingCallbackData.js +31 -31
- package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js +60 -60
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js +36 -36
- package/dist/resource/geometry/granny/TriGrannyRes.js +35 -35
- package/dist/resource/geometry/granny/enums.js +10 -10
- package/dist/resource/geometry/granny/index.js +6 -6
- package/dist/resource/geometry/index.js +17 -17
- package/dist/resource/index.js +54 -52
- package/dist/resource/index.js.map +1 -1
- package/dist/resource/resourceBoundary.js +64 -64
- package/dist/resource/shader/Tr2EffectRes.js +336 -431
- package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
- package/dist/resource/shader/Tr2MaterialArea.js +31 -31
- package/dist/resource/shader/Tr2MaterialMesh.js +27 -27
- package/dist/resource/shader/Tr2MaterialRes.js +31 -31
- package/dist/resource/shader/Tr2Shader.js +283 -261
- package/dist/resource/shader/Tr2Shader.js.map +1 -1
- package/dist/resource/shader/Tr2ShaderPermutation.js +43 -43
- package/dist/resource/shader/index.js +17 -17
- package/dist/resource/shader/reflection/Tr2EffectConstant.js +143 -135
- package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectDefine.js +30 -30
- package/dist/resource/shader/reflection/Tr2EffectDescription.js +114 -109
- package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js +168 -147
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +125 -105
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectResource.js +120 -86
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js +372 -241
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js +78 -68
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2Pass.js +168 -111
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
- package/dist/resource/shader/reflection/carbonRecordFields.js +159 -0
- package/dist/resource/shader/reflection/carbonRecordFields.js.map +1 -0
- package/dist/resource/shader/reflection/shaderStage.js +22 -0
- package/dist/resource/shader/reflection/shaderStage.js.map +1 -0
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js +135 -77
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
- package/dist/resource/texture/CjsTextureArrayRes.js +472 -472
- package/dist/resource/texture/CjsTextureArrayResParameterProxy.js +179 -179
- package/dist/resource/texture/Tr2ImageRes.js +120 -120
- package/dist/resource/texture/Tr2TextureLodManager.js +82 -82
- package/dist/resource/texture/Tr2TextureLodUpdateRequest.js +37 -37
- package/dist/resource/texture/Tr2TexturePackChannel.js +37 -37
- package/dist/resource/texture/Tr2TexturePipeline.js +54 -54
- package/dist/resource/texture/Tr2TexturePipelineParams.js +34 -34
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +40 -40
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +22 -22
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +34 -34
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +31 -31
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js +43 -43
- package/dist/resource/texture/TriTextureRes.js +359 -359
- package/dist/resource/texture/index.js +15 -15
- package/dist/resource/texture/texturePipelineBehavior.js +308 -308
- package/dist/worker/CjsResManMainThreadLoader.js +89 -87
- package/dist/worker/CjsResManMainThreadLoader.js.map +1 -1
- package/dist/worker/CjsResManWorker.js +218 -217
- package/dist/worker/CjsResManWorker.js.map +1 -1
- package/dist/worker/CjsResManWorkerLoader.js +437 -434
- package/dist/worker/CjsResManWorkerLoader.js.map +1 -1
- package/dist/worker/protocol.js +12 -12
- package/docs/README.md +98 -98
- package/docs/architecture.md +118 -109
- package/docs/concepts/resource-lifecycle.md +226 -225
- package/docs/concepts/shader-resource-model.md +111 -114
- package/docs/concepts/writing-an-engine-adapter.md +115 -115
- package/docs/formats/README.md +138 -136
- package/docs/formats/carbon-effect-container.md +553 -452
- package/docs/formats/dxbc/README.md +68 -68
- package/docs/formats/dxbc/architecture.md +80 -80
- package/docs/formats/dxbc/reference/api.md +77 -77
- package/docs/formats/dxbc/reference/classes/README.md +9 -9
- package/docs/formats/dxbc/reference/decoded-output.md +122 -122
- package/docs/formats/gr2.md +160 -160
- package/docs/formats/hlsl/README.md +54 -54
- package/docs/formats/hlsl/architecture.md +65 -67
- package/docs/formats/hlsl/guides/hydrating-json-output.md +60 -62
- package/docs/formats/hlsl/guides/reading-effects.md +64 -64
- package/docs/formats/hlsl/reference/advanced-analysis.md +61 -66
- package/docs/formats/hlsl/reference/api.md +92 -98
- package/docs/formats/hlsl/reference/classes/README.md +11 -11
- package/docs/formats/hlsl/reference/json-graph.md +97 -100
- package/docs/formats/pickle.md +82 -0
- package/docs/formats/provenance.md +196 -196
- package/docs/formats/stl.md +37 -37
- package/docs/formats/webgl/README.md +115 -57
- package/docs/formats/webgl/architecture.md +69 -70
- package/docs/formats/webgl/carbon-constant-layouts.md +326 -326
- package/docs/formats/webgl/decl-io.md +1234 -1234
- package/docs/formats/webgl/memory-structured.md +890 -871
- package/docs/formats/webgl/reference/classes/README.md +9 -9
- package/docs/formats/webgl/texture-sample.md +964 -964
- package/docs/formats/webgpu/README.md +84 -84
- package/docs/formats/webgpu/architecture.md +95 -96
- package/docs/formats/webgpu/formats/{cewgpu.md → carbon-webgpu.md} +215 -216
- package/docs/formats/webgpu/guides/effect-packaging.md +189 -191
- package/docs/formats/webgpu/reference/api.md +196 -197
- package/docs/formats/webgpu/reference/classes/README.md +9 -9
- package/docs/formats/webgpu/reference/wgsl-compatibility.md +1546 -1543
- package/docs/formats/wwise.md +146 -85
- package/docs/reference/classes/README.md +35 -35
- package/docs/reference/classes/audio.md +30 -30
- package/docs/reference/classes/core.md +216 -206
- package/docs/reference/classes/dropped.md +46 -46
- package/docs/reference/classes/formats.md +944 -952
- package/docs/reference/classes/resources.md +456 -456
- package/docs/reference/classes/texture.md +26 -26
- package/docs/reference/events.md +117 -117
- package/docs/reference/motherlode-cache.md +275 -275
- package/docs/reference/queues.md +194 -110
- package/docs/reference/reload.md +107 -107
- package/docs/reference/texture-arrays.md +113 -113
- package/docs/reference/texture-pipeline.md +53 -53
- package/docs/reference/workers.md +142 -135
- package/docs/roadmap.md +150 -150
- package/format-notices/black/LICENSE +21 -21
- package/format-notices/black/NOTICE +47 -47
- package/format-notices/bnk/LICENSE +21 -21
- package/format-notices/bnk/NOTICE +21 -21
- package/format-notices/cmf/LICENSE +21 -21
- package/format-notices/cmf/NOTICE +36 -36
- package/format-notices/dds/LICENSE +21 -21
- package/format-notices/dds/NOTICE +14 -14
- package/format-notices/dxbc/LICENSE +21 -21
- package/format-notices/dxbc/NOTICE +20 -20
- package/format-notices/fbx/LICENSE +21 -21
- package/format-notices/fbx/NOTICE +14 -14
- package/format-notices/flac/LICENSE +21 -21
- package/format-notices/flac/NOTICE +14 -14
- package/format-notices/gif/LICENSE +21 -21
- package/format-notices/gif/NOTICE +14 -14
- package/format-notices/gltf/LICENSE +21 -21
- package/format-notices/gltf/NOTICE +27 -27
- package/format-notices/gr2/LICENSE +21 -21
- package/format-notices/gr2/NOTICE +60 -60
- package/format-notices/gr2/THIRD-PARTY-NOTICES.md +93 -93
- package/format-notices/hlsl/LICENSE +21 -21
- package/format-notices/hlsl/NOTICE +25 -25
- package/format-notices/jpeg/LICENSE +21 -21
- package/format-notices/jpeg/NOTICE +14 -14
- package/format-notices/mp3/LICENSE +21 -21
- package/format-notices/mp3/NOTICE +14 -14
- package/format-notices/mp4/LICENSE +21 -21
- package/format-notices/mp4/NOTICE +14 -14
- package/format-notices/obj/LICENSE +21 -21
- package/format-notices/obj/NOTICE +26 -26
- package/format-notices/ogg/LICENSE +21 -21
- package/format-notices/ogg/NOTICE +28 -28
- package/format-notices/png/LICENSE +21 -21
- package/format-notices/png/NOTICE +14 -14
- package/format-notices/red/LICENSE +21 -21
- package/format-notices/red/NOTICE +31 -31
- package/format-notices/stl/LICENSE +21 -21
- package/format-notices/stl/NOTICE +21 -21
- package/format-notices/tga/LICENSE +21 -21
- package/format-notices/tga/NOTICE +14 -14
- package/format-notices/wav/LICENSE +21 -21
- package/format-notices/wav/NOTICE +14 -14
- package/format-notices/webgl/LICENSE +21 -21
- package/format-notices/webgl/NOTICE +35 -35
- package/format-notices/webgpu/LICENSE +21 -21
- package/format-notices/webgpu/NOTICE +31 -31
- package/format-notices/webm/LICENSE +21 -21
- package/format-notices/webm/NOTICE +14 -14
- package/format-notices/webp/LICENSE +21 -21
- package/format-notices/webp/NOTICE +14 -14
- package/format-notices/wem/LICENSE +57 -57
- package/format-notices/wem/NOTICE +33 -33
- package/format-notices/yaml/LICENSE +21 -21
- package/format-notices/yaml/NOTICE +44 -44
- package/package.json +63 -63
- package/dist/format/carbonEffect/carbonDescriptionFromPortable.js +0 -372
- package/dist/format/carbonEffect/carbonDescriptionFromPortable.js.map +0 -1
- package/dist/format/effect/effectReflectionPackage.js +0 -636
- package/dist/format/effect/effectReflectionPackage.js.map +0 -1
- package/dist/formats/hlsl/core/HlslReader.js +0 -16
- package/dist/formats/hlsl/core/HlslReader.js.map +0 -1
- package/dist/formats/hlsl/core/portableReflection.js +0 -848
- package/dist/formats/hlsl/core/portableReflection.js.map +0 -1
- package/dist/formats/hlsl/portable.js +0 -2
- package/dist/formats/hlsl/portable.js.map +0 -1
- package/dist/formats/webgl/core/cewg/CewgPackage.js +0 -340
- package/dist/formats/webgl/core/cewg/CewgPackage.js.map +0 -1
- package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js +0 -104
- package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js.map +0 -1
- package/dist/formats/webgl/core/cewg/binary.js +0 -19
- package/dist/formats/webgl/core/cewg/binary.js.map +0 -1
- package/dist/formats/webgl/core/cewgCompleteness.js.map +0 -1
- package/dist/formats/webgl/core/effectPackageValidation.js +0 -331
- package/dist/formats/webgl/core/effectPackageValidation.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/containerViews.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/validateContainer.js.map +0 -1
- package/dist/resource/shader/portable.js +0 -33
- package/dist/resource/shader/portable.js.map +0 -1
- package/docs/formats/hlsl/reference/portable-reflection.md +0 -141
- package/docs/formats/webgl/effect-reflection.md +0 -127
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tr2Shader.js","sources":["../../../../src/resource/shader/Tr2Shader.js"],"sourcesContent":["// Source: trinity/trinity/Shader/Tr2Shader.h\n// Source: trinity/trinity/Shader/Tr2Shader.cpp\nimport { CjsSchema, carbon, impl, type } from \"@carbonenginejs/runtime-utils/schema\";\nimport { CjsModel } from \"@carbonenginejs/runtime-utils/model\";\nimport {\n isEffectBodyReflection,\n validateEffectBodyReflection\n} from \"../../formats/hlsl/portable.js\";\nimport { Tr2EffectDescription } from \"./reflection/Tr2EffectDescription.js\";\n\n/** GPU-free selected shader and its complete source reflection graph. */\nexport class Tr2Shader extends CjsModel\n{\n\n /** m_sortValue (unsigned int) */\n sortValue = 0;\n\n /** m_effect (Tr2EffectDescription) */\n effect = new Tr2EffectDescription();\n\n /** m_hasVertexBufferAccessInRtShadow (bool) */\n hasVertexBufferAccessInRtShadow = false;\n\n /**\n * Index of the named technique; 0 for Carbon's empty-string any-technique\n * sentinel and -1 when the shader has no techniques or the name is unknown.\n */\n GetTechniqueIndex(name = \"Main\")\n {\n const techniques = this.effect?.techniques ?? [];\n if (!techniques.length)\n {\n return -1;\n }\n if (name === \"\")\n {\n return 0;\n }\n return techniques.findIndex(technique => technique?.name === name);\n }\n\n /** Number of passes in a technique; 0 for an unknown index. */\n GetPassCount(techniqueIndex = 0)\n {\n return this.effect?.techniques?.[techniqueIndex]?.passes?.length ?? 0;\n }\n\n /**\n * The reflected constant of this name from any stage of any pass, or null;\n * the description is metadata, not a bound GPU slot.\n */\n GetConstant(name)\n {\n return Tr2Shader.findStageValue(this.effect, name, \"constants\");\n }\n\n /**\n * The reflected resource of this name, searching stage resources before\n * UAVs; null when neither has it.\n */\n GetResource(name)\n {\n for (const stage of Tr2Shader.iterateStages(this.effect))\n {\n const resource = Tr2Shader.findNamedCollectionValue(\n stage?.resources,\n name\n );\n if (resource)\n {\n return resource;\n }\n const uav = Tr2Shader.findNamedCollectionValue(stage?.uavs, name);\n if (uav)\n {\n return uav;\n }\n }\n return null;\n }\n\n /**\n * The annotation set authored for a parameter name, or null; the shape\n * depends on the reflection source.\n */\n GetParameterAnnotations(parameterName)\n {\n return Tr2Shader.findAnnotationSet(\n this.effect?.annotations,\n parameterName\n );\n }\n\n /** The packed draw-sort key; 0 until ProcessEffect has run. */\n GetSortValue()\n {\n return this.sortValue;\n }\n\n /** The reflected effect description, by reference rather than copy. */\n GetEffectDescription()\n {\n return this.effect;\n }\n\n /** The same object GetEffectDescription returns. */\n GetEffect()\n {\n return this.effect;\n }\n\n /** The technique's bitmask of shader stages, or 0 for an unknown index. */\n GetShaderTypeMask(techniqueIndex = 0)\n {\n return Number(\n this.effect?.techniques?.[techniqueIndex]?.shaderTypeMask ?? 0\n );\n }\n\n /**\n * Pack the first technique/pass's renderer handles into Carbon's sort key.\n * A device-free source graph retains 0 while its handles remain invalid.\n */\n ProcessEffect()\n {\n this.sortValue = 0;\n const pass = this.effect?.techniques?.[0]?.passes?.[0];\n if (!pass)\n {\n return;\n }\n const stages = pass.stageInputs ?? [];\n const pixelHandle = Number(\n stages[1]?.shader ?? stages[1]?.m_shader ?? 0xffffffff\n );\n const vertexHandle = Number(\n stages[0]?.shader ?? stages[0]?.m_shader ?? 0xffffffff\n );\n if (pixelHandle === 0xffffffff || vertexHandle === 0xffffffff)\n {\n return;\n }\n const pixelShader = pixelHandle & 0x3ff;\n const vertexShader = vertexHandle & 0x3ff;\n const renderStates = Number(pass.renderStates ?? 0) & 0x3ff;\n const passCount = Number(\n this.effect?.techniques?.[0]?.passes?.length ?? 0\n ) & 0x3;\n this.sortValue = (\n (passCount << 30)\n | (pixelShader << 20)\n | (vertexShader << 10)\n | renderStates\n ) >>> 0;\n }\n\n /** Whether this shader accesses vertex buffers in RT shadow mode. */\n HasVertexBufferAccessInRtShadow()\n {\n return this.hasVertexBufferAccessInRtShadow;\n }\n\n /**\n * Construct a canonical shader graph from JS/JSON model values.\n *\n * @param {object} values Canonical model values.\n * @param {object} options CjsModel import options.\n * @returns {Tr2Shader} Hydrated shader graph.\n */\n static from(values = {}, options = {})\n {\n let normalized = values;\n if (values?.effect\n && !(values.effect instanceof Tr2EffectDescription))\n {\n normalized = {\n ...values,\n effect: Tr2EffectDescription.from(values.effect, options)\n };\n }\n const shader = super.from(normalized, options);\n if (!Object.hasOwn(values ?? {}, \"sortValue\"))\n {\n shader.ProcessEffect();\n }\n return shader;\n }\n\n /**\n * Build one canonical GPU-free shader from complete portable reflection.\n * Each child reflection class owns conversion of its own portable record.\n *\n * @param {object} portable Portable effect-body reflection.\n * @returns {Tr2Shader} Canonical selected shader.\n */\n static fromPortable(portable)\n {\n validateEffectBodyReflection(portable);\n\n const shader = new this();\n shader.effect = Tr2EffectDescription.fromPortable(portable.effect);\n shader.ProcessEffect();\n return shader;\n }\n\n /**\n * Whether a value has the supported complete portable-reflection envelope.\n *\n * @param {*} value Candidate value.\n * @returns {boolean} Whether the portable envelope is supported.\n */\n static isPortableReflection(value)\n {\n return isEffectBodyReflection(value);\n }\n\n /** Find one named reflection entry across every stage. */\n static findStageValue(effect, name, key)\n {\n for (const stage of Tr2Shader.iterateStages(effect))\n {\n const found = Tr2Shader.findNamedCollectionValue(stage?.[key], name);\n if (found)\n {\n return found;\n }\n }\n return null;\n }\n\n /** Flatten pass stage inputs in Carbon lookup order. */\n static iterateStages(effect)\n {\n const stages = [];\n for (const technique of effect?.techniques ?? [])\n {\n for (const pass of technique?.passes ?? [])\n {\n stages.push(...pass?.stageInputs ?? []);\n }\n }\n return stages;\n }\n\n /** Find a named entry in an array, Map, or plain object collection. */\n static findNamedCollectionValue(values, name)\n {\n if (!values)\n {\n return null;\n }\n if (Array.isArray(values))\n {\n return values.find(\n value => value?.name === name || value?.[1]?.name === name\n ) ?? null;\n }\n if (values instanceof Map)\n {\n for (const value of values.values())\n {\n if (value?.name === name)\n {\n return value;\n }\n }\n return null;\n }\n for (const value of Object.values(values))\n {\n if (value?.name === name)\n {\n return value;\n }\n }\n return null;\n }\n\n /** Resolve a parameter's annotations from a Map, array, or plain object. */\n static findAnnotationSet(annotations, parameterName)\n {\n if (!annotations)\n {\n return null;\n }\n if (annotations instanceof Map)\n {\n return annotations.get(parameterName) ?? null;\n }\n if (Array.isArray(annotations))\n {\n const entry = annotations.find(\n item => item?.name === parameterName\n || item?.[0] === parameterName\n );\n return entry?.annotations ?? entry?.value ?? entry?.[1] ?? null;\n }\n return annotations[parameterName] ?? null;\n }\n\n}\n\n// Declared as data rather than with decorators, so this module stays plain ESM\n// that loads from source without a transform. The decorator vocabulary is used\n// verbatim as values, so the registered metadata is identical to the decorated\n// form. Field order is key order, and it drives GetValues() export order.\n// Statics belong in `methods`: the prototype is what carries instance fields.\nconst UNVALIDATED_TECHNIQUE_INDEX = impl.reason(\n \"Carbon assumes an already-validated technique index; CarbonEngineJS safely returns zero for an unavailable index.\"\n);\n\nCjsSchema.define(Tr2Shader, {\n className: \"Tr2Shader\",\n family: \"shader\",\n fields: {\n sortValue: type.uint32,\n effect: type.rawStruct(\"Tr2EffectDescription\"),\n hasVertexBufferAccessInRtShadow: type.boolean\n },\n methods: {\n GetTechniqueIndex: [ carbon.method, impl.adapted, impl.reason(\"Carbon returns success through a bool plus output index; CarbonEngineJS returns the index directly or -1 while preserving exact name lookup.\") ],\n GetPassCount: [ carbon.method, impl.adapted, UNVALIDATED_TECHNIQUE_INDEX ],\n GetConstant: [ carbon.method, impl.implemented ],\n GetResource: [ carbon.method, impl.implemented ],\n GetParameterAnnotations: [ carbon.method, impl.implemented ],\n GetSortValue: [ carbon.method, impl.implemented ],\n GetEffectDescription: [ carbon.method, impl.implemented ],\n GetEffect: [ carbon.method, impl.implemented ],\n GetShaderTypeMask: [ carbon.method, impl.adapted, UNVALIDATED_TECHNIQUE_INDEX ],\n ProcessEffect: [ carbon.method, impl.adapted, impl.reason(\"Carbon packs renderer handles assigned while reading; the device-free graph leaves the sort key zero until an engine assigns valid handles.\") ],\n HasVertexBufferAccessInRtShadow: [ carbon.method, impl.implemented ]\n }\n});\n"],"names":["Tr2Shader","CjsModel","sortValue","effect","Tr2EffectDescription","hasVertexBufferAccessInRtShadow","GetTechniqueIndex","name","techniques","length","findIndex","technique","GetPassCount","techniqueIndex","passes","GetConstant","findStageValue","GetResource","stage","iterateStages","resource","findNamedCollectionValue","resources","uav","uavs","GetParameterAnnotations","parameterName","findAnnotationSet","annotations","GetSortValue","GetEffectDescription","GetEffect","GetShaderTypeMask","Number","shaderTypeMask","ProcessEffect","pass","stages","stageInputs","pixelHandle","shader","m_shader","vertexHandle","pixelShader","vertexShader","renderStates","passCount","HasVertexBufferAccessInRtShadow","from","values","options","normalized","Object","hasOwn","fromPortable","portable","validateEffectBodyReflection","isPortableReflection","value","isEffectBodyReflection","key","found","push","Array","isArray","find","Map","get","entry","item","UNVALIDATED_TECHNIQUE_INDEX","impl","reason","CjsSchema","define","className","family","fields","type","uint32","rawStruct","boolean","methods","carbon","method","adapted","implemented"],"mappings":";;;;;AAAA;AACA;;AASA;AACO,MAAMA,SAAS,SAASC,QAAQ,CACvC;AAEE;AACAC,EAAAA,SAAS,GAAG,CAAC;;AAEb;AACAC,EAAAA,MAAM,GAAG,IAAIC,oBAAoB,EAAE;;AAEnC;AACAC,EAAAA,+BAA+B,GA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MAAM,EAAEb,IAAI,CAACe,WAAW,CAAE;IACzDvD,SAAS,EAAE,CAAEoD,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACe,WAAW,CAAE;IAC9CtD,iBAAiB,EAAE,CAAEmD,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACc,OAAO,EAAEf,2BAA2B,CAAE;AAC/EnC,IAAAA,aAAa,EAAE,CAAEgD,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACc,OAAO,EAAEd,IAAI,CAACC,MAAM,CAAC,6IAA6I,CAAC,CAAE;IAC1MzB,+BAA+B,EAAE,CAAEoC,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACe,WAAW;AACpE;AACF,CAAC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Tr2Shader.js","sources":["../../../../src/resource/shader/Tr2Shader.js"],"sourcesContent":["// Source: trinity/trinity/Shader/Tr2Shader.h\n// Source: trinity/trinity/Shader/Tr2Shader.cpp\nimport { CjsSchema, carbon, impl, type } from \"@carbonenginejs/runtime-utils/schema\";\nimport { CjsModel } from \"@carbonenginejs/runtime-utils/model\";\nimport { Tr2EffectDescription } from \"./reflection/Tr2EffectDescription.js\";\n\n/** GPU-free selected shader and its complete source reflection graph. */\nexport class Tr2Shader extends CjsModel\n{\n\n /** m_sortValue (unsigned int) */\n sortValue = 0;\n\n /** m_effect (Tr2EffectDescription) */\n effect = new Tr2EffectDescription();\n\n /** m_hasVertexBufferAccessInRtShadow (bool) */\n hasVertexBufferAccessInRtShadow = false;\n\n /**\n * Index of the named technique; 0 for Carbon's empty-string any-technique\n * sentinel and -1 when the shader has no techniques or the name is unknown.\n */\n GetTechniqueIndex(name = \"Main\")\n {\n const techniques = this.effect?.techniques ?? [];\n if (!techniques.length)\n {\n return -1;\n }\n if (name === \"\")\n {\n return 0;\n }\n return techniques.findIndex(technique => technique?.name === name);\n }\n\n /** Number of passes in a technique; 0 for an unknown index. */\n GetPassCount(techniqueIndex = 0)\n {\n return this.effect?.techniques?.[techniqueIndex]?.passes?.length ?? 0;\n }\n\n /**\n * The reflected constant of this name from any stage of any pass, or null;\n * the description is metadata, not a bound GPU slot.\n */\n GetConstant(name)\n {\n return Tr2Shader.findStageValue(this.effect, name, \"constants\");\n }\n\n /**\n * The reflected resource of this name, searching stage resources before\n * UAVs; null when neither has it.\n */\n GetResource(name)\n {\n for (const stage of Tr2Shader.iterateStages(this.effect))\n {\n const resource = Tr2Shader.findNamedCollectionValue(\n stage?.resources,\n name\n );\n if (resource)\n {\n return resource;\n }\n const uav = Tr2Shader.findNamedCollectionValue(stage?.uavs, name);\n if (uav)\n {\n return uav;\n }\n }\n return null;\n }\n\n /**\n * The annotation set authored for a parameter name, or null; the shape\n * depends on the reflection source.\n */\n GetParameterAnnotations(parameterName)\n {\n return Tr2Shader.findAnnotationSet(\n this.effect?.annotations,\n parameterName\n );\n }\n\n /** The packed draw-sort key; 0 until ProcessEffect has run. */\n GetSortValue()\n {\n return this.sortValue;\n }\n\n /** The reflected effect description, by reference rather than copy. */\n GetEffectDescription()\n {\n return this.effect;\n }\n\n /** The same object GetEffectDescription returns. */\n GetEffect()\n {\n return this.effect;\n }\n\n /** The technique's bitmask of shader stages, or 0 for an unknown index. */\n GetShaderTypeMask(techniqueIndex = 0)\n {\n return Number(\n this.effect?.techniques?.[techniqueIndex]?.shaderTypeMask ?? 0\n );\n }\n\n /**\n * Pack the first technique/pass's renderer handles into Carbon's sort key.\n * A device-free source graph retains 0 while its handles remain invalid.\n */\n ProcessEffect()\n {\n this.sortValue = 0;\n const pass = this.effect?.techniques?.[0]?.passes?.[0];\n if (!pass)\n {\n return;\n }\n const stages = pass.stageInputs ?? [];\n const pixelHandle = Number(\n stages[1]?.shader ?? stages[1]?.m_shader ?? 0xffffffff\n );\n const vertexHandle = Number(\n stages[0]?.shader ?? stages[0]?.m_shader ?? 0xffffffff\n );\n if (pixelHandle === 0xffffffff || vertexHandle === 0xffffffff)\n {\n return;\n }\n const pixelShader = pixelHandle & 0x3ff;\n const vertexShader = vertexHandle & 0x3ff;\n const renderStates = Number(pass.renderStates ?? 0) & 0x3ff;\n const passCount = Number(\n this.effect?.techniques?.[0]?.passes?.length ?? 0\n ) & 0x3;\n this.sortValue = (\n (passCount << 30)\n | (pixelShader << 20)\n | (vertexShader << 10)\n | renderStates\n ) >>> 0;\n }\n\n /** Whether this shader accesses vertex buffers in RT shadow mode. */\n HasVertexBufferAccessInRtShadow()\n {\n return this.hasVertexBufferAccessInRtShadow;\n }\n\n /**\n * Construct a canonical shader graph from JS/JSON model values.\n *\n * @param {object} values Canonical model values.\n * @param {object} options CjsModel import options.\n * @returns {Tr2Shader} Hydrated shader graph.\n */\n static from(values = {}, options = {})\n {\n let normalized = values;\n if (values?.effect\n && !(values.effect instanceof Tr2EffectDescription))\n {\n normalized = {\n ...values,\n effect: Tr2EffectDescription.from(values.effect, options)\n };\n }\n const shader = super.from(normalized, options);\n if (!Object.hasOwn(values ?? {}, \"sortValue\"))\n {\n shader.ProcessEffect();\n }\n return shader;\n }\n\n /**\n * Build one GPU-free shader from one body of a Carbon effect container.\n *\n * `reader` is the container reader the resource opened and retains; this method\n * never opens anything of its own. A body is not independently readable — its\n * strings are offsets into the container's shared arena, and its layout depends\n * on the container's version — so handing each body its own reader would mean\n * re-parsing the header per permutation and losing the arena.\n *\n * Carbon passes exactly that bundle, as loose arguments\n * (`Tr2EffectRes.cpp:126-134`):\n *\n * ```cpp\n * auto offset = m_offsets[index];\n * auto buffer = ...m_data.get() + offset.offset;\n * shader->GetEffect().Read( buffer, offset.size, m_version,\n * m_stringTable, m_stringTableSize, path );\n * shader->ProcessEffect();\n * ```\n *\n * The resource owns `m_data`, `m_offsets`, `m_version` and the string table,\n * and hands the body a pointer plus the version and arena. Here that same state\n * is held by the reader the resource retains, so passing the reader passes the\n * whole bundle and the resource itself adds nothing a body needs.\n *\n * Reading is backend-agnostic. A dx11 body reads exactly as a webgl one does;\n * they differ only in what the optional per-pass block carries, and this method\n * retains that block without interpreting it. What can be *realized* from the\n * result is the engine's question, not the reader's.\n *\n * @param {object} reader Container reader owned by the resource.\n * @param {number} index Permutation index within the container.\n * @returns {Tr2Shader} Canonical selected shader.\n */\n static fromCarbonBinary(reader, index)\n {\n const shader = new this();\n shader.effect = Tr2EffectDescription.fromCarbonBinary(\n reader.readDescription(index)\n );\n shader.ProcessEffect();\n return shader;\n }\n\n /**\n * Find a named value across stage collections in Carbon lookup order.\n *\n * @param {Tr2EffectDescription} effect Effect description to search.\n * @param {string} name Entry name.\n * @param {string} key Stage collection key.\n * @returns {*|null} Matching value, or `null`.\n */\n static findStageValue(effect, name, key)\n {\n for (const stage of Tr2Shader.iterateStages(effect))\n {\n const found = Tr2Shader.findNamedCollectionValue(stage?.[key], name);\n if (found)\n {\n return found;\n }\n }\n return null;\n }\n\n /** Flatten pass stage inputs in Carbon lookup order. */\n static iterateStages(effect)\n {\n const stages = [];\n for (const technique of effect?.techniques ?? [])\n {\n for (const pass of technique?.passes ?? [])\n {\n stages.push(...pass?.stageInputs ?? []);\n }\n }\n return stages;\n }\n\n /** Find a named entry in an array, Map, or plain object collection. */\n static findNamedCollectionValue(values, name)\n {\n if (!values)\n {\n return null;\n }\n if (Array.isArray(values))\n {\n return values.find(\n value => value?.name === name || value?.[1]?.name === name\n ) ?? null;\n }\n if (values instanceof Map)\n {\n for (const value of values.values())\n {\n if (value?.name === name)\n {\n return value;\n }\n }\n return null;\n }\n for (const value of Object.values(values))\n {\n if (value?.name === name)\n {\n return value;\n }\n }\n return null;\n }\n\n /** Resolve a parameter's annotations from a Map, array, or plain object. */\n static findAnnotationSet(annotations, parameterName)\n {\n if (!annotations)\n {\n return null;\n }\n if (annotations instanceof Map)\n {\n return annotations.get(parameterName) ?? null;\n }\n if (Array.isArray(annotations))\n {\n const entry = annotations.find(\n item => item?.name === parameterName\n || item?.[0] === parameterName\n );\n return entry?.annotations ?? entry?.value ?? entry?.[1] ?? null;\n }\n return annotations[parameterName] ?? null;\n }\n\n}\n\n// Declared as data rather than with decorators, so this module stays plain ESM\n// that loads from source without a transform. The decorator vocabulary is used\n// verbatim as values, so the registered metadata is identical to the decorated\n// form. Field order is key order, and it drives GetValues() export order.\n// Statics belong in `methods`: the prototype is what carries instance fields.\nconst UNVALIDATED_TECHNIQUE_INDEX = impl.reason(\n \"Carbon assumes an already-validated technique index; CarbonEngineJS safely returns zero for an unavailable index.\"\n);\n\nCjsSchema.define(Tr2Shader, {\n className: \"Tr2Shader\",\n family: \"shader\",\n fields: {\n sortValue: type.uint32,\n effect: type.rawStruct(\"Tr2EffectDescription\"),\n hasVertexBufferAccessInRtShadow: type.boolean\n },\n methods: {\n GetTechniqueIndex: [ carbon.method, impl.adapted, impl.reason(\"Carbon returns success through a bool plus output index; CarbonEngineJS returns the index directly or -1 while preserving exact name lookup.\") ],\n GetPassCount: [ carbon.method, impl.adapted, UNVALIDATED_TECHNIQUE_INDEX ],\n GetConstant: [ carbon.method, impl.implemented ],\n GetResource: [ carbon.method, impl.implemented ],\n GetParameterAnnotations: [ carbon.method, impl.implemented ],\n GetSortValue: [ carbon.method, impl.implemented ],\n GetEffectDescription: [ carbon.method, impl.implemented ],\n GetEffect: [ carbon.method, impl.implemented ],\n GetShaderTypeMask: [ carbon.method, impl.adapted, UNVALIDATED_TECHNIQUE_INDEX ],\n ProcessEffect: [ carbon.method, impl.adapted, impl.reason(\"Carbon packs renderer handles assigned while reading; the device-free graph leaves the sort key zero until an engine assigns valid handles.\") ],\n HasVertexBufferAccessInRtShadow: [ carbon.method, impl.implemented ]\n }\n});\n"],"names":["Tr2Shader","CjsModel","sortValue","effect","Tr2EffectDescription","hasVertexBufferAccessInRtShadow","GetTechniqueIndex","name","techniques","length","findIndex","technique","GetPassCount","techniqueIndex","passes","GetConstant","findStageValue","GetResource","stage","iterateStages","resource","findNamedCollectionValue","resources","uav","uavs","GetParameterAnnotations","parameterName","findAnnotationSet","annotations","GetSortValue","GetEffectDescription","GetEffect","GetShaderTypeMask","Number","shaderTypeMask","ProcessEffect","pass","stages","stageInputs","pixelHandle","shader","m_shader","vertexHandle","pixelShader","vertexShader","renderStates","passCount","HasVertexBufferAccessInRtShadow","from","values","options","normalized","Object","hasOwn","fromCarbonBinary","reader","index","readDescription","key","found","push","Array","isArray","find","value","Map","get","entry","item","UNVALIDATED_TECHNIQUE_INDEX","impl","reason","CjsSchema","define","className","family","fields","type","uint32","rawStruct","boolean","methods","carbon","method","adapted","implemented"],"mappings":";;;;AAAA;AACA;;AAKA;AACO,MAAMA,SAAS,SAASC,QAAQ,CACvC;AAEE;AACAC,EAAAA,SAAS,GAAG,CAAC;;AAEb;AACAC,EAAAA,MAAM,GAAG,IAAIC,oBAAoB,EAAE;;AAEnC;AACAC,EAAAA,+BAA+B,GAAG,KAAK;;AAEvC;AACF;AACA;AACA;AACEC,EAAAA,iBAAiBA,CAACC,IAAI,GAAG,MAAM,EAC/B;IACE,MAAMC,UAAU,GAAG,IAAI,CAACL,MAAM,EAAEK,UAAU,IAAI,EAAE;AAChD,IAAA,IAAI,CAACA,UAAU,CAACC,MAAM,EACtB;AACE,MAAA,OAAO,EAAE;AACX,IAAA;IACA,IAAIF,IAAI,KAAK,EAAE,EACf;AACE,MAAA,OAAO,CAAC;AACV,IAAA;IACA,OAAOC,UAAU,CAACE,SAAS,CAACC,SAAS,IAAIA,SAAS,EAAEJ,IAAI,KAAKA,IAAI,CAAC;AACpE,EAAA;;AAEA;AACAK,EAAAA,YAAYA,CAACC,cAAc,GAAG,CAAC,EAC/B;AACE,IAAA,OAAO,IAAI,CAACV,MAAM,EAAEK,UAAU,GAAGK,cAAc,CAAC,EAAEC,MAAM,EAAEL,MAAM,IAAI,CAAC;AACvE,EAAA;;AAEA;AACF;AACA;AACA;EACEM,WAAWA,CAACR,IAAI,EAChB;IACE,OAAOP,SAAS,CAACgB,cAAc,CAAC,IAAI,CAACb,MAAM,EAAEI,IAAI,EAAE,WAAW,CAAC;AACjE,EAAA;;AAEA;AACF;AACA;AACA;EACEU,WAAWA,CAACV,IAAI,EA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,IAAI,CAACC,MAAM,CAAC,8IAA8I,CAAC,CAAE;IAC/M3D,YAAY,EAAE,CAAEsE,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACc,OAAO,EAAEf,2BAA2B,CAAE;IAC1EtD,WAAW,EAAE,CAAEmE,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACe,WAAW,CAAE;IAChDpE,WAAW,EAAE,CAAEiE,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACe,WAAW,CAAE;IAChD5D,uBAAuB,EAAE,CAAEyD,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACe,WAAW,CAAE;IAC5DxD,YAAY,EAAE,CAAEqD,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACe,WAAW,CAAE;IACjDvD,oBAAoB,EAAE,CAAEoD,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACe,WAAW,CAAE;IACzDtD,SAAS,EAAE,CAAEmD,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACe,WAAW,CAAE;IAC9CrD,iBAAiB,EAAE,CAAEkD,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACc,OAAO,EAAEf,2BAA2B,CAAE;AAC/ElC,IAAAA,aAAa,EAAE,CAAE+C,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACc,OAAO,EAAEd,IAAI,CAACC,MAAM,CAAC,6IAA6I,CAAC,CAAE;IAC1MxB,+BAA+B,EAAE,CAAEmC,MAAM,CAACC,MAAM,EAAEb,IAAI,CAACe,WAAW;AACpE;AACF,CAAC,CAAC;;;;"}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { CjsSchema, type } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
-
import { CjsModel } from '@carbonenginejs/runtime-utils/model';
|
|
3
|
-
|
|
4
|
-
// Source: trinity/trinity/Resources/Tr2EffectRes.h
|
|
5
|
-
// Schema: format-carbon resources/Tr2ShaderPermutation.json; maintained by runtime-resource.
|
|
6
|
-
|
|
1
|
+
import { CjsSchema, type } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
+
import { CjsModel } from '@carbonenginejs/runtime-utils/model';
|
|
3
|
+
|
|
4
|
+
// Source: trinity/trinity/Resources/Tr2EffectRes.h
|
|
5
|
+
// Schema: format-carbon resources/Tr2ShaderPermutation.json; maintained by runtime-resource.
|
|
6
|
+
|
|
7
7
|
/**
|
|
8
8
|
* Describes one authored effect permutation and the option values a shader
|
|
9
9
|
* resolver may select.
|
|
10
10
|
*
|
|
11
11
|
* This is resource metadata only. Backend shader compilation and pipeline
|
|
12
12
|
* realization remain engine responsibilities.
|
|
13
|
-
*/
|
|
14
|
-
class Tr2ShaderPermutation extends CjsModel {
|
|
15
|
-
/** Authored permutation name. */
|
|
16
|
-
name = "";
|
|
17
|
-
|
|
18
|
-
/** Ordered option names accepted by the permutation. */
|
|
19
|
-
options = [];
|
|
20
|
-
|
|
21
|
-
/** Index of the option selected when a caller supplies no override. */
|
|
22
|
-
defaultOption = 0;
|
|
23
|
-
|
|
24
|
-
/** Human-readable description retained from the effect resource. */
|
|
25
|
-
description = "";
|
|
26
|
-
|
|
27
|
-
/** Carbon permutation category value. */
|
|
28
|
-
type = 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Declared imperatively rather than with decorators, so this module stays
|
|
32
|
-
// plain ESM that loads from source without a transform. The decorator
|
|
33
|
-
// expressions are reused verbatim, so the registered metadata is identical.
|
|
34
|
-
// Statics belong in `methods`: decorateMethod targets the prototype and
|
|
35
|
-
// would register a static as an instance field.
|
|
36
|
-
CjsSchema.define(Tr2ShaderPermutation, {
|
|
37
|
-
className: "Tr2ShaderPermutation",
|
|
38
|
-
family: "resources",
|
|
39
|
-
fields: {
|
|
40
|
-
name: type.string,
|
|
41
|
-
options: type.list("BlueSharedString"),
|
|
42
|
-
defaultOption: type.uint64,
|
|
43
|
-
description: type.string,
|
|
44
|
-
type: type.uint8
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
export { Tr2ShaderPermutation };
|
|
49
|
-
//# sourceMappingURL=Tr2ShaderPermutation.js.map
|
|
13
|
+
*/
|
|
14
|
+
class Tr2ShaderPermutation extends CjsModel {
|
|
15
|
+
/** Authored permutation name. */
|
|
16
|
+
name = "";
|
|
17
|
+
|
|
18
|
+
/** Ordered option names accepted by the permutation. */
|
|
19
|
+
options = [];
|
|
20
|
+
|
|
21
|
+
/** Index of the option selected when a caller supplies no override. */
|
|
22
|
+
defaultOption = 0;
|
|
23
|
+
|
|
24
|
+
/** Human-readable description retained from the effect resource. */
|
|
25
|
+
description = "";
|
|
26
|
+
|
|
27
|
+
/** Carbon permutation category value. */
|
|
28
|
+
type = 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Declared imperatively rather than with decorators, so this module stays
|
|
32
|
+
// plain ESM that loads from source without a transform. The decorator
|
|
33
|
+
// expressions are reused verbatim, so the registered metadata is identical.
|
|
34
|
+
// Statics belong in `methods`: decorateMethod targets the prototype and
|
|
35
|
+
// would register a static as an instance field.
|
|
36
|
+
CjsSchema.define(Tr2ShaderPermutation, {
|
|
37
|
+
className: "Tr2ShaderPermutation",
|
|
38
|
+
family: "resources",
|
|
39
|
+
fields: {
|
|
40
|
+
name: type.string,
|
|
41
|
+
options: type.list("BlueSharedString"),
|
|
42
|
+
defaultOption: type.uint64,
|
|
43
|
+
description: type.string,
|
|
44
|
+
type: type.uint8
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export { Tr2ShaderPermutation };
|
|
49
|
+
//# sourceMappingURL=Tr2ShaderPermutation.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { GetGlobalEffectOptions, ModifyGlobalEffectOptions, Tr2EffectRes } from './Tr2EffectRes.js';
|
|
2
|
-
export { Tr2MaterialArea } from './Tr2MaterialArea.js';
|
|
3
|
-
export { Tr2MaterialMesh } from './Tr2MaterialMesh.js';
|
|
4
|
-
export { Tr2MaterialRes } from './Tr2MaterialRes.js';
|
|
5
|
-
export { Tr2Shader } from './Tr2Shader.js';
|
|
6
|
-
export { Tr2ShaderPermutation } from './Tr2ShaderPermutation.js';
|
|
7
|
-
export { Tr2EffectConstant } from './reflection/Tr2EffectConstant.js';
|
|
8
|
-
export { Tr2EffectDefine } from './reflection/Tr2EffectDefine.js';
|
|
9
|
-
export { Tr2EffectDescription } from './reflection/Tr2EffectDescription.js';
|
|
10
|
-
export { Tr2EffectLibrary } from './reflection/Tr2EffectLibrary.js';
|
|
11
|
-
export { Tr2EffectParameterAnnotation } from './reflection/Tr2EffectParameterAnnotation.js';
|
|
12
|
-
export { Tr2EffectResource } from './reflection/Tr2EffectResource.js';
|
|
13
|
-
export { Tr2EffectStageInput } from './reflection/Tr2EffectStageInput.js';
|
|
14
|
-
export { Tr2EffectTechnique } from './reflection/Tr2EffectTechnique.js';
|
|
15
|
-
export { Tr2Pass } from './reflection/Tr2Pass.js';
|
|
16
|
-
export { Tr2SamplerSetup } from './sampler/Tr2SamplerSetup.js';
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { GetGlobalEffectOptions, ModifyGlobalEffectOptions, Tr2EffectRes } from './Tr2EffectRes.js';
|
|
2
|
+
export { Tr2MaterialArea } from './Tr2MaterialArea.js';
|
|
3
|
+
export { Tr2MaterialMesh } from './Tr2MaterialMesh.js';
|
|
4
|
+
export { Tr2MaterialRes } from './Tr2MaterialRes.js';
|
|
5
|
+
export { Tr2Shader } from './Tr2Shader.js';
|
|
6
|
+
export { Tr2ShaderPermutation } from './Tr2ShaderPermutation.js';
|
|
7
|
+
export { Tr2EffectConstant } from './reflection/Tr2EffectConstant.js';
|
|
8
|
+
export { Tr2EffectDefine } from './reflection/Tr2EffectDefine.js';
|
|
9
|
+
export { Tr2EffectDescription } from './reflection/Tr2EffectDescription.js';
|
|
10
|
+
export { Tr2EffectLibrary } from './reflection/Tr2EffectLibrary.js';
|
|
11
|
+
export { Tr2EffectParameterAnnotation } from './reflection/Tr2EffectParameterAnnotation.js';
|
|
12
|
+
export { Tr2EffectResource } from './reflection/Tr2EffectResource.js';
|
|
13
|
+
export { Tr2EffectStageInput } from './reflection/Tr2EffectStageInput.js';
|
|
14
|
+
export { Tr2EffectTechnique } from './reflection/Tr2EffectTechnique.js';
|
|
15
|
+
export { Tr2Pass } from './reflection/Tr2Pass.js';
|
|
16
|
+
export { Tr2SamplerSetup } from './sampler/Tr2SamplerSetup.js';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,135 +1,143 @@
|
|
|
1
|
-
import { CjsSchema } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
-
import { CjsModel } from '@carbonenginejs/runtime-utils/model';
|
|
3
|
-
import { isPlainObject
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
name
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
offset
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
size
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
type
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
dimension
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
elements
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
isSRGB
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
isAutoregister
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
type: {
|
|
109
|
-
kind: "
|
|
110
|
-
}
|
|
111
|
-
}, {
|
|
112
|
-
name: "
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
1
|
+
import { CjsSchema } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
+
import { CjsModel } from '@carbonenginejs/runtime-utils/model';
|
|
3
|
+
import { isPlainObject } from '@carbonenginejs/runtime-utils/is';
|
|
4
|
+
import { recordText, toRecordText } from './carbonRecordFields.js';
|
|
5
|
+
|
|
6
|
+
// Source: trinity/trinity/Shader/Tr2EffectDescription.h
|
|
7
|
+
|
|
8
|
+
/** Reflected shader constant metadata. */
|
|
9
|
+
class Tr2EffectConstant extends CjsModel {
|
|
10
|
+
/** name (BlueSharedString) */
|
|
11
|
+
name = "";
|
|
12
|
+
|
|
13
|
+
/** offset (unsigned) */
|
|
14
|
+
offset = 0;
|
|
15
|
+
|
|
16
|
+
/** size (unsigned) */
|
|
17
|
+
size = 0;
|
|
18
|
+
|
|
19
|
+
/** type (Type - enum Type) */
|
|
20
|
+
type = 0;
|
|
21
|
+
|
|
22
|
+
/** dimension (unsigned) */
|
|
23
|
+
dimension = 0;
|
|
24
|
+
|
|
25
|
+
/** elements (unsigned) */
|
|
26
|
+
elements = 0;
|
|
27
|
+
|
|
28
|
+
/** isSRGB (bool) */
|
|
29
|
+
isSRGB = false;
|
|
30
|
+
|
|
31
|
+
/** isAutoregister (bool) */
|
|
32
|
+
isAutoregister = false;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Build one constant from its Carbon v15 description record.
|
|
36
|
+
*
|
|
37
|
+
* The record's numeric fields are already the widths Carbon declares, so this
|
|
38
|
+
* is a rename plus the two byte-to-bool conversions; only `name` needs
|
|
39
|
+
* dereferencing, because strings live in the container's arena.
|
|
40
|
+
*
|
|
41
|
+
* @param {object} record Carbon constant record.
|
|
42
|
+
* @returns {Tr2EffectConstant} Reflected constant.
|
|
43
|
+
*/
|
|
44
|
+
static fromCarbonBinary(record) {
|
|
45
|
+
if (!isPlainObject(record)) {
|
|
46
|
+
throw new TypeError("Carbon effect constant record must be an object");
|
|
47
|
+
}
|
|
48
|
+
const constant = new this();
|
|
49
|
+
constant.name = recordText(record.name);
|
|
50
|
+
constant.offset = record.offset;
|
|
51
|
+
constant.size = record.size;
|
|
52
|
+
constant.type = record.type;
|
|
53
|
+
constant.dimension = record.dimension;
|
|
54
|
+
constant.elements = record.elements;
|
|
55
|
+
constant.isSRGB = !!record.isSRGB;
|
|
56
|
+
constant.isAutoregister = !!record.isAutoregister;
|
|
57
|
+
return constant;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Emit this constant as a Carbon v15 description record.
|
|
62
|
+
*
|
|
63
|
+
* @returns {object} Carbon constant record.
|
|
64
|
+
*/
|
|
65
|
+
toCarbonBinary() {
|
|
66
|
+
return {
|
|
67
|
+
name: toRecordText(this.name),
|
|
68
|
+
offset: this.offset,
|
|
69
|
+
size: this.size,
|
|
70
|
+
type: this.type,
|
|
71
|
+
dimension: this.dimension,
|
|
72
|
+
elements: this.elements,
|
|
73
|
+
isSRGB: this.isSRGB ? 1 : 0,
|
|
74
|
+
isAutoregister: this.isAutoregister ? 1 : 0
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
static Type = Object.freeze({
|
|
78
|
+
FLOAT: 0,
|
|
79
|
+
INT: 1,
|
|
80
|
+
UINT: 2,
|
|
81
|
+
BOOL: 3,
|
|
82
|
+
OTHER: 4
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Declared imperatively rather than with decorators, so this module stays plain
|
|
87
|
+
// ESM that loads from source without a transform, which lets its tests import
|
|
88
|
+
// source instead of build output.
|
|
89
|
+
//
|
|
90
|
+
// Field order matters: it drives GetValues() export order. Statics belong in
|
|
91
|
+
// `methods` here rather than in a decorateMethod() call, which targets the
|
|
92
|
+
// prototype and would register a static as an instance field.
|
|
93
|
+
CjsSchema.define(Tr2EffectConstant, {
|
|
94
|
+
className: "Tr2EffectConstant",
|
|
95
|
+
family: "shader",
|
|
96
|
+
fields: [{
|
|
97
|
+
name: "name",
|
|
98
|
+
type: {
|
|
99
|
+
kind: "string"
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
name: "offset",
|
|
103
|
+
type: {
|
|
104
|
+
kind: "uint32"
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
name: "size",
|
|
108
|
+
type: {
|
|
109
|
+
kind: "uint32"
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
name: "type",
|
|
113
|
+
enum: {
|
|
114
|
+
enumType: "Type"
|
|
115
|
+
},
|
|
116
|
+
type: {
|
|
117
|
+
kind: "int32"
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
name: "dimension",
|
|
121
|
+
type: {
|
|
122
|
+
kind: "uint32"
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
name: "elements",
|
|
126
|
+
type: {
|
|
127
|
+
kind: "uint32"
|
|
128
|
+
}
|
|
129
|
+
}, {
|
|
130
|
+
name: "isSRGB",
|
|
131
|
+
type: {
|
|
132
|
+
kind: "boolean"
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
name: "isAutoregister",
|
|
136
|
+
type: {
|
|
137
|
+
kind: "boolean"
|
|
138
|
+
}
|
|
139
|
+
}]
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
export { Tr2EffectConstant };
|
|
143
|
+
//# sourceMappingURL=Tr2EffectConstant.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tr2EffectConstant.js","sources":["../../../../../src/resource/shader/reflection/Tr2EffectConstant.js"],"sourcesContent":["// Source: trinity/trinity/Shader/Tr2EffectDescription.h\nimport { CjsSchema } from \"@carbonenginejs/runtime-utils/schema\";\nimport { CjsModel } from \"@carbonenginejs/runtime-utils/model\";\nimport {\n isPlainObject
|
|
1
|
+
{"version":3,"file":"Tr2EffectConstant.js","sources":["../../../../../src/resource/shader/reflection/Tr2EffectConstant.js"],"sourcesContent":["// Source: trinity/trinity/Shader/Tr2EffectDescription.h\nimport { CjsSchema } from \"@carbonenginejs/runtime-utils/schema\";\nimport { CjsModel } from \"@carbonenginejs/runtime-utils/model\";\nimport {\n isPlainObject\n} from \"@carbonenginejs/runtime-utils/is\";\nimport { recordText, toRecordText } from \"./carbonRecordFields.js\";\n\n/** Reflected shader constant metadata. */\nexport class Tr2EffectConstant extends CjsModel\n{\n\n /** name (BlueSharedString) */\n name = \"\";\n\n /** offset (unsigned) */\n offset = 0;\n\n /** size (unsigned) */\n size = 0;\n\n /** type (Type - enum Type) */\n type = 0;\n\n /** dimension (unsigned) */\n dimension = 0;\n\n /** elements (unsigned) */\n elements = 0;\n\n /** isSRGB (bool) */\n isSRGB = false;\n\n /** isAutoregister (bool) */\n isAutoregister = false;\n\n /**\n * Build one constant from its Carbon v15 description record.\n *\n * The record's numeric fields are already the widths Carbon declares, so this\n * is a rename plus the two byte-to-bool conversions; only `name` needs\n * dereferencing, because strings live in the container's arena.\n *\n * @param {object} record Carbon constant record.\n * @returns {Tr2EffectConstant} Reflected constant.\n */\n static fromCarbonBinary(record)\n {\n if (!isPlainObject(record))\n {\n throw new TypeError(\"Carbon effect constant record must be an object\");\n }\n\n const constant = new this();\n constant.name = recordText(record.name);\n constant.offset = record.offset;\n constant.size = record.size;\n constant.type = record.type;\n constant.dimension = record.dimension;\n constant.elements = record.elements;\n constant.isSRGB = !!record.isSRGB;\n constant.isAutoregister = !!record.isAutoregister;\n return constant;\n }\n\n /**\n * Emit this constant as a Carbon v15 description record.\n *\n * @returns {object} Carbon constant record.\n */\n toCarbonBinary()\n {\n return {\n name: toRecordText(this.name),\n offset: this.offset,\n size: this.size,\n type: this.type,\n dimension: this.dimension,\n elements: this.elements,\n isSRGB: this.isSRGB ? 1 : 0,\n isAutoregister: this.isAutoregister ? 1 : 0\n };\n }\n\n static Type = Object.freeze({\n FLOAT: 0,\n INT: 1,\n UINT: 2,\n BOOL: 3,\n OTHER: 4\n });\n\n}\n\n// Declared imperatively rather than with decorators, so this module stays plain\n// ESM that loads from source without a transform, which lets its tests import\n// source instead of build output.\n//\n// Field order matters: it drives GetValues() export order. Statics belong in\n// `methods` here rather than in a decorateMethod() call, which targets the\n// prototype and would register a static as an instance field.\nCjsSchema.define(Tr2EffectConstant, {\n className: \"Tr2EffectConstant\",\n family: \"shader\",\n fields: [\n { name: \"name\", type: { kind: \"string\" } },\n { name: \"offset\", type: { kind: \"uint32\" } },\n { name: \"size\", type: { kind: \"uint32\" } },\n { name: \"type\", enum: { enumType: \"Type\" }, type: { kind: \"int32\" } },\n { name: \"dimension\", type: { kind: \"uint32\" } },\n { name: \"elements\", type: { kind: \"uint32\" } },\n { name: \"isSRGB\", type: { kind: \"boolean\" } },\n { name: \"isAutoregister\", type: { kind: \"boolean\" } }\n ]\n});\n"],"names":["Tr2EffectConstant","CjsModel","name","offset","size","type","dimension","elements","isSRGB","isAutoregister","fromCarbonBinary","record","isPlainObject","TypeError","constant","recordText","toCarbonBinary","toRecordText","Type","Object","freeze","FLOAT","INT","UINT","BOOL","OTHER","CjsSchema","define","className","family","fields","kind","enum","enumType"],"mappings":";;;;;AAAA;;AAQA;AACO,MAAMA,iBAAiB,SAASC,QAAQ,CAC/C;AAEE;AACAC,EAAAA,IAAI,GAAG,EAAE;;AAET;AACAC,EAAAA,MAAM,GAAG,CAAC;;AAEV;AACAC,EAAAA,IAAI,GAAG,CAAC;;AAER;AACAC,EAAAA,IAAI,GAAG,CAAC;;AAER;AACAC,EAAAA,SAAS,GAAG,CAAC;;AAEb;AACAC,EAAAA,QAAQ,GAAG,CAAC;;AAEZ;AACAC,EAAAA,MAAM,GAAG,KAAK;;AAEd;AACAC,EAAAA,cAAc,GAAG,KAAK;;AAEtB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAOC,gBAAgBA,CAACC,MAAM,EAC9B;AACE,IAAA,IAAI,CAACC,aAAa,CAACD,MAAM,CAAC,EAC1B;AACE,MAAA,MAAM,IAAIE,SAAS,CAAC,iDAAiD,CAAC;AACxE,IAAA;AAEA,IAAA,MAAMC,QAAQ,GAAG,IAAI,IAAI,EAAE;IAC3BA,QAAQ,CAACZ,IAAI,GAAGa,UAAU,CAACJ,MAAM,CAACT,IAAI,CAAC;AACvCY,IAAAA,QAAQ,CAACX,MAAM,GAAGQ,MAAM,CAACR,MAAM;AAC/BW,IAAAA,QAAQ,CAACV,IAAI,GAAGO,MAAM,CAACP,IAAI;AAC3BU,IAAAA,QAAQ,CAACT,IAAI,GAAGM,MAAM,CAACN,IAAI;AAC3BS,IAAAA,QAAQ,CAACR,SAAS,GAAGK,MAAM,CAACL,SAAS;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C1C;AAAE7B,IAAAA,IAAI,EAAE,QAAQ;AAAEG,IAAAA,IAAI,EAAE;AAAE0B,MAAAA,IAAI,EAAE;AAAS;AAAE,GAAC,EAC5C;AAAE7B,IAAAA,IAAI,EAAE,MAAM;AAAEG,IAAAA,IAAI,EAAE;AAAE0B,MAAAA,IAAI,EAAE;AAAS;AAAE,GAAC,EAC1C;AAAE7B,IAAAA,IAAI,EAAE,MAAM;AAAE8B,IAAAA,IAAI,EAAE;AAAEC,MAAAA,QAAQ,EAAE;KAAQ;AAAE5B,IAAAA,IAAI,EAAE;AAAE0B,MAAAA,IAAI,EAAE;AAAQ;AAAE,GAAC,EACrE;AAAE7B,IAAAA,IAAI,EAAE,WAAW;AAAEG,IAAAA,IAAI,EAAE;AAAE0B,MAAAA,IAAI,EAAE;AAAS;AAAE,GAAC,EAC/C;AAAE7B,IAAAA,IAAI,EAAE,UAAU;AAAEG,IAAAA,IAAI,EAAE;AAAE0B,MAAAA,IAAI,EAAE;AAAS;AAAE,GAAC,EAC9C;AAAE7B,IAAAA,IAAI,EAAE,QAAQ;AAAEG,IAAAA,IAAI,EAAE;AAAE0B,MAAAA,IAAI,EAAE;AAAU;AAAE,GAAC,EAC7C;AAAE7B,IAAAA,IAAI,EAAE,gBAAgB;AAAEG,IAAAA,IAAI,EAAE;AAAE0B,MAAAA,IAAI,EAAE;AAAU;GAAG;AAEzD,CAAC,CAAC;;;;"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { CjsSchema, type } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
-
import { CjsModel } from '@carbonenginejs/runtime-utils/model';
|
|
3
|
-
|
|
4
|
-
// Source: trinity/trinity/Shader/Tr2EffectDescription.h
|
|
5
|
-
|
|
6
|
-
/** Effect compile define retained as source metadata. */
|
|
7
|
-
class Tr2EffectDefine extends CjsModel {
|
|
8
|
-
/** name (const char*) */
|
|
9
|
-
name = "";
|
|
10
|
-
|
|
11
|
-
/** value (const char*) */
|
|
12
|
-
value = "";
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Declared imperatively rather than with decorators, so this module stays
|
|
16
|
-
// plain ESM that loads from source without a transform. The decorator
|
|
17
|
-
// expressions are reused verbatim, so the registered metadata is identical.
|
|
18
|
-
// Statics belong in `methods`: decorateMethod targets the prototype and
|
|
19
|
-
// would register a static as an instance field.
|
|
20
|
-
CjsSchema.define(Tr2EffectDefine, {
|
|
21
|
-
className: "Tr2EffectDefine",
|
|
22
|
-
family: "shader",
|
|
23
|
-
fields: {
|
|
24
|
-
name: type.string,
|
|
25
|
-
value: type.string
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export { Tr2EffectDefine };
|
|
30
|
-
//# sourceMappingURL=Tr2EffectDefine.js.map
|
|
1
|
+
import { CjsSchema, type } from '@carbonenginejs/runtime-utils/schema';
|
|
2
|
+
import { CjsModel } from '@carbonenginejs/runtime-utils/model';
|
|
3
|
+
|
|
4
|
+
// Source: trinity/trinity/Shader/Tr2EffectDescription.h
|
|
5
|
+
|
|
6
|
+
/** Effect compile define retained as source metadata. */
|
|
7
|
+
class Tr2EffectDefine extends CjsModel {
|
|
8
|
+
/** name (const char*) */
|
|
9
|
+
name = "";
|
|
10
|
+
|
|
11
|
+
/** value (const char*) */
|
|
12
|
+
value = "";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Declared imperatively rather than with decorators, so this module stays
|
|
16
|
+
// plain ESM that loads from source without a transform. The decorator
|
|
17
|
+
// expressions are reused verbatim, so the registered metadata is identical.
|
|
18
|
+
// Statics belong in `methods`: decorateMethod targets the prototype and
|
|
19
|
+
// would register a static as an instance field.
|
|
20
|
+
CjsSchema.define(Tr2EffectDefine, {
|
|
21
|
+
className: "Tr2EffectDefine",
|
|
22
|
+
family: "shader",
|
|
23
|
+
fields: {
|
|
24
|
+
name: type.string,
|
|
25
|
+
value: type.string
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export { Tr2EffectDefine };
|
|
30
|
+
//# sourceMappingURL=Tr2EffectDefine.js.map
|