@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":"HlslEffectRes.js","sources":["../../../../../../../src/formats/hlsl/core/tr2/resources/HlslEffectRes.js"],"sourcesContent":["import { HlslReader } from \"../../HlslReader.js\";\nimport { asUint8Array } from \"@carbonenginejs/runtime-utils/bytes\";\nimport { HlslEffectStateManager } from \"../../HlslEffectStateManager.js\";\nimport { HlslShader } from \"../shader/HlslShader.js\";\nimport { HlslShaderOption } from \"../shader/HlslShaderOption.js\";\nimport { HlslShaderPermutation } from \"./HlslShaderPermutation.js\";\n\nconst MIN_SUPPORTED_EFFECT_VERSION = 8;\nconst MAX_SUPPORTED_EFFECT_VERSION = 15;\n\n/**\n * Carbon/Trinity effect resource reader for compiled shader metadata.\n */\nexport class HlslEffectRes\n{\n static globalEffectOptions = [];\n\n /**\n * Creates an empty effect resource ready to load a compiled `.sm_*` payload.\n */\n constructor()\n {\n this.m_data = new Uint8Array(0);\n this.m_version = 0;\n this.m_stringTable = new Uint8Array(0);\n this.m_stringTableSize = 0;\n this.m_offsets = [];\n this.m_offsetCount = 0;\n this.m_permutations = [];\n this.m_shaders = new Map();\n this.m_compilerVersion = null;\n this.m_compilerVersionBytes = null;\n this.m_hash = new Uint8Array(0);\n this.sourcePath = \"\";\n this.loadError = null;\n this.effectStateManager = new HlslEffectStateManager();\n }\n\n /**\n * Reads the effect header, string table, permutation axes, and body offsets.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} source Compiled effect bytes.\n * @param {object} [options] Load metadata and dependency overrides.\n * @param {string} [options.sourcePath] Source path used in reports.\n * @param {string} [options.source] Alternate source label.\n * @param {HlslEffectStateManager} [options.effectStateManager] Registry to receive decoded state.\n * @returns {boolean} True when the header was decoded successfully.\n */\n DoLoad(source, options = {})\n {\n this._reset();\n this.sourcePath = options.sourcePath || options.source || \"\";\n this.effectStateManager = options.effectStateManager || new HlslEffectStateManager();\n\n try\n {\n // Carbon owns a memcpy of the loaded resource. Keep the JS graph\n // equally isolated from later caller mutation.\n this.m_data = Uint8Array.from(asUint8Array(source));\n const stream = new HlslReader(this.m_data, { source: this.sourcePath || \"HlslEffectRes\" });\n this.m_version = stream.readUint32();\n\n if (this.m_version < MIN_SUPPORTED_EFFECT_VERSION || this.m_version > MAX_SUPPORTED_EFFECT_VERSION)\n {\n throw new Error(`Unsupported HlslEffectRes version ${this.m_version}; expected ${MIN_SUPPORTED_EFFECT_VERSION}..${MAX_SUPPORTED_EFFECT_VERSION}`);\n }\n\n if (this.m_version >= 15)\n {\n // The header slot is four bytes, not a u32:\n // `constexpr uint8_t ShaderCompilerVersion[4]` = {major, minor,\n // patch, tweak} (ShaderCompilerConfig.h.in:5), of which Carbon's\n // rebuild check compares only the first three\n // (ModifiedTime.cpp:77). A shipped v15 header reads `01 02 06 00`\n // — compiler 1.2.6.0, matching the ShaderCompiler project\n // version. As a u32 that is 0x00060201, which means nothing.\n //\n // `m_compilerVersionBytes` is the truthful reading and is what new\n // code should use. `m_compilerVersion` keeps the dword form because\n // it is republished as `source.compilerVersion` in the portable\n // reflection, where it is asserted to be an unsigned integer\n // (portableReflection.js:645) and covered by a package digest —\n // changing its shape changes package bytes, which belongs with the\n // format rewrite rather than here.\n const compilerVersionBytes = stream.readRaw(4);\n this.m_compilerVersionBytes = Array.from(compilerVersionBytes);\n this.m_compilerVersion = new DataView(\n compilerVersionBytes.buffer,\n compilerVersionBytes.byteOffset,\n 4\n ).getUint32(0, true);\n this.m_hash = stream.readRaw(32);\n }\n\n this.m_stringTableSize = stream.readUint32();\n if (this.m_stringTableSize > this.m_data.length || stream.offset + this.m_stringTableSize > this.m_data.length)\n {\n throw new Error(\"Invalid effect string table size\");\n }\n this.m_stringTable = this.m_data.subarray(stream.offset, stream.offset + this.m_stringTableSize);\n stream.skip(this.m_stringTableSize);\n stream.setStringTable(this.m_stringTable, this.m_stringTableSize);\n\n const permutationCount = stream.readUint8();\n for (let index = 0; index < permutationCount; index += 1)\n {\n const permutation = new HlslShaderPermutation();\n permutation.name = stream.readString();\n permutation.defaultOption = stream.readUint8();\n permutation.description = stream.readString();\n permutation.type = this.m_version > 5 ? stream.readUint8() : 0;\n\n const optionCount = stream.readUint8();\n for (let optionIndex = 0; optionIndex < optionCount; optionIndex += 1)\n {\n permutation.options.push(stream.readString());\n }\n this.m_permutations.push(permutation);\n }\n\n const headerSize = stream.readUint32();\n if (headerSize === 0)\n {\n throw new Error(\"Effect contains no compiled shader bodies\");\n }\n\n this.m_offsetCount = headerSize;\n for (let index = 0; index < headerSize; index += 1)\n {\n const record = {\n index: stream.readUint32(),\n offset: stream.readUint32(),\n size: stream.readUint32()\n };\n record.end = record.offset + record.size;\n if (record.end > this.m_data.length)\n {\n throw new Error(`Invalid effect body record ${index}`);\n }\n this.m_offsets.push(record);\n }\n\n return true;\n }\n catch (error)\n {\n this.loadError = error;\n this.m_shaders.clear();\n return false;\n }\n }\n\n /**\n * Mirrors Carbon's prepare hook by clearing cached shader bodies.\n *\n * @returns {boolean} True when preparation completed.\n */\n DoPrepare()\n {\n this.m_shaders.clear();\n return true;\n }\n\n /**\n * Resolves a permutation option set to a decoded `HlslShader`.\n *\n * @param {Array<HlslShaderOption|object>|Map<string, string>} [options] Local option choices.\n * @param {number|null} [count] Number of local option entries to consider.\n * @returns {HlslShader|null} Decoded shader or null when no matching body exists.\n */\n GetShader(options = [], count = null)\n {\n if (!this.IsGood())\n {\n return null;\n }\n\n const normalizedOptions = normalizeShaderOptions(options);\n const optionCount = Number.isInteger(count) ? Math.min(count, normalizedOptions.length) : normalizedOptions.length;\n let multiplier = 1;\n let index = 0;\n\n for (const permutation of this.m_permutations)\n {\n let value = permutation.defaultOption;\n const globalOption = HlslEffectRes.globalEffectOptions.find((entry) => entry.name === permutation.name);\n const localOption = normalizedOptions.slice(0, optionCount).find((entry) => entry.name === permutation.name);\n const selected = globalOption || localOption;\n\n if (selected)\n {\n const selectedIndex = permutation.options.findIndex((option) => option === selected.value);\n if (selectedIndex >= 0)\n {\n value = selectedIndex;\n }\n }\n\n index += value * multiplier;\n multiplier *= permutation.options.length || 1;\n }\n\n return this.GetShaderByIndex(index);\n }\n\n /**\n * Decodes the body at an exact permutation-table index without applying\n * global or local option overrides.\n *\n * @param {number} index Exact zero-based permutation-table index.\n * @returns {HlslShader|null} Decoded shader or null when the index/body is unavailable.\n */\n GetShaderByIndex(index)\n {\n if (!Number.isSafeInteger(index) || index < 0)\n {\n throw new TypeError(\"HlslEffectRes body index must be a non-negative safe integer\");\n }\n if (!this.IsGood())\n {\n return null;\n }\n if (this.m_shaders.has(index))\n {\n return this.m_shaders.get(index);\n }\n\n const offset = this.m_offsets[index];\n if (!offset)\n {\n return null;\n }\n\n const shader = new HlslShader();\n const buffer = this.m_data.subarray(offset.offset, offset.end);\n const ok = shader.GetEffect().Read(\n buffer,\n offset.size,\n this.m_version,\n this.m_stringTable,\n this.m_stringTableSize,\n this.sourcePath,\n { effectStateManager: this.effectStateManager }\n );\n if (!ok)\n {\n return null;\n }\n\n shader.ProcessEffect();\n this.m_shaders.set(index, shader);\n return shader;\n }\n\n /**\n * Reports whether the effect header has been loaded without error.\n *\n * @returns {boolean} True when this resource has usable effect data.\n */\n IsGood()\n {\n return !this.loadError && this.m_data.length > 0 && this.m_version >= MIN_SUPPORTED_EFFECT_VERSION;\n }\n\n /**\n * Reports whether byte memory usage is known for this resource.\n *\n * @returns {boolean} Always true for byte-backed JavaScript resources.\n */\n IsMemoryUsageKnown()\n {\n return true;\n }\n\n /**\n * Returns the byte size of the loaded effect payload.\n *\n * @returns {number} Loaded byte count.\n */\n GetMemoryUsage()\n {\n return this.m_data.length;\n }\n\n /**\n * Clears decoded shader body caches while keeping the loaded header data.\n */\n ReleaseResources()\n {\n this.m_shaders.clear();\n }\n\n /**\n * Returns JSON-safe permutation metadata for tooling and reports.\n *\n * @returns {object[]} Permutation descriptions.\n */\n GetPermutationDescription()\n {\n return this.m_permutations.map((permutation) => permutation.toJSON());\n }\n\n /**\n * Returns a JSON-safe summary of the loaded effect resource.\n *\n * @returns {object} Serializable effect resource summary.\n */\n toJSON()\n {\n return {\n version: this.m_version,\n compilerVersion: this.m_compilerVersion,\n compilerVersionBytes: this.m_compilerVersionBytes,\n sourcePath: this.sourcePath,\n stringTableSize: this.m_stringTableSize,\n offsetCount: this.m_offsetCount,\n permutations: this.m_permutations.map((entry) => entry.toJSON()),\n offsets: this.m_offsets.map((entry) => ({ ...entry })),\n loadError: this.loadError ? {\n name: this.loadError.name,\n message: this.loadError.message\n } : null\n };\n }\n\n /**\n * Resets loaded state before a new `DoLoad` attempt.\n *\n * @private\n */\n _reset()\n {\n this.m_data = new Uint8Array(0);\n this.m_version = 0;\n this.m_stringTable = new Uint8Array(0);\n this.m_stringTableSize = 0;\n this.m_offsets = [];\n this.m_offsetCount = 0;\n this.m_permutations = [];\n this.m_shaders = new Map();\n this.m_compilerVersion = null;\n this.m_compilerVersionBytes = null;\n this.m_hash = new Uint8Array(0);\n this.loadError = null;\n }\n}\n\n/**\n * Applies global shader option overrides used during permutation lookup.\n *\n * @param {Array<HlslShaderOption|object>|Map<string, string>} [changes] Option changes to merge.\n */\nexport function ModifyGlobalEffectOptions(changes = [])\n{\n for (const change of normalizeShaderOptions(changes))\n {\n const index = HlslEffectRes.globalEffectOptions.findIndex((entry) => entry.name === change.name);\n if (!change.value)\n {\n if (index >= 0) HlslEffectRes.globalEffectOptions.splice(index, 1);\n }\n else if (index >= 0)\n {\n HlslEffectRes.globalEffectOptions[index] = change;\n }\n else\n {\n HlslEffectRes.globalEffectOptions.push(change);\n }\n }\n}\n\n/**\n * Returns the current global shader option overrides.\n *\n * @returns {HlslShaderOption[]} Copy of global shader option overrides.\n */\nexport function GetGlobalEffectOptions()\n{\n return HlslEffectRes.globalEffectOptions.slice();\n}\n\n/**\n * Converts supported option input shapes to `HlslShaderOption` instances.\n *\n * @param {Array<HlslShaderOption|object>|Map<string, string>} options Option input.\n * @returns {HlslShaderOption[]} Normalized option list.\n */\nfunction normalizeShaderOptions(options)\n{\n if (options instanceof Map)\n {\n return Array.from(options.entries()).map(([ name, value ]) => new HlslShaderOption(name, value));\n }\n if (!Array.isArray(options))\n {\n return [];\n }\n return options.map((entry) =>\n {\n if (entry instanceof HlslShaderOption)\n {\n return entry;\n }\n return new HlslShaderOption(entry?.name || \"\", entry?.value || \"\");\n });\n}\n"],"names":["MIN_SUPPORTED_EFFECT_VERSION","MAX_SUPPORTED_EFFECT_VERSION","HlslEffectRes","globalEffectOptions","constructor","m_data","Uint8Array","m_version","m_stringTable","m_stringTableSize","m_offsets","m_offsetCount","m_permutations","m_shaders","Map","m_compilerVersion","m_compilerVersionBytes","m_hash","sourcePath","loadError","effectStateManager","HlslEffectStateManager","DoLoad","source","options","_reset","from","asUint8Array","stream","HlslReader","readUint32","Error","compilerVersionBytes","readRaw","Array","DataView","buffer","byteOffset","getUint32","length","offset","subarray","skip","setStringTable","permutationCount","readUint8","index","permutation","HlslShaderPermutation","name","readString","defaultOption","description","type","optionCount","optionIndex","push","headerSize","record","size","end","error","clear","DoPrepare","GetShader","count","IsGood","normalizedOptions","normalizeShaderOptions","Number","isInteger","Math","min","multiplier","value","globalOption","find","entry","localOption","slice","selected","selectedIndex","findIndex","option","GetShaderByIndex","isSafeInteger","TypeError","has","get","shader","HlslShader","ok","GetEffect","Read","ProcessEffect","set","IsMemoryUsageKnown","GetMemoryUsage","ReleaseResources","GetPermutationDescription","map","toJSON","version","compilerVersion","stringTableSize","offsetCount","permutations","offsets","message","entries","HlslShaderOption","isArray"],"mappings":";;;;;;;AAOA,MAAMA,4BAA4B,GAAG,CAAC;AACtC,MAAMC,4BAA4B,GAAG,EAAE;;AAEvC;AACA;AACA;AACO,MAAMC,aAAa,CAC1B;EACI,OAAOC,mBAAmB,GAAG,EAAE;;AAE/B;AACJ;AACA;AACIC,EAAAA,WAAWA,GACX;AACI,IAAA,IAAI,CAACC,MAAM,GAAG,IAAIC,UAAU,CAAC,CAAC,CAAC;IAC/B,IAAI,CAACC,SAAS,GAAG,CAAC;AAClB,IAAA,IAAI,CAACC,aAAa,GAAG,IAAIF,UAAU,CAAC,CAAC,CAAC;IACtC,IAAI,CAACG,iBAAiB,GAAG,CAAC;IAC1B,IAAI,CAACC,SAAS,GAAG,EAAE;IACnB,IAAI,CAACC,aAAa,GAAG,CAAC;IACtB,IAAI,CAACC,cAAc,GAAG,EAAE;AACxB,IAAA,IAAI,CAACC,SAAS,GAAG,IAAIC,GAAG,EAAE;IAC1B,IAAI,CAACC,iBAAiB,GAAG,IAAI;IAC7B,IAAI,CAACC,sBAAsB,GAAG,IAAI;AAClC,IAAA,IAAI,CAACC,MAAM,GAAG,IAAIX,UAAU,CAAC,CAAC,CAAC;IAC/B,IAAI,CAACY,UAAU,GAAG,EAAE;IACpB,IAAI,CAACC,SAAS,GAAG,IAAI;AACrB,IAAA,IAAI,CAACC,kBAAkB,GAAG,IAAIC,sBAAsB,EAAE;AAC1D,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIC,EAAAA,MAAMA,CAACC,MAAM,EAAEC,OAAO,GAAG,EAAE,EAC3B;IACI,IAAI,CAACC,MAAM,EAAE;IACb,IAAI,CAACP,UAAU,GAAGM,OAAO,CAACN,UAAU,IAAIM,OAAO,CAACD,MAAM,IAA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,YAAYV,GAAG,EAC1B;IACI,OAAOoB,KAAK,CAACR,IAAI,CAACF,OAAO,CAACqF,OAAO,EAAE,CAAC,CAACT,GAAG,CAAC,CAAC,CAAEnD,IAAI,EAAEyB,KAAK,CAAE,KAAK,IAAIoC,gBAAgB,CAAC7D,IAAI,EAAEyB,KAAK,CAAC,CAAC;AACpG,EAAA;AACA,EAAA,IAAI,CAACxC,KAAK,CAAC6E,OAAO,CAACvF,OAAO,CAAC,EAC3B;AACI,IAAA,OAAO,EAAE;AACb,EAAA;AACA,EAAA,OAAOA,OAAO,CAAC4E,GAAG,CAAEvB,KAAK,IACzB;IACI,IAAIA,KAAK,YAAYiC,gBAAgB,EACrC;AACI,MAAA,OAAOjC,KAAK;AAChB,IAAA;AACA,IAAA,OAAO,IAAIiC,gBAAgB,CAACjC,KAAK,EAAE5B,IAAI,IAAI,EAAE,EAAE4B,KAAK,EAAEH,KAAK,IAAI,EAAE,CAAC;AACtE,EAAA,CAAC,CAAC;AACN;;;;"}
|
|
1
|
+
{"version":3,"file":"HlslEffectRes.js","sources":["../../../../../../../src/formats/hlsl/core/tr2/resources/HlslEffectRes.js"],"sourcesContent":["import { asUint8Array } from \"@carbonenginejs/runtime-utils/bytes\";\nimport { HlslEffectStateManager } from \"../../HlslEffectStateManager.js\";\nimport { HlslShader } from \"../shader/HlslShader.js\";\nimport { HlslShaderBytecode } from \"../../HlslShaderBytecode.js\";\nimport { HlslShaderOption } from \"../shader/HlslShaderOption.js\";\nimport { HlslShaderPermutation } from \"./HlslShaderPermutation.js\";\nimport { hlslShaderStageName } from \"../HlslRenderContextEnum.js\";\nimport { runtimeDescriptionFromCarbon } from \"../../carbonDescriptionToRuntime.js\";\nimport { CjsCarbonEffectReader } from \"../../../../../format/carbonEffect/CjsCarbonEffectReader.js\";\nimport { CARBON_EFFECT_MIN_DATA_VERSION } from \"../../../../../format/carbonEffect/carbonEffectRecords.js\";\n\n/**\n * Carbon/Trinity effect resource reader for compiled shader metadata.\n */\nexport class HlslEffectRes\n{\n static globalEffectOptions = [];\n\n /**\n * Creates an empty effect resource ready to load a compiled `.sm_*` payload.\n */\n constructor()\n {\n this.m_data = new Uint8Array(0);\n this.m_reader = null;\n this.m_version = 0;\n this.m_stringTable = new Uint8Array(0);\n this.m_stringTableSize = 0;\n this.m_offsets = [];\n this.m_offsetCount = 0;\n this.m_permutations = [];\n this.m_shaders = new Map();\n this.m_compilerVersion = null;\n this.m_compilerVersionBytes = null;\n this.m_hash = new Uint8Array(0);\n this.sourcePath = \"\";\n this.loadError = null;\n this.effectStateManager = new HlslEffectStateManager();\n }\n\n /**\n * Reads the effect header, string table, permutation axes, and body offsets.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} source Compiled effect bytes.\n * @param {object} [options] Load metadata and dependency overrides.\n * @param {string} [options.sourcePath] Source path used in reports.\n * @param {string} [options.source] Alternate source label.\n * @param {HlslEffectStateManager} [options.effectStateManager] Registry to receive decoded state.\n * @returns {boolean} True when the header was decoded successfully.\n */\n DoLoad(source, options = {})\n {\n this._reset();\n this.sourcePath = options.sourcePath || options.source || \"\";\n this.effectStateManager = options.effectStateManager || new HlslEffectStateManager();\n\n try\n {\n // Carbon owns a memcpy of the loaded resource. Keep the JS graph\n // equally isolated from later caller mutation.\n this.m_data = Uint8Array.from(asUint8Array(source));\n\n // One header walk, for every accepted version. This header -\n // version, compiler version and source hash where present, arena,\n // permutation axes, offset table - is the layout\n // `CjsCarbonEffectReader` parses, and two hand-written copies of\n // one layout are two chances to disagree. Reading it there also\n // brings three checks a local walk never had: the offset table\n // must be dense and positionally indexed, and the body region must\n // begin exactly where the header ends. Carbon indexes that table\n // positionally without ever reading the stored index, so a sparse\n // or misordered table does not fail there - it silently returns\n // the wrong shader body, which is the failure class the container\n // port exists to close.\n const reader = new CjsCarbonEffectReader(this.m_data, {\n source: this.sourcePath || \"HlslEffectRes\"\n });\n this.m_reader = reader;\n this.m_version = reader.version;\n\n if (reader.compilerVersion)\n {\n this.m_compilerVersionBytes = reader.compilerVersion;\n this.m_compilerVersion = new DataView(\n Uint8Array.from(reader.compilerVersion).buffer\n ).getUint32(0, true);\n }\n this.m_hash = reader.sourceHash ?? new Uint8Array(0);\n this.m_stringTableSize = reader.stringTableSize;\n this.m_stringTable = reader.stringTableBytes;\n\n for (const axis of reader.permutations)\n {\n const permutation = new HlslShaderPermutation();\n permutation.name = axis.name.value;\n permutation.defaultOption = axis.defaultOption;\n permutation.description = axis.description.value;\n permutation.type = axis.type;\n for (const option of axis.options) permutation.options.push(option.value);\n this.m_permutations.push(permutation);\n }\n\n this.m_offsetCount = reader.records.length;\n for (const record of reader.records)\n {\n this.m_offsets.push({\n index: record.index,\n offset: record.offset,\n size: record.size,\n end: record.offset + record.size\n });\n }\n\n return true;\n }\n catch (error)\n {\n this.loadError = error;\n this.m_shaders.clear();\n return false;\n }\n }\n\n /**\n * Mirrors Carbon's prepare hook by clearing cached shader bodies.\n *\n * @returns {boolean} True when preparation completed.\n */\n DoPrepare()\n {\n this.m_shaders.clear();\n return true;\n }\n\n /**\n * Resolves a permutation option set to a decoded `HlslShader`.\n *\n * @param {Array<HlslShaderOption|object>|Map<string, string>} [options] Local option choices.\n * @param {number|null} [count] Number of local option entries to consider.\n * @returns {HlslShader|null} Decoded shader or null when no matching body exists.\n */\n GetShader(options = [], count = null)\n {\n if (!this.IsGood())\n {\n return null;\n }\n\n const normalizedOptions = normalizeShaderOptions(options);\n const optionCount = Number.isInteger(count) ? Math.min(count, normalizedOptions.length) : normalizedOptions.length;\n let multiplier = 1;\n let index = 0;\n\n for (const permutation of this.m_permutations)\n {\n let value = permutation.defaultOption;\n const globalOption = HlslEffectRes.globalEffectOptions.find((entry) => entry.name === permutation.name);\n const localOption = normalizedOptions.slice(0, optionCount).find((entry) => entry.name === permutation.name);\n const selected = globalOption || localOption;\n\n if (selected)\n {\n const selectedIndex = permutation.options.findIndex((option) => option === selected.value);\n if (selectedIndex >= 0)\n {\n value = selectedIndex;\n }\n }\n\n index += value * multiplier;\n multiplier *= permutation.options.length || 1;\n }\n\n return this.GetShaderByIndex(index);\n }\n\n /**\n * Decodes the body at an exact permutation-table index without applying\n * global or local option overrides.\n *\n * @param {number} index Exact zero-based permutation-table index.\n * @returns {HlslShader|null} Decoded shader or null when the index/body is unavailable.\n */\n GetShaderByIndex(index)\n {\n if (!Number.isSafeInteger(index) || index < 0)\n {\n throw new TypeError(\"HlslEffectRes body index must be a non-negative safe integer\");\n }\n if (!this.IsGood())\n {\n return null;\n }\n if (this.m_shaders.has(index))\n {\n return this.m_shaders.get(index);\n }\n\n const offset = this.m_offsets[index];\n if (!offset || !this.m_reader)\n {\n return null;\n }\n\n // The retained container reader decodes the body's record tree - the\n // single byte-reading implementation - and the corpus-proven adapter\n // maps those records onto the runtime shape. The record tree is a\n // transient internal handoff, never exposed or persisted.\n try\n {\n const records = this.m_reader.readDescription(index);\n const built = runtimeDescriptionFromCarbon(records, {\n effectName: this.sourcePath,\n version: this.m_version,\n effectStateManager: this.effectStateManager,\n bytecodeFor: (stage, stageType) => new HlslShaderBytecode({\n stageType,\n stageName: hlslShaderStageName(stageType),\n bytes: stage.shaderData.bytes,\n shaderSize: stage.shaderData.size,\n stringTableOffset: stage.shaderData.offset,\n effectName: this.sourcePath\n })\n });\n\n const shader = new HlslShader();\n const description = shader.GetEffect();\n description.version = this.m_version;\n description.effectName = this.sourcePath;\n description.effectStateManager = built.effectStateManager;\n description.techniques = built.techniques;\n description.annotations = built.annotations;\n\n shader.ProcessEffect();\n this.m_shaders.set(index, shader);\n return shader;\n }\n catch\n {\n // Mirrors the historical reader contract: an undecodable body is\n // reported as absent rather than thrown, and is not cached so a\n // later caller sees the same result.\n return null;\n }\n }\n\n /**\n * Reports whether the effect header has been loaded without error.\n *\n * @returns {boolean} True when this resource has usable effect data.\n */\n IsGood()\n {\n return !this.loadError && this.m_data.length > 0 && this.m_version >= CARBON_EFFECT_MIN_DATA_VERSION;\n }\n\n /**\n * Reports whether byte memory usage is known for this resource.\n *\n * @returns {boolean} Always true for byte-backed JavaScript resources.\n */\n IsMemoryUsageKnown()\n {\n return true;\n }\n\n /**\n * Returns the byte size of the loaded effect payload.\n *\n * @returns {number} Loaded byte count.\n */\n GetMemoryUsage()\n {\n return this.m_data.length;\n }\n\n /**\n * Clears decoded shader body caches while keeping the loaded header data.\n */\n ReleaseResources()\n {\n this.m_shaders.clear();\n }\n\n /**\n * Returns JSON-safe permutation metadata for tooling and reports.\n *\n * @returns {object[]} Permutation descriptions.\n */\n GetPermutationDescription()\n {\n return this.m_permutations.map((permutation) => permutation.toJSON());\n }\n\n /**\n * Returns a JSON-safe summary of the loaded effect resource.\n *\n * @returns {object} Serializable effect resource summary.\n */\n toJSON()\n {\n return {\n version: this.m_version,\n compilerVersion: this.m_compilerVersion,\n compilerVersionBytes: this.m_compilerVersionBytes,\n sourcePath: this.sourcePath,\n stringTableSize: this.m_stringTableSize,\n offsetCount: this.m_offsetCount,\n permutations: this.m_permutations.map((entry) => entry.toJSON()),\n offsets: this.m_offsets.map((entry) => ({ ...entry })),\n loadError: this.loadError ? {\n name: this.loadError.name,\n message: this.loadError.message\n } : null\n };\n }\n\n /**\n * Resets loaded state before a new `DoLoad` attempt.\n *\n * @private\n */\n _reset()\n {\n this.m_data = new Uint8Array(0);\n this.m_reader = null;\n this.m_version = 0;\n this.m_stringTable = new Uint8Array(0);\n this.m_stringTableSize = 0;\n this.m_offsets = [];\n this.m_offsetCount = 0;\n this.m_permutations = [];\n this.m_shaders = new Map();\n this.m_compilerVersion = null;\n this.m_compilerVersionBytes = null;\n this.m_hash = new Uint8Array(0);\n this.loadError = null;\n }\n}\n\n/**\n * Applies global shader option overrides used during permutation lookup.\n *\n * @param {Array<HlslShaderOption|object>|Map<string, string>} [changes] Option changes to merge.\n */\nexport function ModifyGlobalEffectOptions(changes = [])\n{\n for (const change of normalizeShaderOptions(changes))\n {\n const index = HlslEffectRes.globalEffectOptions.findIndex((entry) => entry.name === change.name);\n if (!change.value)\n {\n if (index >= 0) HlslEffectRes.globalEffectOptions.splice(index, 1);\n }\n else if (index >= 0)\n {\n HlslEffectRes.globalEffectOptions[index] = change;\n }\n else\n {\n HlslEffectRes.globalEffectOptions.push(change);\n }\n }\n}\n\n/**\n * Returns the current global shader option overrides.\n *\n * @returns {HlslShaderOption[]} Copy of global shader option overrides.\n */\nexport function GetGlobalEffectOptions()\n{\n return HlslEffectRes.globalEffectOptions.slice();\n}\n\n/**\n * Converts supported option input shapes to `HlslShaderOption` instances.\n *\n * @param {Array<HlslShaderOption|object>|Map<string, string>} options Option input.\n * @returns {HlslShaderOption[]} Normalized option list.\n */\nfunction normalizeShaderOptions(options)\n{\n if (options instanceof Map)\n {\n return Array.from(options.entries()).map(([ name, value ]) => new HlslShaderOption(name, value));\n }\n if (!Array.isArray(options))\n {\n return [];\n }\n return options.map((entry) =>\n {\n if (entry instanceof HlslShaderOption)\n {\n return entry;\n }\n return new HlslShaderOption(entry?.name || \"\", entry?.value || \"\");\n });\n}\n"],"names":["HlslEffectRes","globalEffectOptions","constructor","m_data","Uint8Array","m_reader","m_version","m_stringTable","m_stringTableSize","m_offsets","m_offsetCount","m_permutations","m_shaders","Map","m_compilerVersion","m_compilerVersionBytes","m_hash","sourcePath","loadError","effectStateManager","HlslEffectStateManager","DoLoad","source","options","_reset","from","asUint8Array","reader","CjsCarbonEffectReader","version","compilerVersion","DataView","buffer","getUint32","sourceHash","stringTableSize","stringTableBytes","axis","permutations","permutation","HlslShaderPermutation","name","value","defaultOption","description","type","option","push","records","length","record","index","offset","size","end","error","clear","DoPrepare","GetShader","count","IsGood","normalizedOptions","normalizeShaderOptions","optionCount","Number","isInteger","Math","min","multiplier","globalOption","find","entry","localOption","slice","selected","selectedIndex","findIndex","GetShaderByIndex","isSafeInteger","TypeError","has","get","readDescription","built","runtimeDescriptionFromCarbon","effectName","bytecodeFor","stage","stageType","HlslShaderBytecode","stageName","hlslShaderStageName","bytes","shaderData","shaderSize","stringTableOffset","shader","HlslShader","GetEffect","techniques","annotations","ProcessEffect","set","CARBON_EFFECT_MIN_DATA_VERSION","IsMemoryUsageKnown","GetMemoryUsage","ReleaseResources","GetPermutationDescription","map","toJSON","compilerVersionBytes","offsetCount","offsets","message","Array","entries","HlslShaderOption","isArray"],"mappings":";;;;;;;;;;;AAWA;AACA;AACA;AACO,MAAMA,aAAa,CAC1B;EACI,OAAOC,mBAAmB,GAAG,EAAE;;AAE/B;AACJ;AACA;AACIC,EAAAA,WAAWA,GACX;AACI,IAAA,IAAI,CAACC,MAAM,GAAG,IAAIC,UAAU,CAAC,CAAC,CAAC;IAC/B,IAAI,CAACC,QAAQ,GAAG,IAAI;IACpB,IAAI,CAACC,SAAS,GAAG,CAAC;AAClB,IAAA,IAAI,CAACC,aAAa,GAAG,IAAIH,UAAU,CAAC,CAAC,CAAC;IACtC,IAAI,CAACI,iBAAiB,GAAG,CAAC;IAC1B,IAAI,CAACC,SAAS,GAAG,EAAE;IACnB,IAAI,CAACC,aAAa,GAAG,CAAC;IACtB,IAAI,CAACC,cAAc,GAAG,EAAE;AACxB,IAAA,IAAI,CAACC,SAAS,GAAG,IAAIC,GAAG,EAAE;IAC1B,IAAI,CAACC,iBAAiB,GAAG,IAAI;IAC7B,IAAI,CAACC,sBAAsB,GAAG,IAAI;AAClC,IAAA,IAAI,CAACC,MAAM,GAAG,IAAIZ,UAAU,CAAC,CAAC,CAAC;IAC/B,IAAI,CAACa,UAAU,GAAG,EAAE;IACpB,IAAI,CAACC,SAAS,GAAG,IAAI;AACrB,IAAA,IAAI,CAACC,kBAAkB,GAAG,IAAIC,sBAAsB,EAAE;AAC1D,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIC,EAAAA,MAAMA,CAACC,MAAM,EAAEC,OAAO,GAAG,EAAE,EAC3B;IACI,IAAI,CAACC,MAAM,EAAE;IACb,IAAI,CAACP,UAAU,GAAGM,OAAO,CAACN,UAAU,IAAIM,OAAO,CAACD,MAAM,IAAI,EAAE;IAC5D,I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
|
|
6
|
-
* Creates an empty permutation description as stored in an effect header.
|
|
7
|
-
*/
|
|
8
|
-
constructor() {
|
|
9
|
-
this.name = "";
|
|
10
|
-
this.options = [];
|
|
11
|
-
this.defaultOption = 0;
|
|
12
|
-
this.description = "";
|
|
13
|
-
this.type = 0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Returns the permutation metadata in report-friendly form.
|
|
18
|
-
*
|
|
19
|
-
* @returns {object} Serializable permutation description.
|
|
20
|
-
*/
|
|
21
|
-
toJSON() {
|
|
22
|
-
return {
|
|
23
|
-
name: this.name,
|
|
24
|
-
options: this.options.slice(),
|
|
25
|
-
defaultOption: this.defaultOption,
|
|
26
|
-
description: this.description,
|
|
27
|
-
type: this.type
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { HlslShaderPermutation };
|
|
33
|
-
//# sourceMappingURL=HlslShaderPermutation.js.map
|
|
1
|
+
/**
|
|
2
|
+
* Trinity shader permutation axis and option metadata.
|
|
3
|
+
*/
|
|
4
|
+
class HlslShaderPermutation {
|
|
5
|
+
/**
|
|
6
|
+
* Creates an empty permutation description as stored in an effect header.
|
|
7
|
+
*/
|
|
8
|
+
constructor() {
|
|
9
|
+
this.name = "";
|
|
10
|
+
this.options = [];
|
|
11
|
+
this.defaultOption = 0;
|
|
12
|
+
this.description = "";
|
|
13
|
+
this.type = 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Returns the permutation metadata in report-friendly form.
|
|
18
|
+
*
|
|
19
|
+
* @returns {object} Serializable permutation description.
|
|
20
|
+
*/
|
|
21
|
+
toJSON() {
|
|
22
|
+
return {
|
|
23
|
+
name: this.name,
|
|
24
|
+
options: this.options.slice(),
|
|
25
|
+
defaultOption: this.defaultOption,
|
|
26
|
+
description: this.description,
|
|
27
|
+
type: this.type
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { HlslShaderPermutation };
|
|
33
|
+
//# sourceMappingURL=HlslShaderPermutation.js.map
|