@carbonenginejs/runtime 0.1.0-alpha.0 → 0.1.0-alpha.1
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/README.md +58 -125
- package/dist/audio/index.js +8 -1
- package/dist/audio/index.js.map +1 -1
- package/dist/audio/trinity/audio/AudActionLog/AudActionLogCB.js +84 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionLogCB.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecord.js +14 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecord.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordExecuteActionOnPlayingID.js +26 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordExecuteActionOnPlayingID.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordPostEvent.js +27 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordPostEvent.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetRTPC.js +27 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetRTPC.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetState.js +25 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetState.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetSwitch.js +26 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetSwitch.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/IAudActionLog.js +58 -0
- package/dist/audio/trinity/audio/AudActionLog/IAudActionLog.js.map +1 -0
- package/dist/audio/trinity/audio/AudManager.js +1 -1
- package/dist/audio/trinity/audio/AudManager.js.map +1 -1
- package/dist/audio/trinity/audio/{AudObstructionOcclusion.js → AudObstructionOcclusion/AudObstructionOcclusion.js} +8 -52
- package/dist/audio/trinity/audio/AudObstructionOcclusion/AudObstructionOcclusion.js.map +1 -0
- package/dist/audio/trinity/audio/AudObstructionOcclusion/EmitterState.js +17 -0
- package/dist/audio/trinity/audio/AudObstructionOcclusion/EmitterState.js.map +1 -0
- package/dist/audio/trinity/audio/AudObstructionOcclusion/FadingValue.js +46 -0
- package/dist/audio/trinity/audio/AudObstructionOcclusion/FadingValue.js.map +1 -0
- package/dist/audio/trinity/index.js +8 -1
- package/dist/audio/trinity/index.js.map +1 -1
- package/dist/character/CjsCharacterAppearanceConstruction.js +5 -0
- package/dist/character/CjsCharacterAppearanceConstruction.js.map +1 -1
- package/dist/character/CjsCharacterAppearanceManager.js +14 -0
- package/dist/character/CjsCharacterAppearanceManager.js.map +1 -1
- package/dist/character/CjsCharacterFoundationConstruction.js +5 -0
- package/dist/character/CjsCharacterFoundationConstruction.js.map +1 -1
- package/dist/character/CjsCharacterTexturePolicy.js +5 -0
- package/dist/character/CjsCharacterTexturePolicy.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesAppearanceAL.js +17 -0
- package/dist/character/gles/CjsCharacterGlesAppearanceAL.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesAtlasRenderer.js +2 -0
- package/dist/character/gles/CjsCharacterGlesAtlasRenderer.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesFoundationTranslator.js +5 -0
- package/dist/character/gles/CjsCharacterGlesFoundationTranslator.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesLegacyConstructionTranslator.js +5 -0
- package/dist/character/gles/CjsCharacterGlesLegacyConstructionTranslator.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesMorphDeformation.js +2 -0
- package/dist/character/gles/CjsCharacterGlesMorphDeformation.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesPaletteCompatibility.js +5 -0
- package/dist/character/gles/CjsCharacterGlesPaletteCompatibility.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesTriangleCoverage.js +5 -0
- package/dist/character/gles/CjsCharacterGlesTriangleCoverage.js.map +1 -1
- package/dist/character/webgl2/CjsCharacterWebgl2EffectRouter.js +9 -0
- package/dist/character/webgl2/CjsCharacterWebgl2EffectRouter.js.map +1 -1
- package/dist/global/blue/CjsScriptCallback.js +142 -0
- package/dist/global/blue/CjsScriptCallback.js.map +1 -0
- package/dist/global/blue/index.js +2 -0
- package/dist/global/blue/index.js.map +1 -0
- package/dist/global/consts/renderContext/formats.js +51 -1
- package/dist/global/consts/renderContext/formats.js.map +1 -1
- package/dist/global/consts/renderContext/index.js +2 -2
- package/dist/global/consts/renderContext/renderStates.js +16 -1
- package/dist/global/consts/renderContext/renderStates.js.map +1 -1
- package/dist/global/contracts/index.js +0 -1
- package/dist/global/contracts/index.js.map +1 -1
- package/dist/global/index.js +4 -3
- package/dist/global/index.js.map +1 -1
- package/dist/global/math/index.js +2 -0
- package/dist/global/math/index.js.map +1 -1
- package/dist/global/math/mesh.js +70 -16
- package/dist/global/math/mesh.js.map +1 -1
- package/dist/global/math/noise.js +47 -68
- package/dist/global/math/noise.js.map +1 -1
- package/dist/global/math/pool.js +18 -3
- package/dist/global/math/pool.js.map +1 -1
- package/dist/global/math/random.js +52 -0
- package/dist/global/math/random.js.map +1 -0
- package/dist/global/math/tri3.js +18 -4
- package/dist/global/math/tri3.js.map +1 -1
- package/dist/global/utils/bytes.js +22 -4
- package/dist/global/utils/bytes.js.map +1 -1
- package/dist/global/utils/checksum.js +80 -0
- package/dist/global/utils/checksum.js.map +1 -0
- package/dist/global/utils/errors/CjsCancellationError.js +36 -0
- package/dist/global/utils/errors/CjsCancellationError.js.map +1 -0
- package/dist/global/utils/errors/CjsError.js +21 -52
- package/dist/global/utils/errors/CjsError.js.map +1 -1
- package/dist/global/utils/errors/abort.js +1 -1
- package/dist/global/utils/errors/abort.js.map +1 -1
- package/dist/global/utils/errors/index.js +2 -1
- package/dist/global/utils/errors/index.js.map +1 -1
- package/dist/global/utils/index.js +4 -2
- package/dist/global/utils/index.js.map +1 -1
- package/dist/index.js +95 -35
- package/dist/index.js.map +1 -1
- package/dist/input/Tr2MainWindow.js +7 -9
- package/dist/input/Tr2MainWindow.js.map +1 -1
- package/dist/resource/CjsResMan.js +33 -39
- package/dist/resource/CjsResMan.js.map +1 -1
- package/dist/resource/CjsResource.js +19 -5
- package/dist/resource/CjsResource.js.map +1 -1
- package/dist/resource/audio/AudioGeometryResData.js +22 -27
- package/dist/resource/audio/AudioGeometryResData.js.map +1 -1
- package/dist/resource/audio/CjsAudioRes.js +4 -5
- package/dist/resource/audio/CjsAudioRes.js.map +1 -1
- package/dist/resource/format/CjsBitReader.js +263 -0
- package/dist/resource/format/CjsBitReader.js.map +1 -0
- package/dist/resource/format/CjsByteReader.js +130 -125
- package/dist/resource/format/CjsByteReader.js.map +1 -1
- package/dist/resource/format/CjsFormat.js +11 -4
- package/dist/resource/format/CjsFormat.js.map +1 -1
- package/dist/resource/format/CjsFormatError.js +37 -1
- package/dist/resource/format/CjsFormatError.js.map +1 -1
- package/dist/resource/format/CjsResourceProbe.js +41 -37
- package/dist/resource/format/CjsResourceProbe.js.map +1 -1
- package/dist/resource/format/carbonRecordGuard.js +33 -0
- package/dist/resource/format/carbonRecordGuard.js.map +1 -0
- package/dist/resource/format/imageSignatures.js +202 -0
- package/dist/resource/format/imageSignatures.js.map +1 -0
- package/dist/resource/format/index.js +2 -1
- package/dist/resource/format/index.js.map +1 -1
- package/dist/resource/format/jsonPolicies.js +180 -0
- package/dist/resource/format/jsonPolicies.js.map +1 -0
- package/dist/resource/formats/black/core/helpers.js +18 -29
- package/dist/resource/formats/black/core/helpers.js.map +1 -1
- package/dist/resource/formats/bnk/CjsBnkFormat.js +4 -3
- package/dist/resource/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/resource/formats/bnk/core/WwiseCursor.js +218 -0
- package/dist/resource/formats/bnk/core/WwiseCursor.js.map +1 -0
- package/dist/resource/formats/bnk/core/busNodes.js +2 -1
- package/dist/resource/formats/bnk/core/busNodes.js.map +1 -1
- package/dist/resource/formats/bnk/core/effectNodes.js +2 -1
- package/dist/resource/formats/bnk/core/effectNodes.js.map +1 -1
- package/dist/resource/formats/bnk/core/eventAction.js +15 -93
- package/dist/resource/formats/bnk/core/eventAction.js.map +1 -1
- package/dist/resource/formats/bnk/core/globalSettings.js +19 -94
- package/dist/resource/formats/bnk/core/globalSettings.js.map +1 -1
- package/dist/resource/formats/bnk/core/helpers.js +2 -48
- package/dist/resource/formats/bnk/core/helpers.js.map +1 -1
- package/dist/resource/formats/bnk/core/musicNodes.js +42 -134
- package/dist/resource/formats/bnk/core/musicNodes.js.map +1 -1
- package/dist/resource/formats/bnk/core/nodeBase.js +20 -111
- package/dist/resource/formats/bnk/core/nodeBase.js.map +1 -1
- package/dist/resource/formats/bnk/core/sfxNodes.js +2 -1
- package/dist/resource/formats/bnk/core/sfxNodes.js.map +1 -1
- package/dist/resource/formats/cmf/CjsCmfFormat.js +242 -228
- package/dist/resource/formats/cmf/CjsCmfFormat.js.map +1 -1
- package/dist/resource/formats/cmf/core/binary.js +54 -60
- package/dist/resource/formats/cmf/core/binary.js.map +1 -1
- package/dist/resource/formats/dds/CjsDdsFormat.js +5 -3
- package/dist/resource/formats/dds/CjsDdsFormat.js.map +1 -1
- package/dist/resource/formats/dds/core/bc6h.js +16 -18
- package/dist/resource/formats/dds/core/bc6h.js.map +1 -1
- package/dist/resource/formats/dds/core/bc7.js +28 -24
- package/dist/resource/formats/dds/core/bc7.js.map +1 -1
- package/dist/resource/formats/dds/core/helpers.js +7 -133
- package/dist/resource/formats/dds/core/helpers.js.map +1 -1
- package/dist/resource/formats/dxbc/CjsDxbcFormat.js +3 -2
- package/dist/resource/formats/dxbc/CjsDxbcFormat.js.map +1 -1
- package/dist/resource/formats/dxbc/core/helpers.js +4 -32
- package/dist/resource/formats/dxbc/core/helpers.js.map +1 -1
- package/dist/resource/formats/fbx/CjsFbxFormat.js +11 -0
- package/dist/resource/formats/fbx/CjsFbxFormat.js.map +1 -1
- package/dist/resource/formats/fbx/core/helpers.js +18 -12
- package/dist/resource/formats/fbx/core/helpers.js.map +1 -1
- package/dist/resource/formats/flac/CjsFlacFormat.js +4 -9
- package/dist/resource/formats/flac/CjsFlacFormat.js.map +1 -1
- package/dist/resource/formats/flac/core/helpers.js +1 -62
- package/dist/resource/formats/flac/core/helpers.js.map +1 -1
- package/dist/resource/formats/gif/CjsGifFormat.js +4 -9
- package/dist/resource/formats/gif/CjsGifFormat.js.map +1 -1
- package/dist/resource/formats/gif/core/helpers.js +1 -63
- package/dist/resource/formats/gif/core/helpers.js.map +1 -1
- package/dist/resource/formats/gltf/CjsGltfFormat.js +4 -3
- package/dist/resource/formats/gltf/CjsGltfFormat.js.map +1 -1
- package/dist/resource/formats/gltf/core/helpers.js +3 -19
- package/dist/resource/formats/gltf/core/helpers.js.map +1 -1
- package/dist/resource/formats/gr2/CjsGr2Format.js +105 -92
- package/dist/resource/formats/gr2/CjsGr2Format.js.map +1 -1
- package/dist/resource/formats/gr2/core/container.js +1 -10
- package/dist/resource/formats/gr2/core/container.js.map +1 -1
- package/dist/resource/formats/gr2/core/helpers.js +24 -35
- package/dist/resource/formats/gr2/core/helpers.js.map +1 -1
- package/dist/resource/formats/gr2/core/shared.js +193 -189
- package/dist/resource/formats/gr2/core/shared.js.map +1 -1
- package/dist/resource/formats/hlsl/CjsHlslFormat.js +4 -3
- package/dist/resource/formats/hlsl/CjsHlslFormat.js.map +1 -1
- package/dist/resource/formats/hlsl/core/helpers.js +1 -30
- package/dist/resource/formats/hlsl/core/helpers.js.map +1 -1
- package/dist/resource/formats/jpeg/CjsJpegFormat.js +5 -3
- package/dist/resource/formats/jpeg/CjsJpegFormat.js.map +1 -1
- package/dist/resource/formats/jpeg/core/helpers.js +7 -134
- package/dist/resource/formats/jpeg/core/helpers.js.map +1 -1
- package/dist/resource/formats/mp3/CjsMp3Format.js +4 -9
- package/dist/resource/formats/mp3/CjsMp3Format.js.map +1 -1
- package/dist/resource/formats/mp3/core/helpers.js +1 -64
- package/dist/resource/formats/mp3/core/helpers.js.map +1 -1
- package/dist/resource/formats/mp4/CjsMp4Format.js +4 -9
- package/dist/resource/formats/mp4/CjsMp4Format.js.map +1 -1
- package/dist/resource/formats/mp4/core/helpers.js +1 -73
- package/dist/resource/formats/mp4/core/helpers.js.map +1 -1
- package/dist/resource/formats/obj/CjsObjFormat.js +4 -3
- package/dist/resource/formats/obj/CjsObjFormat.js.map +1 -1
- package/dist/resource/formats/obj/core/helpers.js +93 -115
- package/dist/resource/formats/obj/core/helpers.js.map +1 -1
- package/dist/resource/formats/ogg/CjsOggFormat.js +4 -3
- package/dist/resource/formats/ogg/CjsOggFormat.js.map +1 -1
- package/dist/resource/formats/ogg/core/helpers.js +1 -15
- package/dist/resource/formats/ogg/core/helpers.js.map +1 -1
- package/dist/resource/formats/ogg/core/vorbis.js +138 -144
- package/dist/resource/formats/ogg/core/vorbis.js.map +1 -1
- package/dist/resource/formats/pickle/CjsPickleFormat.js +83 -114
- package/dist/resource/formats/pickle/CjsPickleFormat.js.map +1 -1
- package/dist/resource/formats/png/CjsPngFormat.js +5 -3
- package/dist/resource/formats/png/CjsPngFormat.js.map +1 -1
- package/dist/resource/formats/png/core/helpers.js +13 -152
- package/dist/resource/formats/png/core/helpers.js.map +1 -1
- package/dist/resource/formats/png/core/writer.js +3 -27
- package/dist/resource/formats/png/core/writer.js.map +1 -1
- package/dist/resource/formats/red/core/helpers.js +19 -29
- package/dist/resource/formats/red/core/helpers.js.map +1 -1
- package/dist/resource/formats/stl/CjsStlFormat.js +158 -147
- package/dist/resource/formats/stl/CjsStlFormat.js.map +1 -1
- package/dist/resource/formats/stl/core/helpers.js +44 -66
- package/dist/resource/formats/stl/core/helpers.js.map +1 -1
- package/dist/resource/formats/tga/CjsTgaFormat.js +5 -3
- package/dist/resource/formats/tga/CjsTgaFormat.js.map +1 -1
- package/dist/resource/formats/tga/core/helpers.js +7 -153
- package/dist/resource/formats/tga/core/helpers.js.map +1 -1
- package/dist/resource/formats/vta/CjsVtaFormat.js +4 -3
- package/dist/resource/formats/vta/CjsVtaFormat.js.map +1 -1
- package/dist/resource/formats/vta/core/helpers.js +1 -17
- package/dist/resource/formats/vta/core/helpers.js.map +1 -1
- package/dist/resource/formats/wav/CjsWavFormat.js +4 -3
- package/dist/resource/formats/wav/CjsWavFormat.js.map +1 -1
- package/dist/resource/formats/wav/core/helpers.js +1 -15
- package/dist/resource/formats/wav/core/helpers.js.map +1 -1
- package/dist/resource/formats/webgl/CjsWebglFormat.js +4 -3
- package/dist/resource/formats/webgl/CjsWebglFormat.js.map +1 -1
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +52 -4
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
- package/dist/resource/formats/webgl/core/helpers.js +39 -68
- package/dist/resource/formats/webgl/core/helpers.js.map +1 -1
- package/dist/resource/formats/webgpu/CjsWebgpuFormat.js +4 -3
- package/dist/resource/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
- package/dist/resource/formats/webgpu/core/helpers.js +4 -30
- package/dist/resource/formats/webgpu/core/helpers.js.map +1 -1
- package/dist/resource/formats/webm/CjsWebmFormat.js +4 -9
- package/dist/resource/formats/webm/CjsWebmFormat.js.map +1 -1
- package/dist/resource/formats/webm/core/helpers.js +1 -73
- package/dist/resource/formats/webm/core/helpers.js.map +1 -1
- package/dist/resource/formats/webp/CjsWebpFormat.js +4 -9
- package/dist/resource/formats/webp/CjsWebpFormat.js.map +1 -1
- package/dist/resource/formats/webp/core/helpers.js +1 -62
- package/dist/resource/formats/webp/core/helpers.js.map +1 -1
- package/dist/resource/formats/wem/CjsWemFormat.js +4 -3
- package/dist/resource/formats/wem/CjsWemFormat.js.map +1 -1
- package/dist/resource/formats/wem/core/bitStream.js +83 -106
- package/dist/resource/formats/wem/core/bitStream.js.map +1 -1
- package/dist/resource/formats/wem/core/codebookLibrary.js +52 -52
- package/dist/resource/formats/wem/core/codebookLibrary.js.map +1 -1
- package/dist/resource/formats/wem/core/helpers.js +1 -15
- package/dist/resource/formats/wem/core/helpers.js.map +1 -1
- package/dist/resource/formats/wem/core/wemToOgg.js +67 -67
- package/dist/resource/formats/wem/core/wemToOgg.js.map +1 -1
- package/dist/resource/geometry/MeshDecalData.js +23 -25
- package/dist/resource/geometry/MeshDecalData.js.map +1 -1
- package/dist/resource/geometry/MeshDecalLodData.js +14 -23
- package/dist/resource/geometry/MeshDecalLodData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryRes.js +299 -284
- package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResAreaData.js +30 -31
- package/dist/resource/geometry/TriGeometryResAreaData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResJointData.js +16 -24
- package/dist/resource/geometry/TriGeometryResJointData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResLodData.js +50 -41
- package/dist/resource/geometry/TriGeometryResLodData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResMeshData.js +32 -32
- package/dist/resource/geometry/TriGeometryResMeshData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResSkeletonData.js +14 -23
- package/dist/resource/geometry/TriGeometryResSkeletonData.js.map +1 -1
- package/dist/resource/geometry/TriJointBinding.js +16 -24
- package/dist/resource/geometry/TriJointBinding.js.map +1 -1
- package/dist/resource/geometry/TriMorphTargetGeometryConstants.js +22 -27
- package/dist/resource/geometry/TriMorphTargetGeometryConstants.js.map +1 -1
- package/dist/resource/geometry/TriRtGeometryConstants.js +50 -41
- package/dist/resource/geometry/TriRtGeometryConstants.js.map +1 -1
- package/dist/resource/geometry/granny/GStateBindingCallbackData.js +12 -22
- package/dist/resource/geometry/granny/GStateBindingCallbackData.js.map +1 -1
- package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js +30 -31
- package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js.map +1 -1
- package/dist/resource/index.js +1 -1
- package/dist/resource/shader/reflection/Tr2EffectConstant.js +16 -17
- package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectDescription.js +26 -28
- package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js +24 -25
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +21 -22
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectResource.js +25 -26
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js +69 -72
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js +17 -18
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2Pass.js +42 -43
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2RenderStateSetup.js +26 -5
- package/dist/resource/shader/reflection/Tr2RenderStateSetup.js.map +1 -1
- package/dist/resource/shader/reflection/carbonRecordFields.js +87 -90
- package/dist/resource/shader/reflection/carbonRecordFields.js.map +1 -1
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js +32 -34
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
- package/dist/resource/texture/CjsTextureArrayRes.js +1 -6
- package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
- package/dist/resource/texture/Tr2TextureLodManager.js +35 -27
- package/dist/resource/texture/Tr2TextureLodManager.js.map +1 -1
- package/dist/resource/texture/Tr2TextureLodUpdateRequest.js +16 -24
- package/dist/resource/texture/Tr2TextureLodUpdateRequest.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePackChannel.js +16 -24
- package/dist/resource/texture/Tr2TexturePackChannel.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipeline.js +24 -20
- package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineParams.js +14 -23
- package/dist/resource/texture/Tr2TexturePipelineParams.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +18 -25
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +11 -16
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +14 -23
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +12 -22
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js +38 -26
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -1
- package/dist/resource/worker/CjsResManMainThreadLoader.js +2 -5
- package/dist/resource/worker/CjsResManMainThreadLoader.js.map +1 -1
- package/dist/resource/worker/CjsResManWorkerLoader.js +6 -7
- package/dist/resource/worker/CjsResManWorkerLoader.js.map +1 -1
- package/dist/resource/worker/protocol.js +18 -1
- package/dist/resource/worker/protocol.js.map +1 -1
- package/dist/sof/EveSOF.js +2 -222
- package/dist/sof/EveSOF.js.map +1 -1
- package/dist/sof/SofDocumentBuilder.js +205 -0
- package/dist/sof/SofDocumentBuilder.js.map +1 -0
- package/dist/sof/faction/ErrSOFFactionColorSetTypeNotFound.js +16 -0
- package/dist/sof/faction/ErrSOFFactionColorSetTypeNotFound.js.map +1 -0
- package/dist/sof/faction/ErrSOFFactionColorSetTypeUnknown.js +16 -0
- package/dist/sof/faction/ErrSOFFactionColorSetTypeUnknown.js.map +1 -0
- package/dist/sof/faction/EveSOFDataFactionColorSet.js +3 -27
- package/dist/sof/faction/EveSOFDataFactionColorSet.js.map +1 -1
- package/dist/sof/faction/index.js +3 -1
- package/dist/sof/faction/index.js.map +1 -1
- package/dist/sof/generic/ErrSOFAreaShaderNotFound.js +18 -0
- package/dist/sof/generic/ErrSOFAreaShaderNotFound.js.map +1 -0
- package/dist/sof/generic/ErrSOFDecalShaderNotFound.js +18 -0
- package/dist/sof/generic/ErrSOFDecalShaderNotFound.js.map +1 -0
- package/dist/sof/generic/ErrSOFMaterialPrefixNotFound.js +21 -0
- package/dist/sof/generic/ErrSOFMaterialPrefixNotFound.js.map +1 -0
- package/dist/sof/generic/ErrSOFPatternMaterialPrefixNotFound.js +21 -0
- package/dist/sof/generic/ErrSOFPatternMaterialPrefixNotFound.js.map +1 -0
- package/dist/sof/generic/EveSOFDataGeneric.js +5 -69
- package/dist/sof/generic/EveSOFDataGeneric.js.map +1 -1
- package/dist/sof/generic/index.js +5 -1
- package/dist/sof/generic/index.js.map +1 -1
- package/dist/sof/index.js +23 -7
- package/dist/sof/index.js.map +1 -1
- package/dist/sof/pattern/ErrSOFProjectionNotFound.js +20 -0
- package/dist/sof/pattern/ErrSOFProjectionNotFound.js.map +1 -0
- package/dist/sof/pattern/EveSOFDataPattern.js +2 -17
- package/dist/sof/pattern/EveSOFDataPattern.js.map +1 -1
- package/dist/sof/pattern/index.js +2 -1
- package/dist/sof/pattern/index.js.map +1 -1
- package/dist/sof/shared/ErrSOFAreaTypeNotFound.js +16 -0
- package/dist/sof/shared/ErrSOFAreaTypeNotFound.js.map +1 -0
- package/dist/sof/shared/ErrSOFLogoSetTypeNotFound.js +16 -0
- package/dist/sof/shared/ErrSOFLogoSetTypeNotFound.js.map +1 -0
- package/dist/sof/shared/ErrSOFLogoSetTypeUnknown.js +16 -0
- package/dist/sof/shared/ErrSOFLogoSetTypeUnknown.js.map +1 -0
- package/dist/sof/shared/EveSOFDataArea.js +2 -13
- package/dist/sof/shared/EveSOFDataArea.js.map +1 -1
- package/dist/sof/shared/EveSOFDataLogoSet.js +3 -27
- package/dist/sof/shared/EveSOFDataLogoSet.js.map +1 -1
- package/dist/sof/shared/EveSOFDataParameter.js +2 -146
- package/dist/sof/shared/EveSOFDataParameter.js.map +1 -1
- package/dist/sof/shared/EveSOFDataParameterBool.js +40 -0
- package/dist/sof/shared/EveSOFDataParameterBool.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterColor.js +36 -0
- package/dist/sof/shared/EveSOFDataParameterColor.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterFloat.js +37 -0
- package/dist/sof/shared/EveSOFDataParameterFloat.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterInt.js +37 -0
- package/dist/sof/shared/EveSOFDataParameterInt.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterVector2.js +37 -0
- package/dist/sof/shared/EveSOFDataParameterVector2.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterVector3.js +37 -0
- package/dist/sof/shared/EveSOFDataParameterVector3.js.map +1 -0
- package/dist/sof/shared/{EveSOFDataSpotlightAttachment.js → EveSOFDataSpotLightAttachment.js} +1 -1
- package/dist/sof/shared/{EveSOFDataSpotlightAttachment.js.map → EveSOFDataSpotLightAttachment.js.map} +1 -1
- package/dist/sof/shared/index.js +13 -4
- package/dist/sof/shared/index.js.map +1 -1
- package/dist/sof/sofDocumentValues.js +33 -0
- package/dist/sof/sofDocumentValues.js.map +1 -0
- package/dist/trinity/controllers/ITr2Controller/ITr2ActionController.js +168 -0
- package/dist/trinity/controllers/ITr2Controller/ITr2ActionController.js.map +1 -0
- package/dist/trinity/controllers/{ITr2Controller.js → ITr2Controller/ITr2Controller.js} +2 -134
- package/dist/trinity/controllers/ITr2Controller/ITr2Controller.js.map +1 -0
- package/dist/trinity/controllers/Tr2Controller.js +2 -1
- package/dist/trinity/controllers/Tr2Controller.js.map +1 -1
- package/dist/trinity/controllers/Tr2ControllerReference.js +2 -1
- package/dist/trinity/controllers/Tr2ControllerReference.js.map +1 -1
- package/dist/trinity/controllers/action/ITr2ControllerAction.js +2 -1
- package/dist/trinity/controllers/action/ITr2ControllerAction.js.map +1 -1
- package/dist/trinity/controllers/action/Tr2ActionSpawnParticles.js +10 -9
- package/dist/trinity/controllers/action/Tr2ActionSpawnParticles.js.map +1 -1
- package/dist/trinity/controllers/expression/CjsControllerExpressionCompileError.js +26 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionCompileError.js.map +1 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionEvaluateError.js +24 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionEvaluateError.js.map +1 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionParser.js +387 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionParser.js.map +1 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionProgram.js +4 -1011
- package/dist/trinity/controllers/expression/CjsControllerExpressionProgram.js.map +1 -1
- package/dist/trinity/controllers/expression/expressionRuntime.js +605 -0
- package/dist/trinity/controllers/expression/expressionRuntime.js.map +1 -0
- package/dist/trinity/controllers/index.js +5 -2
- package/dist/trinity/controllers/index.js.map +1 -1
- package/dist/trinity/controllers/state/ITr2StateMachineStateFinalizer.js +2 -1
- package/dist/trinity/controllers/state/ITr2StateMachineStateFinalizer.js.map +1 -1
- package/dist/trinity/controllers/timeline/Tr2TimelineController.js +2 -1
- package/dist/trinity/controllers/timeline/Tr2TimelineController.js.map +1 -1
- package/dist/trinity/core/ITr2Updateable.js +2 -1
- package/dist/trinity/core/ITr2Updateable.js.map +1 -1
- package/dist/trinity/core/Tr2Blitter.js +6 -3
- package/dist/trinity/core/Tr2Blitter.js.map +1 -1
- package/dist/trinity/core/Tr2Denoiser.js +256 -0
- package/dist/trinity/core/Tr2Denoiser.js.map +1 -0
- package/dist/trinity/core/Tr2GpuResourcePool/GpuResourceHandle.js +115 -0
- package/dist/trinity/core/Tr2GpuResourcePool/GpuResourceHandle.js.map +1 -0
- package/dist/trinity/core/Tr2GpuResourcePool/TextureSize2D.js +79 -0
- package/dist/trinity/core/Tr2GpuResourcePool/TextureSize2D.js.map +1 -0
- package/dist/trinity/core/{Tr2GpuResourcePool.js → Tr2GpuResourcePool/Tr2GpuResourcePool.js} +63 -151
- package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js.map +1 -0
- package/dist/trinity/core/{Tr2QuadRenderer.js → Tr2QuadRenderer/Tr2QuadRenderer.js} +8 -30
- package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRenderer.js.map +1 -0
- package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRendererEffectRecord.js +38 -0
- package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRendererEffectRecord.js.map +1 -0
- package/dist/trinity/core/Tr2RenderUtils.js +20 -3
- package/dist/trinity/core/Tr2RenderUtils.js.map +1 -1
- package/dist/trinity/core/Tr2Renderer.js +146 -1
- package/dist/trinity/core/Tr2Renderer.js.map +1 -1
- package/dist/trinity/core/Tr2ShadowMap.js +135 -14
- package/dist/trinity/core/Tr2ShadowMap.js.map +1 -1
- package/dist/trinity/core/{Tr2TextureArray.js → Tr2TextureArray/Tr2TextureArray.js} +3 -58
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js.map +1 -0
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArrayElement.js +61 -0
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArrayElement.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatch/DefaultKeyGenerator.js +26 -0
- package/dist/trinity/core/batch/TriRenderBatch/DefaultKeyGenerator.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatch/EffectKeyGenerator.js +29 -0
- package/dist/trinity/core/batch/TriRenderBatch/EffectKeyGenerator.js.map +1 -0
- package/dist/trinity/core/batch/{ITriRenderBatchAccumulator.js → TriRenderBatch/ITriRenderBatchAccumulator.js} +30 -30
- package/dist/trinity/core/batch/TriRenderBatch/ITriRenderBatchAccumulator.js.map +1 -0
- package/dist/trinity/core/batch/{Tr2RenderBatch.js → TriRenderBatch/Tr2RenderBatch.js} +81 -154
- package/dist/trinity/core/batch/TriRenderBatch/Tr2RenderBatch.js.map +1 -0
- package/dist/trinity/core/batch/{TriRenderBatchAccumulator.js → TriRenderBatch/TriRenderBatchAccumulator.js} +7 -38
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAccumulator.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlock.js +61 -0
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlock.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlocksWithSharedMaterial.js +40 -0
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlocksWithSharedMaterial.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatchMap.js +6 -1
- package/dist/trinity/core/batch/TriRenderBatchMap.js.map +1 -1
- package/dist/trinity/core/context/Tr2RenderContext.js +75 -57
- package/dist/trinity/core/context/Tr2RenderContext.js.map +1 -1
- package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityEvent.js +67 -0
- package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityEvent.js.map +1 -0
- package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityResults.js +50 -0
- package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityResults.js.map +1 -0
- package/dist/trinity/core/device/Tr2DepthStencil.js +186 -13
- package/dist/trinity/core/device/Tr2DepthStencil.js.map +1 -1
- package/dist/trinity/core/device/{Tr2RingBuffer.js → Tr2RingBuffer/Tr2RingBuffer.js} +27 -79
- package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBuffer.js.map +1 -0
- package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBufferOffsets.js +114 -0
- package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBufferOffsets.js.map +1 -0
- package/dist/trinity/core/device/{Tr2SuballocatedBuffer.js → Tr2SuballocatedBuffer/Tr2SuballocatedBuffer.js} +5 -59
- package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBuffer.js.map +1 -0
- package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBufferAllocation.js +80 -0
- package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBufferAllocation.js.map +1 -0
- package/dist/trinity/core/index.js +42 -15
- package/dist/trinity/core/index.js.map +1 -1
- package/dist/trinity/core/lighting/Tr2LightManager.js +6 -1
- package/dist/trinity/core/lighting/Tr2LightManager.js.map +1 -1
- package/dist/trinity/core/mesh/{ITr2ImpostorSource.js → ITr2ImpostorSource/ITr2ImpostorSource.js} +6 -28
- package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSource.js.map +1 -0
- package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSourceImpostorHash.js +32 -0
- package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSourceImpostorHash.js.map +1 -0
- package/dist/trinity/core/mesh/{ITr2InstanceData.js → ITr2InstanceData/ITr2InstanceData.js} +5 -29
- package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceData.js.map +1 -0
- package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceDataInstanceData.js +33 -0
- package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceDataInstanceData.js.map +1 -0
- package/dist/trinity/core/mesh/Tr2DirectInstanceData.js +2 -1
- package/dist/trinity/core/mesh/Tr2DirectInstanceData.js.map +1 -1
- package/dist/trinity/core/mesh/Tr2MeshBase.js +7 -1
- package/dist/trinity/core/mesh/Tr2MeshBase.js.map +1 -1
- package/dist/trinity/core/mesh/Tr2RuntimeInstanceData.js +2 -1
- package/dist/trinity/core/mesh/Tr2RuntimeInstanceData.js.map +1 -1
- package/dist/trinity/core/mesh/TriGeometryResAllocations.js +6 -2
- package/dist/trinity/core/mesh/TriGeometryResAllocations.js.map +1 -1
- package/dist/trinity/core/rawData/CjsConstantLayout.js +196 -0
- package/dist/trinity/core/rawData/CjsConstantLayout.js.map +1 -0
- package/dist/trinity/core/rawData/CjsPerFrameLayouts.js +8 -3
- package/dist/trinity/core/rawData/CjsPerFrameLayouts.js.map +1 -1
- package/dist/trinity/core/rawData/CjsPerObjectLayouts.js +40 -732
- package/dist/trinity/core/rawData/CjsPerObjectLayouts.js.map +1 -1
- package/dist/trinity/core/rawData/layouts/CjsEveBasicLayout.js +34 -0
- package/dist/trinity/core/rawData/layouts/CjsEveBasicLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveBoosterSetLayout.js +69 -0
- package/dist/trinity/core/rawData/layouts/CjsEveBoosterSetLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildBoosterSetLayout.js +59 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildBoosterSetLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildBulletStormLayout.js +37 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildBulletStormLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildSpherePinLayout.js +44 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildSpherePinLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveLensflareLayout.js +31 -0
- package/dist/trinity/core/rawData/layouts/CjsEveLensflareLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveMissileWarheadLayout.js +29 -0
- package/dist/trinity/core/rawData/layouts/CjsEveMissileWarheadLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEvePerObjectLayout.js +39 -0
- package/dist/trinity/core/rawData/layouts/CjsEvePerObjectLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSceneStaticParticlesLayout.js +30 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSceneStaticParticlesLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectDecalLayout.js +78 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectDecalLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectLayout.js +169 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpacePerObjectLayout.js +107 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpacePerObjectLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpherePinLayout.js +44 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpherePinLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveStretch2Layout.js +34 -0
- package/dist/trinity/core/rawData/layouts/CjsEveStretch2Layout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveTurretSetLayout.js +82 -0
- package/dist/trinity/core/rawData/layouts/CjsEveTurretSetLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsTr2PerObjectLayout.js +42 -0
- package/dist/trinity/core/rawData/layouts/CjsTr2PerObjectLayout.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveBasicPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveBasicPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveBoosterSetPerObjectData.js +59 -0
- package/dist/trinity/core/rawData/perObjectData/EveBoosterSetPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildBoosterSetPerObjectData.js +59 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildBoosterSetPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildBulletStormPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildBulletStormPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildSpherePinPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildSpherePinPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveDecalPerObjectData.js +59 -0
- package/dist/trinity/core/rawData/perObjectData/EveDecalPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveLensflarePerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveLensflarePerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveMissileWarheadPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveMissileWarheadPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveSceneStaticParticlesPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveSceneStaticParticlesPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveSpherePinPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveSpherePinPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveTurretSetPerObjectData.js +59 -0
- package/dist/trinity/core/rawData/perObjectData/EveTurretSetPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/StretchPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/StretchPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/{Tr2PerObjectData.js → perObjectData/Tr2PerObjectData.js} +110 -62
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataPSBuffer.js +104 -0
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataPSBuffer.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataStandard.js +87 -0
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataStandard.js.map +1 -0
- package/dist/trinity/core/variable/TriVariable.js +83 -83
- package/dist/trinity/core/variable/TriVariable.js.map +1 -1
- package/dist/trinity/core/vertex/{Tr2VertexDefinition.js → Tr2VertexDefinition/Tr2VertexDefinition.js} +4 -20
- package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinition.js.map +1 -0
- package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinitionItem.js +29 -0
- package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinitionItem.js.map +1 -0
- package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js +116 -36
- package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js.map +1 -1
- package/dist/trinity/curves/curve/Tr2CurveRandomAxisRotation.js +50 -92
- package/dist/trinity/curves/curve/Tr2CurveRandomAxisRotation.js.map +1 -1
- package/dist/trinity/eve/EveModularObjectModifier.js +9 -5
- package/dist/trinity/eve/EveModularObjectModifier.js.map +1 -1
- package/dist/trinity/eve/IEveInheritPropertiesOwner.js +2 -1
- package/dist/trinity/eve/IEveInheritPropertiesOwner.js.map +1 -1
- package/dist/trinity/eve/IEveSpaceObject2.js +2 -1
- package/dist/trinity/eve/IEveSpaceObject2.js.map +1 -1
- package/dist/trinity/eve/IEveTransform.js +2 -1
- package/dist/trinity/eve/IEveTransform.js.map +1 -1
- package/dist/trinity/eve/attachment/banner/EveBannerSet.js +2 -2
- package/dist/trinity/eve/attachment/banner/EveBannerSet.js.map +1 -1
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2.js +109 -133
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2.js.map +1 -1
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2Item.js +40 -0
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2Item.js.map +1 -0
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2Renderable.js +1 -1
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2Renderable.js.map +1 -1
- package/dist/trinity/eve/attachment/decal/DecalMeshCache.js +2 -14
- package/dist/trinity/eve/attachment/decal/DecalMeshCache.js.map +1 -1
- package/dist/trinity/eve/attachment/decal/DecalMeshCacheMeshBuffers.js +18 -0
- package/dist/trinity/eve/attachment/decal/DecalMeshCacheMeshBuffers.js.map +1 -0
- package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js +1 -1
- package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js.map +1 -1
- package/dist/trinity/eve/attachment/haze/EveHazeSet.js +1 -1
- package/dist/trinity/eve/attachment/haze/EveHazeSet.js.map +1 -1
- package/dist/trinity/eve/attachment/plane/EvePlaneSet.js +1 -1
- package/dist/trinity/eve/attachment/plane/EvePlaneSet.js.map +1 -1
- package/dist/trinity/eve/attachment/spotlight/EveSpotlightSet.js +2 -2
- package/dist/trinity/eve/attachment/spotlight/EveSpotlightSet.js.map +1 -1
- package/dist/trinity/eve/attachment/sprite/EveSpriteLineSet.js +1 -1
- package/dist/trinity/eve/attachment/sprite/EveSpriteLineSet.js.map +1 -1
- package/dist/trinity/eve/attachment/sprite/EveSpriteSet.js +4 -2
- package/dist/trinity/eve/attachment/sprite/EveSpriteSet.js.map +1 -1
- package/dist/trinity/eve/attachment/turrets/EveTurretSet.js +143 -139
- package/dist/trinity/eve/attachment/turrets/EveTurretSet.js.map +1 -1
- package/dist/trinity/eve/camera/EveCamera.js +1 -1
- package/dist/trinity/eve/camera/EveCamera.js.map +1 -1
- package/dist/trinity/eve/child/EveChildBoosterSet.js +12 -1
- package/dist/trinity/eve/child/EveChildBoosterSet.js.map +1 -1
- package/dist/trinity/eve/child/EveChildCloud2.js +178 -151
- package/dist/trinity/eve/child/EveChildCloud2.js.map +1 -1
- package/dist/trinity/eve/child/EveChildContainer.js +141 -141
- package/dist/trinity/eve/child/EveChildContainer.js.map +1 -1
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js +87 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js.map +1 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshArea.js +46 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshArea.js.map +1 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshInstance.js +35 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshInstance.js.map +1 -0
- package/dist/trinity/eve/child/{EveChildInstancedMeshes.js → EveChildInstancedMeshes/EveChildInstancedMeshes.js} +42 -163
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js.map +1 -0
- package/dist/trinity/eve/child/EveChildMesh.js +218 -218
- package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
- package/dist/trinity/eve/child/EveChildPartData/EveChildPartData.js +53 -0
- package/dist/trinity/eve/child/EveChildPartData/EveChildPartData.js.map +1 -0
- package/dist/trinity/eve/child/{EveChildPartData.js → EveChildPartData/EveChildPartDataPartData.js} +9 -45
- package/dist/trinity/eve/child/EveChildPartData/EveChildPartDataPartData.js.map +1 -0
- package/dist/trinity/eve/child/EveChildParticleSystem.js +30 -29
- package/dist/trinity/eve/child/EveChildParticleSystem.js.map +1 -1
- package/dist/trinity/eve/child/EveChildTransform.js +5 -0
- package/dist/trinity/eve/child/EveChildTransform.js.map +1 -1
- package/dist/trinity/eve/child/EveChildTurret.js +7 -0
- package/dist/trinity/eve/child/EveChildTurret.js.map +1 -1
- package/dist/trinity/eve/index.js +10 -4
- package/dist/trinity/eve/index.js.map +1 -1
- package/dist/trinity/eve/lights/Tr2Light.js +5 -0
- package/dist/trinity/eve/lights/Tr2Light.js.map +1 -1
- package/dist/trinity/eve/overlays/overlayBatches.js +6 -1
- package/dist/trinity/eve/overlays/overlayBatches.js.map +1 -1
- package/dist/trinity/eve/particles/static/EveSceneStaticParticles.js +4 -4
- package/dist/trinity/eve/particles/static/EveSceneStaticParticles.js.map +1 -1
- package/dist/trinity/eve/renderable/stretch/EveStretch2.js +76 -71
- package/dist/trinity/eve/renderable/stretch/EveStretch2.js.map +1 -1
- package/dist/trinity/eve/renderable/stretch/EveStretch3.js +1 -1
- package/dist/trinity/eve/renderable/stretch/EveStretch3.js.map +1 -1
- package/dist/trinity/eve/spaceObject/EveShip2.js +3 -3
- package/dist/trinity/eve/spaceObject/EveShip2.js.map +1 -1
- package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +408 -407
- package/dist/trinity/eve/spaceObject/EveSpaceObject2.js.map +1 -1
- package/dist/trinity/eve/ui/EveTacticalOverlay.js +1 -1
- package/dist/trinity/eve/ui/EveTacticalOverlay.js.map +1 -1
- package/dist/trinity/eve/ui/lines/EveCurveLineSet.js +9 -9
- package/dist/trinity/eve/ui/lines/EveCurveLineSet.js.map +1 -1
- package/dist/trinity/eve/ui/lines/EveLineSet.js +27 -25
- package/dist/trinity/eve/ui/lines/EveLineSet.js.map +1 -1
- package/dist/trinity/eve/ui/tacticalOverlay/EveTacticalTrails.js +3 -2
- package/dist/trinity/eve/ui/tacticalOverlay/EveTacticalTrails.js.map +1 -1
- package/dist/trinity/generated/index.js +0 -1
- package/dist/trinity/generated/index.js.map +1 -1
- package/dist/trinity/generated/trinityCore/index.js +0 -1
- package/dist/trinity/generated/trinityCore/index.js.map +1 -1
- package/dist/trinity/index.js +59 -23
- package/dist/trinity/index.js.map +1 -1
- package/dist/trinity/particle/{ITr2GenericEmitter.js → ITr2GenericEmitter/ITr2GenericEmitter.js} +4 -32
- package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitter.js.map +1 -0
- package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitterUpdateArguments.js +36 -0
- package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitterUpdateArguments.js.map +1 -0
- package/dist/trinity/particle/Tr2ParticleSystem.js +4 -2
- package/dist/trinity/particle/Tr2ParticleSystem.js.map +1 -1
- package/dist/trinity/particle/element/Tr2ParticleElementData.js +15 -4
- package/dist/trinity/particle/element/Tr2ParticleElementData.js.map +1 -1
- package/dist/trinity/particle/emitter/Tr2DynamicEmitter.js +21 -20
- package/dist/trinity/particle/emitter/Tr2DynamicEmitter.js.map +1 -1
- package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js +23 -22
- package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js.map +1 -1
- package/dist/trinity/particle/emitter/Tr2StaticEmitter.js +14 -13
- package/dist/trinity/particle/emitter/Tr2StaticEmitter.js.map +1 -1
- package/dist/trinity/particle/index.js +2 -1
- package/dist/trinity/particle/index.js.map +1 -1
- package/dist/trinity/renderJob/step/TriStepPushRenderTarget.js +7 -1
- package/dist/trinity/renderJob/step/TriStepPushRenderTarget.js.map +1 -1
- package/dist/trinity/shader/Tr2Effect.js +131 -58
- package/dist/trinity/shader/Tr2Effect.js.map +1 -1
- package/dist/trinity/shader/Tr2EffectStateManager.js +17 -5
- package/dist/trinity/shader/Tr2EffectStateManager.js.map +1 -1
- package/dist/trinity/shader/Tr2Material.js +21 -4
- package/dist/trinity/shader/Tr2Material.js.map +1 -1
- package/dist/trinity/shader/material/Tr2EffectPassParameters.js +4 -1
- package/dist/trinity/shader/material/Tr2EffectPassParameters.js.map +1 -1
- package/dist/trinity/shader/parameter/Tr2GeometryBufferParameter.js +2 -2
- package/dist/trinity/shader/parameter/Tr2GeometryBufferParameter.js.map +1 -1
- package/dist/trinityal/Tr2BufferAL/Tr2BufferDescriptionAL.js +79 -0
- package/dist/trinityal/Tr2BufferAL/Tr2BufferDescriptionAL.js.map +1 -0
- package/dist/trinityal/{Tr2DeviceResourceAL.js → Tr2DeviceResourceAL/Tr2BaseDeviceResourceAL.js} +77 -79
- package/dist/trinityal/Tr2DeviceResourceAL/Tr2BaseDeviceResourceAL.js.map +1 -0
- package/dist/trinityal/Tr2DeviceResourceAL/Tr2DeviceResourceAL.js +24 -0
- package/dist/trinityal/Tr2DeviceResourceAL/Tr2DeviceResourceAL.js.map +1 -0
- package/dist/trinityal/Tr2DrawUPHelper.js +2 -1
- package/dist/trinityal/Tr2DrawUPHelper.js.map +1 -1
- package/dist/trinityal/Tr2HalHelperStructures/Tr2MsaaDesc.js +45 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2MsaaDesc.js.map +1 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2SamplerDescription.js +154 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2SamplerDescription.js.map +1 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2SubresourceData.js +48 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2SubresourceData.js.map +1 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureCoordBox.js +75 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureCoordBox.js.map +1 -0
- package/dist/trinityal/{Tr2HalHelperStructures.js → Tr2HalHelperStructures/Tr2TextureSubresource.js} +11 -115
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js.map +1 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2Viewport.js +51 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2Viewport.js.map +1 -0
- package/dist/trinityal/{Tr2RenderPassAL.js → Tr2RenderPassAL/Tr2ColorAttachment.js} +5 -28
- package/dist/trinityal/Tr2RenderPassAL/Tr2ColorAttachment.js.map +1 -0
- package/dist/trinityal/Tr2RenderPassAL/Tr2DepthAttachment.js +38 -0
- package/dist/trinityal/Tr2RenderPassAL/Tr2DepthAttachment.js.map +1 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2RegisterMapAL.js +80 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2RegisterMapAL.js.map +1 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetAL.js +76 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetAL.js.map +1 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetALStub.js +96 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetALStub.js.map +1 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetDescriptionAL.js +196 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetDescriptionAL.js.map +1 -0
- package/dist/trinityal/index.js +22 -9
- package/dist/trinityal/index.js.map +1 -1
- package/dist/trinityal/stub/Tr2BufferALStub.js +86 -141
- package/dist/trinityal/stub/Tr2BufferALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2CapsALStub.js +17 -0
- package/dist/trinityal/stub/Tr2CapsALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2ConstantBufferALStub.js +57 -41
- package/dist/trinityal/stub/Tr2ConstantBufferALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2FenceALStub.js +18 -2
- package/dist/trinityal/stub/Tr2FenceALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2GpuTimerALStub.js +97 -0
- package/dist/trinityal/stub/Tr2GpuTimerALStub.js.map +1 -0
- package/dist/trinityal/stub/Tr2OcclusionQueryALStub.js +124 -0
- package/dist/trinityal/stub/Tr2OcclusionQueryALStub.js.map +1 -0
- package/dist/trinityal/stub/Tr2PipelineStatsQueryALStub/Tr2PipelineStatsQueryALStub.js +146 -0
- package/dist/trinityal/stub/Tr2PipelineStatsQueryALStub/Tr2PipelineStatsQueryALStub.js.map +1 -0
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2BindlessResourcesAL.js +28 -0
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2BindlessResourcesAL.js.map +1 -0
- package/dist/trinityal/stub/{Tr2RenderContextALStub.js → Tr2RenderContextALStub/Tr2RenderContextALStub.js} +70 -75
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js.map +1 -0
- package/dist/trinityal/stub/Tr2SamplerStateALStub.js +47 -31
- package/dist/trinityal/stub/Tr2SamplerStateALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2ShaderALStub.js +61 -45
- package/dist/trinityal/stub/Tr2ShaderALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2ShaderProgramALStub.js +51 -33
- package/dist/trinityal/stub/Tr2ShaderProgramALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2SwapChainALStub.js +61 -45
- package/dist/trinityal/stub/Tr2SwapChainALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2TextureALStub.js +188 -171
- package/dist/trinityal/stub/Tr2TextureALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2VertexLayoutALStub.js +43 -27
- package/dist/trinityal/stub/Tr2VertexLayoutALStub.js.map +1 -1
- package/dist/trinityal/stub/{Tr2VideoAdapterInfoALStub.js → Tr2VideoAdapterInfoStub.js} +16 -1
- package/dist/trinityal/stub/Tr2VideoAdapterInfoStub.js.map +1 -0
- package/dist/trinityal/stub/index.js +8 -4
- package/dist/trinityal/stub/index.js.map +1 -1
- package/dist/trinityal/vertexLayoutMatch.js +2 -2
- package/dist/trinityal/vertexLayoutMatch.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuBufferAL.js +105 -90
- package/dist/trinityal/webgpu/CjsWebgpuBufferAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuCapsAL.js +17 -0
- package/dist/trinityal/webgpu/CjsWebgpuCapsAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuConstantBufferAL.js +15 -0
- package/dist/trinityal/webgpu/CjsWebgpuConstantBufferAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuDevice.js +2 -2
- package/dist/trinityal/webgpu/CjsWebgpuDevice.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js +900 -938
- package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuResourceSetAL.js +56 -60
- package/dist/trinityal/webgpu/CjsWebgpuResourceSetAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuSamplerStateAL.js +16 -1
- package/dist/trinityal/webgpu/CjsWebgpuSamplerStateAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuShaderAL.js +100 -379
- package/dist/trinityal/webgpu/CjsWebgpuShaderAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuShaderProgramAL.js +330 -0
- package/dist/trinityal/webgpu/CjsWebgpuShaderProgramAL.js.map +1 -0
- package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js +15 -0
- package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js.map +1 -1
- package/dist/trinityal/webgpu/core/{constantArena.js → CjsWebgpuConstantArena.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuConstantArena.js.map +1 -0
- package/dist/trinityal/webgpu/core/{batchGroups.js → CjsWebgpuEncodeState.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuEncodeState.js.map +1 -0
- package/dist/trinityal/webgpu/core/{perFrameSource.js → CjsWebgpuPerFrameSource.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuPerFrameSource.js.map +1 -0
- package/dist/trinityal/webgpu/core/{pipelineCache.js → CjsWebgpuPipelineCache.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuPipelineCache.js.map +1 -0
- package/dist/trinityal/webgpu/core/{psoDescription.js → CjsWebgpuPsoDescription.js} +2 -2
- package/dist/trinityal/webgpu/core/CjsWebgpuPsoDescription.js.map +1 -0
- package/dist/trinityal/webgpu/core/{renderTarget.js → CjsWebgpuRenderTarget.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuRenderTarget.js.map +1 -0
- package/dist/trinityal/webgpu/core/{samplerSource.js → CjsWebgpuSamplerSource.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuSamplerSource.js.map +1 -0
- package/dist/trinityal/webgpu/core/{textureSource.js → CjsWebgpuTextureSource.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuTextureSource.js.map +1 -0
- package/dist/trinityal/webgpu/core/{trinityBatchDispatcher.js → CjsWebgpuTrinityBatchDispatcher.js} +4 -4
- package/dist/trinityal/webgpu/core/CjsWebgpuTrinityBatchDispatcher.js.map +1 -0
- package/dist/trinityal/webgpu/core/{trinityBatchResolver.js → CjsWebgpuTrinityBatchResolver.js} +81 -81
- package/dist/trinityal/webgpu/core/CjsWebgpuTrinityBatchResolver.js.map +1 -0
- package/dist/trinityal/webgpu/core/{trinityPassEncoder.js → CjsWebgpuTrinityPassEncoder.js} +2 -2
- package/dist/trinityal/webgpu/core/CjsWebgpuTrinityPassEncoder.js.map +1 -0
- package/dist/trinityal/webgpu/core/{workQueue.js → CjsWebgpuWorkQueue.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuWorkQueue.js.map +1 -0
- package/dist/trinityal/webgpu/internal.js +12 -11
- package/dist/trinityal/webgpu/internal.js.map +1 -1
- package/docs/audio/reference/classes/trinity.md +44 -34
- package/docs/character/architecture.md +276 -0
- package/docs/character/reference/character-appearance-plans.md +30 -66
- package/docs/character/reference/prepared-libraries.md +14 -30
- package/docs/global/reference/api.md +2 -1
- package/docs/global/reference/classes/README.md +53 -71
- package/docs/global/reference/classes/dropped.md +16 -0
- package/docs/resource/README.md +19 -15
- package/docs/resource/architecture.md +9 -2
- package/docs/resource/concepts/format-capabilities.md +124 -80
- package/docs/resource/concepts/shared-format-helpers.md +94 -0
- package/docs/resource/formats/README.md +230 -224
- package/docs/resource/formats/bitknit2.md +221 -0
- package/docs/resource/formats/carbon-effect-container.md +184 -269
- package/docs/resource/formats/gr2.md +6 -1
- package/docs/resource/formats/schemabound.md +28 -48
- package/docs/resource/formats/static.md +70 -97
- package/docs/resource/formats/webgl/carbon-constant-layouts.md +8 -8
- package/docs/resource/formats/webgl/decl-io.md +165 -256
- package/docs/resource/formats/webgl/memory-structured.md +64 -142
- package/docs/resource/formats/webgl/texture-sample.md +109 -138
- package/docs/resource/formats/webgpu/formats/carbon-webgpu.md +38 -69
- package/docs/resource/formats/webgpu/guides/effect-packaging.md +54 -116
- package/docs/resource/formats/webgpu/reference/api.md +64 -67
- package/docs/resource/formats/webgpu/reference/wgsl-compatibility.md +104 -260
- package/docs/resource/reference/classes/core.md +256 -236
- package/docs/resource/reference/classes/formats.md +1668 -1672
- package/docs/resource/reference/workers.md +4 -2
- package/docs/sof/reference/classes/core.md +1 -1
- package/docs/sof/reference/classes/faction.md +2 -2
- package/docs/sof/reference/classes/generic.md +4 -4
- package/docs/sof/reference/classes/pattern.md +1 -1
- package/docs/sof/reference/classes/shared.md +10 -10
- package/docs/trinity/architecture.md +55 -44
- package/docs/trinity/concepts/generated-class-lifecycle.md +10 -15
- package/docs/trinity/reference/classes/curves-and-utilities.md +496 -506
- package/docs/trinity/reference/classes/dropped.md +0 -189
- package/docs/trinity/reference/classes/eve-runtime.md +8 -8
- package/docs/trinity/reference/classes/generated.md +0 -10
- package/docs/trinity/reference/classes/particle.md +2 -2
- package/docs/trinity/reference/classes/trinity-core.md +1554 -1256
- package/docs/trinity/reference/implementation-status.md +50 -75
- package/docs/trinity/reference/main-semantic-extraction.md +13 -17
- package/docs/trinityal/reference/classes/README.md +77 -27
- package/docs/trinityal/reference/classes/dropped.md +82 -0
- package/docs/trinityal/webgpu/README.md +3 -1
- package/docs/trinityal/webgpu/architecture.md +121 -228
- package/docs/trinityal/webgpu/reference/api.md +5 -5
- package/docs/trinityal/webgpu/reference/classes/README.md +13 -13
- package/format-notices/gr2/NOTICE +18 -12
- package/format-notices/gr2/THIRD-PARTY-NOTICES.md +5 -5
- package/package.json +4 -1
- package/dist/audio/trinity/audio/AudActionLog.js +0 -173
- package/dist/audio/trinity/audio/AudActionLog.js.map +0 -1
- package/dist/audio/trinity/audio/AudObstructionOcclusion.js.map +0 -1
- package/dist/global/contracts/CjsScriptCallback.js +0 -94
- package/dist/global/contracts/CjsScriptCallback.js.map +0 -1
- package/dist/trinity/controllers/ITr2Controller.js.map +0 -1
- package/dist/trinity/core/Tr2GpuResourcePool.js.map +0 -1
- package/dist/trinity/core/Tr2QuadRenderer.js.map +0 -1
- package/dist/trinity/core/Tr2TextureArray.js.map +0 -1
- package/dist/trinity/core/batch/ITriRenderBatchAccumulator.js.map +0 -1
- package/dist/trinity/core/batch/Tr2RenderBatch.js.map +0 -1
- package/dist/trinity/core/batch/TriRenderBatchAccumulator.js.map +0 -1
- package/dist/trinity/core/context/CjsShadowMapExecutor.js +0 -43
- package/dist/trinity/core/context/CjsShadowMapExecutor.js.map +0 -1
- package/dist/trinity/core/context/CjsVolumetricsExecutor.js +0 -64
- package/dist/trinity/core/context/CjsVolumetricsExecutor.js.map +0 -1
- package/dist/trinity/core/context/Tr2VisibilityResults.js +0 -109
- package/dist/trinity/core/context/Tr2VisibilityResults.js.map +0 -1
- package/dist/trinity/core/device/Tr2RingBuffer.js.map +0 -1
- package/dist/trinity/core/device/Tr2SuballocatedBuffer.js.map +0 -1
- package/dist/trinity/core/mesh/ITr2ImpostorSource.js.map +0 -1
- package/dist/trinity/core/mesh/ITr2InstanceData.js.map +0 -1
- package/dist/trinity/core/rawData/Tr2PerObjectData.js.map +0 -1
- package/dist/trinity/core/rawData/constantLayout.js +0 -175
- package/dist/trinity/core/rawData/constantLayout.js.map +0 -1
- package/dist/trinity/core/vertex/Tr2VertexDefinition.js.map +0 -1
- package/dist/trinity/eve/child/EveChildInstancedMeshes.js.map +0 -1
- package/dist/trinity/eve/child/EveChildPartData.js.map +0 -1
- package/dist/trinity/generated/trinityCore/Tr2Denoiser.js +0 -47
- package/dist/trinity/generated/trinityCore/Tr2Denoiser.js.map +0 -1
- package/dist/trinity/particle/ITr2GenericEmitter.js.map +0 -1
- package/dist/trinityal/Tr2DeviceResourceAL.js.map +0 -1
- package/dist/trinityal/Tr2HalHelperStructures.js.map +0 -1
- package/dist/trinityal/Tr2RenderPassAL.js.map +0 -1
- package/dist/trinityal/Tr2ResourceSetAL.js +0 -419
- package/dist/trinityal/Tr2ResourceSetAL.js.map +0 -1
- package/dist/trinityal/Tr2SamplerDescription.js +0 -72
- package/dist/trinityal/Tr2SamplerDescription.js.map +0 -1
- package/dist/trinityal/stub/Tr2QueryALStub.js +0 -326
- package/dist/trinityal/stub/Tr2QueryALStub.js.map +0 -1
- package/dist/trinityal/stub/Tr2RenderContextALStub.js.map +0 -1
- package/dist/trinityal/stub/Tr2VideoAdapterInfoALStub.js.map +0 -1
- package/dist/trinityal/webgpu/core/batchGroups.js.map +0 -1
- package/dist/trinityal/webgpu/core/constantArena.js.map +0 -1
- package/dist/trinityal/webgpu/core/perFrameSource.js.map +0 -1
- package/dist/trinityal/webgpu/core/pipelineCache.js.map +0 -1
- package/dist/trinityal/webgpu/core/psoDescription.js.map +0 -1
- package/dist/trinityal/webgpu/core/renderTarget.js.map +0 -1
- package/dist/trinityal/webgpu/core/samplerSource.js.map +0 -1
- package/dist/trinityal/webgpu/core/textureSource.js.map +0 -1
- package/dist/trinityal/webgpu/core/trinityBatchDispatcher.js.map +0 -1
- package/dist/trinityal/webgpu/core/trinityBatchResolver.js.map +0 -1
- package/dist/trinityal/webgpu/core/trinityPassEncoder.js.map +0 -1
- package/dist/trinityal/webgpu/core/workQueue.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tr2RenderStateSetup.js","sources":["../../../../../src/resource/shader/reflection/Tr2RenderStateSetup.js"],"sourcesContent":["// Source: trinity/trinity/Shader/Tr2EffectStateManager.h:104\n// `typedef std::map<Tr2RenderContextEnum::RenderState, uint32_t> Tr2RenderStateSetup`\n// registered by Tr2EffectStateManager::RegisterRenderStateSetup (:118), whose\n// returned handle is what Tr2Pass stores in `renderStates`.\n//\n// Carbon keeps a setup raw and replays it onto a D3D device. Neither of our\n// backends is D3D, so the setup is interpreted here instead - once, so two\n// backends cannot disagree about what a Carbon render-state id means.\n//\n// Every Carbon vocabulary it reads comes from #consts/render-context rather\n// than being re-declared here. One object, however many names: a second frozen\n// copy of the same members drifts silently. The ids in particular are a trap -\n// RS_SCISSORTESTENABLE (174) exists in D3D9 and in ccpwgl but NOT in Carbon,\n// whose enum jumps 173 straight to 175.\n//\n// Generic members are named generically; anything true of only one backend is\n// named for that backend. `GetWebgpuRecipe` is a projection, not an override of\n// anything: no polymorphism dispatches on it, and a WebGL sibling returns a\n// different shape because WebGPU folds state into a pipeline at creation while\n// WebGL mutates it per draw.\nimport {\n BlendMode,\n BlendOperation,\n ColorWriteEnable,\n CompareFunc,\n CullMode,\n FillMode,\n RenderState\n} from \"#consts/render-context\";\nimport { float32FromBits } from \"#utils/bytes\";\n\n/**\n * The render states this class interprets, by Carbon id.\n *\n * A subset with intent, taken from the shared table rather than hand-typed:\n * these are the states a draw needs. Everything else Carbon declares is\n * retained uninterpreted under `unhandled`.\n */\nconst RS = Object.freeze({\n ZENABLE: RenderState.RS_ZENABLE,\n FILLMODE: RenderState.RS_FILLMODE,\n ZWRITEENABLE: RenderState.RS_ZWRITEENABLE,\n ALPHATESTENABLE: RenderState.RS_ALPHATESTENABLE,\n SRCBLEND: RenderState.RS_SRCBLEND,\n DESTBLEND: RenderState.RS_DESTBLEND,\n CULLMODE: RenderState.RS_CULLMODE,\n ZFUNC: RenderState.RS_ZFUNC,\n ALPHAREF: RenderState.RS_ALPHAREF,\n ALPHAFUNC: RenderState.RS_ALPHAFUNC,\n ALPHABLENDENABLE: RenderState.RS_ALPHABLENDENABLE,\n COLORWRITEENABLE: RenderState.RS_COLORWRITEENABLE,\n BLENDOP: RenderState.RS_BLENDOP,\n SLOPESCALEDEPTHBIAS: RenderState.RS_SLOPESCALEDEPTHBIAS,\n BLENDFACTOR: RenderState.RS_BLENDFACTOR,\n SRGBWRITEENABLE: RenderState.RS_SRGBWRITEENABLE,\n DEPTHBIAS: RenderState.RS_DEPTHBIAS,\n SEPARATEALPHABLENDENABLE: RenderState.RS_SEPARATEALPHABLENDENABLE,\n SRCBLENDALPHA: RenderState.RS_SRCBLENDALPHA,\n DESTBLENDALPHA: RenderState.RS_DESTBLENDALPHA,\n BLENDOPALPHA: RenderState.RS_BLENDOPALPHA\n});\n\nconst INTERPRETED = new Set(Object.values(RS));\n\n/**\n * Carbon comparison values to neutral spellings.\n *\n * The spelling is backend-neutral on purpose. WebGPU wants `less-equal` and\n * WebGL wants `LEQUAL`; deciding either here would bake a backend into a shared\n * property.\n */\nconst COMPARE = Object.freeze({\n [CompareFunc.CMP_NEVER]: \"never\",\n [CompareFunc.CMP_LESS]: \"less\",\n [CompareFunc.CMP_EQUAL]: \"equal\",\n [CompareFunc.CMP_LESSEQUAL]: \"lessEqual\",\n [CompareFunc.CMP_GREATER]: \"greater\",\n [CompareFunc.CMP_NOTEQUAL]: \"notEqual\",\n [CompareFunc.CMP_GREATEREQUAL]: \"greaterEqual\",\n [CompareFunc.CMP_ALWAYS]: \"always\"\n});\n\n/** Carbon blend modes to neutral spellings. */\nconst BLEND_FACTOR = Object.freeze({\n [BlendMode.BM_ZERO]: \"zero\",\n [BlendMode.BM_ONE]: \"one\",\n [BlendMode.BM_SRCCOLOR]: \"srcColor\",\n [BlendMode.BM_INVSRCCOLOR]: \"invSrcColor\",\n [BlendMode.BM_SRCALPHA]: \"srcAlpha\",\n [BlendMode.BM_INVSRCALPHA]: \"invSrcAlpha\",\n [BlendMode.BM_DESTALPHA]: \"destAlpha\",\n [BlendMode.BM_INVDESTALPHA]: \"invDestAlpha\",\n [BlendMode.BM_DESTCOLOR]: \"destColor\",\n [BlendMode.BM_INVDESTCOLOR]: \"invDestColor\",\n [BlendMode.BM_SRCALPHASAT]: \"srcAlphaSat\",\n [BlendMode.BM_BOTHSRCALPHA]: \"bothSrcAlpha\",\n [BlendMode.BM_BOTHINVSRCALPHA]: \"bothInvSrcAlpha\",\n [BlendMode.BM_BLENDFACTOR]: \"blendFactor\",\n [BlendMode.BM_INVBLENDFACTOR]: \"invBlendFactor\"\n});\n\n/**\n * Carbon blend operations to neutral spellings.\n *\n * `BO_DISABLE` is a real Carbon member, not enum-width padding, so it maps\n * rather than throwing. A setup that authors it is not blending, whatever\n * ALPHABLENDENABLE says.\n */\nconst BLEND_OP = Object.freeze({\n [BlendOperation.BO_DISABLE]: \"disable\",\n [BlendOperation.BO_ADD]: \"add\",\n [BlendOperation.BO_SUBTRACT]: \"subtract\",\n [BlendOperation.BO_REVSUBTRACT]: \"revSubtract\",\n [BlendOperation.BO_MIN]: \"min\",\n [BlendOperation.BO_MAX]: \"max\"\n});\n\n/**\n * Carbon cull modes to neutral spellings, named by the winding DISCARDED.\n *\n * D3D names the winding to cull; a modern API names the face. The two agree\n * only once a front-face winding is chosen, and that belongs to the backend\n * projection rather than to the authored setup.\n */\nconst CULL = Object.freeze({\n [CullMode.CULLMODE_NONE]: \"none\",\n [CullMode.CULLMODE_CW]: \"cw\",\n [CullMode.CULLMODE_CCW]: \"ccw\"\n});\n\n/** Carbon fill modes to neutral spellings. */\nconst FILL = Object.freeze({\n [FillMode.FM_POINT]: \"point\",\n [FillMode.FM_WIREFRAME]: \"wireframe\",\n [FillMode.FM_SOLID]: \"solid\"\n});\n\n/**\n * Carbon's inverted-depth-test override, as a neutral mapping.\n *\n * `Tr2EffectStateManager::SetInvertedDepthTest` (Tr2EffectStateManager.cpp:834)\n * installs an RS_ZFUNC override table that swaps the ordered comparisons and\n * leaves the order-free ones alone. This is the same table in our spelling.\n */\nconst INVERTED_COMPARE = Object.freeze({\n never: \"never\",\n less: \"greater\",\n equal: \"equal\",\n lessEqual: \"greaterEqual\",\n greater: \"less\",\n notEqual: \"notEqual\",\n greaterEqual: \"lessEqual\",\n always: \"always\"\n});\n\n/**\n * Carbon's inverted-cull override, as a neutral mapping.\n *\n * `Tr2EffectStateManager::SetInvertedCullMode` (Tr2EffectStateManager.cpp:815)\n * installs an RS_CULLMODE override that swaps the two windings and leaves\n * `none` alone.\n */\nconst INVERTED_CULL = Object.freeze({ none: \"none\", cw: \"ccw\", ccw: \"cw\" });\n\n/** Neutral comparison spellings to WebGPU's. */\nconst WEBGPU_COMPARE = Object.freeze({\n never: \"never\",\n less: \"less\",\n equal: \"equal\",\n lessEqual: \"less-equal\",\n greater: \"greater\",\n notEqual: \"not-equal\",\n greaterEqual: \"greater-equal\",\n always: \"always\"\n});\n\n/**\n * Neutral blend factors to WebGPU's.\n *\n * `bothSrcAlpha` and `bothInvSrcAlpha` are absent: they are D3D9 fixed-function\n * modes that set the source and destination factors together, and WebGPU has no\n * equivalent. They fail rather than being approximated.\n */\nconst WEBGPU_BLEND_FACTOR = Object.freeze({\n zero: \"zero\",\n one: \"one\",\n srcColor: \"src\",\n invSrcColor: \"one-minus-src\",\n srcAlpha: \"src-alpha\",\n invSrcAlpha: \"one-minus-src-alpha\",\n destAlpha: \"dst-alpha\",\n invDestAlpha: \"one-minus-dst-alpha\",\n destColor: \"dst\",\n invDestColor: \"one-minus-dst\",\n srcAlphaSat: \"src-alpha-saturated\",\n blendFactor: \"constant\",\n invBlendFactor: \"one-minus-constant\"\n});\n\n/**\n * Neutral blend equations to WebGPU's.\n *\n * `disable` is absent: WebGPU expresses \"not blending\" by omitting the blend\n * member, so a disabled operation is resolved before this table is consulted.\n */\nconst WEBGPU_BLEND_OP = Object.freeze({\n add: \"add\",\n subtract: \"subtract\",\n revSubtract: \"reverse-subtract\",\n min: \"min\",\n max: \"max\"\n});\n\n/**\n * Depth-format mantissa widths, for the WebGPU bias conversion.\n *\n * A UNORM depth buffer's smallest increment is `1 / (2^bits - 1)`, so a float\n * bias multiplies by that many units. `depth32float` has no fixed increment -\n * WebGPU defines the unit as format-dependent and implementation-chosen there -\n * so a float bias cannot be converted exactly and is refused.\n */\nconst WEBGPU_DEPTH_UNORM_BITS = Object.freeze({\n depth16unorm: 16,\n depth24plus: 24,\n \"depth24plus-stencil8\": 24\n});\n\n/**\n * WebGPU front-face winding, stated once.\n *\n * Carbon runs D3D's default rasterizer state, in which a clockwise winding is\n * the front face. Every WebGPU cull decision is relative to this.\n */\nconst WEBGPU_FRONT_FACE = \"cw\";\n\n/**\n * Authored values a setup inherits when it sets nothing.\n *\n * These are the D3D defaults Carbon inherits, named through the shared\n * vocabulary rather than repeated as numbers.\n */\nconst DEFAULT_DEPTH_COMPARE = CompareFunc.CMP_LESSEQUAL;\nconst DEFAULT_CULL = CullMode.CULLMODE_CCW;\nconst DEFAULT_FILL = FillMode.FM_SOLID;\nconst DEFAULT_SRC_BLEND = BlendMode.BM_ONE;\nconst DEFAULT_DEST_BLEND = BlendMode.BM_ZERO;\nconst DEFAULT_BLEND_OP = BlendOperation.BO_ADD;\nconst DEFAULT_ALPHA_FUNC = CompareFunc.CMP_ALWAYS;\nconst DEFAULT_COLOR_WRITE = ColorWriteEnable.COLORWRITEENABLE_RED\n | ColorWriteEnable.COLORWRITEENABLE_GREEN\n | ColorWriteEnable.COLORWRITEENABLE_BLUE\n | ColorWriteEnable.COLORWRITEENABLE_ALPHA;\n\n/**\n * Looks a value up in a mapping table, failing on an unmapped one.\n *\n * A silently substituted default here is a wrong draw with no error, which is\n * the expensive failure mode.\n *\n * @param {object} table Mapping table.\n * @param {string|number} value Value to map.\n * @param {string} message Failure message, already naming what was being mapped.\n * @returns {string} Mapped value.\n */\nfunction mapOrFail(table, value, message)\n{\n const mapped = table[value];\n if (mapped === undefined) throw new RangeError(message);\n return mapped;\n}\n\n/**\n * Splits a Carbon colour-write mask into channel flags.\n *\n * @param {number} value Raw mask.\n * @returns {object} Per-channel flags.\n */\nfunction colorWriteMask(value)\n{\n return {\n red: (value & ColorWriteEnable.COLORWRITEENABLE_RED) !== 0,\n green: (value & ColorWriteEnable.COLORWRITEENABLE_GREEN) !== 0,\n blue: (value & ColorWriteEnable.COLORWRITEENABLE_BLUE) !== 0,\n alpha: (value & ColorWriteEnable.COLORWRITEENABLE_ALPHA) !== 0\n };\n}\n\n/**\n * Splits a D3DCOLOR blend constant into normalised channels.\n *\n * @param {number} value Raw ARGB colour.\n * @returns {object} Normalised channels.\n */\nfunction blendConstant(value)\n{\n const unsigned = value >>> 0;\n return {\n r: ((unsigned >>> 16) & 0xff) / 255,\n g: ((unsigned >>> 8) & 0xff) / 255,\n b: (unsigned & 0xff) / 255,\n a: ((unsigned >>> 24) & 0xff) / 255\n };\n}\n\n/**\n * Translates one blend component into WebGPU's vocabulary.\n *\n * @param {{src:string,dst:string,op:string}} component Neutral factors.\n * @returns {object} WebGPU blend component.\n */\nfunction webgpuBlendComponent(component)\n{\n return {\n srcFactor: mapOrFail(\n WEBGPU_BLEND_FACTOR,\n component.src,\n `WebGPU has no blend factor equivalent for Carbon's \"${component.src}\"`\n ),\n dstFactor: mapOrFail(\n WEBGPU_BLEND_FACTOR,\n component.dst,\n `WebGPU has no blend factor equivalent for Carbon's \"${component.dst}\"`\n ),\n operation: mapOrFail(\n WEBGPU_BLEND_OP,\n component.op,\n `WebGPU has no blend operation equivalent for Carbon's \"${component.op}\"`\n )\n };\n}\n\n/** One pass's registered set of render states, interpreted. */\nexport class Tr2RenderStateSetup\n{\n\n /**\n * The raw `[state, value]` pairs this setup actually AUTHORED.\n *\n * RETAINED BECAUSE UNAUTHORED IS NOT THE SAME AS DEFAULT, and losing that\n * distinction cost a hull. Every field below resolves to a default when the\n * pass is silent about it, which reads correctly for one setup and is wrong\n * the moment two are applied in sequence. Carbon sets render states one at a\n * time through D3D, where they are STICKY: `ApplyStandardStates` puts the\n * rendering mode's block down - for RM_OPAQUE that includes `CULLMODE_CW` -\n * and a pass setup that never mentions cull leaves it standing.\n *\n * Ours replaced the whole block, so the pass's silence became the default\n * `CULLMODE_CCW`, which culls the BACK faces where the mode asked to cull the\n * FRONT ones. Every EVE hull then drew its interior: the silhouette is right\n * and the surfaces are the wrong ones, which is a hard thing to see.\n * `Overlay` below is what lets a setup be applied without erasing what it did\n * not speak about.\n */\n authoredStates = [];\n\n /** Depth test, write, comparison, and the two bias terms. */\n depth = {\n test: true,\n write: true,\n compare: \"lessEqual\",\n bias: 0,\n slopeScaledBias: 0\n };\n\n /** Winding that is discarded: `none`, `cw` or `ccw`. */\n cull = \"ccw\";\n\n /** Rasterizer fill: `solid`, `wireframe` or `point`. */\n fill = \"solid\";\n\n /** Blend factors and equation, or null when the setup does not blend. */\n blend = null;\n\n /** Per-channel colour write flags. */\n colorWrite = { red: true, green: true, blue: true, alpha: true };\n\n /** Comparison and reference, or null when the setup does not alpha test. */\n alphaTest = null;\n\n /** Whether the setup writes sRGB-encoded colour. */\n srgbWrite = false;\n\n /**\n * Authored states this class does not interpret, retained verbatim.\n *\n * Stencil, fog, the fixed-function lighting states and point sprites land\n * here rather than being dropped, so a consumer that meets one can assert on\n * it instead of silently rendering without it. Nothing in the current draw\n * path authors them.\n */\n unhandled = [];\n\n // The shared vocabularies, aliased rather than re-declared: one object with a\n // class-scoped name, which is what enum placement requires.\n\n /** @see CompareFunc */\n static CompareFunc = CompareFunc;\n\n /** @see BlendMode */\n static BlendMode = BlendMode;\n\n /** @see BlendOperation */\n static BlendOperation = BlendOperation;\n\n /** @see CullMode */\n static CullMode = CullMode;\n\n /** @see FillMode */\n static FillMode = FillMode;\n\n /** @see ColorWriteEnable */\n static ColorWriteEnable = ColorWriteEnable;\n\n /**\n * Interprets a flat `[state, value, state, value, ...]` list, which is how\n * Carbon stores its built-in rendering-mode setups.\n *\n * MERGING IS CONCATENATION. Carbon re-applies a rendering mode's standard\n * states immediately before a pass's own every time it applies them\n * (Tr2EffectStateManager.cpp:716), so the effective state is the mode's list\n * with the pass's overlaid. Passing `[...standard, ...pass]` yields exactly\n * that, because a repeated state id overwrites the earlier one.\n *\n * @param {Array<number>} keyValues Flat state/value pairs.\n * @returns {Tr2RenderStateSetup} Interpreted setup.\n * @throws {RangeError} When the list has an odd length.\n */\n static fromKeyValues(keyValues)\n {\n const pairs = keyValues ?? [];\n\n if (pairs.length % 2 !== 0)\n {\n throw new RangeError(\"a render-state key/value list must have an even length\");\n }\n\n const renderStateValues = [];\n\n for (let i = 0; i < pairs.length; i += 2)\n {\n renderStateValues.push({ state: pairs[i], value: pairs[i + 1] });\n }\n\n return this.fromPass({ renderStateValues });\n }\n\n\n /**\n * Interprets one reflected pass's authored render states.\n *\n * `depth.test` folds D3D's ZENABLE, including `D3DZB_USEW` (2), which enables\n * the test; the W-buffer distinction has no modern equivalent and no\n * consumer.\n *\n * The two bias values are reinterpreted float bits, not integers. Carbon\n * stores them as raw uint32 patterns like every other float-valued render\n * state.\n *\n * @param {{renderStateValues?: Array<{state:number,value:number}>}} pass Reflected pass.\n * @returns {Tr2RenderStateSetup} Interpreted setup.\n */\n static fromPass(pass)\n {\n const authored = new Map();\n for (const entry of pass?.renderStateValues ?? [])\n {\n authored.set(Number(entry.state), Number(entry.value));\n }\n\n const read = (id, fallback) => (authored.has(id) ? authored.get(id) : fallback);\n const mapState = (table, id, fallback, name) =>\n {\n const value = read(id, fallback);\n return mapOrFail(\n table,\n value,\n `Carbon render state ${name} has no mapping for value ${value}`\n );\n };\n\n const setup = new this();\n\n setup.depth = {\n test: read(RS.ZENABLE, 1) !== 0,\n write: read(RS.ZWRITEENABLE, 1) !== 0,\n compare: mapState(COMPARE, RS.ZFUNC, DEFAULT_DEPTH_COMPARE, \"RS_ZFUNC\"),\n bias: float32FromBits(read(RS.DEPTHBIAS, 0)),\n slopeScaledBias: float32FromBits(read(RS.SLOPESCALEDEPTHBIAS, 0))\n };\n setup.cull = mapState(CULL, RS.CULLMODE, DEFAULT_CULL, \"RS_CULLMODE\");\n setup.fill = mapState(FILL, RS.FILLMODE, DEFAULT_FILL, \"RS_FILLMODE\");\n setup.colorWrite = colorWriteMask(read(RS.COLORWRITEENABLE, DEFAULT_COLOR_WRITE));\n setup.srgbWrite = read(RS.SRGBWRITEENABLE, 0) !== 0;\n\n if (read(RS.ALPHABLENDENABLE, 0) !== 0)\n {\n const srcBlend = read(RS.SRCBLEND, DEFAULT_SRC_BLEND);\n const destBlend = read(RS.DESTBLEND, DEFAULT_DEST_BLEND);\n const blendOp = read(RS.BLENDOP, DEFAULT_BLEND_OP);\n const color = {\n src: mapState(BLEND_FACTOR, RS.SRCBLEND, DEFAULT_SRC_BLEND, \"RS_SRCBLEND\"),\n dst: mapState(BLEND_FACTOR, RS.DESTBLEND, DEFAULT_DEST_BLEND, \"RS_DESTBLEND\"),\n op: mapState(BLEND_OP, RS.BLENDOP, DEFAULT_BLEND_OP, \"RS_BLENDOP\")\n };\n // BO_DISABLE means the setup is not blending, however ALPHABLENDENABLE reads.\n if (color.op !== \"disable\")\n {\n setup.blend = {\n color,\n alpha: read(RS.SEPARATEALPHABLENDENABLE, 0) !== 0\n ? {\n src: mapState(BLEND_FACTOR, RS.SRCBLENDALPHA, srcBlend, \"RS_SRCBLENDALPHA\"),\n dst: mapState(BLEND_FACTOR, RS.DESTBLENDALPHA, destBlend, \"RS_DESTBLENDALPHA\"),\n op: mapState(BLEND_OP, RS.BLENDOPALPHA, blendOp, \"RS_BLENDOPALPHA\")\n }\n : { ...color },\n constant: authored.has(RS.BLENDFACTOR)\n ? blendConstant(authored.get(RS.BLENDFACTOR))\n : null\n };\n }\n }\n\n if (read(RS.ALPHATESTENABLE, 0) !== 0)\n {\n setup.alphaTest = {\n compare: mapState(COMPARE, RS.ALPHAFUNC, DEFAULT_ALPHA_FUNC, \"RS_ALPHAFUNC\"),\n ref: read(RS.ALPHAREF, 0)\n };\n }\n\n for (const [ state, value ] of authored)\n {\n if (!INTERPRETED.has(state)) setup.unhandled.push({ state, value });\n }\n setup.unhandled.sort((left, right) => left.state - right.state);\n\n setup.authoredStates = [ ...authored ].sort((left, right) => left[0] - right[0]);\n\n return setup;\n }\n\n\n /**\n * A setup carrying `base`'s states with `over`'s authored ones on top.\n *\n * This is what makes a sequence of applies behave the way D3D's do, where a\n * state nobody set this draw keeps the value the last one gave it. Carbon\n * relies on that: `ApplyStandardStates` lays down the rendering mode's block\n * and a pass setup then speaks only for what it changes.\n *\n * Returns `over` unchanged when it authors everything `base` did, so the\n * common case allocates nothing and the interned setup is preserved.\n *\n * @param {Tr2RenderStateSetup|null} base The states already in effect.\n * @param {Tr2RenderStateSetup|null} over The setup being applied.\n * @returns {Tr2RenderStateSetup|null} The combined setup.\n */\n static Overlay(base, over)\n {\n if (!base) return over;\n if (!over) return base;\n\n const combined = new Map(base.authoredStates);\n\n for (const [ state, value ] of over.authoredStates) combined.set(state, value);\n\n // Nothing of the base survived, so the applied setup already says it all.\n if (combined.size === over.authoredStates.length) return over;\n\n return Tr2RenderStateSetup.fromPass({\n renderStateValues: [ ...combined ].map(([ state, value ]) => ({ state, value }))\n });\n }\n\n /**\n * A canonical string identifying this exact set of states.\n *\n * Carbon gives a registered setup a handle through\n * `RegisterRenderStateSetup` and reuses it across passes; this is that\n * handle's portable equivalent. It is the canonical serialization rather than\n * a hash, so two different setups cannot collide - a setup is small enough to\n * make that affordable, for the same reason the WebGPU pipeline cache\n * serializes its recipes exactly.\n *\n * Uninterpreted states take part, so two passes that differ only in a state\n * nothing reads are not treated as one.\n *\n * @returns {string} Canonical identity.\n */\n Key()\n {\n return JSON.stringify([\n this.depth.test,\n this.depth.write,\n this.depth.compare,\n this.depth.bias,\n this.depth.slopeScaledBias,\n this.cull,\n this.fill,\n this.blend && [\n this.blend.color.src, this.blend.color.dst, this.blend.color.op,\n this.blend.alpha.src, this.blend.alpha.dst, this.blend.alpha.op,\n this.blend.constant && [\n this.blend.constant.r,\n this.blend.constant.g,\n this.blend.constant.b,\n this.blend.constant.a\n ]\n ],\n [ this.colorWrite.red, this.colorWrite.green, this.colorWrite.blue, this.colorWrite.alpha ],\n this.alphaTest && [ this.alphaTest.compare, this.alphaTest.ref ],\n this.srgbWrite,\n this.unhandled.map(entry => [ entry.state, entry.value ])\n ]);\n }\n\n /**\n * Projects this setup into WebGPU pipeline state.\n *\n * The return is the state half of a pipeline recipe, not a whole recipe: the\n * caller owns topology, vertex buffer layouts and target formats, and merges\n * `primitive` and `depthStencil` into its recipe and `target` into the entry\n * of `fragment.targets` this pass writes.\n *\n * `depthStencil` is null when there is no depth attachment, because a WebGPU\n * pipeline may not declare depth state without one. Pass `depthFormat` as\n * null to say so; a setup that authored a depth bias then fails rather than\n * losing it silently.\n *\n * `invertedDepthTest` and `invertedCullMode` are Carbon's two render-state\n * overrides, which it installs on the state manager rather than authoring per\n * pass - reversed depth and mirrored rendering respectively. They belong here\n * rather than on the setup because the same registered setup is drawn both\n * ways. Applying one changes the projection, and therefore the caller's\n * pipeline cache key, which is what keeps the two variants distinct.\n *\n * Alpha test is returned untranslated. It is not pipeline state in WebGPU -\n * the compiled shader already discards - so the caller is handed the authored\n * intent instead of having it dropped here.\n *\n * @param {object} [options] Properties the authored setup cannot know.\n * @param {string|null} [options.depthFormat] Depth attachment format, or null when there is none.\n * @param {boolean} [options.invertedDepthTest] Apply Carbon's RS_ZFUNC override.\n * @param {boolean} [options.invertedCullMode] Apply Carbon's RS_CULLMODE override.\n * @returns {object} WebGPU pipeline state plus the untranslated authored intent.\n */\n GetWebgpuRecipe(options = {})\n {\n const depthFormat = options.depthFormat === undefined ? \"depth24plus\" : options.depthFormat;\n\n if (this.fill !== \"solid\")\n {\n throw new RangeError(`WebGPU cannot rasterize Carbon fill mode \"${this.fill}\"`);\n }\n\n const cull = options.invertedCullMode ? INVERTED_CULL[this.cull] : this.cull;\n const compare = options.invertedDepthTest\n ? INVERTED_COMPARE[this.depth.compare]\n : this.depth.compare;\n\n const hasBias = this.depth.bias !== 0 || this.depth.slopeScaledBias !== 0;\n if (depthFormat === null && (this.depth.test || this.depth.write || hasBias))\n {\n throw new Error(\"pass authors depth state but no depth attachment was supplied\");\n }\n\n let depthBias = 0;\n if (this.depth.bias !== 0)\n {\n const bits = WEBGPU_DEPTH_UNORM_BITS[depthFormat];\n if (bits === undefined)\n {\n throw new RangeError(\n `Carbon's fractional depth bias cannot be converted for depth format \"${depthFormat}\"`\n );\n }\n depthBias = Math.round(this.depth.bias * (2 ** bits - 1));\n }\n\n // The channel bits are the same in both vocabularies, so the mask is rebuilt\n // through the shared flags rather than through literals.\n const writeMask = (this.colorWrite.red ? ColorWriteEnable.COLORWRITEENABLE_RED : 0)\n | (this.colorWrite.green ? ColorWriteEnable.COLORWRITEENABLE_GREEN : 0)\n | (this.colorWrite.blue ? ColorWriteEnable.COLORWRITEENABLE_BLUE : 0)\n | (this.colorWrite.alpha ? ColorWriteEnable.COLORWRITEENABLE_ALPHA : 0);\n\n return {\n primitive: {\n cullMode: cull === \"none\" ? \"none\" : (cull === WEBGPU_FRONT_FACE ? \"front\" : \"back\"),\n frontFace: WEBGPU_FRONT_FACE\n },\n depthStencil: depthFormat === null\n ? null\n : {\n format: depthFormat,\n depthWriteEnabled: this.depth.write,\n // A disabled depth test is expressed as an always-passing compare,\n // which is what WebGPU offers; there is no separate enable.\n depthCompare: this.depth.test\n ? mapOrFail(\n WEBGPU_COMPARE,\n compare,\n `WebGPU has no depth comparison equivalent for Carbon's \"${compare}\"`\n )\n : \"always\",\n ...(hasBias\n ? { depthBias, depthBiasSlopeScale: this.depth.slopeScaledBias, depthBiasClamp: 0 }\n : {})\n },\n target: {\n writeMask,\n ...(this.blend\n ? {\n blend: {\n color: webgpuBlendComponent(this.blend.color),\n alpha: webgpuBlendComponent(this.blend.alpha)\n }\n }\n : {})\n },\n // Set only when the setup authored one; the caller applies it per render pass.\n blendConstant: this.blend?.constant ?? null,\n alphaTest: this.alphaTest,\n unhandled: this.unhandled\n };\n }\n\n}\n"],"names":["RS","Object","freeze","ZENABLE","RenderState","RS_ZENABLE","FILLMODE","RS_FILLMODE","ZWRITEENABLE","RS_ZWRITEENABLE","ALPHATESTENABLE","RS_ALPHATESTENABLE","SRCBLEND","RS_SRCBLEND","DESTBLEND","RS_DESTBLEND","CULLMODE","RS_CULLMODE","ZFUNC","RS_ZFUNC","ALPHAREF","RS_ALPHAREF","ALPHAFUNC","RS_ALPHAFUNC","ALPHABLENDENABLE","RS_ALPHABLENDENABLE","COLORWRITEENABLE","RS_COLORWRITEENABLE","BLENDOP","RS_BLENDOP","SLOPESCALEDEPTHBIAS","RS_SLOPESCALEDEPTHBIAS","BLENDFACTOR","RS_BLENDFACTOR","SRGBWRITEENABLE","RS_SRGBWRITEENABLE","DEPTHBIAS","RS_DEPTHBIAS","SEPARATEALPHABLENDENABLE","RS_SEPARATEALPHABLENDENABLE","SRCBLENDALPHA","RS_SRCBLENDALPHA","DESTBLENDALPHA","RS_DESTBLENDALPHA","BLENDOPALPHA","RS_BLENDOPALPHA","INTERPRETED","Set","values","COMPARE","CompareFunc","CMP_NEVER","CMP_LESS","CMP_EQUAL","CMP_LESSEQUAL","CMP_GREATER","CMP_NOTEQUAL","CMP_GREATEREQUAL","CMP_ALWAYS","BLEND_FACTOR","BlendMode","BM_ZERO","BM_ONE","BM_SRCCOLOR","BM_INVSRCCOLOR","BM_SRCALPHA","BM_INVSRCALPHA","BM_DESTALPHA","BM_INVDESTALPHA","BM_DESTCOLOR","BM_INVDESTCOLOR","BM_SRCALPHASAT","BM_BOTHSRCALPHA","BM_BOTHINVSRCALPHA","BM_BLENDFACTOR","BM_INVBLENDFACTOR","BLEND_OP","BlendOperation","BO_DISABLE","BO_ADD","BO_SUBTRACT","BO_REVSUBTRACT","BO_MIN","BO_MAX","CULL","CullMode","CULLMODE_NONE","CULLMODE_CW","CULLMODE_CCW","FILL","FillMode","FM_POINT","FM_WIREFRAME","FM_SOLID","INVERTED_COMPARE","never","less","equal","lessEqual","greater","notEqual","greaterEqual","always","INVERTED_CULL","none","cw","ccw","WEBGPU_COMPARE","WEBGPU_BLEND_FACTOR","zero","one","srcColor","invSrcColor","srcAlpha","invSrcAlpha","destAlpha","invDestAlpha","destColor","invDestColor","srcAlphaSat","blendFactor","invBlendFactor","WEBGPU_BLEND_OP","add","subtract","revSubtract","min","max","WEBGPU_DEPTH_UNORM_BITS","depth16unorm","depth24plus","WEBGPU_FRONT_FACE","DEFAULT_DEPTH_COMPARE","DEFAULT_CULL","DEFAULT_FILL","DEFAULT_SRC_BLEND","DEFAULT_DEST_BLEND","DEFAULT_BLEND_OP","DEFAULT_ALPHA_FUNC","DEFAULT_COLOR_WRITE","ColorWriteEnable","COLORWRITEENABLE_RED","COLORWRITEENABLE_GREEN","COLORWRITEENABLE_BLUE","COLORWRITEENABLE_ALPHA","mapOrFail","table","value","message","mapped","undefined","RangeError","colorWriteMask","red","green","blue","alpha","blendConstant","unsigned","r","g","b","a","webgpuBlendComponent","component","srcFactor","src","dstFactor","dst","operation","op","Tr2RenderStateSetup","authoredStates","depth","test","write","compare","bias","slopeScaledBias","cull","fill","blend","colorWrite","alphaTest","srgbWrite","unhandled","fromKeyValues","keyValues","pairs","length","renderStateValues","i","push","state","fromPass","pass","authored","Map","entry","set","Number","read","id","fallback","has","get","mapState","name","setup","float32FromBits","srcBlend","destBlend","blendOp","color","constant","ref","sort","left","right","Overlay","base","over","combined","size","map","Key","JSON","stringify","GetWebgpuRecipe","options","depthFormat","invertedCullMode","invertedDepthTest","hasBias","Error","depthBias","bits","Math","round","writeMask","primitive","cullMode","frontFace","depthStencil","format","depthWriteEnabled","depthCompare","depthBiasSlopeScale","depthBiasClamp","target"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,EAAE,GAAGC,MAAM,CAACC,MAAM,CAAC;EACvBC,OAAO,EAAEC,WAAW,CAACC,UAAU;EAC/BC,QAAQ,EAAEF,WAAW,CAACG,WAAW;EACjCC,YAAY,EAAEJ,WAAW,CAACK,eAAe;EACzCC,eAAe,EAAEN,WAAW,CAACO,kBAAkB;EAC/CC,QAAQ,EAAER,WAAW,CAACS,WAAW;EACjCC,SAAS,EAAEV,WAAW,CAACW,YAAY;EACnCC,QAAQ,EAAEZ,WAAW,CAACa,WAAW;EACjCC,KAAK,EAAEd,WAAW,CAACe,QAAQ;EAC3BC,QAAQ,EAAEhB,WAAW,CAACiB,WAAW;EACjCC,SAAS,EAAElB,WAAW,CAACmB,YAAY;EACnCC,gBAAgB,EAAEpB,WAAW,CAACqB,mBAAmB;EACjDC,gBAAgB,EAAEtB,WAAW,CAACuB,mBAAmB;EACjDC,OAAO,EAAExB,WAAW,CAACyB,UAAU;EAC/BC,mBAAmB,EAAE1B,WAAW,CAAC2B,sBAAsB;EACvDC,WAAW,EAAE5B,WAAW,CAAC6B,cAAc;EACvCC,eAAe,EAAE9B,WAAW,CAAC+B,kBAAkB;EAC/CC,SAAS,EAAEhC,WAAW,CAACiC,YAAY;EACnCC,wBAAwB,EAAElC,WAAW,CAACmC,2BAA2B;E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AI,IAAI,CAAC1D,KAAK,GACV;AACAA,UAAAA,KAAK,EAAE;YACLgC,KAAK,EAAElD,oBAAoB,CAAC,IAAI,CAACkB,KAAK,CAACgC,KAAK,CAAC;AAC7CzD,YAAAA,KAAK,EAAEO,oBAAoB,CAAC,IAAI,CAACkB,KAAK,CAACzB,KAAK;AAC9C;SACD,GACC,EAAE;OACP;AACD;AACAC,MAAAA,aAAa,EAAE,IAAI,CAACwB,KAAK,EAAEiC,QAAQ,IAAI,IAAI;MAC3C/B,SAAS,EAAE,IAAI,CAACA,SAAS;MACzBE,SAAS,EAAE,IAAI,CAACA;KACjB;AACH,EAAA;AAEF;;;;"}
|
|
1
|
+
{"version":3,"file":"Tr2RenderStateSetup.js","sources":["../../../../../src/resource/shader/reflection/Tr2RenderStateSetup.js"],"sourcesContent":["// Source: trinity/trinity/Shader/Tr2EffectStateManager.h:104\n// `typedef std::map<Tr2RenderContextEnum::RenderState, uint32_t> Tr2RenderStateSetup`\n// registered by Tr2EffectStateManager::RegisterRenderStateSetup (:118), whose\n// returned handle is what Tr2Pass stores in `renderStates`.\n//\n// Carbon keeps a setup raw and replays it onto a D3D device. Neither of our\n// backends is D3D, so the setup is interpreted here instead - once, so two\n// backends cannot disagree about what a Carbon render-state id means.\n//\n// Every Carbon vocabulary it reads comes from #consts/render-context rather\n// than being re-declared here. One object, however many names: a second frozen\n// copy of the same members drifts silently. The ids in particular are a trap -\n// RS_SCISSORTESTENABLE (174) exists in D3D9 and in ccpwgl but NOT in Carbon,\n// whose enum jumps 173 straight to 175.\n//\n// Generic members are named generically; anything true of only one backend is\n// named for that backend. `GetWebgpuRecipe` is a projection, not an override of\n// anything: no polymorphism dispatches on it, and a WebGL sibling returns a\n// different shape because WebGPU folds state into a pipeline at creation while\n// WebGL mutates it per draw.\nimport { color } from \"#math/color\";\nimport {\n BlendMode,\n BlendOperation,\n ColorWriteEnable,\n CompareFunc,\n CullMode,\n FillMode,\n RenderState\n} from \"#consts/render-context\";\nimport { float32FromBits } from \"#utils/bytes\";\n\n/**\n * The render states this class interprets, by Carbon id.\n *\n * A subset with intent, taken from the shared table rather than hand-typed:\n * these are the states a draw needs. Everything else Carbon declares is\n * retained uninterpreted under `unhandled`.\n */\nconst RS = Object.freeze({\n ZENABLE: RenderState.RS_ZENABLE,\n FILLMODE: RenderState.RS_FILLMODE,\n ZWRITEENABLE: RenderState.RS_ZWRITEENABLE,\n ALPHATESTENABLE: RenderState.RS_ALPHATESTENABLE,\n SRCBLEND: RenderState.RS_SRCBLEND,\n DESTBLEND: RenderState.RS_DESTBLEND,\n CULLMODE: RenderState.RS_CULLMODE,\n ZFUNC: RenderState.RS_ZFUNC,\n ALPHAREF: RenderState.RS_ALPHAREF,\n ALPHAFUNC: RenderState.RS_ALPHAFUNC,\n ALPHABLENDENABLE: RenderState.RS_ALPHABLENDENABLE,\n COLORWRITEENABLE: RenderState.RS_COLORWRITEENABLE,\n BLENDOP: RenderState.RS_BLENDOP,\n SLOPESCALEDEPTHBIAS: RenderState.RS_SLOPESCALEDEPTHBIAS,\n BLENDFACTOR: RenderState.RS_BLENDFACTOR,\n SRGBWRITEENABLE: RenderState.RS_SRGBWRITEENABLE,\n DEPTHBIAS: RenderState.RS_DEPTHBIAS,\n SEPARATEALPHABLENDENABLE: RenderState.RS_SEPARATEALPHABLENDENABLE,\n SRCBLENDALPHA: RenderState.RS_SRCBLENDALPHA,\n DESTBLENDALPHA: RenderState.RS_DESTBLENDALPHA,\n BLENDOPALPHA: RenderState.RS_BLENDOPALPHA\n});\n\nconst INTERPRETED = new Set(Object.values(RS));\n\n/**\n * Carbon comparison values to neutral spellings.\n *\n * The spelling is backend-neutral on purpose. WebGPU wants `less-equal` and\n * WebGL wants `LEQUAL`; deciding either here would bake a backend into a shared\n * property.\n */\nconst COMPARE = Object.freeze({\n [CompareFunc.CMP_NEVER]: \"never\",\n [CompareFunc.CMP_LESS]: \"less\",\n [CompareFunc.CMP_EQUAL]: \"equal\",\n [CompareFunc.CMP_LESSEQUAL]: \"lessEqual\",\n [CompareFunc.CMP_GREATER]: \"greater\",\n [CompareFunc.CMP_NOTEQUAL]: \"notEqual\",\n [CompareFunc.CMP_GREATEREQUAL]: \"greaterEqual\",\n [CompareFunc.CMP_ALWAYS]: \"always\"\n});\n\n/** Carbon blend modes to neutral spellings. */\nconst BLEND_FACTOR = Object.freeze({\n [BlendMode.BM_ZERO]: \"zero\",\n [BlendMode.BM_ONE]: \"one\",\n [BlendMode.BM_SRCCOLOR]: \"srcColor\",\n [BlendMode.BM_INVSRCCOLOR]: \"invSrcColor\",\n [BlendMode.BM_SRCALPHA]: \"srcAlpha\",\n [BlendMode.BM_INVSRCALPHA]: \"invSrcAlpha\",\n [BlendMode.BM_DESTALPHA]: \"destAlpha\",\n [BlendMode.BM_INVDESTALPHA]: \"invDestAlpha\",\n [BlendMode.BM_DESTCOLOR]: \"destColor\",\n [BlendMode.BM_INVDESTCOLOR]: \"invDestColor\",\n [BlendMode.BM_SRCALPHASAT]: \"srcAlphaSat\",\n [BlendMode.BM_BOTHSRCALPHA]: \"bothSrcAlpha\",\n [BlendMode.BM_BOTHINVSRCALPHA]: \"bothInvSrcAlpha\",\n [BlendMode.BM_BLENDFACTOR]: \"blendFactor\",\n [BlendMode.BM_INVBLENDFACTOR]: \"invBlendFactor\"\n});\n\n/**\n * Carbon blend operations to neutral spellings.\n *\n * `BO_DISABLE` is a real Carbon member, not enum-width padding, so it maps\n * rather than throwing. A setup that authors it is not blending, whatever\n * ALPHABLENDENABLE says.\n */\nconst BLEND_OP = Object.freeze({\n [BlendOperation.BO_DISABLE]: \"disable\",\n [BlendOperation.BO_ADD]: \"add\",\n [BlendOperation.BO_SUBTRACT]: \"subtract\",\n [BlendOperation.BO_REVSUBTRACT]: \"revSubtract\",\n [BlendOperation.BO_MIN]: \"min\",\n [BlendOperation.BO_MAX]: \"max\"\n});\n\n/**\n * Carbon cull modes to neutral spellings, named by the winding DISCARDED.\n *\n * D3D names the winding to cull; a modern API names the face. The two agree\n * only once a front-face winding is chosen, and that belongs to the backend\n * projection rather than to the authored setup.\n */\nconst CULL = Object.freeze({\n [CullMode.CULLMODE_NONE]: \"none\",\n [CullMode.CULLMODE_CW]: \"cw\",\n [CullMode.CULLMODE_CCW]: \"ccw\"\n});\n\n/** Carbon fill modes to neutral spellings. */\nconst FILL = Object.freeze({\n [FillMode.FM_POINT]: \"point\",\n [FillMode.FM_WIREFRAME]: \"wireframe\",\n [FillMode.FM_SOLID]: \"solid\"\n});\n\n/**\n * Carbon's inverted-depth-test override, as a neutral mapping.\n *\n * `Tr2EffectStateManager::SetInvertedDepthTest` (Tr2EffectStateManager.cpp:834)\n * installs an RS_ZFUNC override table that swaps the ordered comparisons and\n * leaves the order-free ones alone. This is the same table in our spelling.\n */\nconst INVERTED_COMPARE = Object.freeze({\n never: \"never\",\n less: \"greater\",\n equal: \"equal\",\n lessEqual: \"greaterEqual\",\n greater: \"less\",\n notEqual: \"notEqual\",\n greaterEqual: \"lessEqual\",\n always: \"always\"\n});\n\n/**\n * Carbon's inverted-cull override, as a neutral mapping.\n *\n * `Tr2EffectStateManager::SetInvertedCullMode` (Tr2EffectStateManager.cpp:815)\n * installs an RS_CULLMODE override that swaps the two windings and leaves\n * `none` alone.\n */\nconst INVERTED_CULL = Object.freeze({ none: \"none\", cw: \"ccw\", ccw: \"cw\" });\n\n/** Neutral comparison spellings to WebGPU's. */\nconst WEBGPU_COMPARE = Object.freeze({\n never: \"never\",\n less: \"less\",\n equal: \"equal\",\n lessEqual: \"less-equal\",\n greater: \"greater\",\n notEqual: \"not-equal\",\n greaterEqual: \"greater-equal\",\n always: \"always\"\n});\n\n/**\n * Neutral blend factors to WebGPU's.\n *\n * `bothSrcAlpha` and `bothInvSrcAlpha` are absent: they are D3D9 fixed-function\n * modes that set the source and destination factors together, and WebGPU has no\n * equivalent. They fail rather than being approximated.\n */\nconst WEBGPU_BLEND_FACTOR = Object.freeze({\n zero: \"zero\",\n one: \"one\",\n srcColor: \"src\",\n invSrcColor: \"one-minus-src\",\n srcAlpha: \"src-alpha\",\n invSrcAlpha: \"one-minus-src-alpha\",\n destAlpha: \"dst-alpha\",\n invDestAlpha: \"one-minus-dst-alpha\",\n destColor: \"dst\",\n invDestColor: \"one-minus-dst\",\n srcAlphaSat: \"src-alpha-saturated\",\n blendFactor: \"constant\",\n invBlendFactor: \"one-minus-constant\"\n});\n\n/**\n * Neutral blend equations to WebGPU's.\n *\n * `disable` is absent: WebGPU expresses \"not blending\" by omitting the blend\n * member, so a disabled operation is resolved before this table is consulted.\n */\nconst WEBGPU_BLEND_OP = Object.freeze({\n add: \"add\",\n subtract: \"subtract\",\n revSubtract: \"reverse-subtract\",\n min: \"min\",\n max: \"max\"\n});\n\n/**\n * Depth-format mantissa widths, for the WebGPU bias conversion.\n *\n * A UNORM depth buffer's smallest increment is `1 / (2^bits - 1)`, so a float\n * bias multiplies by that many units. `depth32float` has no fixed increment -\n * WebGPU defines the unit as format-dependent and implementation-chosen there -\n * so a float bias cannot be converted exactly and is refused.\n */\nconst WEBGPU_DEPTH_UNORM_BITS = Object.freeze({\n depth16unorm: 16,\n depth24plus: 24,\n \"depth24plus-stencil8\": 24\n});\n\n/**\n * WebGPU front-face winding, stated once.\n *\n * Carbon runs D3D's default rasterizer state, in which a clockwise winding is\n * the front face. Every WebGPU cull decision is relative to this.\n */\nconst WEBGPU_FRONT_FACE = \"cw\";\n\n/**\n * Authored values a setup inherits when it sets nothing.\n *\n * These are the D3D defaults Carbon inherits, named through the shared\n * vocabulary rather than repeated as numbers.\n */\nconst DEFAULT_DEPTH_COMPARE = CompareFunc.CMP_LESSEQUAL;\nconst DEFAULT_CULL = CullMode.CULLMODE_CCW;\nconst DEFAULT_FILL = FillMode.FM_SOLID;\nconst DEFAULT_SRC_BLEND = BlendMode.BM_ONE;\nconst DEFAULT_DEST_BLEND = BlendMode.BM_ZERO;\nconst DEFAULT_BLEND_OP = BlendOperation.BO_ADD;\nconst DEFAULT_ALPHA_FUNC = CompareFunc.CMP_ALWAYS;\nconst DEFAULT_COLOR_WRITE = ColorWriteEnable.COLORWRITEENABLE_RED\n | ColorWriteEnable.COLORWRITEENABLE_GREEN\n | ColorWriteEnable.COLORWRITEENABLE_BLUE\n | ColorWriteEnable.COLORWRITEENABLE_ALPHA;\n\n/**\n * Looks a value up in a mapping table, failing on an unmapped one.\n *\n * A silently substituted default here is a wrong draw with no error, which is\n * the expensive failure mode.\n *\n * @param {object} table Mapping table.\n * @param {string|number} value Value to map.\n * @param {string} message Failure message, already naming what was being mapped.\n * @returns {string} Mapped value.\n */\nfunction mapOrFail(table, value, message)\n{\n const mapped = table[value];\n if (mapped === undefined) throw new RangeError(message);\n return mapped;\n}\n\n/**\n * Splits a Carbon colour-write mask into channel flags.\n *\n * @param {number} value Raw mask.\n * @returns {object} Per-channel flags.\n */\nfunction colorWriteMask(value)\n{\n return {\n red: (value & ColorWriteEnable.COLORWRITEENABLE_RED) !== 0,\n green: (value & ColorWriteEnable.COLORWRITEENABLE_GREEN) !== 0,\n blue: (value & ColorWriteEnable.COLORWRITEENABLE_BLUE) !== 0,\n alpha: (value & ColorWriteEnable.COLORWRITEENABLE_ALPHA) !== 0\n };\n}\n\n/**\n * Splits a D3DCOLOR blend constant into normalised channels.\n *\n * @param {number} value Raw ARGB colour.\n * @returns {object} Normalised channels.\n */\n// One decode of the packed ARGB word, reused rather than restated. `color`\n// already owns the layout - Carbon's `Color(uint32_t)`, alpha in bits 24-31 then\n// r, g, b - and having the same four shifts written twice is how the two stop\n// agreeing. The scratch is module-scope because this runs per render state and\n// the result is copied out immediately.\n// A PLAIN array, deliberately, and NOT a math-library one.\n//\n// The render state carries doubles: 0x80 normalises to 0.5019607843137255, and\n// a single-precision round trip returns 0.501960813999176 instead. A test pins\n// the exact value, and it caught this.\n//\n// The rule is about the CONTRACT, not about today's element type. A math array's\n// element type is not ours to assume - gl-matrix exposes `setMatrixArrayType`,\n// and this repository declares array types deliberately through the schema's\n// per-type decorators rather than inferring them. So a value whose precision is\n// part of its meaning must not be routed through a math array at all, whatever\n// that array happens to be built from right now.\nconst blendScratch = [ 0, 0, 0, 0 ];\n\nfunction blendConstant(value)\n{\n color.fromARGB(blendScratch, value >>> 0);\n\n // The object shape is what the recipe consumes; only the bit layout is shared.\n return { r: blendScratch[0], g: blendScratch[1], b: blendScratch[2], a: blendScratch[3] };\n}\n\n/**\n * Translates one blend component into WebGPU's vocabulary.\n *\n * @param {{src:string,dst:string,op:string}} component Neutral factors.\n * @returns {object} WebGPU blend component.\n */\nfunction webgpuBlendComponent(component)\n{\n return {\n srcFactor: mapOrFail(\n WEBGPU_BLEND_FACTOR,\n component.src,\n `WebGPU has no blend factor equivalent for Carbon's \"${component.src}\"`\n ),\n dstFactor: mapOrFail(\n WEBGPU_BLEND_FACTOR,\n component.dst,\n `WebGPU has no blend factor equivalent for Carbon's \"${component.dst}\"`\n ),\n operation: mapOrFail(\n WEBGPU_BLEND_OP,\n component.op,\n `WebGPU has no blend operation equivalent for Carbon's \"${component.op}\"`\n )\n };\n}\n\n/** One pass's registered set of render states, interpreted. */\nexport class Tr2RenderStateSetup\n{\n\n /**\n * The raw `[state, value]` pairs this setup actually AUTHORED.\n *\n * RETAINED BECAUSE UNAUTHORED IS NOT THE SAME AS DEFAULT, and losing that\n * distinction cost a hull. Every field below resolves to a default when the\n * pass is silent about it, which reads correctly for one setup and is wrong\n * the moment two are applied in sequence. Carbon sets render states one at a\n * time through D3D, where they are STICKY: `ApplyStandardStates` puts the\n * rendering mode's block down - for RM_OPAQUE that includes `CULLMODE_CW` -\n * and a pass setup that never mentions cull leaves it standing.\n *\n * Ours replaced the whole block, so the pass's silence became the default\n * `CULLMODE_CCW`, which culls the BACK faces where the mode asked to cull the\n * FRONT ones. Every EVE hull then drew its interior: the silhouette is right\n * and the surfaces are the wrong ones, which is a hard thing to see.\n * `Overlay` below is what lets a setup be applied without erasing what it did\n * not speak about.\n */\n authoredStates = [];\n\n /** Depth test, write, comparison, and the two bias terms. */\n depth = {\n test: true,\n write: true,\n compare: \"lessEqual\",\n bias: 0,\n slopeScaledBias: 0\n };\n\n /** Winding that is discarded: `none`, `cw` or `ccw`. */\n cull = \"ccw\";\n\n /** Rasterizer fill: `solid`, `wireframe` or `point`. */\n fill = \"solid\";\n\n /** Blend factors and equation, or null when the setup does not blend. */\n blend = null;\n\n /** Per-channel colour write flags. */\n colorWrite = { red: true, green: true, blue: true, alpha: true };\n\n /** Comparison and reference, or null when the setup does not alpha test. */\n alphaTest = null;\n\n /** Whether the setup writes sRGB-encoded colour. */\n srgbWrite = false;\n\n /**\n * Authored states this class does not interpret, retained verbatim.\n *\n * Stencil, fog, the fixed-function lighting states and point sprites land\n * here rather than being dropped, so a consumer that meets one can assert on\n * it instead of silently rendering without it. Nothing in the current draw\n * path authors them.\n */\n unhandled = [];\n\n // The shared vocabularies, aliased rather than re-declared: one object with a\n // class-scoped name, which is what enum placement requires.\n\n /** @see CompareFunc */\n static CompareFunc = CompareFunc;\n\n /** @see BlendMode */\n static BlendMode = BlendMode;\n\n /** @see BlendOperation */\n static BlendOperation = BlendOperation;\n\n /** @see CullMode */\n static CullMode = CullMode;\n\n /** @see FillMode */\n static FillMode = FillMode;\n\n /** @see ColorWriteEnable */\n static ColorWriteEnable = ColorWriteEnable;\n\n /**\n * Interprets a flat `[state, value, state, value, ...]` list, which is how\n * Carbon stores its built-in rendering-mode setups.\n *\n * MERGING IS CONCATENATION. Carbon re-applies a rendering mode's standard\n * states immediately before a pass's own every time it applies them\n * (Tr2EffectStateManager.cpp:716), so the effective state is the mode's list\n * with the pass's overlaid. Passing `[...standard, ...pass]` yields exactly\n * that, because a repeated state id overwrites the earlier one.\n *\n * @param {Array<number>} keyValues Flat state/value pairs.\n * @returns {Tr2RenderStateSetup} Interpreted setup.\n * @throws {RangeError} When the list has an odd length.\n */\n static fromKeyValues(keyValues)\n {\n const pairs = keyValues ?? [];\n\n if (pairs.length % 2 !== 0)\n {\n throw new RangeError(\"a render-state key/value list must have an even length\");\n }\n\n const renderStateValues = [];\n\n for (let i = 0; i < pairs.length; i += 2)\n {\n renderStateValues.push({ state: pairs[i], value: pairs[i + 1] });\n }\n\n return this.fromPass({ renderStateValues });\n }\n\n\n /**\n * Interprets one reflected pass's authored render states.\n *\n * `depth.test` folds D3D's ZENABLE, including `D3DZB_USEW` (2), which enables\n * the test; the W-buffer distinction has no modern equivalent and no\n * consumer.\n *\n * The two bias values are reinterpreted float bits, not integers. Carbon\n * stores them as raw uint32 patterns like every other float-valued render\n * state.\n *\n * @param {{renderStateValues?: Array<{state:number,value:number}>}} pass Reflected pass.\n * @returns {Tr2RenderStateSetup} Interpreted setup.\n */\n static fromPass(pass)\n {\n const authored = new Map();\n for (const entry of pass?.renderStateValues ?? [])\n {\n authored.set(Number(entry.state), Number(entry.value));\n }\n\n const read = (id, fallback) => (authored.has(id) ? authored.get(id) : fallback);\n const mapState = (table, id, fallback, name) =>\n {\n const value = read(id, fallback);\n return mapOrFail(\n table,\n value,\n `Carbon render state ${name} has no mapping for value ${value}`\n );\n };\n\n const setup = new this();\n\n setup.depth = {\n test: read(RS.ZENABLE, 1) !== 0,\n write: read(RS.ZWRITEENABLE, 1) !== 0,\n compare: mapState(COMPARE, RS.ZFUNC, DEFAULT_DEPTH_COMPARE, \"RS_ZFUNC\"),\n bias: float32FromBits(read(RS.DEPTHBIAS, 0)),\n slopeScaledBias: float32FromBits(read(RS.SLOPESCALEDEPTHBIAS, 0))\n };\n setup.cull = mapState(CULL, RS.CULLMODE, DEFAULT_CULL, \"RS_CULLMODE\");\n setup.fill = mapState(FILL, RS.FILLMODE, DEFAULT_FILL, \"RS_FILLMODE\");\n setup.colorWrite = colorWriteMask(read(RS.COLORWRITEENABLE, DEFAULT_COLOR_WRITE));\n setup.srgbWrite = read(RS.SRGBWRITEENABLE, 0) !== 0;\n\n if (read(RS.ALPHABLENDENABLE, 0) !== 0)\n {\n const srcBlend = read(RS.SRCBLEND, DEFAULT_SRC_BLEND);\n const destBlend = read(RS.DESTBLEND, DEFAULT_DEST_BLEND);\n const blendOp = read(RS.BLENDOP, DEFAULT_BLEND_OP);\n const color = {\n src: mapState(BLEND_FACTOR, RS.SRCBLEND, DEFAULT_SRC_BLEND, \"RS_SRCBLEND\"),\n dst: mapState(BLEND_FACTOR, RS.DESTBLEND, DEFAULT_DEST_BLEND, \"RS_DESTBLEND\"),\n op: mapState(BLEND_OP, RS.BLENDOP, DEFAULT_BLEND_OP, \"RS_BLENDOP\")\n };\n // BO_DISABLE means the setup is not blending, however ALPHABLENDENABLE reads.\n if (color.op !== \"disable\")\n {\n setup.blend = {\n color,\n alpha: read(RS.SEPARATEALPHABLENDENABLE, 0) !== 0\n ? {\n src: mapState(BLEND_FACTOR, RS.SRCBLENDALPHA, srcBlend, \"RS_SRCBLENDALPHA\"),\n dst: mapState(BLEND_FACTOR, RS.DESTBLENDALPHA, destBlend, \"RS_DESTBLENDALPHA\"),\n op: mapState(BLEND_OP, RS.BLENDOPALPHA, blendOp, \"RS_BLENDOPALPHA\")\n }\n : { ...color },\n constant: authored.has(RS.BLENDFACTOR)\n ? blendConstant(authored.get(RS.BLENDFACTOR))\n : null\n };\n }\n }\n\n if (read(RS.ALPHATESTENABLE, 0) !== 0)\n {\n setup.alphaTest = {\n compare: mapState(COMPARE, RS.ALPHAFUNC, DEFAULT_ALPHA_FUNC, \"RS_ALPHAFUNC\"),\n ref: read(RS.ALPHAREF, 0)\n };\n }\n\n for (const [ state, value ] of authored)\n {\n if (!INTERPRETED.has(state)) setup.unhandled.push({ state, value });\n }\n setup.unhandled.sort((left, right) => left.state - right.state);\n\n setup.authoredStates = [ ...authored ].sort((left, right) => left[0] - right[0]);\n\n return setup;\n }\n\n\n /**\n * A setup carrying `base`'s states with `over`'s authored ones on top.\n *\n * This is what makes a sequence of applies behave the way D3D's do, where a\n * state nobody set this draw keeps the value the last one gave it. Carbon\n * relies on that: `ApplyStandardStates` lays down the rendering mode's block\n * and a pass setup then speaks only for what it changes.\n *\n * Returns `over` unchanged when it authors everything `base` did, so the\n * common case allocates nothing and the interned setup is preserved.\n *\n * @param {Tr2RenderStateSetup|null} base The states already in effect.\n * @param {Tr2RenderStateSetup|null} over The setup being applied.\n * @returns {Tr2RenderStateSetup|null} The combined setup.\n */\n static Overlay(base, over)\n {\n if (!base) return over;\n if (!over) return base;\n\n const combined = new Map(base.authoredStates);\n\n for (const [ state, value ] of over.authoredStates) combined.set(state, value);\n\n // Nothing of the base survived, so the applied setup already says it all.\n if (combined.size === over.authoredStates.length) return over;\n\n return Tr2RenderStateSetup.fromPass({\n renderStateValues: [ ...combined ].map(([ state, value ]) => ({ state, value }))\n });\n }\n\n /**\n * A canonical string identifying this exact set of states.\n *\n * Carbon gives a registered setup a handle through\n * `RegisterRenderStateSetup` and reuses it across passes; this is that\n * handle's portable equivalent. It is the canonical serialization rather than\n * a hash, so two different setups cannot collide - a setup is small enough to\n * make that affordable, for the same reason the WebGPU pipeline cache\n * serializes its recipes exactly.\n *\n * Uninterpreted states take part, so two passes that differ only in a state\n * nothing reads are not treated as one.\n *\n * @returns {string} Canonical identity.\n */\n Key()\n {\n return JSON.stringify([\n this.depth.test,\n this.depth.write,\n this.depth.compare,\n this.depth.bias,\n this.depth.slopeScaledBias,\n this.cull,\n this.fill,\n this.blend && [\n this.blend.color.src, this.blend.color.dst, this.blend.color.op,\n this.blend.alpha.src, this.blend.alpha.dst, this.blend.alpha.op,\n this.blend.constant && [\n this.blend.constant.r,\n this.blend.constant.g,\n this.blend.constant.b,\n this.blend.constant.a\n ]\n ],\n [ this.colorWrite.red, this.colorWrite.green, this.colorWrite.blue, this.colorWrite.alpha ],\n this.alphaTest && [ this.alphaTest.compare, this.alphaTest.ref ],\n this.srgbWrite,\n this.unhandled.map(entry => [ entry.state, entry.value ])\n ]);\n }\n\n /**\n * Projects this setup into WebGPU pipeline state.\n *\n * The return is the state half of a pipeline recipe, not a whole recipe: the\n * caller owns topology, vertex buffer layouts and target formats, and merges\n * `primitive` and `depthStencil` into its recipe and `target` into the entry\n * of `fragment.targets` this pass writes.\n *\n * `depthStencil` is null when there is no depth attachment, because a WebGPU\n * pipeline may not declare depth state without one. Pass `depthFormat` as\n * null to say so; a setup that authored a depth bias then fails rather than\n * losing it silently.\n *\n * `invertedDepthTest` and `invertedCullMode` are Carbon's two render-state\n * overrides, which it installs on the state manager rather than authoring per\n * pass - reversed depth and mirrored rendering respectively. They belong here\n * rather than on the setup because the same registered setup is drawn both\n * ways. Applying one changes the projection, and therefore the caller's\n * pipeline cache key, which is what keeps the two variants distinct.\n *\n * Alpha test is returned untranslated. It is not pipeline state in WebGPU -\n * the compiled shader already discards - so the caller is handed the authored\n * intent instead of having it dropped here.\n *\n * @param {object} [options] Properties the authored setup cannot know.\n * @param {string|null} [options.depthFormat] Depth attachment format, or null when there is none.\n * @param {boolean} [options.invertedDepthTest] Apply Carbon's RS_ZFUNC override.\n * @param {boolean} [options.invertedCullMode] Apply Carbon's RS_CULLMODE override.\n * @returns {object} WebGPU pipeline state plus the untranslated authored intent.\n */\n GetWebgpuRecipe(options = {})\n {\n const depthFormat = options.depthFormat === undefined ? \"depth24plus\" : options.depthFormat;\n\n if (this.fill !== \"solid\")\n {\n throw new RangeError(`WebGPU cannot rasterize Carbon fill mode \"${this.fill}\"`);\n }\n\n const cull = options.invertedCullMode ? INVERTED_CULL[this.cull] : this.cull;\n const compare = options.invertedDepthTest\n ? INVERTED_COMPARE[this.depth.compare]\n : this.depth.compare;\n\n const hasBias = this.depth.bias !== 0 || this.depth.slopeScaledBias !== 0;\n if (depthFormat === null && (this.depth.test || this.depth.write || hasBias))\n {\n throw new Error(\"pass authors depth state but no depth attachment was supplied\");\n }\n\n let depthBias = 0;\n if (this.depth.bias !== 0)\n {\n const bits = WEBGPU_DEPTH_UNORM_BITS[depthFormat];\n if (bits === undefined)\n {\n throw new RangeError(\n `Carbon's fractional depth bias cannot be converted for depth format \"${depthFormat}\"`\n );\n }\n depthBias = Math.round(this.depth.bias * (2 ** bits - 1));\n }\n\n // The channel bits are the same in both vocabularies, so the mask is rebuilt\n // through the shared flags rather than through literals.\n const writeMask = (this.colorWrite.red ? ColorWriteEnable.COLORWRITEENABLE_RED : 0)\n | (this.colorWrite.green ? ColorWriteEnable.COLORWRITEENABLE_GREEN : 0)\n | (this.colorWrite.blue ? ColorWriteEnable.COLORWRITEENABLE_BLUE : 0)\n | (this.colorWrite.alpha ? ColorWriteEnable.COLORWRITEENABLE_ALPHA : 0);\n\n return {\n primitive: {\n cullMode: cull === \"none\" ? \"none\" : (cull === WEBGPU_FRONT_FACE ? \"front\" : \"back\"),\n frontFace: WEBGPU_FRONT_FACE\n },\n depthStencil: depthFormat === null\n ? null\n : {\n format: depthFormat,\n depthWriteEnabled: this.depth.write,\n // A disabled depth test is expressed as an always-passing compare,\n // which is what WebGPU offers; there is no separate enable.\n depthCompare: this.depth.test\n ? mapOrFail(\n WEBGPU_COMPARE,\n compare,\n `WebGPU has no depth comparison equivalent for Carbon's \"${compare}\"`\n )\n : \"always\",\n ...(hasBias\n ? { depthBias, depthBiasSlopeScale: this.depth.slopeScaledBias, depthBiasClamp: 0 }\n : {})\n },\n target: {\n writeMask,\n ...(this.blend\n ? {\n blend: {\n color: webgpuBlendComponent(this.blend.color),\n alpha: webgpuBlendComponent(this.blend.alpha)\n }\n }\n : {})\n },\n // Set only when the setup authored one; the caller applies it per render pass.\n blendConstant: this.blend?.constant ?? null,\n alphaTest: this.alphaTest,\n unhandled: this.unhandled\n };\n }\n\n}\n"],"names":["RS","Object","freeze","ZENABLE","RenderState","RS_ZENABLE","FILLMODE","RS_FILLMODE","ZWRITEENABLE","RS_ZWRITEENABLE","ALPHATESTENABLE","RS_ALPHATESTENABLE","SRCBLEND","RS_SRCBLEND","DESTBLEND","RS_DESTBLEND","CULLMODE","RS_CULLMODE","ZFUNC","RS_ZFUNC","ALPHAREF","RS_ALPHAREF","ALPHAFUNC","RS_ALPHAFUNC","ALPHABLENDENABLE","RS_ALPHABLENDENABLE","COLORWRITEENABLE","RS_COLORWRITEENABLE","BLENDOP","RS_BLENDOP","SLOPESCALEDEPTHBIAS","RS_SLOPESCALEDEPTHBIAS","BLENDFACTOR","RS_BLENDFACTOR","SRGBWRITEENABLE","RS_SRGBWRITEENABLE","DEPTHBIAS","RS_DEPTHBIAS","SEPARATEALPHABLENDENABLE","RS_SEPARATEALPHABLENDENABLE","SRCBLENDALPHA","RS_SRCBLENDALPHA","DESTBLENDALPHA","RS_DESTBLENDALPHA","BLENDOPALPHA","RS_BLENDOPALPHA","INTERPRETED","Set","values","COMPARE","CompareFunc","CMP_NEVER","CMP_LESS","CMP_EQUAL","CMP_LESSEQUAL","CMP_GREATER","CMP_NOTEQUAL","CMP_GREATEREQUAL","CMP_ALWAYS","BLEND_FACTOR","BlendMode","BM_ZERO","BM_ONE","BM_SRCCOLOR","BM_INVSRCCOLOR","BM_SRCALPHA","BM_INVSRCALPHA","BM_DESTALPHA","BM_INVDESTALPHA","BM_DESTCOLOR","BM_INVDESTCOLOR","BM_SRCALPHASAT","BM_BOTHSRCALPHA","BM_BOTHINVSRCALPHA","BM_BLENDFACTOR","BM_INVBLENDFACTOR","BLEND_OP","BlendOperation","BO_DISABLE","BO_ADD","BO_SUBTRACT","BO_REVSUBTRACT","BO_MIN","BO_MAX","CULL","CullMode","CULLMODE_NONE","CULLMODE_CW","CULLMODE_CCW","FILL","FillMode","FM_POINT","FM_WIREFRAME","FM_SOLID","INVERTED_COMPARE","never","less","equal","lessEqual","greater","notEqual","greaterEqual","always","INVERTED_CULL","none","cw","ccw","WEBGPU_COMPARE","WEBGPU_BLEND_FACTOR","zero","one","srcColor","invSrcColor","srcAlpha","invSrcAlpha","destAlpha","invDestAlpha","destColor","invDestColor","srcAlphaSat","blendFactor","invBlendFactor","WEBGPU_BLEND_OP","add","subtract","revSubtract","min","max","WEBGPU_DEPTH_UNORM_BITS","depth16unorm","depth24plus","WEBGPU_FRONT_FACE","DEFAULT_DEPTH_COMPARE","DEFAULT_CULL","DEFAULT_FILL","DEFAULT_SRC_BLEND","DEFAULT_DEST_BLEND","DEFAULT_BLEND_OP","DEFAULT_ALPHA_FUNC","DEFAULT_COLOR_WRITE","ColorWriteEnable","COLORWRITEENABLE_RED","COLORWRITEENABLE_GREEN","COLORWRITEENABLE_BLUE","COLORWRITEENABLE_ALPHA","mapOrFail","table","value","message","mapped","undefined","RangeError","colorWriteMask","red","green","blue","alpha","blendScratch","blendConstant","color","fromARGB","r","g","b","a","webgpuBlendComponent","component","srcFactor","src","dstFactor","dst","operation","op","Tr2RenderStateSetup","authoredStates","depth","test","write","compare","bias","slopeScaledBias","cull","fill","blend","colorWrite","alphaTest","srgbWrite","unhandled","fromKeyValues","keyValues","pairs","length","renderStateValues","i","push","state","fromPass","pass","authored","Map","entry","set","Number","read","id","fallback","has","get","mapState","name","setup","float32FromBits","srcBlend","destBlend","blendOp","constant","ref","sort","left","right","Overlay","base","over","combined","size","map","Key","JSON","stringify","GetWebgpuRecipe","options","depthFormat","invertedCullMode","invertedDepthTest","hasBias","Error","depthBias","bits","Math","round","writeMask","primitive","cullMode","frontFace","depthStencil","format","depthWriteEnabled","depthCompare","depthBiasSlopeScale","depthBiasClamp","target"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,EAAE,GAAGC,MAAM,CAACC,MAAM,CAAC;EACvBC,OAAO,EAAEC,WAAW,CAACC,UAAU;EAC/BC,QAAQ,EAAEF,WAAW,CAACG,WAAW;EACjCC,YAAY,EAAEJ,WAAW,CAACK,eAAe;EACzCC,eAAe,EAAEN,WAAW,CAACO,kBAAkB;EAC/CC,QAAQ,EAAER,WAAW,CAACS,WAAW;EACjCC,SAAS,EAAEV,WAAW,CAACW,YAAY;EACnCC,QAAQ,EAAEZ,WAAW,CAACa,WAAW;EACjCC,KAAK,EAAEd,WAAW,CAACe,QAAQ;EAC3BC,QAAQ,EAAE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;AACDiH,MAAAA,YAAY,EAAEb,WAAW,KAAK,IAAI,GAC9B,IAAI,GACJ;AACAc,QAAAA,MAAM,EAAEd,WAAW;AACnBe,QAAAA,iBAAiB,EAAE,IAAI,CAACvE,KAAK,CAACE,KAAK;AACnC;AACA;AACAsE,QAAAA,YAAY,EAAE,IAAI,CAACxE,KAAK,CAACC,IAAI,GACzB/B,SAAS,CACTtC,cAAc,EACduE,OAAO,EACP,CAAA,wDAAA,EAA2DA,OAAO,CAAA,CAAA,CACpE,CAAC,GACC,QAAQ;AACZ,QAAA,IAAIwD,OAAO,GACP;UAAEE,SAAS;AAAEY,UAAAA,mBAAmB,EAAE,IAAI,CAACzE,KAAK,CAACK,eAAe;AAAEqE,UAAAA,cAAc,EAAE;SAAG,GACjF,EAAE;OACP;AACHC,MAAAA,MAAM,EAAE;QACNV,SAAS;QACT,IAAI,IAAI,CAACzD,KAAK,GACV;AACAA,UAAAA,KAAK,EAAE;YACLxB,KAAK,EAAEM,oBAAoB,CAAC,IAAI,CAACkB,KAAK,CAACxB,KAAK,CAAC;AAC7CH,YAAAA,KAAK,EAAES,oBAAoB,CAAC,IAAI,CAACkB,KAAK,CAAC3B,KAAK;AAC9C;SACD,GACC,EAAE;OACP;AACD;AACAE,MAAAA,aAAa,EAAE,IAAI,CAACyB,KAAK,EAAEgC,QAAQ,IAAI,IAAI;MAC3C9B,SAAS,EAAE,IAAI,CAACA,SAAS;MACzBE,SAAS,EAAE,IAAI,CAACA;KACjB;AACH,EAAA;AAEF;;;;"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { readU32LE, float32ToBits, float32FromBits } from '#utils/bytes';
|
|
2
|
+
|
|
1
3
|
// Shared field accessors for Carbon v15 description records.
|
|
2
4
|
//
|
|
3
5
|
// The record tree is what the one Carbon effect reader emits
|
|
@@ -17,65 +19,60 @@
|
|
|
17
19
|
// out, compared byte for byte over the shipped corpus, so a mistake that
|
|
18
20
|
// satisfied both sides would have to be an exact inverse of itself.
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @param {{offset:number,value:string}|null|undefined} ref String reference.
|
|
26
|
-
* @returns {string} The referenced text, or "" when unset.
|
|
22
|
+
/**
|
|
23
|
+
* Reads the text out of an arena string reference.
|
|
24
|
+
*
|
|
25
|
+
* @param {{offset:number,value:string}|null|undefined} ref String reference.
|
|
26
|
+
* @returns {string} The referenced text, or "" when unset.
|
|
27
27
|
*/
|
|
28
28
|
function recordText(ref) {
|
|
29
29
|
return String(ref?.value ?? "");
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
/**
|
|
33
|
-
* Decodes an annotation record's four raw bytes as the `u32` bit pattern the
|
|
34
|
-
* reflection classes carry as `rawValue`.
|
|
35
|
-
*
|
|
36
|
-
* Carbon stores the value as a `{float,int32_t}` union and the type byte decides
|
|
37
|
-
* which member is meaningful, so the bits travel untyped and each annotation type
|
|
38
|
-
* reinterprets them itself. Decoding to a number here — rather than to a float —
|
|
39
|
-
* is what keeps a value like `-FLT_MAX` exact.
|
|
40
|
-
*
|
|
41
|
-
* @param {Uint8Array|null|undefined} bytes Four little-endian bytes.
|
|
42
|
-
* @returns {number} The unsigned 32-bit pattern those bytes carry.
|
|
32
|
+
/**
|
|
33
|
+
* Decodes an annotation record's four raw bytes as the `u32` bit pattern the
|
|
34
|
+
* reflection classes carry as `rawValue`.
|
|
35
|
+
*
|
|
36
|
+
* Carbon stores the value as a `{float,int32_t}` union and the type byte decides
|
|
37
|
+
* which member is meaningful, so the bits travel untyped and each annotation type
|
|
38
|
+
* reinterprets them itself. Decoding to a number here — rather than to a float —
|
|
39
|
+
* is what keeps a value like `-FLT_MAX` exact.
|
|
40
|
+
*
|
|
41
|
+
* @param {Uint8Array|null|undefined} bytes Four little-endian bytes.
|
|
42
|
+
* @returns {number} The unsigned 32-bit pattern those bytes carry.
|
|
43
43
|
*/
|
|
44
44
|
function recordRawValue(bytes) {
|
|
45
45
|
if (!bytes || bytes.length < 4) return 0;
|
|
46
|
-
|
|
47
|
-
rawValueBuffer.setUint8(1, bytes[1]);
|
|
48
|
-
rawValueBuffer.setUint8(2, bytes[2]);
|
|
49
|
-
rawValueBuffer.setUint8(3, bytes[3]);
|
|
50
|
-
return rawValueBuffer.getUint32(0, true);
|
|
46
|
+
return readU32LE(bytes, 0);
|
|
51
47
|
}
|
|
52
48
|
|
|
53
|
-
/**
|
|
54
|
-
* Re-encodes a record's `float` as the `u32` bit pattern the reflection classes
|
|
55
|
-
* carry in their `*Raw` sampler fields.
|
|
56
|
-
*
|
|
57
|
-
* The container stores sampler LOD and border values as real floats, but the
|
|
58
|
-
* class keeps the bits, so a value like `-FLT_MAX` survives serialization without
|
|
59
|
-
* a decimal round trip. Reading the float and re-encoding it here is exact: the
|
|
60
|
-
* record's value came from a `f32` read, so it is already representable.
|
|
61
|
-
*
|
|
62
|
-
* @param {number} value Float value from a sampler record.
|
|
63
|
-
* @returns {number} The unsigned 32-bit pattern encoding that float.
|
|
49
|
+
/**
|
|
50
|
+
* Re-encodes a record's `float` as the `u32` bit pattern the reflection classes
|
|
51
|
+
* carry in their `*Raw` sampler fields.
|
|
52
|
+
*
|
|
53
|
+
* The container stores sampler LOD and border values as real floats, but the
|
|
54
|
+
* class keeps the bits, so a value like `-FLT_MAX` survives serialization without
|
|
55
|
+
* a decimal round trip. Reading the float and re-encoding it here is exact: the
|
|
56
|
+
* record's value came from a `f32` read, so it is already representable.
|
|
57
|
+
*
|
|
58
|
+
* @param {number} value Float value from a sampler record.
|
|
59
|
+
* @returns {number} The unsigned 32-bit pattern encoding that float.
|
|
64
60
|
*/
|
|
65
61
|
function recordRawBits(value) {
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
// The non-finite substitution is the RECORD's rule, not the conversion's: a
|
|
63
|
+
// sampler record has no encoding for NaN, so it stores zero.
|
|
64
|
+
return float32ToBits(Number.isFinite(value) ? value : 0);
|
|
68
65
|
}
|
|
69
66
|
|
|
70
|
-
/**
|
|
71
|
-
* Wraps text as the arena string reference the writer interns.
|
|
72
|
-
*
|
|
73
|
-
* The offset is always 0: the writer assigns real offsets while building the
|
|
74
|
-
* arena, and any value here would be discarded. Carrying the text is the whole
|
|
75
|
-
* job.
|
|
76
|
-
*
|
|
77
|
-
* @param {string} value Text value.
|
|
78
|
-
* @returns {{offset:number,value:string}} String reference.
|
|
67
|
+
/**
|
|
68
|
+
* Wraps text as the arena string reference the writer interns.
|
|
69
|
+
*
|
|
70
|
+
* The offset is always 0: the writer assigns real offsets while building the
|
|
71
|
+
* arena, and any value here would be discarded. Carrying the text is the whole
|
|
72
|
+
* job.
|
|
73
|
+
*
|
|
74
|
+
* @param {string} value Text value.
|
|
75
|
+
* @returns {{offset:number,value:string}} String reference.
|
|
79
76
|
*/
|
|
80
77
|
function toRecordText(value) {
|
|
81
78
|
return {
|
|
@@ -84,54 +81,54 @@ function toRecordText(value) {
|
|
|
84
81
|
};
|
|
85
82
|
}
|
|
86
83
|
|
|
87
|
-
/**
|
|
88
|
-
* Encodes a `u32` bit pattern as an annotation record's four raw bytes.
|
|
89
|
-
*
|
|
90
|
-
* The inverse of {@link recordRawValue}, and raw for the same reason: the value
|
|
91
|
-
* is written through one union member and read through another, so no numeric
|
|
92
|
-
* conversion may happen on the way out either.
|
|
93
|
-
*
|
|
94
|
-
* @param {number} rawValue Unsigned 32-bit pattern.
|
|
95
|
-
* @returns {Uint8Array} Four little-endian bytes.
|
|
84
|
+
/**
|
|
85
|
+
* Encodes a `u32` bit pattern as an annotation record's four raw bytes.
|
|
86
|
+
*
|
|
87
|
+
* The inverse of {@link recordRawValue}, and raw for the same reason: the value
|
|
88
|
+
* is written through one union member and read through another, so no numeric
|
|
89
|
+
* conversion may happen on the way out either.
|
|
90
|
+
*
|
|
91
|
+
* @param {number} rawValue Unsigned 32-bit pattern.
|
|
92
|
+
* @returns {Uint8Array} Four little-endian bytes.
|
|
96
93
|
*/
|
|
97
94
|
function toRecordRawValue(rawValue) {
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
const value = rawValue >>> 0,
|
|
96
|
+
bytes = new Uint8Array(4);
|
|
97
|
+
bytes[0] = value & 0xff;
|
|
98
|
+
bytes[1] = value >>> 8 & 0xff;
|
|
99
|
+
bytes[2] = value >>> 16 & 0xff;
|
|
100
|
+
bytes[3] = value >>> 24 & 0xff;
|
|
103
101
|
return bytes;
|
|
104
102
|
}
|
|
105
103
|
|
|
106
|
-
/**
|
|
107
|
-
* Decodes a `*Raw` sampler field back to the float the record stores.
|
|
108
|
-
*
|
|
109
|
-
* The inverse of {@link recordRawBits}. Assigning the raw `u32` straight across
|
|
110
|
-
* would write `4286578687.0` where the file says `-3.4028235e38`, and every
|
|
111
|
-
* structural check in the container would accept it.
|
|
112
|
-
*
|
|
113
|
-
* @param {number} bits Raw 32-bit pattern.
|
|
114
|
-
* @returns {number} The float those bits encode.
|
|
104
|
+
/**
|
|
105
|
+
* Decodes a `*Raw` sampler field back to the float the record stores.
|
|
106
|
+
*
|
|
107
|
+
* The inverse of {@link recordRawBits}. Assigning the raw `u32` straight across
|
|
108
|
+
* would write `4286578687.0` where the file says `-3.4028235e38`, and every
|
|
109
|
+
* structural check in the container would accept it.
|
|
110
|
+
*
|
|
111
|
+
* @param {number} bits Raw 32-bit pattern.
|
|
112
|
+
* @returns {number} The float those bits encode.
|
|
115
113
|
*/
|
|
116
114
|
function toRecordFloat(bits) {
|
|
117
|
-
|
|
118
|
-
return rawValueBuffer.getFloat32(0, true);
|
|
115
|
+
return float32FromBits(bits ?? 0);
|
|
119
116
|
}
|
|
120
117
|
|
|
121
|
-
/**
|
|
122
|
-
* Wraps bytes as the record codec's sized blob reference.
|
|
123
|
-
*
|
|
124
|
-
* A zero-length blob keeps the offset word the file carried, because the writer
|
|
125
|
-
* passes it straight through rather than interning anything. That word is
|
|
126
|
-
* usually `0xffffffff`, but not always — measured across the shipped corpus,
|
|
127
|
-
* 150 of 4833 files carry a live-looking offset behind a zero size, and
|
|
128
|
-
* normalizing it changes the bytes and can make two distinct bodies collapse
|
|
129
|
-
* into one. An empty payload and an absent one are not the same thing.
|
|
130
|
-
*
|
|
131
|
-
* @param {Uint8Array} bytes Payload bytes.
|
|
132
|
-
* @param {number} [declaredSize] Size to declare when tracked separately.
|
|
133
|
-
* @param {number} [unsetOffset] Offset word to keep when the size is zero.
|
|
134
|
-
* @returns {{size:number,offset:number,bytes:Uint8Array}} Blob reference.
|
|
118
|
+
/**
|
|
119
|
+
* Wraps bytes as the record codec's sized blob reference.
|
|
120
|
+
*
|
|
121
|
+
* A zero-length blob keeps the offset word the file carried, because the writer
|
|
122
|
+
* passes it straight through rather than interning anything. That word is
|
|
123
|
+
* usually `0xffffffff`, but not always — measured across the shipped corpus,
|
|
124
|
+
* 150 of 4833 files carry a live-looking offset behind a zero size, and
|
|
125
|
+
* normalizing it changes the bytes and can make two distinct bodies collapse
|
|
126
|
+
* into one. An empty payload and an absent one are not the same thing.
|
|
127
|
+
*
|
|
128
|
+
* @param {Uint8Array} bytes Payload bytes.
|
|
129
|
+
* @param {number} [declaredSize] Size to declare when tracked separately.
|
|
130
|
+
* @param {number} [unsetOffset] Offset word to keep when the size is zero.
|
|
131
|
+
* @returns {{size:number,offset:number,bytes:Uint8Array}} Blob reference.
|
|
135
132
|
*/
|
|
136
133
|
function toRecordBlob(bytes, declaredSize, unsetOffset = 0xffffffff) {
|
|
137
134
|
const owned = bytes instanceof Uint8Array ? bytes : new Uint8Array(0);
|
|
@@ -143,12 +140,12 @@ function toRecordBlob(bytes, declaredSize, unsetOffset = 0xffffffff) {
|
|
|
143
140
|
};
|
|
144
141
|
}
|
|
145
142
|
|
|
146
|
-
/**
|
|
147
|
-
* Returns a blob reference's payload bytes, or an empty view when the reference
|
|
148
|
-
* was never set.
|
|
149
|
-
*
|
|
150
|
-
* @param {{size:number,offset:number,bytes:Uint8Array}|null|undefined} ref Blob.
|
|
151
|
-
* @returns {Uint8Array} Owned-by-the-container view over the payload.
|
|
143
|
+
/**
|
|
144
|
+
* Returns a blob reference's payload bytes, or an empty view when the reference
|
|
145
|
+
* was never set.
|
|
146
|
+
*
|
|
147
|
+
* @param {{size:number,offset:number,bytes:Uint8Array}|null|undefined} ref Blob.
|
|
148
|
+
* @returns {Uint8Array} Owned-by-the-container view over the payload.
|
|
152
149
|
*/
|
|
153
150
|
function recordBytes(ref) {
|
|
154
151
|
const bytes = ref?.bytes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carbonRecordFields.js","sources":["../../../../../src/resource/shader/reflection/carbonRecordFields.js"],"sourcesContent":["// Shared field accessors for Carbon v15 description records.\
|
|
1
|
+
{"version":3,"file":"carbonRecordFields.js","sources":["../../../../../src/resource/shader/reflection/carbonRecordFields.js"],"sourcesContent":["import { float32FromBits, float32ToBits, readU32LE } from \"#utils/bytes\";\n\n// Shared field accessors for Carbon v15 description records.\n//\n// The record tree is what the one Carbon effect reader emits\n// (`format/carbonEffect/carbonEffectRecords.js`). Each reflection class maps its\n// own record, but three field encodings recur across all of them and are worth\n// naming once rather than open-coding at every call site:\n//\n// - a string is an arena reference `{offset, value}`, not a string;\n// - an annotation value is four raw little-endian bytes, because Carbon writes\n// it through one union member and reads it through another, so the bytes are\n// the only faithful carrier;\n// - a blob is `{size, offset, bytes}` with `offset === 0xffffffff` meaning the\n// reference was never set, which is not the same as an empty payload.\n//\n// Both directions live here, as `recordX` and `toRecordX` pairs. They are held\n// apart by the round trip rather than by separation: records in, classes, records\n// out, compared byte for byte over the shipped corpus, so a mistake that\n// satisfied both sides would have to be an exact inverse of itself.\n\n/**\n * Reads the text out of an arena string reference.\n *\n * @param {{offset:number,value:string}|null|undefined} ref String reference.\n * @returns {string} The referenced text, or \"\" when unset.\n */\nexport function recordText(ref)\n{\n return String(ref?.value ?? \"\");\n}\n\n/**\n * Decodes an annotation record's four raw bytes as the `u32` bit pattern the\n * reflection classes carry as `rawValue`.\n *\n * Carbon stores the value as a `{float,int32_t}` union and the type byte decides\n * which member is meaningful, so the bits travel untyped and each annotation type\n * reinterprets them itself. Decoding to a number here — rather than to a float —\n * is what keeps a value like `-FLT_MAX` exact.\n *\n * @param {Uint8Array|null|undefined} bytes Four little-endian bytes.\n * @returns {number} The unsigned 32-bit pattern those bytes carry.\n */\nexport function recordRawValue(bytes)\n{\n if (!bytes || bytes.length < 4) return 0;\n return readU32LE(bytes, 0);\n}\n\n/**\n * Re-encodes a record's `float` as the `u32` bit pattern the reflection classes\n * carry in their `*Raw` sampler fields.\n *\n * The container stores sampler LOD and border values as real floats, but the\n * class keeps the bits, so a value like `-FLT_MAX` survives serialization without\n * a decimal round trip. Reading the float and re-encoding it here is exact: the\n * record's value came from a `f32` read, so it is already representable.\n *\n * @param {number} value Float value from a sampler record.\n * @returns {number} The unsigned 32-bit pattern encoding that float.\n */\nexport function recordRawBits(value)\n{\n // The non-finite substitution is the RECORD's rule, not the conversion's: a\n // sampler record has no encoding for NaN, so it stores zero.\n return float32ToBits(Number.isFinite(value) ? value : 0);\n}\n\n/**\n * Wraps text as the arena string reference the writer interns.\n *\n * The offset is always 0: the writer assigns real offsets while building the\n * arena, and any value here would be discarded. Carrying the text is the whole\n * job.\n *\n * @param {string} value Text value.\n * @returns {{offset:number,value:string}} String reference.\n */\nexport function toRecordText(value)\n{\n return { offset: 0, value: String(value ?? \"\") };\n}\n\n/**\n * Encodes a `u32` bit pattern as an annotation record's four raw bytes.\n *\n * The inverse of {@link recordRawValue}, and raw for the same reason: the value\n * is written through one union member and read through another, so no numeric\n * conversion may happen on the way out either.\n *\n * @param {number} rawValue Unsigned 32-bit pattern.\n * @returns {Uint8Array} Four little-endian bytes.\n */\nexport function toRecordRawValue(rawValue)\n{\n const\n value = rawValue >>> 0,\n bytes = new Uint8Array(4);\n\n bytes[0] = value & 0xff;\n bytes[1] = (value >>> 8) & 0xff;\n bytes[2] = (value >>> 16) & 0xff;\n bytes[3] = (value >>> 24) & 0xff;\n return bytes;\n}\n\n/**\n * Decodes a `*Raw` sampler field back to the float the record stores.\n *\n * The inverse of {@link recordRawBits}. Assigning the raw `u32` straight across\n * would write `4286578687.0` where the file says `-3.4028235e38`, and every\n * structural check in the container would accept it.\n *\n * @param {number} bits Raw 32-bit pattern.\n * @returns {number} The float those bits encode.\n */\nexport function toRecordFloat(bits)\n{\n return float32FromBits(bits ?? 0);\n}\n\n/**\n * Wraps bytes as the record codec's sized blob reference.\n *\n * A zero-length blob keeps the offset word the file carried, because the writer\n * passes it straight through rather than interning anything. That word is\n * usually `0xffffffff`, but not always — measured across the shipped corpus,\n * 150 of 4833 files carry a live-looking offset behind a zero size, and\n * normalizing it changes the bytes and can make two distinct bodies collapse\n * into one. An empty payload and an absent one are not the same thing.\n *\n * @param {Uint8Array} bytes Payload bytes.\n * @param {number} [declaredSize] Size to declare when tracked separately.\n * @param {number} [unsetOffset] Offset word to keep when the size is zero.\n * @returns {{size:number,offset:number,bytes:Uint8Array}} Blob reference.\n */\nexport function toRecordBlob(bytes, declaredSize, unsetOffset = 0xffffffff)\n{\n const owned = bytes instanceof Uint8Array ? bytes : new Uint8Array(0);\n const size = declaredSize ?? owned.byteLength;\n return { size, offset: size === 0 ? (unsetOffset >>> 0) : 0, bytes: owned };\n}\n\n/**\n * Returns a blob reference's payload bytes, or an empty view when the reference\n * was never set.\n *\n * @param {{size:number,offset:number,bytes:Uint8Array}|null|undefined} ref Blob.\n * @returns {Uint8Array} Owned-by-the-container view over the payload.\n */\nexport function recordBytes(ref)\n{\n const bytes = ref?.bytes;\n return bytes instanceof Uint8Array ? bytes : new Uint8Array(0);\n}\n"],"names":["recordText","ref","String","value","recordRawValue","bytes","length","readU32LE","recordRawBits","float32ToBits","Number","isFinite","toRecordText","offset","toRecordRawValue","rawValue","Uint8Array","toRecordFloat","bits","float32FromBits","toRecordBlob","declaredSize","unsetOffset","owned","size","byteLength","recordBytes"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,IAAI;EAChCE,KAAK,CAAC,CAAC,CAAC,GAAIF,KAAK,KAAK,EAAE,GAAI,IAAI;AAChC,EAAA,OAAOE,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASY,aAAaA,CAACC,IAAI,EAClC;AACE,EAAA,OAAOC,eAAe,CAACD,IAAI,IAAI,CAAC,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,YAAYA,CAACf,KAAK,EAAEgB,YAAY,EAAEC,WAAW,GAAG,UAAU,EAC1E;AACE,EAAA,MAAMC,KAAK,GAAGlB,KAAK,YAAYW,UAAU,GAAGX,KAAK,GAAG,IAAIW,UAAU,CAAC,CAAC,CAAC;AACrE,EAAA,MAAMQ,IAAI,GAAGH,YAAY,IAAIE,KAAK,CAACE,UAAU;EAC7C,OAAO;IAAED,IAAI;IAAEX,MAAM,EAAEW,IAAI,KAAK,CAAC,GAAIF,WAAW,KAAK,CAAC,GAAI,CAAC;AAAEjB,IAAAA,KAAK,EAAEkB;GAAO;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,WAAWA,CAACzB,GAAG,EAC/B;AACE,EAAA,MAAMI,KAAK,GAAGJ,GAAG,EAAEI,KAAK;EACxB,OAAOA,KAAK,YAAYW,UAAU,GAAGX,KAAK,GAAG,IAAIW,UAAU,CAAC,CAAC,CAAC;AAChE;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { assertCarbonRecord } from '../../format/carbonRecordGuard.js';
|
|
1
2
|
import { CjsSchema, impl, type } from '#schema';
|
|
2
3
|
import { CjsModel } from '#model';
|
|
3
|
-
import { isPlainObject } from '#utils/is';
|
|
4
4
|
import { recordText, recordRawBits, toRecordFloat, toRecordText } from '../reflection/carbonRecordFields.js';
|
|
5
5
|
|
|
6
6
|
// Source: trinity/trinity/Shader/Tr2EffectDescription.h
|
|
@@ -19,12 +19,12 @@ class Tr2SamplerSetup extends CjsModel {
|
|
|
19
19
|
/** Whether the sampler occupies a dynamic register rather than static signature state. */
|
|
20
20
|
isDynamic = false;
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* Construct a canonical sampler record from JS/JSON model values.
|
|
24
|
-
*
|
|
25
|
-
* @param {object} values Canonical model values.
|
|
26
|
-
* @param {object} options CjsModel import options.
|
|
27
|
-
* @returns {Tr2SamplerSetup} Hydrated sampler.
|
|
22
|
+
/**
|
|
23
|
+
* Construct a canonical sampler record from JS/JSON model values.
|
|
24
|
+
*
|
|
25
|
+
* @param {object} values Canonical model values.
|
|
26
|
+
* @param {object} options CjsModel import options.
|
|
27
|
+
* @returns {Tr2SamplerSetup} Hydrated sampler.
|
|
28
28
|
*/
|
|
29
29
|
static from(values = {}, options = {}) {
|
|
30
30
|
let normalized = values;
|
|
@@ -38,26 +38,24 @@ class Tr2SamplerSetup extends CjsModel {
|
|
|
38
38
|
return super.from(normalized, options);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
/**
|
|
42
|
-
* Build one dynamic sampler from its Carbon v15 description record.
|
|
43
|
-
*
|
|
44
|
-
* The name is kept whatever `isDynamic` says. Carbon nulls a non-dynamic
|
|
45
|
-
* sampler's name while reading (`Tr2EffectDescription.cpp:430-433`), but that
|
|
46
|
-
* is a runtime decision made on the way to a device — the file still carries
|
|
47
|
-
* the string, and this graph has to be able to re-emit the file it came from.
|
|
48
|
-
* Dropping it loses arena content: measured across the shipped corpus, this
|
|
49
|
-
* single rule accounted for every non-byte-identical re-emission.
|
|
50
|
-
*
|
|
51
|
-
* A consumer that wants Carbon's runtime view asks for it: the name is
|
|
52
|
-
* meaningful only when `isDynamic`.
|
|
53
|
-
*
|
|
54
|
-
* @param {object} record Carbon sampler record.
|
|
55
|
-
* @returns {Tr2SamplerSetup} Reflected sampler.
|
|
41
|
+
/**
|
|
42
|
+
* Build one dynamic sampler from its Carbon v15 description record.
|
|
43
|
+
*
|
|
44
|
+
* The name is kept whatever `isDynamic` says. Carbon nulls a non-dynamic
|
|
45
|
+
* sampler's name while reading (`Tr2EffectDescription.cpp:430-433`), but that
|
|
46
|
+
* is a runtime decision made on the way to a device — the file still carries
|
|
47
|
+
* the string, and this graph has to be able to re-emit the file it came from.
|
|
48
|
+
* Dropping it loses arena content: measured across the shipped corpus, this
|
|
49
|
+
* single rule accounted for every non-byte-identical re-emission.
|
|
50
|
+
*
|
|
51
|
+
* A consumer that wants Carbon's runtime view asks for it: the name is
|
|
52
|
+
* meaningful only when `isDynamic`.
|
|
53
|
+
*
|
|
54
|
+
* @param {object} record Carbon sampler record.
|
|
55
|
+
* @returns {Tr2SamplerSetup} Reflected sampler.
|
|
56
56
|
*/
|
|
57
57
|
static fromCarbonBinary(record) {
|
|
58
|
-
|
|
59
|
-
throw new TypeError("Carbon effect sampler record must be an object");
|
|
60
|
-
}
|
|
58
|
+
assertCarbonRecord(record, "sampler");
|
|
61
59
|
const sampler = new this();
|
|
62
60
|
sampler.isDynamic = !!record.isDynamic;
|
|
63
61
|
sampler.name = recordText(record.name);
|
|
@@ -80,15 +78,15 @@ class Tr2SamplerSetup extends CjsModel {
|
|
|
80
78
|
return sampler;
|
|
81
79
|
}
|
|
82
80
|
|
|
83
|
-
/**
|
|
84
|
-
* Emit this sampler as a Carbon v15 record.
|
|
85
|
-
*
|
|
86
|
-
* The name is written whether or not it is meaningful: Carbon's writer always
|
|
87
|
-
* emits the field, and the string it emits is the one the compiler authored,
|
|
88
|
-
* not the one Carbon's reader keeps.
|
|
89
|
-
*
|
|
90
|
-
* @param {number} registerIndex Register this sampler is bound at.
|
|
91
|
-
* @returns {object} Carbon sampler record.
|
|
81
|
+
/**
|
|
82
|
+
* Emit this sampler as a Carbon v15 record.
|
|
83
|
+
*
|
|
84
|
+
* The name is written whether or not it is meaningful: Carbon's writer always
|
|
85
|
+
* emits the field, and the string it emits is the one the compiler authored,
|
|
86
|
+
* not the one Carbon's reader keeps.
|
|
87
|
+
*
|
|
88
|
+
* @param {number} registerIndex Register this sampler is bound at.
|
|
89
|
+
* @returns {object} Carbon sampler record.
|
|
92
90
|
*/
|
|
93
91
|
toCarbonBinary(registerIndex) {
|
|
94
92
|
const descriptor = this.sampler ?? {};
|