@carbonenginejs/runtime 0.1.0-alpha.4 → 0.1.0-alpha.5
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/dist/global/blue/BlueClasses.js +200 -0
- package/dist/global/blue/BlueClasses.js.map +1 -0
- package/dist/global/blue/IBlueClasses.js +79 -0
- package/dist/global/blue/IBlueClasses.js.map +1 -0
- package/dist/global/blue/IBlueDynamicResourceConstructor.js +16 -0
- package/dist/global/blue/IBlueDynamicResourceConstructor.js.map +1 -1
- package/dist/global/blue/blue.js +8 -2
- package/dist/global/blue/blue.js.map +1 -1
- package/dist/global/blue/index.js +2 -0
- package/dist/global/blue/index.js.map +1 -1
- package/dist/global/consts/index.js +0 -1
- package/dist/global/consts/index.js.map +1 -1
- package/dist/global/consts/renderContext/formats.js +26 -25
- package/dist/global/consts/renderContext/formats.js.map +1 -1
- package/dist/{trinityal/Tr2BitmapDimensions.js → global/imageio/BitmapDimensions.js} +19 -15
- package/dist/global/imageio/BitmapDimensions.js.map +1 -0
- package/dist/global/imageio/Cutout.js +28 -0
- package/dist/global/imageio/Cutout.js.map +1 -0
- package/dist/global/imageio/HostBitmap.js +1106 -0
- package/dist/global/imageio/HostBitmap.js.map +1 -0
- package/dist/global/imageio/ImageIOResult.js +99 -0
- package/dist/global/imageio/ImageIOResult.js.map +1 -0
- package/dist/global/imageio/ImageUtility.js +205 -0
- package/dist/global/imageio/ImageUtility.js.map +1 -0
- package/dist/global/imageio/LoadParameters.js +86 -0
- package/dist/global/imageio/LoadParameters.js.map +1 -0
- package/dist/global/imageio/Metadata.js +22 -0
- package/dist/global/imageio/Metadata.js.map +1 -0
- package/dist/global/imageio/index.js +8 -0
- package/dist/global/{consts/webgpu → imageio}/index.js.map +1 -1
- package/dist/global/index.js +2 -1
- package/dist/global/index.js.map +1 -1
- package/dist/global/math/color.js +1 -1
- package/dist/global/math/color.js.map +1 -1
- package/dist/global/schema/CjsSchema.js +8 -0
- package/dist/global/schema/CjsSchema.js.map +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/resource/CjsResMan.js +47 -7
- package/dist/resource/CjsResMan.js.map +1 -1
- package/dist/resource/Tr2LightProfileRes.js +37 -0
- package/dist/resource/Tr2LightProfileRes.js.map +1 -1
- package/dist/resource/format/CjsByteWriter.js +46 -46
- package/dist/resource/format/CjsByteWriter.js.map +1 -1
- package/dist/resource/format/CjsFormat.js +7 -8
- package/dist/resource/format/CjsFormat.js.map +1 -1
- package/dist/resource/format/CjsFormatStore.js +8 -8
- package/dist/resource/format/CjsFormatStore.js.map +1 -1
- package/dist/resource/format/CjsGeometryFormat.js +114 -0
- package/dist/resource/format/CjsGeometryFormat.js.map +1 -0
- package/dist/resource/format/CjsImageFormat.js +282 -0
- package/dist/resource/format/CjsImageFormat.js.map +1 -0
- package/dist/resource/format/CjsResourceProbe.js +12 -48
- package/dist/resource/format/CjsResourceProbe.js.map +1 -1
- package/dist/resource/format/CjsStringTable.js +37 -37
- package/dist/resource/format/CjsStringTable.js.map +1 -1
- package/dist/resource/format/carbonEffect/CjsCarbonEffectReader.js +10 -10
- package/dist/resource/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -1
- package/dist/resource/format/carbonEffect/CjsCarbonEffectWriter.js +37 -37
- package/dist/resource/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -1
- package/dist/resource/format/carbonEffect/carbonEffectBackendBlock.js +35 -7
- package/dist/resource/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -1
- package/dist/resource/format/index.js +3 -1
- package/dist/resource/format/index.js.map +1 -1
- package/dist/resource/formats/black/CjsBlackFormat.js +130 -137
- package/dist/resource/formats/black/CjsBlackFormat.js.map +1 -1
- package/dist/resource/formats/bnk/CjsBnkFormat.js +12 -19
- package/dist/resource/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/resource/formats/bnk/core/helpers.js +1 -3
- package/dist/resource/formats/bnk/core/helpers.js.map +1 -1
- package/dist/resource/formats/cmf/CjsCmfFormat.js +19 -82
- package/dist/resource/formats/cmf/CjsCmfFormat.js.map +1 -1
- package/dist/resource/formats/cmf/core/constants.js +1 -2
- package/dist/resource/formats/cmf/core/constants.js.map +1 -1
- package/dist/resource/formats/{stl/core/targets.js → cmf/core/flatShared.js} +9 -8
- package/dist/resource/formats/cmf/core/flatShared.js.map +1 -0
- package/dist/resource/formats/cmf/core/helpers.js +13 -13
- package/dist/resource/formats/cmf/core/helpers.js.map +1 -1
- package/dist/resource/formats/cmf/core/writer.js +24 -24
- package/dist/resource/formats/cmf/core/writer.js.map +1 -1
- package/dist/resource/formats/dds/CjsDdsFormat.js +134 -17
- package/dist/resource/formats/dds/CjsDdsFormat.js.map +1 -1
- package/dist/resource/formats/dds/core/helpers.js +125 -40
- package/dist/resource/formats/dds/core/helpers.js.map +1 -1
- package/dist/resource/formats/dxbc/CjsDxbcFormat.js +14 -16
- package/dist/resource/formats/dxbc/CjsDxbcFormat.js.map +1 -1
- package/dist/resource/formats/dxbc/core/{container.js → DxbcContainer.js} +2 -2
- package/dist/resource/formats/dxbc/core/DxbcContainer.js.map +1 -0
- package/dist/resource/formats/dxbc/core/{errors.js → DxbcReadError.js} +1 -1
- package/dist/resource/formats/dxbc/core/DxbcReadError.js.map +1 -0
- package/dist/resource/formats/dxbc/core/DxbcReader.js +1 -1
- package/dist/resource/formats/dxbc/core/DxbcReader.js.map +1 -1
- package/dist/resource/formats/dxbc/core/{program.js → DxbcShaderProgram.js} +2 -2
- package/dist/resource/formats/dxbc/core/DxbcShaderProgram.js.map +1 -0
- package/dist/resource/formats/dxbc/core/{signature.js → DxbcSignatureChunk.js} +2 -2
- package/dist/resource/formats/dxbc/core/DxbcSignatureChunk.js.map +1 -0
- package/dist/resource/formats/dxbc/core/decoder.js +2 -2
- package/dist/resource/formats/dxbc/core/decoder.js.map +1 -1
- package/dist/resource/formats/dxbc/core/helpers.js +3 -3
- package/dist/resource/formats/dxbc/core/helpers.js.map +1 -1
- package/dist/resource/formats/fbx/CjsFbxFormat.js +18 -20
- package/dist/resource/formats/fbx/CjsFbxFormat.js.map +1 -1
- package/dist/resource/formats/flac/CjsFlacFormat.js +7 -13
- package/dist/resource/formats/flac/CjsFlacFormat.js.map +1 -1
- package/dist/resource/formats/fsd/32/CjsFsd32Format.js +29 -29
- package/dist/resource/formats/fsd/32/CjsFsd32Format.js.map +1 -1
- package/dist/resource/formats/fsd/64/CjsFsd64Format.js +3 -3
- package/dist/resource/formats/fsd/64/CjsFsd64Format.js.map +1 -1
- package/dist/resource/formats/fsd/64/core/CjsFsd64Binary.js +23 -23
- package/dist/resource/formats/fsd/64/core/CjsFsd64Binary.js.map +1 -1
- package/dist/resource/formats/fsd/64/core/CjsFsd64Reader.js +8 -8
- package/dist/resource/formats/fsd/64/core/CjsFsd64Reader.js.map +1 -1
- package/dist/resource/formats/fsd/CjsFsdFormat.js +23 -23
- package/dist/resource/formats/fsd/CjsFsdFormat.js.map +1 -1
- package/dist/resource/formats/gif/CjsGifFormat.js +24 -15
- package/dist/resource/formats/gif/CjsGifFormat.js.map +1 -1
- package/dist/resource/formats/gltf/CjsGltfFormat.js +33 -98
- package/dist/resource/formats/gltf/CjsGltfFormat.js.map +1 -1
- package/dist/resource/formats/gltf/core/helpers.js +3 -12
- package/dist/resource/formats/gltf/core/helpers.js.map +1 -1
- package/dist/resource/formats/gr2/CjsGr2Format.js +27 -91
- package/dist/resource/formats/gr2/CjsGr2Format.js.map +1 -1
- package/dist/resource/formats/hlsl/CjsHlslFormat.js +22 -25
- package/dist/resource/formats/hlsl/CjsHlslFormat.js.map +1 -1
- package/dist/resource/formats/hlsl/core/carbonDescriptionToRuntime.js +1 -1
- package/dist/resource/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -1
- package/dist/resource/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +3 -3
- package/dist/resource/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js.map +1 -1
- package/dist/resource/formats/ies/CjsIESFormat.js +29 -29
- package/dist/resource/formats/ies/CjsIESFormat.js.map +1 -1
- package/dist/resource/formats/jpeg/CjsJpegFormat.js +24 -15
- package/dist/resource/formats/jpeg/CjsJpegFormat.js.map +1 -1
- package/dist/resource/formats/jpeg/core/helpers.js +3 -5
- package/dist/resource/formats/jpeg/core/helpers.js.map +1 -1
- package/dist/resource/formats/jpeg/core/jpeg.js +58 -58
- package/dist/resource/formats/jpeg/core/jpeg.js.map +1 -1
- package/dist/resource/formats/jsonl/CjsJsonlFormat.js +3 -3
- package/dist/resource/formats/jsonl/CjsJsonlFormat.js.map +1 -1
- package/dist/resource/formats/mp3/CjsMp3Format.js +7 -14
- package/dist/resource/formats/mp3/CjsMp3Format.js.map +1 -1
- package/dist/resource/formats/mp3/core/helpers.js +3 -5
- package/dist/resource/formats/mp3/core/helpers.js.map +1 -1
- package/dist/resource/formats/mp4/CjsMp4Format.js +7 -13
- package/dist/resource/formats/mp4/CjsMp4Format.js.map +1 -1
- package/dist/resource/formats/mp4/core/helpers.js +3 -5
- package/dist/resource/formats/mp4/core/helpers.js.map +1 -1
- package/dist/resource/formats/obj/CjsObjFormat.js +92 -157
- package/dist/resource/formats/obj/CjsObjFormat.js.map +1 -1
- package/dist/resource/formats/obj/core/helpers.js +5 -113
- package/dist/resource/formats/obj/core/helpers.js.map +1 -1
- package/dist/resource/formats/ogg/CjsOggFormat.js +7 -14
- package/dist/resource/formats/ogg/CjsOggFormat.js.map +1 -1
- package/dist/resource/formats/pickle/CjsPickleFormat.js +7 -12
- package/dist/resource/formats/pickle/CjsPickleFormat.js.map +1 -1
- package/dist/resource/formats/pickle/core/CjsPickleProtocol0Reader.js +7 -7
- package/dist/resource/formats/pickle/core/CjsPickleProtocol0Reader.js.map +1 -1
- package/dist/resource/formats/pickle/core/CjsPickleProtocol4Reader.js +7 -7
- package/dist/resource/formats/pickle/core/CjsPickleProtocol4Reader.js.map +1 -1
- package/dist/resource/formats/png/CjsPngFormat.js +40 -15
- package/dist/resource/formats/png/CjsPngFormat.js.map +1 -1
- package/dist/resource/formats/png/core/helpers.js +4 -6
- package/dist/resource/formats/png/core/helpers.js.map +1 -1
- package/dist/resource/formats/red/CjsRedFormat.js +22 -28
- package/dist/resource/formats/red/CjsRedFormat.js.map +1 -1
- package/dist/resource/formats/schemabound/CjsSchemaBoundFormat.js +3 -7
- package/dist/resource/formats/schemabound/CjsSchemaBoundFormat.js.map +1 -1
- package/dist/resource/formats/schemabound/core/schemaBoundValues.js +5 -0
- package/dist/resource/formats/schemabound/core/schemaBoundValues.js.map +1 -1
- package/dist/resource/formats/sqlite/CjsSqliteFormat.js +4 -9
- package/dist/resource/formats/sqlite/CjsSqliteFormat.js.map +1 -1
- package/dist/resource/formats/static/CjsStaticFormat.js +4 -4
- package/dist/resource/formats/static/CjsStaticFormat.js.map +1 -1
- package/dist/resource/formats/stl/CjsStlFormat.js +39 -104
- package/dist/resource/formats/stl/CjsStlFormat.js.map +1 -1
- package/dist/resource/formats/stl/core/helpers.js +5 -19
- package/dist/resource/formats/stl/core/helpers.js.map +1 -1
- package/dist/resource/formats/tga/CjsTgaFormat.js +26 -15
- package/dist/resource/formats/tga/CjsTgaFormat.js.map +1 -1
- package/dist/resource/formats/tga/core/helpers.js +3 -5
- package/dist/resource/formats/tga/core/helpers.js.map +1 -1
- package/dist/resource/formats/vta/CjsVtaFormat.js +8 -15
- package/dist/resource/formats/vta/CjsVtaFormat.js.map +1 -1
- package/dist/resource/formats/wav/CjsWavFormat.js +7 -14
- package/dist/resource/formats/wav/CjsWavFormat.js.map +1 -1
- package/dist/resource/formats/wav/core/helpers.js +3 -5
- package/dist/resource/formats/wav/core/helpers.js.map +1 -1
- package/dist/resource/formats/webgl/CjsWebglFormat.js +103 -105
- package/dist/resource/formats/webgl/CjsWebglFormat.js.map +1 -1
- package/dist/resource/formats/webgl/core/{errors.js → WebglReadError.js} +1 -1
- package/dist/resource/formats/webgl/core/WebglReadError.js.map +1 -0
- package/dist/resource/formats/webgl/core/effectPackage.js +1 -1
- package/dist/resource/formats/webgl/core/effectPackage.js.map +1 -1
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +3 -3
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
- package/dist/resource/formats/webgl/core/glsl/{DxbcGlslHelpers.js → DxbcGlslHelperRegistry.js} +2 -2
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslHelperRegistry.js.map +1 -0
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +1 -1
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -1
- package/dist/resource/formats/webgl/core/glslBackendBlock.js +1 -1
- package/dist/resource/formats/webgl/core/glslBackendBlock.js.map +1 -1
- package/dist/resource/formats/webgl/core/helpers.js.map +1 -1
- package/dist/resource/formats/webgpu/CjsWebgpuFormat.js +28 -29
- package/dist/resource/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
- package/dist/resource/formats/webgpu/core/{errors.js → WebgpuReadError.js} +1 -1
- package/dist/resource/formats/webgpu/core/WebgpuReadError.js.map +1 -0
- package/dist/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js +1 -1
- package/dist/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js.map +1 -1
- package/dist/resource/formats/webgpu/core/helpers.js +1 -1
- package/dist/resource/formats/webgpu/core/helpers.js.map +1 -1
- package/dist/resource/formats/webgpu/core/ir/lowerDxbcToIr.js +1 -1
- package/dist/resource/formats/webgpu/core/ir/lowerDxbcToIr.js.map +1 -1
- package/dist/resource/formats/webgpu/core/wgsl/buildWgslSet.js +18 -6
- package/dist/resource/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
- package/dist/resource/formats/webgpu/core/wgsl/lowerBindingLayout.js +39 -13
- package/dist/resource/formats/webgpu/core/wgsl/lowerBindingLayout.js.map +1 -1
- package/dist/resource/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +16 -14
- package/dist/resource/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js.map +1 -1
- package/dist/resource/formats/webm/CjsWebmFormat.js +8 -13
- package/dist/resource/formats/webm/CjsWebmFormat.js.map +1 -1
- package/dist/resource/formats/webm/core/helpers.js +3 -5
- package/dist/resource/formats/webm/core/helpers.js.map +1 -1
- package/dist/resource/formats/webp/CjsWebpFormat.js +8 -12
- package/dist/resource/formats/webp/CjsWebpFormat.js.map +1 -1
- package/dist/resource/formats/wem/CjsWemFormat.js +9 -17
- package/dist/resource/formats/wem/CjsWemFormat.js.map +1 -1
- package/dist/resource/formats/wem/core/bitStream.js +35 -35
- package/dist/resource/formats/wem/core/bitStream.js.map +1 -1
- package/dist/resource/formats/wem/core/helpers.js +1 -3
- package/dist/resource/formats/wem/core/helpers.js.map +1 -1
- package/dist/resource/formats/yaml/CjsYamlFormat.js +28 -37
- package/dist/resource/formats/yaml/CjsYamlFormat.js.map +1 -1
- package/dist/resource/imageio/ImageIO.js +142 -0
- package/dist/resource/imageio/ImageIO.js.map +1 -0
- package/dist/resource/imageio/index.js +17 -0
- package/dist/resource/imageio/index.js.map +1 -0
- package/dist/resource/index.js +7 -0
- package/dist/resource/index.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectResource.js +24 -2
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2Pass.js +76 -5
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
- package/dist/resource/texture/CjsTextureArrayConstructor.js +97 -0
- package/dist/resource/texture/CjsTextureArrayConstructor.js.map +1 -0
- package/dist/resource/texture/CjsTexturePackConstructor.js +160 -0
- package/dist/resource/texture/CjsTexturePackConstructor.js.map +1 -0
- package/dist/resource/texture/CjsTexturePipelineStepArray.js +72 -0
- package/dist/resource/texture/CjsTexturePipelineStepArray.js.map +1 -0
- package/dist/resource/texture/CjsTexturePipelineStepConvert.js +73 -0
- package/dist/resource/texture/CjsTexturePipelineStepConvert.js.map +1 -0
- package/dist/resource/texture/CjsTexturePipelineStepPack.js +71 -0
- package/dist/resource/texture/CjsTexturePipelineStepPack.js.map +1 -0
- package/dist/resource/texture/CjsTexturePipelineStepResize.js +123 -0
- package/dist/resource/texture/CjsTexturePipelineStepResize.js.map +1 -0
- package/dist/resource/texture/SolidColorTextureConstructor.js +11 -1
- package/dist/resource/texture/SolidColorTextureConstructor.js.map +1 -1
- package/dist/resource/texture/Tr2ImageRes.js +100 -68
- package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipeline.js +45 -25
- package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +34 -1
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +30 -3
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +81 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +36 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js +146 -24
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -1
- package/dist/resource/texture/TriTextureRes.js +151 -29
- package/dist/resource/texture/TriTextureRes.js.map +1 -1
- package/dist/resource/texture/index.js +7 -0
- package/dist/resource/texture/index.js.map +1 -1
- package/dist/resource/texture/registerTextureResources.js +83 -0
- package/dist/resource/texture/registerTextureResources.js.map +1 -0
- package/dist/resource/texture/solidColorTexture.js +10 -19
- package/dist/resource/texture/solidColorTexture.js.map +1 -1
- package/dist/sof/EveSOF.js +39 -7
- package/dist/sof/EveSOF.js.map +1 -1
- package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js +2 -2
- package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js.map +1 -1
- package/dist/trinity/core/Tr2ImageIOHelpers.js +80 -17
- package/dist/trinity/core/Tr2ImageIOHelpers.js.map +1 -1
- package/dist/trinity/core/Tr2RenderUtils.js +1 -1
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js +49 -62
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js.map +1 -1
- package/dist/trinity/core/Tr2TextureReference.js +114 -0
- package/dist/trinity/core/Tr2TextureReference.js.map +1 -0
- package/dist/trinity/core/device/Tr2DepthStencil.js +2 -2
- package/dist/trinity/core/device/Tr2DepthStencil.js.map +1 -1
- package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBuffer.js +1 -1
- package/dist/trinity/core/index.js +1 -0
- package/dist/trinity/core/index.js.map +1 -1
- package/dist/trinity/core/lighting/Tr2LightManager.js +5 -4
- package/dist/trinity/core/lighting/Tr2LightManager.js.map +1 -1
- package/dist/trinity/core/procedural/GradientTextureConstructor.js +5 -4
- package/dist/trinity/core/procedural/GradientTextureConstructor.js.map +1 -1
- package/dist/trinity/core/procedural/gradientTexture.js +10 -13
- package/dist/trinity/core/procedural/gradientTexture.js.map +1 -1
- package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js +1 -1
- package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js.map +1 -1
- package/dist/trinity/eve/EveImpactOverlay.js +102 -50
- package/dist/trinity/eve/EveImpactOverlay.js.map +1 -1
- package/dist/trinity/eve/EveModularObjectModifier.js +9 -18
- package/dist/trinity/eve/EveModularObjectModifier.js.map +1 -1
- package/dist/trinity/eve/attachment/turrets/EveTurretSet.js +175 -157
- package/dist/trinity/eve/attachment/turrets/EveTurretSet.js.map +1 -1
- package/dist/trinity/eve/attachment/turrets/EveTurretTarget.js +100 -83
- package/dist/trinity/eve/attachment/turrets/EveTurretTarget.js.map +1 -1
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js +26 -20
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js.map +1 -1
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js +368 -179
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js.map +1 -1
- package/dist/trinity/eve/child/EveChildMesh.js +242 -234
- package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
- package/dist/trinity/eve/child/EveChildTurret.js +57 -16
- package/dist/trinity/eve/child/EveChildTurret.js.map +1 -1
- package/dist/trinity/eve/child/EveSpaceObjectChild.js +28 -1
- package/dist/trinity/eve/child/EveSpaceObjectChild.js.map +1 -1
- package/dist/trinity/eve/index.js +2 -2
- package/dist/trinity/eve/overlays/EveDamageOverlay.js +5 -1
- package/dist/trinity/eve/overlays/EveDamageOverlay.js.map +1 -1
- package/dist/trinity/eve/scene/EveSpaceScene.js +234 -233
- package/dist/trinity/eve/scene/EveSpaceScene.js.map +1 -1
- package/dist/trinity/eve/scene/EveSpaceSceneRenderDriver.js +2 -0
- package/dist/trinity/eve/scene/EveSpaceSceneRenderDriver.js.map +1 -1
- package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +492 -437
- package/dist/trinity/eve/spaceObject/EveSpaceObject2.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 +3 -3
- package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js +10 -1
- package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js.map +1 -1
- package/dist/trinity/shader/Tr2DataTextureManager.js +152 -66
- package/dist/trinity/shader/Tr2DataTextureManager.js.map +1 -1
- package/dist/trinity/shader/Tr2Material.js +1 -1
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js +5 -5
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js.map +1 -1
- package/dist/trinityal/index.js +1 -1
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js +2 -2
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2SwapChainALStub.js +45 -45
- package/dist/trinityal/stub/Tr2SwapChainALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2TextureALStub.js +170 -170
- package/dist/trinityal/stub/Tr2TextureALStub.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuDevice.js +234 -164
- package/dist/trinityal/webgpu/CjsWebgpuDevice.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js +7 -0
- package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js +78 -14
- package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js.map +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuUtils.js +94 -0
- package/dist/trinityal/webgpu/core/CjsWebgpuUtils.js.map +1 -0
- package/dist/trinityal/webgpu/internal.js +1 -0
- package/dist/trinityal/webgpu/internal.js.map +1 -1
- package/docs/global/reference/classes/README.md +90 -0
- package/docs/resource/concepts/format-capabilities.md +3 -3
- package/docs/resource/formats/README.md +1 -1
- package/docs/resource/reference/classes/core.md +31 -1
- package/docs/resource/reference/classes/formats.md +7 -7
- package/docs/resource/reference/classes/resources.md +76 -16
- package/docs/trinity/reference/classes/generated.md +0 -10
- package/docs/trinity/reference/classes/trinity-core.md +1692 -1682
- package/docs/trinityal/reference/classes/README.md +0 -10
- package/docs/trinityal/webgpu/reference/classes/README.md +276 -266
- package/package.json +4 -3
- package/dist/global/consts/webgpu/index.js +0 -2
- package/dist/global/consts/webgpu/textureFormats.js +0 -180
- package/dist/global/consts/webgpu/textureFormats.js.map +0 -1
- package/dist/resource/formats/dxbc/core/container.js.map +0 -1
- package/dist/resource/formats/dxbc/core/errors.js.map +0 -1
- package/dist/resource/formats/dxbc/core/program.js.map +0 -1
- package/dist/resource/formats/dxbc/core/signature.js.map +0 -1
- package/dist/resource/formats/stl/core/targets.js.map +0 -1
- package/dist/resource/formats/webgl/core/errors.js.map +0 -1
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslHelpers.js.map +0 -1
- package/dist/resource/formats/webgpu/core/errors.js.map +0 -1
- package/dist/resource/texture/texturePipelineBehavior.js +0 -332
- package/dist/resource/texture/texturePipelineBehavior.js.map +0 -1
- package/dist/trinity/generated/trinityCore/Tr2TextureReference.js +0 -40
- package/dist/trinity/generated/trinityCore/Tr2TextureReference.js.map +0 -1
- package/dist/trinityal/Tr2BitmapDimensions.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../../../../src/resource/formats/wav/core/helpers.js"],"sourcesContent":["import { toJsonWithByteSummary as toJsonValue } from \"../../../format/jsonPolicies.js\";\nimport { asUint8Array, readFourCc, readU16LE, readU32LE } from \"#utils/bytes\";\nexport const OUTPUT_AUDIO = \"audio\";\nexport const OUTPUT_PCM = \"pcm\";\nexport const OUTPUT_RAW = \"raw\";\nexport const OUTPUT_JSON = \"json\";\n\nexport const DEFAULT_VALUES = Object.freeze({\n emit: OUTPUT_RAW,\n inputType: \"\",\n source: \"\"\n});\n\nconst DEBUG_OUTPUTS = Object.freeze({\n wav: \"wavJson\",\n mp3: \"mp3Json\"\n});\n\n/**\n * Normalizes reader options against their supported defaults for the WAV format\n * reader.\n */\nexport function normalizeValues(base = DEFAULT_VALUES, options = {}, readerName = \"CjsAudioFormat\")\n{\n const values = { ...DEFAULT_VALUES, ...(base || {}), ...(options || {}) };\n values.inputType = normalizeInputType(values.inputType);\n values.emit = normalizeEmit(values.emit, values.inputType, readerName);\n return values;\n}\n\n/** Normalizes the requested input representation for the WAV format reader. */\nexport function normalizeInputType(inputType)\n{\n return inputType ? String(inputType).replace(/^\\./u, \"\").toLowerCase() : \"\";\n}\n\n/** Normalizes the requested output representation for the WAV format reader. */\nexport function normalizeEmit(emit, inputType, readerName)\n{\n if (emit === undefined || emit === null) return OUTPUT_RAW;\n if (emit === OUTPUT_JSON && inputType) return DEBUG_OUTPUTS[inputType] || OUTPUT_JSON;\n if ([ OUTPUT_AUDIO, OUTPUT_PCM, OUTPUT_RAW, OUTPUT_JSON ].includes(emit)) return emit;\n if (Object.values(DEBUG_OUTPUTS).includes(emit)) return emit;\n throw new TypeError(`${readerName}: unknown emit value ${JSON.stringify(emit)}`);\n}\n\n/** Returns a byte view over the supplied binary input for the WAV format reader. */\n/** Inspects input using normalized format options for the WAV format reader. */\nexport function inspectWithValues(input, values = DEFAULT_VALUES, expectedType = \"\")\n{\n const bytes = asUint8Array(input, \"Audio input\");\n const metadata = inspectBytes(bytes);\n if (expectedType && metadata.sourceFormat && metadata.sourceFormat !== expectedType)\n {\n throw new TypeError(`CjsAudioFormat: expected ${expectedType}, got ${metadata.sourceFormat}`);\n }\n return {\n payloadType: \"audio\",\n mediaTypes: [ \"audio\" ],\n byteLength: bytes.byteLength,\n sourceFormat: expectedType || values.inputType || metadata.sourceFormat,\n ...metadata\n };\n}\n\n/**\n * Reports whether input is supported under normalized format options for the WAV\n * format reader.\n */\nexport function probeSupportWithValues(input, values = DEFAULT_VALUES, expectedType = \"\")\n{\n try\n {\n const metadata = inspectWithValues(input, values, expectedType);\n const canEmitPcm = metadata.sourceFormat === \"wav\" && canEmitWavPcm(metadata);\n const mimeType = getAudioMimeType(metadata);\n return {\n format: metadata.sourceFormat,\n source: values.source || \"buffer\",\n supported: metadata.sourceFormat ? (canEmitPcm ? \"full\" : \"partial\") : \"none\",\n confidence: metadata.sourceFormat ? 1 : 0,\n preferredOutput: canEmitPcm ? \"pcm\" : \"raw\",\n reason: metadata.sourceFormat ? \"Container/header recognized.\" : \"Unrecognized audio format.\",\n metadata,\n variants: [\n {\n kind: \"raw\",\n payloadType: \"raw\",\n codec: metadata.audioFormat || metadata.sourceFormat,\n mimeType,\n supported: true,\n },\n {\n kind: \"pcm\",\n codec: metadata.sampleFormat || \"pcm\",\n supported: canEmitPcm,\n payloadType: canEmitPcm ? \"pcm\" : \"pcm\",\n reason: canEmitPcm ? \"\" : \"Only WAV PCM/IEEE-float data chunks can be emitted as PCM.\"\n }\n ],\n warnings: [],\n errors: []\n };\n }\n catch (error)\n {\n return {\n format: expectedType || values.inputType || \"\",\n source: values.source || \"buffer\",\n supported: \"none\",\n confidence: 0,\n preferredOutput: \"\",\n reason: error.message,\n metadata: null,\n variants: [],\n warnings: [],\n errors: [ error.message ]\n };\n }\n}\n\n/** Reads input using normalized format options for the WAV format reader. */\nexport function readWithValues(input, values = DEFAULT_VALUES, expectedType = \"\")\n{\n const bytes = asUint8Array(input, \"Audio input\");\n const metadata = inspectWithValues(bytes, values, expectedType);\n if (values.emit === OUTPUT_RAW)\n {\n return {\n payloadType: \"raw\",\n sourceFormat: metadata.sourceFormat,\n mimeType: getAudioMimeType(metadata),\n metadata,\n bytes\n };\n }\n if (values.emit === OUTPUT_JSON || values.emit === DEBUG_OUTPUTS[metadata.sourceFormat]) return metadata;\n if ((values.emit === OUTPUT_PCM || values.emit === OUTPUT_AUDIO) && metadata.sourceFormat === \"wav\")\n {\n return readWavPcm(bytes, metadata, values.emit);\n }\n\n const error = new Error(`${metadata.sourceFormat}: emit \"${values.emit}\" is not implemented yet`);\n error.code = \"CJS_FORMAT_OUTPUT_NOT_IMPLEMENTED\";\n error.sourceFormat = metadata.sourceFormat;\n error.emit = values.emit;\n throw error;\n}\n\nfunction getAudioMimeType(metadata)\n{\n if (metadata.sourceFormat === \"mp3\") return \"audio/mpeg\";\n return \"audio/wav\";\n}\n\n/** Converts a parsed payload into a JSON-safe value for the WAV format reader. */\n/** The shared JSON policy for this reader, under the name its callers use. */\nexport { toJsonValue };\n\n/**\n * Inspects the supplied bytes without decoding their payload for the WAV format\n * reader.\n */\nexport function inspectBytes(bytes)\n{\n if (isWAV(bytes)) return inspectWAV(bytes);\n if (isMP3(bytes)) return inspectMP3(bytes);\n return { sourceFormat: \"\", audioFormat: \"\" };\n}\n\n/**\n * Reports whether the supplied bytes have a RIFF/WAVE header for the WAV format\n * reader.\n */\nexport function isWAV(bytes)\n{\n return bytes.byteLength >= 12 && readFourCc(bytes, 0) === \"RIFF\" && readFourCc(bytes, 8) === \"WAVE\";\n}\n\n/**\n * Reports whether the supplied bytes have a supported MP3 header for the WAV\n * format reader.\n */\nexport function isMP3(bytes)\n{\n return bytes.byteLength >= 3 &&\n (readFourCc(bytes, 0, 3) === \"ID3\" || (bytes[0] === 0xff && (bytes[1] & 0xe0) === 0xe0));\n}\n\nfunction inspectWAV(bytes)\n{\n let offset = 12;\n const info = {\n sourceFormat: \"wav\",\n audioFormat: \"wav\",\n sampleRate: 0,\n channels: 0,\n bitsPerSample: 0,\n byteRate: 0,\n blockAlign: 0,\n dataOffset: 0,\n dataBytes: 0,\n containerFormatTag: 0,\n validBitsPerSample: 0,\n channelMask: 0,\n channelLayout: \"unspecified\",\n durationSeconds: 0\n };\n while (offset + 8 <= bytes.byteLength)\n {\n const id = readFourCc(bytes, offset), size = readU32LE(bytes, offset + 4), dataOffset = offset + 8;\n if (id === \"fmt \" && dataOffset + 16 <= bytes.byteLength)\n {\n const containerFormatTag = readU16LE(bytes, dataOffset);\n info.containerFormatTag = containerFormatTag;\n info.formatTag = containerFormatTag;\n info.channels = readU16LE(bytes, dataOffset + 2);\n info.sampleRate = readU32LE(bytes, dataOffset + 4);\n info.byteRate = readU32LE(bytes, dataOffset + 8);\n info.blockAlign = readU16LE(bytes, dataOffset + 12);\n info.bitsPerSample = readU16LE(bytes, dataOffset + 14);\n info.validBitsPerSample = info.bitsPerSample;\n if (containerFormatTag === 0xfffe && size >= 40 && dataOffset + 40 <= bytes.byteLength)\n {\n info.validBitsPerSample = readU16LE(bytes, dataOffset + 18) || info.bitsPerSample;\n info.channelMask = readU32LE(bytes, dataOffset + 20);\n info.subFormatTag = readU16LE(bytes, dataOffset + 24);\n info.formatTag = info.subFormatTag;\n info.channelLayout = channelLayoutFromMask(info.channelMask, info.channels);\n }\n info.sampleFormat = wavSampleFormat(info.formatTag, info.bitsPerSample);\n }\n if (id === \"data\")\n {\n info.dataOffset = dataOffset;\n info.dataBytes = size;\n }\n offset = dataOffset + size + (size & 1);\n }\n info.frameCount = info.blockAlign ? Math.floor(info.dataBytes / info.blockAlign) : 0;\n info.durationSeconds = info.sampleRate ? info.frameCount / info.sampleRate : 0;\n return info;\n}\n\nfunction inspectMP3(bytes)\n{\n return {\n sourceFormat: \"mp3\",\n audioFormat: \"mp3\",\n hasId3: readFourCc(bytes, 0, 3) === \"ID3\"\n };\n}\n\n\nfunction canEmitWavPcm(metadata)\n{\n return metadata.dataOffset > 0 &&\n [ 1, 3 ].includes(metadata.formatTag) &&\n metadata.channels > 0 &&\n metadata.sampleRate > 0 &&\n canReadWavSampleWidth(metadata);\n}\n\nfunction readWavPcm(bytes, metadata, emit)\n{\n if (!canEmitWavPcm(metadata))\n {\n const error = new Error(\"wav: only PCM and IEEE-float WAV data chunks can be emitted as PCM\");\n error.code = \"CJS_FORMAT_OUTPUT_NOT_SUPPORTED\";\n error.sourceFormat = metadata.sourceFormat;\n throw error;\n }\n\n const end = metadata.dataOffset + metadata.dataBytes;\n if (end > bytes.byteLength)\n {\n const error = new Error(\"wav: data chunk is truncated\");\n error.code = \"CJS_FORMAT_TRUNCATED\";\n error.sourceFormat = metadata.sourceFormat;\n throw error;\n }\n\n const data = decodeWavSamples(bytes, metadata, end);\n\n return {\n payloadType: emit === OUTPUT_AUDIO ? OUTPUT_AUDIO : OUTPUT_PCM,\n sourceFormat: \"wav\",\n audioFormat: metadata.sampleFormat,\n sampleFormat: metadata.sampleFormat,\n sampleRate: metadata.sampleRate,\n channels: metadata.channels,\n interleaving: \"interleaved\",\n channelLayout: metadata.channelLayout || \"unspecified\",\n bitsPerSample: metadata.bitsPerSample,\n blockAlign: metadata.blockAlign,\n frameCount: metadata.frameCount,\n durationSeconds: metadata.sampleRate ? metadata.frameCount / metadata.sampleRate : 0,\n metadata,\n data\n };\n}\n\nfunction decodeWavSamples(bytes, metadata, end)\n{\n const bytesPerSample = metadata.bitsPerSample / 8;\n if (!Number.isInteger(bytesPerSample) || bytesPerSample <= 0 || metadata.dataBytes % bytesPerSample !== 0)\n {\n const error = new Error(`wav: unsupported sample width ${metadata.bitsPerSample}`);\n error.code = \"CJS_FORMAT_OUTPUT_NOT_SUPPORTED\";\n error.sourceFormat = metadata.sourceFormat;\n throw error;\n }\n\n const sampleCount = metadata.dataBytes / bytesPerSample;\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n if (metadata.formatTag === 1)\n {\n if (metadata.bitsPerSample === 8) return Uint8Array.from(bytes.subarray(metadata.dataOffset, end));\n if (metadata.bitsPerSample === 16)\n {\n const data = new Int16Array(sampleCount);\n for (let i = 0; i < sampleCount; i++) data[i] = view.getInt16(metadata.dataOffset + i * 2, true);\n return data;\n }\n if (metadata.bitsPerSample === 24)\n {\n const data = new Int32Array(sampleCount);\n for (let i = 0; i < sampleCount; i++)\n {\n const offset = metadata.dataOffset + i * 3;\n let value = view.getUint8(offset) | (view.getUint8(offset + 1) << 8) | (view.getUint8(offset + 2) << 16);\n if (value & 0x800000) value |= 0xff000000;\n data[i] = value;\n }\n return data;\n }\n if (metadata.bitsPerSample === 32)\n {\n const data = new Int32Array(sampleCount);\n for (let i = 0; i < sampleCount; i++) data[i] = view.getInt32(metadata.dataOffset + i * 4, true);\n return data;\n }\n }\n if (metadata.formatTag === 3 && metadata.bitsPerSample === 32)\n {\n const data = new Float32Array(sampleCount);\n for (let i = 0; i < sampleCount; i++) data[i] = view.getFloat32(metadata.dataOffset + i * 4, true);\n return data;\n }\n if (metadata.formatTag === 3 && metadata.bitsPerSample === 64)\n {\n const data = new Float64Array(sampleCount);\n for (let i = 0; i < sampleCount; i++) data[i] = view.getFloat64(metadata.dataOffset + i * 8, true);\n return data;\n }\n\n const error = new Error(`wav: unsupported ${metadata.sampleFormat} sample data`);\n error.code = \"CJS_FORMAT_OUTPUT_NOT_SUPPORTED\";\n error.sourceFormat = metadata.sourceFormat;\n throw error;\n}\n\nfunction canReadWavSampleWidth(metadata)\n{\n if (metadata.formatTag === 1) return [ 8, 16, 24, 32 ].includes(metadata.bitsPerSample);\n if (metadata.formatTag === 3) return [ 32, 64 ].includes(metadata.bitsPerSample);\n return false;\n}\n\nfunction wavSampleFormat(formatTag, bitsPerSample)\n{\n if (formatTag === 3) return `float${bitsPerSample}`;\n if (formatTag === 1) return `pcm${bitsPerSample}`;\n return `wav-format-${formatTag}`;\n}\n\nfunction channelLayoutFromMask(mask, channels)\n{\n const names = [\n [ 0x001, \"front-left\" ], [ 0x002, \"front-right\" ], [ 0x004, \"front-center\" ],\n [ 0x008, \"low-frequency\" ], [ 0x010, \"back-left\" ], [ 0x020, \"back-right\" ],\n [ 0x040, \"front-left-of-center\" ], [ 0x080, \"front-right-of-center\" ], [ 0x100, \"back-center\" ],\n [ 0x200, \"side-left\" ], [ 0x400, \"side-right\" ], [ 0x800, \"top-center\" ],\n [ 0x1000, \"top-front-left\" ], [ 0x2000, \"top-front-center\" ], [ 0x4000, \"top-front-right\" ],\n [ 0x8000, \"top-back-left\" ], [ 0x10000, \"top-back-center\" ], [ 0x20000, \"top-back-right\" ]\n ];\n const layout = names.filter(([ bit ]) => mask & bit).map(([ , name ]) => name);\n return layout.length === channels ? layout : layout.length ? layout : \"unspecified\";\n}\n\n"],"names":["OUTPUT_AUDIO","OUTPUT_PCM","OUTPUT_RAW","OUTPUT_JSON","DEFAULT_VALUES","Object","freeze","emit","inputType","source","DEBUG_OUTPUTS","wav","mp3","normalizeValues","base","options","readerName","values","normalizeInputType","normalizeEmit","String","replace","toLowerCase","undefined","includes","TypeError","JSON","stringify","inspectWithValues","input","expectedType","bytes","asUint8Array","metadata","inspectBytes","sourceFormat","payloadType","mediaTypes","byteLength","probeSupportWithValues","canEmitPcm","canEmitWavPcm","mimeType","getAudioMimeType","format","supported","confidence","preferredOutput","reason","variants","kind","codec","audioFormat","sampleFormat","warnings","errors","error","message","readWithValues","readWavPcm","Error","code","isWAV","inspectWAV","isMP3","inspectMP3","readFourCc","offset","info","sampleRate","channels","bitsPerSample","byteRate","blockAlign","dataOffset","dataBytes","containerFormatTag","validBitsPerSample","channelMask","channelLayout","durationSeconds","id","size","readU32LE","readU16LE","formatTag","subFormatTag","channelLayoutFromMask","wavSampleFormat","frameCount","Math","floor","hasId3","canReadWavSampleWidth","end","data","decodeWavSamples","interleaving","bytesPerSample","Number","isInteger","sampleCount","view","DataView","buffer","byteOffset","Uint8Array","from","subarray","Int16Array","i","getInt16","Int32Array","value","getUint8","getInt32","Float32Array","getFloat32","Float64Array","getFloat64","mask","names","layout","filter","bit","map","name","length"],"mappings":";;AAEO,MAAMA,YAAY,GAAG;AACrB,MAAMC,UAAU,GAAG;AACnB,MAAMC,UAAU,GAAG;AACnB,MAAMC,WAAW,GAAG;MAEdC,cAAc,GAAGC,MAAM,CAACC,MAAM,CAAC;AACxCC,EAAAA,IAAI,EAAEL,UAAU;AAChBM,EAAAA,SAAS,EAAE,EAAE;AACbC,EAAAA,MAAM,EAAE;AACZ,CAAC;AAED,MAAMC,aAAa,GAAGL,MAAM,CAACC,MAAM,CAAC;AAChCK,EAAAA,GAAG,EAAE,SAAS;AACdC,EAAAA,GAAG,EAAE;AACT,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACO,SAASC,eAAeA,CAACC,IAAI,GAAGV,cAAc,EAAEW,OAAO,GAAG,EAAE,EAAEC,UAAU,GAAG,gBAAgB,EAClG;AACI,EAAA,MAAMC,MAAM,GAAG;AAAE,IAAA,GAAGb,cAAc;AAAE,IAAA,IAAIU,IAAI,IAAI,EAAE,CAAC;IAAE,IAAIC,OAAO,IAAI,EAAE;GAAG;EACzEE,MAAM,CAACT,SAAS,GAAGU,kBAAkB,CAACD,MAAM,CAACT,SAAS,CAAC;AACvDS,EAAAA,M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,CAAE,EAC/F,CAAE,KAAK,EAAE,WAAW,CAAE,EAAE,CAAE,KAAK,EAAE,YAAY,CAAE,EAAE,CAAE,KAAK,EAAE,YAAY,CAAE,EACxE,CAAE,MAAM,EAAE,gBAAgB,CAAE,EAAE,CAAE,MAAM,EAAE,kBAAkB,CAAE,EAAE,CAAE,MAAM,EAAE,iBAAiB,CAAE,EAC3F,CAAE,MAAM,EAAE,eAAe,CAAE,EAAE,CAAE,OAAO,EAAE,iBAAiB,CAAE,EAAE,CAAE,OAAO,EAAE,gBAAgB,CAAE,CAC7F;EACD,MAAMC,MAAM,GAAGD,KAAK,CAACE,MAAM,CAAC,CAAC,CAAEC,GAAG,CAAE,KAAKJ,IAAI,GAAGI,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC,GAAIC,IAAI,CAAE,KAAKA,IAAI,CAAC;AAC9E,EAAA,OAAOJ,MAAM,CAACK,MAAM,KAAKzD,QAAQ,GAAGoD,MAAM,GAAGA,MAAM,CAACK,MAAM,GAAGL,MAAM,GAAG,aAAa;AACvF;;;;"}
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../../../../src/resource/formats/wav/core/helpers.js"],"sourcesContent":["import { toJsonWithByteSummary as toJsonValue } from \"../../../format/jsonPolicies.js\";\nimport { asUint8Array, readFourCc, readU16LE, readU32LE } from \"#utils/bytes\";\nexport const OUTPUT_AUDIO = \"audio\";\nexport const OUTPUT_PCM = \"pcm\";\nexport const OUTPUT_RAW = \"raw\";\nexport const OUTPUT_JSON = \"json\";\n\nexport const DEFAULT_VALUES = Object.freeze({\n emit: OUTPUT_RAW,\n inputType: \"\",\n source: \"\"\n});\n\nconst DEBUG_OUTPUTS = Object.freeze({\n wav: \"wavJson\",\n mp3: \"mp3Json\"\n});\n\n/**\n * Normalizes reader options against their supported defaults for the WAV format\n * reader.\n */\nexport function normalizeValues(base = DEFAULT_VALUES, options = {}, readerName = \"CjsAudioFormat\")\n{\n const values = { ...DEFAULT_VALUES, ...(base || {}), ...(options || {}) };\n values.inputType = normalizeInputType(values.inputType);\n values.emit = normalizeEmit(values.emit, values.inputType, readerName);\n return values;\n}\n\n/** Normalizes the requested input representation for the WAV format reader. */\nexport function normalizeInputType(inputType)\n{\n return inputType ? String(inputType).replace(/^\\./u, \"\").toLowerCase() : \"\";\n}\n\n/** Normalizes the requested output representation for the WAV format reader. */\nexport function normalizeEmit(emit, inputType, readerName)\n{\n if (emit === undefined || emit === null) return OUTPUT_RAW;\n if ([ OUTPUT_AUDIO, OUTPUT_PCM, OUTPUT_RAW].includes(emit)) return emit;\n if (Object.values(DEBUG_OUTPUTS).includes(emit)) return emit;\n throw new TypeError(`${readerName}: unknown emit value ${JSON.stringify(emit)}`);\n}\n\n/** Returns a byte view over the supplied binary input for the WAV format reader. */\n/** Inspects input using normalized format options for the WAV format reader. */\nexport function inspectWithValues(input, values = DEFAULT_VALUES, expectedType = \"\")\n{\n const bytes = asUint8Array(input, \"Audio input\");\n const metadata = inspectBytes(bytes);\n if (expectedType && metadata.sourceFormat && metadata.sourceFormat !== expectedType)\n {\n throw new TypeError(`CjsAudioFormat: expected ${expectedType}, got ${metadata.sourceFormat}`);\n }\n return {\n payloadType: \"audio\",\n mediaTypes: [ \"audio\" ],\n byteLength: bytes.byteLength,\n sourceFormat: expectedType || values.inputType || metadata.sourceFormat,\n ...metadata\n };\n}\n\n/**\n * Reports whether input is supported under normalized format options for the WAV\n * format reader.\n */\nexport function probeSupportWithValues(input, values = DEFAULT_VALUES, expectedType = \"\")\n{\n try\n {\n const metadata = inspectWithValues(input, values, expectedType);\n const canEmitPcm = metadata.sourceFormat === \"wav\" && canEmitWavPcm(metadata);\n const mimeType = getAudioMimeType(metadata);\n return {\n format: metadata.sourceFormat,\n source: values.source || \"buffer\",\n supported: metadata.sourceFormat ? (canEmitPcm ? \"full\" : \"partial\") : \"none\",\n confidence: metadata.sourceFormat ? 1 : 0,\n preferredOutput: canEmitPcm ? \"pcm\" : \"raw\",\n reason: metadata.sourceFormat ? \"Container/header recognized.\" : \"Unrecognized audio format.\",\n metadata,\n variants: [\n {\n kind: \"raw\",\n payloadType: \"raw\",\n codec: metadata.audioFormat || metadata.sourceFormat,\n mimeType,\n supported: true,\n },\n {\n kind: \"pcm\",\n codec: metadata.sampleFormat || \"pcm\",\n supported: canEmitPcm,\n payloadType: canEmitPcm ? \"pcm\" : \"pcm\",\n reason: canEmitPcm ? \"\" : \"Only WAV PCM/IEEE-float data chunks can be emitted as PCM.\"\n }\n ],\n warnings: [],\n errors: []\n };\n }\n catch (error)\n {\n return {\n format: expectedType || values.inputType || \"\",\n source: values.source || \"buffer\",\n supported: \"none\",\n confidence: 0,\n preferredOutput: \"\",\n reason: error.message,\n metadata: null,\n variants: [],\n warnings: [],\n errors: [ error.message ]\n };\n }\n}\n\n/** Reads input using normalized format options for the WAV format reader. */\nexport function readWithValues(input, values = DEFAULT_VALUES, expectedType = \"\")\n{\n const bytes = asUint8Array(input, \"Audio input\");\n const metadata = inspectWithValues(bytes, values, expectedType);\n if (values.emit === OUTPUT_RAW)\n {\n return {\n payloadType: \"raw\",\n sourceFormat: metadata.sourceFormat,\n mimeType: getAudioMimeType(metadata),\n metadata,\n bytes\n };\n }\n if (values.emit === DEBUG_OUTPUTS[metadata.sourceFormat]) return metadata;\n if ((values.emit === OUTPUT_PCM || values.emit === OUTPUT_AUDIO) && metadata.sourceFormat === \"wav\")\n {\n return readWavPcm(bytes, metadata, values.emit);\n }\n\n const error = new Error(`${metadata.sourceFormat}: emit \"${values.emit}\" is not implemented yet`);\n error.code = \"CJS_FORMAT_OUTPUT_NOT_IMPLEMENTED\";\n error.sourceFormat = metadata.sourceFormat;\n error.emit = values.emit;\n throw error;\n}\n\nfunction getAudioMimeType(metadata)\n{\n if (metadata.sourceFormat === \"mp3\") return \"audio/mpeg\";\n return \"audio/wav\";\n}\n\n/** Converts a parsed payload into a JSON-safe value for the WAV format reader. */\n/** The shared JSON policy for this reader, under the name its callers use. */\nexport { toJsonValue };\n\n/**\n * Inspects the supplied bytes without decoding their payload for the WAV format\n * reader.\n */\nexport function inspectBytes(bytes)\n{\n if (isWAV(bytes)) return inspectWAV(bytes);\n if (isMP3(bytes)) return inspectMP3(bytes);\n return { sourceFormat: \"\", audioFormat: \"\" };\n}\n\n/**\n * Reports whether the supplied bytes have a RIFF/WAVE header for the WAV format\n * reader.\n */\nexport function isWAV(bytes)\n{\n return bytes.byteLength >= 12 && readFourCc(bytes, 0) === \"RIFF\" && readFourCc(bytes, 8) === \"WAVE\";\n}\n\n/**\n * Reports whether the supplied bytes have a supported MP3 header for the WAV\n * format reader.\n */\nexport function isMP3(bytes)\n{\n return bytes.byteLength >= 3 &&\n (readFourCc(bytes, 0, 3) === \"ID3\" || (bytes[0] === 0xff && (bytes[1] & 0xe0) === 0xe0));\n}\n\nfunction inspectWAV(bytes)\n{\n let offset = 12;\n const info = {\n sourceFormat: \"wav\",\n audioFormat: \"wav\",\n sampleRate: 0,\n channels: 0,\n bitsPerSample: 0,\n byteRate: 0,\n blockAlign: 0,\n dataOffset: 0,\n dataBytes: 0,\n containerFormatTag: 0,\n validBitsPerSample: 0,\n channelMask: 0,\n channelLayout: \"unspecified\",\n durationSeconds: 0\n };\n while (offset + 8 <= bytes.byteLength)\n {\n const id = readFourCc(bytes, offset), size = readU32LE(bytes, offset + 4), dataOffset = offset + 8;\n if (id === \"fmt \" && dataOffset + 16 <= bytes.byteLength)\n {\n const containerFormatTag = readU16LE(bytes, dataOffset);\n info.containerFormatTag = containerFormatTag;\n info.formatTag = containerFormatTag;\n info.channels = readU16LE(bytes, dataOffset + 2);\n info.sampleRate = readU32LE(bytes, dataOffset + 4);\n info.byteRate = readU32LE(bytes, dataOffset + 8);\n info.blockAlign = readU16LE(bytes, dataOffset + 12);\n info.bitsPerSample = readU16LE(bytes, dataOffset + 14);\n info.validBitsPerSample = info.bitsPerSample;\n if (containerFormatTag === 0xfffe && size >= 40 && dataOffset + 40 <= bytes.byteLength)\n {\n info.validBitsPerSample = readU16LE(bytes, dataOffset + 18) || info.bitsPerSample;\n info.channelMask = readU32LE(bytes, dataOffset + 20);\n info.subFormatTag = readU16LE(bytes, dataOffset + 24);\n info.formatTag = info.subFormatTag;\n info.channelLayout = channelLayoutFromMask(info.channelMask, info.channels);\n }\n info.sampleFormat = wavSampleFormat(info.formatTag, info.bitsPerSample);\n }\n if (id === \"data\")\n {\n info.dataOffset = dataOffset;\n info.dataBytes = size;\n }\n offset = dataOffset + size + (size & 1);\n }\n info.frameCount = info.blockAlign ? Math.floor(info.dataBytes / info.blockAlign) : 0;\n info.durationSeconds = info.sampleRate ? info.frameCount / info.sampleRate : 0;\n return info;\n}\n\nfunction inspectMP3(bytes)\n{\n return {\n sourceFormat: \"mp3\",\n audioFormat: \"mp3\",\n hasId3: readFourCc(bytes, 0, 3) === \"ID3\"\n };\n}\n\n\nfunction canEmitWavPcm(metadata)\n{\n return metadata.dataOffset > 0 &&\n [ 1, 3 ].includes(metadata.formatTag) &&\n metadata.channels > 0 &&\n metadata.sampleRate > 0 &&\n canReadWavSampleWidth(metadata);\n}\n\nfunction readWavPcm(bytes, metadata, emit)\n{\n if (!canEmitWavPcm(metadata))\n {\n const error = new Error(\"wav: only PCM and IEEE-float WAV data chunks can be emitted as PCM\");\n error.code = \"CJS_FORMAT_OUTPUT_NOT_SUPPORTED\";\n error.sourceFormat = metadata.sourceFormat;\n throw error;\n }\n\n const end = metadata.dataOffset + metadata.dataBytes;\n if (end > bytes.byteLength)\n {\n const error = new Error(\"wav: data chunk is truncated\");\n error.code = \"CJS_FORMAT_TRUNCATED\";\n error.sourceFormat = metadata.sourceFormat;\n throw error;\n }\n\n const data = decodeWavSamples(bytes, metadata, end);\n\n return {\n payloadType: emit === OUTPUT_AUDIO ? OUTPUT_AUDIO : OUTPUT_PCM,\n sourceFormat: \"wav\",\n audioFormat: metadata.sampleFormat,\n sampleFormat: metadata.sampleFormat,\n sampleRate: metadata.sampleRate,\n channels: metadata.channels,\n interleaving: \"interleaved\",\n channelLayout: metadata.channelLayout || \"unspecified\",\n bitsPerSample: metadata.bitsPerSample,\n blockAlign: metadata.blockAlign,\n frameCount: metadata.frameCount,\n durationSeconds: metadata.sampleRate ? metadata.frameCount / metadata.sampleRate : 0,\n metadata,\n data\n };\n}\n\nfunction decodeWavSamples(bytes, metadata, end)\n{\n const bytesPerSample = metadata.bitsPerSample / 8;\n if (!Number.isInteger(bytesPerSample) || bytesPerSample <= 0 || metadata.dataBytes % bytesPerSample !== 0)\n {\n const error = new Error(`wav: unsupported sample width ${metadata.bitsPerSample}`);\n error.code = \"CJS_FORMAT_OUTPUT_NOT_SUPPORTED\";\n error.sourceFormat = metadata.sourceFormat;\n throw error;\n }\n\n const sampleCount = metadata.dataBytes / bytesPerSample;\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n if (metadata.formatTag === 1)\n {\n if (metadata.bitsPerSample === 8) return Uint8Array.from(bytes.subarray(metadata.dataOffset, end));\n if (metadata.bitsPerSample === 16)\n {\n const data = new Int16Array(sampleCount);\n for (let i = 0; i < sampleCount; i++) data[i] = view.getInt16(metadata.dataOffset + i * 2, true);\n return data;\n }\n if (metadata.bitsPerSample === 24)\n {\n const data = new Int32Array(sampleCount);\n for (let i = 0; i < sampleCount; i++)\n {\n const offset = metadata.dataOffset + i * 3;\n let value = view.getUint8(offset) | (view.getUint8(offset + 1) << 8) | (view.getUint8(offset + 2) << 16);\n if (value & 0x800000) value |= 0xff000000;\n data[i] = value;\n }\n return data;\n }\n if (metadata.bitsPerSample === 32)\n {\n const data = new Int32Array(sampleCount);\n for (let i = 0; i < sampleCount; i++) data[i] = view.getInt32(metadata.dataOffset + i * 4, true);\n return data;\n }\n }\n if (metadata.formatTag === 3 && metadata.bitsPerSample === 32)\n {\n const data = new Float32Array(sampleCount);\n for (let i = 0; i < sampleCount; i++) data[i] = view.getFloat32(metadata.dataOffset + i * 4, true);\n return data;\n }\n if (metadata.formatTag === 3 && metadata.bitsPerSample === 64)\n {\n const data = new Float64Array(sampleCount);\n for (let i = 0; i < sampleCount; i++) data[i] = view.getFloat64(metadata.dataOffset + i * 8, true);\n return data;\n }\n\n const error = new Error(`wav: unsupported ${metadata.sampleFormat} sample data`);\n error.code = \"CJS_FORMAT_OUTPUT_NOT_SUPPORTED\";\n error.sourceFormat = metadata.sourceFormat;\n throw error;\n}\n\nfunction canReadWavSampleWidth(metadata)\n{\n if (metadata.formatTag === 1) return [ 8, 16, 24, 32 ].includes(metadata.bitsPerSample);\n if (metadata.formatTag === 3) return [ 32, 64 ].includes(metadata.bitsPerSample);\n return false;\n}\n\nfunction wavSampleFormat(formatTag, bitsPerSample)\n{\n if (formatTag === 3) return `float${bitsPerSample}`;\n if (formatTag === 1) return `pcm${bitsPerSample}`;\n return `wav-format-${formatTag}`;\n}\n\nfunction channelLayoutFromMask(mask, channels)\n{\n const names = [\n [ 0x001, \"front-left\" ], [ 0x002, \"front-right\" ], [ 0x004, \"front-center\" ],\n [ 0x008, \"low-frequency\" ], [ 0x010, \"back-left\" ], [ 0x020, \"back-right\" ],\n [ 0x040, \"front-left-of-center\" ], [ 0x080, \"front-right-of-center\" ], [ 0x100, \"back-center\" ],\n [ 0x200, \"side-left\" ], [ 0x400, \"side-right\" ], [ 0x800, \"top-center\" ],\n [ 0x1000, \"top-front-left\" ], [ 0x2000, \"top-front-center\" ], [ 0x4000, \"top-front-right\" ],\n [ 0x8000, \"top-back-left\" ], [ 0x10000, \"top-back-center\" ], [ 0x20000, \"top-back-right\" ]\n ];\n const layout = names.filter(([ bit ]) => mask & bit).map(([ , name ]) => name);\n return layout.length === channels ? layout : layout.length ? layout : \"unspecified\";\n}\n\n"],"names":["OUTPUT_AUDIO","OUTPUT_PCM","OUTPUT_RAW","DEFAULT_VALUES","Object","freeze","emit","inputType","source","DEBUG_OUTPUTS","wav","mp3","normalizeValues","base","options","readerName","values","normalizeInputType","normalizeEmit","String","replace","toLowerCase","undefined","includes","TypeError","JSON","stringify","inspectWithValues","input","expectedType","bytes","asUint8Array","metadata","inspectBytes","sourceFormat","payloadType","mediaTypes","byteLength","probeSupportWithValues","canEmitPcm","canEmitWavPcm","mimeType","getAudioMimeType","format","supported","confidence","preferredOutput","reason","variants","kind","codec","audioFormat","sampleFormat","warnings","errors","error","message","readWithValues","readWavPcm","Error","code","isWAV","inspectWAV","isMP3","inspectMP3","readFourCc","offset","info","sampleRate","channels","bitsPerSample","byteRate","blockAlign","dataOffset","dataBytes","containerFormatTag","validBitsPerSample","channelMask","channelLayout","durationSeconds","id","size","readU32LE","readU16LE","formatTag","subFormatTag","channelLayoutFromMask","wavSampleFormat","frameCount","Math","floor","hasId3","canReadWavSampleWidth","end","data","decodeWavSamples","interleaving","bytesPerSample","Number","isInteger","sampleCount","view","DataView","buffer","byteOffset","Uint8Array","from","subarray","Int16Array","i","getInt16","Int32Array","value","getUint8","getInt32","Float32Array","getFloat32","Float64Array","getFloat64","mask","names","layout","filter","bit","map","name","length"],"mappings":";;AAEO,MAAMA,YAAY,GAAG;AACrB,MAAMC,UAAU,GAAG;AACnB,MAAMC,UAAU,GAAG;MAGbC,cAAc,GAAGC,MAAM,CAACC,MAAM,CAAC;AACxCC,EAAAA,IAAI,EAAEJ,UAAU;AAChBK,EAAAA,SAAS,EAAE,EAAE;AACbC,EAAAA,MAAM,EAAE;AACZ,CAAC;AAED,MAAMC,aAAa,GAAGL,MAAM,CAACC,MAAM,CAAC;AAChCK,EAAAA,GAAG,EAAE,SAAS;AACdC,EAAAA,GAAG,EAAE;AACT,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACO,SAASC,eAAeA,CAACC,IAAI,GAAGV,cAAc,EAAEW,OAAO,GAAG,EAAE,EAAEC,UAAU,GAAG,gBAAgB,EAClG;AACI,EAAA,MAAMC,MAAM,GAAG;AAAE,IAAA,GAAGb,cAAc;AAAE,IAAA,IAAIU,IAAI,IAAI,EAAE,CAAC;IAAE,IAAIC,OAAO,IAAI,EAAE;GAAG;EACzEE,MAAM,CAACT,SAAS,GAAGU,kBAAkB,CAACD,M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EACxE,CAAE,MAAM,EAAE,gBAAgB,CAAE,EAAE,CAAE,MAAM,EAAE,kBAAkB,CAAE,EAAE,CAAE,MAAM,EAAE,iBAAiB,CAAE,EAC3F,CAAE,MAAM,EAAE,eAAe,CAAE,EAAE,CAAE,OAAO,EAAE,iBAAiB,CAAE,EAAE,CAAE,OAAO,EAAE,gBAAgB,CAAE,CAC7F;EACD,MAAMC,MAAM,GAAGD,KAAK,CAACE,MAAM,CAAC,CAAC,CAAEC,GAAG,CAAE,KAAKJ,IAAI,GAAGI,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC,GAAIC,IAAI,CAAE,KAAKA,IAAI,CAAC;AAC9E,EAAA,OAAOJ,MAAM,CAACK,MAAM,KAAKzD,QAAQ,GAAGoD,MAAM,GAAGA,MAAM,CAACK,MAAM,GAAGL,MAAM,GAAG,aAAa;AACvF;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CjsFormat } from '../../format/CjsFormat.js';
|
|
2
|
-
import { DEFAULT_VALUES, normalizeValues, emitGlslWithOptions, isWebglEffectContainer
|
|
2
|
+
import { DEFAULT_VALUES, normalizeValues, emitGlslWithOptions, isWebglEffectContainer } from './core/helpers.js';
|
|
3
3
|
import { buildEffectPackage } from './core/effectPackage.js';
|
|
4
4
|
import { readGlslEffectContainer } from './core/readGlslEffectContainer.js';
|
|
5
5
|
import { inspectGlslEffectContainer } from './core/inspectGlslEffectContainer.js';
|
|
@@ -7,191 +7,189 @@ import { toJsonWithCollections } from '../../format/jsonPolicies.js';
|
|
|
7
7
|
|
|
8
8
|
const FORMAT_NAME = "CjsWebglFormat";
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* CarbonEngineJS-facing format surface for `.carbonwebgl` WebGL shader packages, and
|
|
12
|
-
* a DXBC -> GLSL ES 3.00 emitter for the WebGL2 vertex/pixel/map-style-compute
|
|
13
|
-
* stages ccpwgl targets.
|
|
14
|
-
*
|
|
15
|
-
* The Cjs prefix marks this as a JavaScript format/construction boundary. A
|
|
16
|
-
* WebGL effect is a stock Carbon effect container whose stored programs are
|
|
17
|
-
* GLSL ES 3.00 - the same file shape Carbon ships for its own backends, and the
|
|
18
|
-
* same one WebGPU emits with WGSL. `Read` decodes one into stage and shader
|
|
19
|
-
* records; `Inspect` is a cheap structural summary; `BuildEffect` translates a
|
|
20
|
-
* compiled Tr2 effect into one; `EmitGlsl` translates a single DXBC stage.
|
|
10
|
+
/**
|
|
11
|
+
* CarbonEngineJS-facing format surface for `.carbonwebgl` WebGL shader packages, and
|
|
12
|
+
* a DXBC -> GLSL ES 3.00 emitter for the WebGL2 vertex/pixel/map-style-compute
|
|
13
|
+
* stages ccpwgl targets.
|
|
14
|
+
*
|
|
15
|
+
* The Cjs prefix marks this as a JavaScript format/construction boundary. A
|
|
16
|
+
* WebGL effect is a stock Carbon effect container whose stored programs are
|
|
17
|
+
* GLSL ES 3.00 - the same file shape Carbon ships for its own backends, and the
|
|
18
|
+
* same one WebGPU emits with WGSL. `Read` decodes one into stage and shader
|
|
19
|
+
* records; `Inspect` is a cheap structural summary; `BuildEffect` translates a
|
|
20
|
+
* compiled Tr2 effect into one; `EmitGlsl` translates a single DXBC stage.
|
|
21
21
|
*/
|
|
22
22
|
class CjsWebglFormat extends CjsFormat {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
_emit = DEFAULT_VALUES.emit;
|
|
24
|
+
_source = DEFAULT_VALUES.source;
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* Create a reusable format profile.
|
|
28
|
-
*
|
|
29
|
-
* @param {object} [options] Default format values.
|
|
26
|
+
/**
|
|
27
|
+
* Create a reusable format profile.
|
|
28
|
+
*
|
|
29
|
+
* @param {object} [options] Default format values.
|
|
30
30
|
*/
|
|
31
31
|
constructor(options = {}) {
|
|
32
32
|
super();
|
|
33
33
|
this.SetValues(options);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
* Set format values for this reusable profile.
|
|
38
|
-
*
|
|
39
|
-
* @param {object} [options] Values to merge into the profile.
|
|
40
|
-
* @returns {CjsWebglFormat} This format profile.
|
|
36
|
+
/**
|
|
37
|
+
* Set format values for this reusable profile.
|
|
38
|
+
*
|
|
39
|
+
* @param {object} [options] Values to merge into the profile.
|
|
40
|
+
* @returns {CjsWebglFormat} This format profile.
|
|
41
41
|
*/
|
|
42
42
|
SetValues(options = {}) {
|
|
43
43
|
const values = normalizeValues(this.GetValues(), options, FORMAT_NAME);
|
|
44
|
-
this
|
|
45
|
-
this
|
|
44
|
+
this._emit = values.emit;
|
|
45
|
+
this._source = values.source;
|
|
46
46
|
return this;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* Get this profile's current values, optionally with per-call overrides.
|
|
51
|
-
*
|
|
52
|
-
* @param {object} [options] Optional values to merge into a copy.
|
|
53
|
-
* @returns {object} A copy of the effective values.
|
|
49
|
+
/**
|
|
50
|
+
* Get this profile's current values, optionally with per-call overrides.
|
|
51
|
+
*
|
|
52
|
+
* @param {object} [options] Optional values to merge into a copy.
|
|
53
|
+
* @returns {object} A copy of the effective values.
|
|
54
54
|
*/
|
|
55
55
|
GetValues(options = {}) {
|
|
56
56
|
return normalizeValues({
|
|
57
|
-
emit: this
|
|
58
|
-
source: this
|
|
57
|
+
emit: this._emit,
|
|
58
|
+
source: this._source
|
|
59
59
|
}, options, FORMAT_NAME);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
/**
|
|
63
|
-
* Decode an effect container into stage and shader records.
|
|
64
|
-
*
|
|
65
|
-
* @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.
|
|
66
|
-
* @param {object} [options] Per-call value overrides.
|
|
67
|
-
* @returns {object} Stage graph in the completeness rules' vocabulary.
|
|
62
|
+
/**
|
|
63
|
+
* Decode an effect container into stage and shader records.
|
|
64
|
+
*
|
|
65
|
+
* @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.
|
|
66
|
+
* @param {object} [options] Per-call value overrides.
|
|
67
|
+
* @returns {object} Stage graph in the completeness rules' vocabulary.
|
|
68
68
|
*/
|
|
69
69
|
Read(input, options = {}) {
|
|
70
70
|
return readGlslEffectContainer(input, this.GetValues(options));
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
/**
|
|
74
|
-
* Summarise an effect container without decoding every body's records.
|
|
75
|
-
*
|
|
76
|
-
* @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.
|
|
77
|
-
* @param {object} [options] Per-call value overrides.
|
|
78
|
-
* @returns {object} Plain summary data.
|
|
73
|
+
/**
|
|
74
|
+
* Summarise an effect container without decoding every body's records.
|
|
75
|
+
*
|
|
76
|
+
* @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.
|
|
77
|
+
* @param {object} [options] Per-call value overrides.
|
|
78
|
+
* @returns {object} Plain summary data.
|
|
79
79
|
*/
|
|
80
80
|
Inspect(input, options = {}) {
|
|
81
81
|
return inspectGlslEffectContainer(input, this.GetValues(options));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
/**
|
|
85
|
-
* Translates one DXBC vertex/pixel/map-style-compute stage into GLSL ES 3.00.
|
|
86
|
-
*
|
|
87
|
-
* @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.
|
|
88
|
-
* @param {object} [options] Combined ccpwgl-profile/emit options. See {@link CjsWebglFormat.emitGlsl}.
|
|
89
|
-
* @returns {object} GLSL text plus the IO contract the packaging layer records.
|
|
84
|
+
/**
|
|
85
|
+
* Translates one DXBC vertex/pixel/map-style-compute stage into GLSL ES 3.00.
|
|
86
|
+
*
|
|
87
|
+
* @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.
|
|
88
|
+
* @param {object} [options] Combined ccpwgl-profile/emit options. See {@link CjsWebglFormat.emitGlsl}.
|
|
89
|
+
* @returns {object} GLSL text plus the IO contract the packaging layer records.
|
|
90
90
|
*/
|
|
91
91
|
EmitGlsl(dxbcBytes, options = {}) {
|
|
92
92
|
return emitGlslWithOptions(dxbcBytes, options);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
/**
|
|
96
|
-
* Builds a complete effect container from compiled Tr2 effect bytes.
|
|
97
|
-
*
|
|
98
|
-
* @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.
|
|
99
|
-
* @param {object} [options] Selection, provenance, and emitter policy.
|
|
100
|
-
* @returns {object} Package bytes plus inspection and qualification records.
|
|
95
|
+
/**
|
|
96
|
+
* Builds a complete effect container from compiled Tr2 effect bytes.
|
|
97
|
+
*
|
|
98
|
+
* @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.
|
|
99
|
+
* @param {object} [options] Selection, provenance, and emitter policy.
|
|
100
|
+
* @returns {object} Package bytes plus inspection and qualification records.
|
|
101
101
|
*/
|
|
102
102
|
BuildEffect(input, options = {}) {
|
|
103
103
|
return buildEffectPackage(input, options);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
/**
|
|
107
|
-
* Instance JSON-compatible conversion.
|
|
108
|
-
*
|
|
109
|
-
* @param {any} value Format output to convert.
|
|
110
|
-
* @returns {any} Plain JSON-compatible data.
|
|
106
|
+
/**
|
|
107
|
+
* Instance JSON-compatible conversion.
|
|
108
|
+
*
|
|
109
|
+
* @param {any} value Format output to convert.
|
|
110
|
+
* @returns {any} Plain JSON-compatible data.
|
|
111
111
|
*/
|
|
112
112
|
ToJSON(value) {
|
|
113
113
|
return toJsonWithCollections(value);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
/**
|
|
117
|
-
* Static payload sniff. Static methods use camelCase by convention.
|
|
118
|
-
*
|
|
119
|
-
* @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.
|
|
120
|
-
* @returns {boolean} True when the payload has the container shape.
|
|
116
|
+
/**
|
|
117
|
+
* Static payload sniff. Static methods use camelCase by convention.
|
|
118
|
+
*
|
|
119
|
+
* @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.
|
|
120
|
+
* @returns {boolean} True when the payload has the container shape.
|
|
121
121
|
*/
|
|
122
122
|
static isWebglEffectContainer(input) {
|
|
123
123
|
return isWebglEffectContainer(input);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
/**
|
|
127
|
-
* Static one-shot container decode.
|
|
128
|
-
*
|
|
129
|
-
* @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.
|
|
130
|
-
* @param {object} [options] Format values.
|
|
131
|
-
* @returns {object} Stage graph in the completeness rules' vocabulary.
|
|
126
|
+
/**
|
|
127
|
+
* Static one-shot container decode.
|
|
128
|
+
*
|
|
129
|
+
* @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.
|
|
130
|
+
* @param {object} [options] Format values.
|
|
131
|
+
* @returns {object} Stage graph in the completeness rules' vocabulary.
|
|
132
132
|
*/
|
|
133
133
|
static read(input, options = {}) {
|
|
134
134
|
return readGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
/**
|
|
138
|
-
* Static one-shot inspection.
|
|
139
|
-
*
|
|
140
|
-
* @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.
|
|
141
|
-
* @param {object} [options] Format values.
|
|
142
|
-
* @returns {object} Plain summary data.
|
|
137
|
+
/**
|
|
138
|
+
* Static one-shot inspection.
|
|
139
|
+
*
|
|
140
|
+
* @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.
|
|
141
|
+
* @param {object} [options] Format values.
|
|
142
|
+
* @returns {object} Plain summary data.
|
|
143
143
|
*/
|
|
144
144
|
static inspect(input, options = {}) {
|
|
145
145
|
return inspectGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
/**
|
|
149
|
-
* Static one-shot DXBC-to-GLSL emission.
|
|
150
|
-
*
|
|
151
|
-
* @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.
|
|
152
|
-
* @param {object} [options] Combined ccpwgl-profile/emit options: `constantBufferStyle`
|
|
153
|
-
* (`"array"` (default) uniform `vec4[]` for ccpwgl's uniform4fv path, or `"std140"`),
|
|
154
|
-
* `pixelConstantBufferRemap` (default `{ 0: 7 }`, pixel-stage cb slot renames),
|
|
155
|
-
* `samplerName(register, stageName)` (naming function), `vertexStructuredCapacity`
|
|
156
|
-
* (default 69, bone-array element capacity), `dataTextureWidth` (default 2048),
|
|
157
|
-
* `pairVaryings` (per-call varying zero-fill list), `source` (per-call error-detail name).
|
|
158
|
-
* @returns {object} GLSL text plus the IO contract the packaging layer records.
|
|
148
|
+
/**
|
|
149
|
+
* Static one-shot DXBC-to-GLSL emission.
|
|
150
|
+
*
|
|
151
|
+
* @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.
|
|
152
|
+
* @param {object} [options] Combined ccpwgl-profile/emit options: `constantBufferStyle`
|
|
153
|
+
* (`"array"` (default) uniform `vec4[]` for ccpwgl's uniform4fv path, or `"std140"`),
|
|
154
|
+
* `pixelConstantBufferRemap` (default `{ 0: 7 }`, pixel-stage cb slot renames),
|
|
155
|
+
* `samplerName(register, stageName)` (naming function), `vertexStructuredCapacity`
|
|
156
|
+
* (default 69, bone-array element capacity), `dataTextureWidth` (default 2048),
|
|
157
|
+
* `pairVaryings` (per-call varying zero-fill list), `source` (per-call error-detail name).
|
|
158
|
+
* @returns {object} GLSL text plus the IO contract the packaging layer records.
|
|
159
159
|
*/
|
|
160
160
|
static emitGlsl(dxbcBytes, options = {}) {
|
|
161
161
|
return emitGlslWithOptions(dxbcBytes, options);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
/**
|
|
165
|
-
* Static whole-effect container builder.
|
|
166
|
-
*
|
|
167
|
-
* @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.
|
|
168
|
-
* @param {object} [options] Selection, provenance, and emitter policy.
|
|
169
|
-
* @returns {object} Package bytes plus inspection and qualification records.
|
|
164
|
+
/**
|
|
165
|
+
* Static whole-effect container builder.
|
|
166
|
+
*
|
|
167
|
+
* @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.
|
|
168
|
+
* @param {object} [options] Selection, provenance, and emitter policy.
|
|
169
|
+
* @returns {object} Package bytes plus inspection and qualification records.
|
|
170
170
|
*/
|
|
171
171
|
static buildEffect(input, options = {}) {
|
|
172
172
|
return buildEffectPackage(input, options);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
/**
|
|
176
|
-
* Static JSON-compatible conversion.
|
|
177
|
-
*
|
|
178
|
-
* @param {any} value Format output to convert.
|
|
179
|
-
* @returns {any} Plain JSON-compatible data.
|
|
175
|
+
/**
|
|
176
|
+
* Static JSON-compatible conversion.
|
|
177
|
+
*
|
|
178
|
+
* @param {any} value Format output to convert.
|
|
179
|
+
* @returns {any} Plain JSON-compatible data.
|
|
180
180
|
*/
|
|
181
181
|
static toJSON(value) {
|
|
182
182
|
return toJsonWithCollections(value);
|
|
183
183
|
}
|
|
184
|
-
static
|
|
185
|
-
static
|
|
186
|
-
static mediaTypes = Object.freeze(["shader"]);
|
|
184
|
+
static id = "CjsWebglFormat";
|
|
185
|
+
static mediaTypes = ["shader"];
|
|
187
186
|
static outputs = CjsFormat.defineOutputs({
|
|
188
187
|
json: {
|
|
189
188
|
default: true,
|
|
190
189
|
decoded: true
|
|
191
190
|
}
|
|
192
191
|
});
|
|
193
|
-
static extensions =
|
|
194
|
-
static packageVersion = "0.2.0";
|
|
192
|
+
static extensions = [];
|
|
195
193
|
}
|
|
196
194
|
|
|
197
195
|
export { CjsWebglFormat, CjsWebglFormat as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CjsWebglFormat.js","sources":["../../../../../src/resource/formats/webgl/CjsWebglFormat.js"],"sourcesContent":["import { CjsFormat } from \"../../format/CjsFormat.js\";\r\n/**\r\n * Exposed CarbonEngineJS-facing WebGL format class.\r\n *\r\n * Keep this file small and reviewable: container decoding lives in\r\n * core/readGlslEffectContainer.js, summarising in\r\n * core/inspectGlslEffectContainer.js, the DXBC-to-GLSL ES 3.00 emitter under\r\n * core/glsl, and option normalization in core/helpers.js.\r\n */\r\n\r\nimport {\r\n DEFAULT_VALUES,\r\n OUTPUT_JSON,\r\n emitGlslWithOptions,\r\n isWebglEffectContainer,\r\n normalizeValues,\r\n toJsonValue\r\n} from \"./core/helpers.js\";\r\nimport { buildEffectPackage } from \"./core/effectPackage.js\";\r\nimport { readGlslEffectContainer } from \"./core/readGlslEffectContainer.js\";\r\nimport { inspectGlslEffectContainer } from \"./core/inspectGlslEffectContainer.js\";\r\n\r\nconst FORMAT_NAME = \"CjsWebglFormat\";\r\n\r\n/**\r\n * CarbonEngineJS-facing format surface for `.carbonwebgl` WebGL shader packages, and\r\n * a DXBC -> GLSL ES 3.00 emitter for the WebGL2 vertex/pixel/map-style-compute\r\n * stages ccpwgl targets.\r\n *\r\n * The Cjs prefix marks this as a JavaScript format/construction boundary. A\r\n * WebGL effect is a stock Carbon effect container whose stored programs are\r\n * GLSL ES 3.00 - the same file shape Carbon ships for its own backends, and the\r\n * same one WebGPU emits with WGSL. `Read` decodes one into stage and shader\r\n * records; `Inspect` is a cheap structural summary; `BuildEffect` translates a\r\n * compiled Tr2 effect into one; `EmitGlsl` translates a single DXBC stage.\r\n */\r\nexport class CjsWebglFormat extends CjsFormat\r\n{\r\n\r\n #emit = DEFAULT_VALUES.emit;\r\n #source = DEFAULT_VALUES.source;\r\n\r\n /**\r\n * Create a reusable format profile.\r\n *\r\n * @param {object} [options] Default format values.\r\n */\r\n constructor(options = {})\r\n {\r\n super();\r\n this.SetValues(options);\r\n }\r\n\r\n /**\r\n * Set format values for this reusable profile.\r\n *\r\n * @param {object} [options] Values to merge into the profile.\r\n * @returns {CjsWebglFormat} This format profile.\r\n */\r\n SetValues(options = {})\r\n {\r\n const values = normalizeValues(this.GetValues(), options, FORMAT_NAME);\r\n\r\n this.#emit = values.emit;\r\n this.#source = values.source;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Get this profile's current values, optionally with per-call overrides.\r\n *\r\n * @param {object} [options] Optional values to merge into a copy.\r\n * @returns {object} A copy of the effective values.\r\n */\r\n GetValues(options = {})\r\n {\r\n return normalizeValues({\r\n emit: this.#emit,\r\n source: this.#source\r\n }, options, FORMAT_NAME);\r\n }\r\n\r\n /**\r\n * Decode an effect container into stage and shader records.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Stage graph in the completeness rules' vocabulary.\r\n */\r\n Read(input, options = {})\r\n {\r\n return readGlslEffectContainer(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Summarise an effect container without decoding every body's records.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\r\n * @param {object} [options] Per-call value overrides.\r\n * @returns {object} Plain summary data.\r\n */\r\n Inspect(input, options = {})\r\n {\r\n return inspectGlslEffectContainer(input, this.GetValues(options));\r\n }\r\n\r\n /**\r\n * Translates one DXBC vertex/pixel/map-style-compute stage into GLSL ES 3.00.\r\n *\r\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\r\n * @param {object} [options] Combined ccpwgl-profile/emit options. See {@link CjsWebglFormat.emitGlsl}.\r\n * @returns {object} GLSL text plus the IO contract the packaging layer records.\r\n */\r\n EmitGlsl(dxbcBytes, options = {})\r\n {\r\n return emitGlslWithOptions(dxbcBytes, options);\r\n }\r\n\r\n /**\r\n * Builds a complete effect container from compiled Tr2 effect bytes.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\r\n * @param {object} [options] Selection, provenance, and emitter policy.\r\n * @returns {object} Package bytes plus inspection and qualification records.\r\n */\r\n BuildEffect(input, options = {})\r\n {\r\n return buildEffectPackage(input, options);\r\n }\r\n\r\n /**\r\n * Instance JSON-compatible conversion.\r\n *\r\n * @param {any} value Format output to convert.\r\n * @returns {any} Plain JSON-compatible data.\r\n */\r\n ToJSON(value)\r\n {\r\n return toJsonValue(value);\r\n }\r\n\r\n /**\r\n * Static payload sniff. Static methods use camelCase by convention.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.\r\n * @returns {boolean} True when the payload has the container shape.\r\n */\r\n static isWebglEffectContainer(input)\r\n {\r\n return isWebglEffectContainer(input);\r\n }\r\n\r\n /**\r\n * Static one-shot container decode.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Stage graph in the completeness rules' vocabulary.\r\n */\r\n static read(input, options = {})\r\n {\r\n return readGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static one-shot inspection.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\r\n * @param {object} [options] Format values.\r\n * @returns {object} Plain summary data.\r\n */\r\n static inspect(input, options = {})\r\n {\r\n return inspectGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\r\n }\r\n\r\n /**\r\n * Static one-shot DXBC-to-GLSL emission.\r\n *\r\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\r\n * @param {object} [options] Combined ccpwgl-profile/emit options: `constantBufferStyle`\r\n * (`\"array\"` (default) uniform `vec4[]` for ccpwgl's uniform4fv path, or `\"std140\"`),\r\n * `pixelConstantBufferRemap` (default `{ 0: 7 }`, pixel-stage cb slot renames),\r\n * `samplerName(register, stageName)` (naming function), `vertexStructuredCapacity`\r\n * (default 69, bone-array element capacity), `dataTextureWidth` (default 2048),\r\n * `pairVaryings` (per-call varying zero-fill list), `source` (per-call error-detail name).\r\n * @returns {object} GLSL text plus the IO contract the packaging layer records.\r\n */\r\n static emitGlsl(dxbcBytes, options = {})\r\n {\r\n return emitGlslWithOptions(dxbcBytes, options);\r\n }\r\n\r\n /**\r\n * Static whole-effect container builder.\r\n *\r\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\r\n * @param {object} [options] Selection, provenance, and emitter policy.\r\n * @returns {object} Package bytes plus inspection and qualification records.\r\n */\r\n static buildEffect(input, options = {})\r\n {\r\n return buildEffectPackage(input, options);\r\n }\r\n\r\n /**\r\n * Static JSON-compatible conversion.\r\n *\r\n * @param {any} value Format output to convert.\r\n * @returns {any} Plain JSON-compatible data.\r\n */\r\n static toJSON(value)\r\n {\r\n return toJsonValue(value);\r\n }\r\n\r\n static OUTPUT_JSON = OUTPUT_JSON;\r\n static id = \"webgl\";\r\n static mediaTypes = Object.freeze([ \"shader\" ]);\r\n static outputs = CjsFormat.defineOutputs({\r\n json: { default: true, decoded: true }\r\n });\r\n static extensions = Object.freeze([]);\r\n static packageVersion = \"0.2.0\";\r\n\r\n}\r\n\r\nexport default CjsWebglFormat;\r\n"],"names":["FORMAT_NAME","CjsWebglFormat","CjsFormat","DEFAULT_VALUES","emit","source","constructor","options","SetValues","values","normalizeValues","GetValues","Read","input","readGlslEffectContainer","Inspect","inspectGlslEffectContainer","EmitGlsl","dxbcBytes","emitGlslWithOptions","BuildEffect","buildEffectPackage","ToJSON","value","toJsonValue","isWebglEffectContainer","read","inspect","emitGlsl","buildEffect","toJSON","OUTPUT_JSON","id","mediaTypes","Object","freeze","outputs","defineOutputs","json","default","decoded","extensions","packageVersion"],"mappings":";;;;;;;AAsBA,MAAMA,WAAW,GAAG,gBAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,SAASC,SAAS,CAC7C;AAEI,EAAA,KAAK,GAAGC,cAAc,CAACC,IAAI;AAC3B,EA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G,EAAE,EACtC;AACI,IAAA,OAAOc,kBAAkB,CAACR,KAAK,EAAEN,OAAO,CAAC;AAC7C,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;EACI,OAAOuB,MAAMA,CAACP,KAAK,EACnB;IACI,OAAOC,qBAAW,CAACD,KAAK,CAAC;AAC7B,EAAA;EAEA,OAAOQ,WAAW,GAAGA,WAAW;EAChC,OAAOC,EAAE,GAAG,OAAO;EACnB,OAAOC,UAAU,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAE,QAAQ,CAAE,CAAC;AAC/C,EAAA,OAAOC,OAAO,GAAGlC,SAAS,CAACmC,aAAa,CAAC;AACrCC,IAAAA,IAAI,EAAE;AAAEC,MAAAA,OAAO,EAAE,IAAI;AAAEC,MAAAA,OAAO,EAAE;AAAK;AACzC,GAAC,CAAC;AACF,EAAA,OAAOC,UAAU,GAAGP,MAAM,CAACC,MAAM,CAAC,EAAE,CAAC;EACrC,OAAOO,cAAc,GAAG,OAAO;AAEnC;;;;"}
|
|
1
|
+
{"version":3,"file":"CjsWebglFormat.js","sources":["../../../../../src/resource/formats/webgl/CjsWebglFormat.js"],"sourcesContent":["import { CjsFormat } from \"../../format/CjsFormat.js\";\n/**\n * Exposed CarbonEngineJS-facing WebGL format class.\n *\n * Keep this file small and reviewable: container decoding lives in\n * core/readGlslEffectContainer.js, summarising in\n * core/inspectGlslEffectContainer.js, the DXBC-to-GLSL ES 3.00 emitter under\n * core/glsl, and option normalization in core/helpers.js.\n */\n\nimport {\n DEFAULT_VALUES,\n OUTPUT_JSON,\n emitGlslWithOptions,\n isWebglEffectContainer,\n normalizeValues,\n toJsonValue\n} from \"./core/helpers.js\";\nimport { buildEffectPackage } from \"./core/effectPackage.js\";\nimport { readGlslEffectContainer } from \"./core/readGlslEffectContainer.js\";\nimport { inspectGlslEffectContainer } from \"./core/inspectGlslEffectContainer.js\";\n\nconst FORMAT_NAME = \"CjsWebglFormat\";\n\n/**\n * CarbonEngineJS-facing format surface for `.carbonwebgl` WebGL shader packages, and\n * a DXBC -> GLSL ES 3.00 emitter for the WebGL2 vertex/pixel/map-style-compute\n * stages ccpwgl targets.\n *\n * The Cjs prefix marks this as a JavaScript format/construction boundary. A\n * WebGL effect is a stock Carbon effect container whose stored programs are\n * GLSL ES 3.00 - the same file shape Carbon ships for its own backends, and the\n * same one WebGPU emits with WGSL. `Read` decodes one into stage and shader\n * records; `Inspect` is a cheap structural summary; `BuildEffect` translates a\n * compiled Tr2 effect into one; `EmitGlsl` translates a single DXBC stage.\n */\nexport class CjsWebglFormat extends CjsFormat\n{\n\n _emit = DEFAULT_VALUES.emit;\n _source = DEFAULT_VALUES.source;\n\n /**\n * Create a reusable format profile.\n *\n * @param {object} [options] Default format values.\n */\n constructor(options = {})\n {\n super();\n this.SetValues(options);\n }\n\n /**\n * Set format values for this reusable profile.\n *\n * @param {object} [options] Values to merge into the profile.\n * @returns {CjsWebglFormat} This format profile.\n */\n SetValues(options = {})\n {\n const values = normalizeValues(this.GetValues(), options, FORMAT_NAME);\n\n this._emit = values.emit;\n this._source = values.source;\n\n return this;\n }\n\n /**\n * Get this profile's current values, optionally with per-call overrides.\n *\n * @param {object} [options] Optional values to merge into a copy.\n * @returns {object} A copy of the effective values.\n */\n GetValues(options = {})\n {\n return normalizeValues({\n emit: this._emit,\n source: this._source\n }, options, FORMAT_NAME);\n }\n\n /**\n * Decode an effect container into stage and shader records.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Per-call value overrides.\n * @returns {object} Stage graph in the completeness rules' vocabulary.\n */\n Read(input, options = {})\n {\n return readGlslEffectContainer(input, this.GetValues(options));\n }\n\n /**\n * Summarise an effect container without decoding every body's records.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Per-call value overrides.\n * @returns {object} Plain summary data.\n */\n Inspect(input, options = {})\n {\n return inspectGlslEffectContainer(input, this.GetValues(options));\n }\n\n /**\n * Translates one DXBC vertex/pixel/map-style-compute stage into GLSL ES 3.00.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\n * @param {object} [options] Combined ccpwgl-profile/emit options. See {@link CjsWebglFormat.emitGlsl}.\n * @returns {object} GLSL text plus the IO contract the packaging layer records.\n */\n EmitGlsl(dxbcBytes, options = {})\n {\n return emitGlslWithOptions(dxbcBytes, options);\n }\n\n /**\n * Builds a complete effect container from compiled Tr2 effect bytes.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\n * @param {object} [options] Selection, provenance, and emitter policy.\n * @returns {object} Package bytes plus inspection and qualification records.\n */\n BuildEffect(input, options = {})\n {\n return buildEffectPackage(input, options);\n }\n\n /**\n * Instance JSON-compatible conversion.\n *\n * @param {any} value Format output to convert.\n * @returns {any} Plain JSON-compatible data.\n */\n ToJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * Static payload sniff. Static methods use camelCase by convention.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.\n * @returns {boolean} True when the payload has the container shape.\n */\n static isWebglEffectContainer(input)\n {\n return isWebglEffectContainer(input);\n }\n\n /**\n * Static one-shot container decode.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Format values.\n * @returns {object} Stage graph in the completeness rules' vocabulary.\n */\n static read(input, options = {})\n {\n return readGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Static one-shot inspection.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Format values.\n * @returns {object} Plain summary data.\n */\n static inspect(input, options = {})\n {\n return inspectGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Static one-shot DXBC-to-GLSL emission.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\n * @param {object} [options] Combined ccpwgl-profile/emit options: `constantBufferStyle`\n * (`\"array\"` (default) uniform `vec4[]` for ccpwgl's uniform4fv path, or `\"std140\"`),\n * `pixelConstantBufferRemap` (default `{ 0: 7 }`, pixel-stage cb slot renames),\n * `samplerName(register, stageName)` (naming function), `vertexStructuredCapacity`\n * (default 69, bone-array element capacity), `dataTextureWidth` (default 2048),\n * `pairVaryings` (per-call varying zero-fill list), `source` (per-call error-detail name).\n * @returns {object} GLSL text plus the IO contract the packaging layer records.\n */\n static emitGlsl(dxbcBytes, options = {})\n {\n return emitGlslWithOptions(dxbcBytes, options);\n }\n\n /**\n * Static whole-effect container builder.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\n * @param {object} [options] Selection, provenance, and emitter policy.\n * @returns {object} Package bytes plus inspection and qualification records.\n */\n static buildEffect(input, options = {})\n {\n return buildEffectPackage(input, options);\n }\n\n /**\n * Static JSON-compatible conversion.\n *\n * @param {any} value Format output to convert.\n * @returns {any} Plain JSON-compatible data.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n static id = \"CjsWebglFormat\";\n static mediaTypes = [ \"shader\" ];\n static outputs = CjsFormat.defineOutputs({\n json: { default: true, decoded: true }\n });\n static extensions = [];\n\n}\n\nexport default CjsWebglFormat;\n"],"names":["FORMAT_NAME","CjsWebglFormat","CjsFormat","_emit","DEFAULT_VALUES","emit","_source","source","constructor","options","SetValues","values","normalizeValues","GetValues","Read","input","readGlslEffectContainer","Inspect","inspectGlslEffectContainer","EmitGlsl","dxbcBytes","emitGlslWithOptions","BuildEffect","buildEffectPackage","ToJSON","value","toJsonValue","isWebglEffectContainer","read","inspect","emitGlsl","buildEffect","toJSON","id","mediaTypes","outputs","defineOutputs","json","default","decoded","extensions"],"mappings":";;;;;;;AAsBA,MAAMA,WAAW,GAAG,gBAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAA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;AACA;AACA;EACI,OAAOsB,WAAWA,CAAChB,KAAK,EAAEN,OAAO,GAAG,EAAE,EACtC;AACI,IAAA,OAAOc,kBAAkB,CAACR,KAAK,EAAEN,OAAO,CAAC;AAC7C,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;EACI,OAAOuB,MAAMA,CAACP,KAAK,EACnB;IACI,OAAOC,qBAAW,CAACD,KAAK,CAAC;AAC7B,EAAA;EAEA,OAAOQ,EAAE,GAAG,gBAAgB;AAC5B,EAAA,OAAOC,UAAU,GAAG,CAAE,QAAQ,CAAE;AAChC,EAAA,OAAOC,OAAO,GAAGjC,SAAS,CAACkC,aAAa,CAAC;AACrCC,IAAAA,IAAI,EAAE;AAAEC,MAAAA,OAAO,EAAE,IAAI;AAAEC,MAAAA,OAAO,EAAE;AAAK;AACzC,GAAC,CAAC;EACF,OAAOC,UAAU,GAAG,EAAE;AAE1B;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebglReadError.js","sources":["../../../../../../src/resource/formats/webgl/core/WebglReadError.js"],"sourcesContent":["/**\r\n * Error raised when a Carbon WebGL package or a DXBC-to-GLSL emission cannot be\r\n * completed safely.\r\n *\r\n * This format has no dependency on the sibling `formats/dxbc` internal\r\n * `DxbcReadError` class (that format only exports its public `CjsDxbcFormat`\r\n * boundary). Emitter/package failures raised from this format's own code\r\n * use this class instead, while thrown messages that document a specific\r\n * failure mode (see README/tests) are kept identical to their origin in\r\n * `hlslreader`.\r\n */\r\nexport class WebglReadError extends Error\r\n{\r\n /**\r\n * Creates a read/emit error with structured location details.\r\n *\r\n * @param {string} message Human-readable failure reason.\r\n * @param {object} [details] Extra reader state such as source, offset, or opcode.\r\n */\r\n constructor(message, details = {})\r\n {\r\n super(message);\r\n this.name = \"WebglReadError\";\r\n this.details = details;\r\n }\r\n}\r\n"],"names":["WebglReadError","Error","constructor","message","details","name"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,SAASC,KAAK,CACzC;AACI;AACJ;AACA;AACA;AACA;AACA;AACIC,EAAAA,WAAWA,CAACC,OAAO,EAAEC,OAAO,GAAG,EAAE,EACjC;IACI,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,gBAAgB;IAC5B,IAAI,CAACD,OAAO,GAAGA,OAAO;AAC1B,EAAA;AACJ;;;;"}
|
|
@@ -42,7 +42,7 @@ function buildEffectPackage(input, options = {}) {
|
|
|
42
42
|
// up front. What lands in `info.containerVersion` is what was emitted.
|
|
43
43
|
const containerVersion = resolveWriteVersion(options.version);
|
|
44
44
|
const effectRes = CjsHlslFormat.read(values.sourceBytes, {
|
|
45
|
-
emit:
|
|
45
|
+
emit: "raw",
|
|
46
46
|
source: values.source
|
|
47
47
|
});
|
|
48
48
|
if (!effectRes.IsGood()) {
|