@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
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { impl, CjsSchema, carbon } from '#schema';
|
|
2
|
+
import { IBlueClasses } from './IBlueClasses.js';
|
|
3
|
+
|
|
4
|
+
// Source: blueexposure/BlueClasses.h
|
|
5
|
+
// Source: blueexposure/BlueClasses.cpp
|
|
6
|
+
// Source: blueexposure/include/BlueTypes.h:409-419 (Be::ClassRegistration)
|
|
7
|
+
//
|
|
8
|
+
// The registry behind `blue.classes` (`BeClasses`).
|
|
9
|
+
//
|
|
10
|
+
// ONE TABLE, NOT TWO. `CjsSchema` already keeps the by-name constructor table
|
|
11
|
+
// (`SetConstructor`/`GetConstructor`) and fills it for every class it defines;
|
|
12
|
+
// it currently does four or five Carbon jobs at once (ClassInfo, BeClasses,
|
|
13
|
+
// RTTI, the copier, the exposure macros), and its class registry is
|
|
14
|
+
// BeClasses' job (operator, 2026-09-22; /docs/architecture/blue-service-ownership.md).
|
|
15
|
+
// Until that splits out, this class is the Carbon-named face over the same table, so a
|
|
16
|
+
// class registered either way is found either way. A class with no schema
|
|
17
|
+
// (HostBitmap, for one) registers here.
|
|
18
|
+
//
|
|
19
|
+
// It answers truthfully
|
|
20
|
+
// before anything is composed - an empty registry finds nothing, which is what
|
|
21
|
+
// Carbon returns for a class nobody registered - so the slot holds this class
|
|
22
|
+
// directly rather than a throwing interface.
|
|
23
|
+
//
|
|
24
|
+
// A REGISTRATION IS { name, type, createFn, flags }. `type`, `createFn` and
|
|
25
|
+
// `flags` are Carbon's `mType`, `mCreateFn` and `mFlags`. In JavaScript a
|
|
26
|
+
// class is its own type information, so `type` is the constructor itself:
|
|
27
|
+
// `GetClassRegistration("X").type` is how a caller reaches a class's statics
|
|
28
|
+
// or subclasses it without importing it. `name` is the class name Carbon's
|
|
29
|
+
// `ClassInfo` carries; it is given explicitly and never read from
|
|
30
|
+
// `type.name`, because a minifier renames classes and the lookup would
|
|
31
|
+
// then silently miss in production.
|
|
32
|
+
//
|
|
33
|
+
// A CLASS ID IS THE CLASS NAME. Carbon's `Be::Clsid` is a GUID paired with a
|
|
34
|
+
// module and name, and `FindClsid` already ignores the module ("we don't allow
|
|
35
|
+
// name clashes between modules", BlueClasses.cpp:340-343). With no GUIDs to
|
|
36
|
+
// carry, the name is the only identity there is.
|
|
37
|
+
|
|
38
|
+
/** `BlueClasses` - the class registry `blue.classes` holds, per blueexposure/BlueClasses.cpp. */
|
|
39
|
+
class BlueClasses extends IBlueClasses {
|
|
40
|
+
/** Carbon's `Be::ClassRegistration::Flags` (BlueTypes.h:415-418). */
|
|
41
|
+
static Flags = {
|
|
42
|
+
DISABLE_PYTHON_CONSTRUCTION: 1
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** Carbon's per-registration createFn and flags, where they differ from `new type()` and 0. */
|
|
46
|
+
_extras = new Map();
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Register every entry of a table (BlueClasses.cpp:296-302).
|
|
50
|
+
*
|
|
51
|
+
* @param {Array<{name: string, type: Function, createFn?: Function, flags?: number}>} table Registrations.
|
|
52
|
+
*/
|
|
53
|
+
RegisterClasses(table) {
|
|
54
|
+
for (const registration of table) {
|
|
55
|
+
this._RegisterSingleClass(registration);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Remove every entry of a table (BlueClasses.cpp:304-310, 282-294).
|
|
61
|
+
*
|
|
62
|
+
* @param {Array<{name: string}>} table Registrations to remove.
|
|
63
|
+
*/
|
|
64
|
+
UnregisterClasses(table) {
|
|
65
|
+
for (const registration of table) {
|
|
66
|
+
this._extras.delete(registration.name);
|
|
67
|
+
CjsSchema.DeleteConstructor(registration.name);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The registration for a class id, or null (BlueClasses.cpp:331-336).
|
|
73
|
+
*
|
|
74
|
+
* @param {string} clsid Class id, which is the class name.
|
|
75
|
+
* @returns {{name: string, type: Function, createFn: Function, flags: number}|null} Registration.
|
|
76
|
+
*/
|
|
77
|
+
GetClassRegistration(clsid) {
|
|
78
|
+
const type = CjsSchema.GetConstructor(clsid);
|
|
79
|
+
if (!type) return null;
|
|
80
|
+
const extras = this._extras.get(clsid);
|
|
81
|
+
return {
|
|
82
|
+
name: clsid,
|
|
83
|
+
type,
|
|
84
|
+
createFn: extras?.createFn ?? (() => new type()),
|
|
85
|
+
flags: extras?.flags ?? 0
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The class id registered under a name, or null (BlueClasses.cpp:355-364).
|
|
91
|
+
*
|
|
92
|
+
* @param {string} name Class name.
|
|
93
|
+
* @returns {string|null} Class id.
|
|
94
|
+
*/
|
|
95
|
+
FindClsid(name) {
|
|
96
|
+
return CjsSchema.GetConstructor(name) ? name : null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* A new instance of the class with this id, or null (BlueClasses.cpp:429-445).
|
|
101
|
+
*
|
|
102
|
+
* @param {string} clsid Class id, which is the class name.
|
|
103
|
+
* @returns {object|null} New instance.
|
|
104
|
+
*/
|
|
105
|
+
CreateInstance(clsid) {
|
|
106
|
+
const registration = this.GetClassRegistration(clsid);
|
|
107
|
+
return registration ? registration.createFn() : null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* A new instance of the class registered under a name, or null (BlueClasses.cpp:448-464).
|
|
112
|
+
*
|
|
113
|
+
* @param {string} className Class name.
|
|
114
|
+
* @returns {object|null} New instance.
|
|
115
|
+
*/
|
|
116
|
+
CreateInstanceFromName(className) {
|
|
117
|
+
return this.CreateInstance(className);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Register one entry, refusing a name already taken (BlueClasses.cpp:266-280). */
|
|
121
|
+
_RegisterSingleClass(registration) {
|
|
122
|
+
const {
|
|
123
|
+
name,
|
|
124
|
+
type
|
|
125
|
+
} = registration;
|
|
126
|
+
if (CjsSchema.GetConstructor(name)) {
|
|
127
|
+
// Carbon: CCP_LOGERR("Class %s.%s is already registered!") and keeps the
|
|
128
|
+
// first registration (BlueClasses.cpp:272-276).
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
CjsSchema.SetConstructor(name, type);
|
|
132
|
+
if (registration.createFn || registration.flags) {
|
|
133
|
+
this._extras.set(name, {
|
|
134
|
+
createFn: registration.createFn,
|
|
135
|
+
flags: registration.flags ?? 0
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
QueryThisInterface() {
|
|
140
|
+
throw new Error("BlueClasses.QueryThisInterface is not implemented");
|
|
141
|
+
}
|
|
142
|
+
FindVariable() {
|
|
143
|
+
throw new Error("BlueClasses.FindVariable is not implemented");
|
|
144
|
+
}
|
|
145
|
+
UpdateObjectCount() {
|
|
146
|
+
throw new Error("BlueClasses.UpdateObjectCount is not implemented");
|
|
147
|
+
}
|
|
148
|
+
CopyTo() {
|
|
149
|
+
throw new Error("BlueClasses.CopyTo is not implemented");
|
|
150
|
+
}
|
|
151
|
+
CloneTo() {
|
|
152
|
+
throw new Error("BlueClasses.CloneTo is not implemented");
|
|
153
|
+
}
|
|
154
|
+
ProcessPendingDeletes() {
|
|
155
|
+
throw new Error("BlueClasses.ProcessPendingDeletes is not implemented");
|
|
156
|
+
}
|
|
157
|
+
ProcessAllPendingDeletes() {
|
|
158
|
+
throw new Error("BlueClasses.ProcessAllPendingDeletes is not implemented");
|
|
159
|
+
}
|
|
160
|
+
SetPendingDeletesEnabled() {
|
|
161
|
+
throw new Error("BlueClasses.SetPendingDeletesEnabled is not implemented");
|
|
162
|
+
}
|
|
163
|
+
IsPendingDeletesEnabled() {
|
|
164
|
+
throw new Error("BlueClasses.IsPendingDeletesEnabled is not implemented");
|
|
165
|
+
}
|
|
166
|
+
RegisterThunker() {
|
|
167
|
+
throw new Error("BlueClasses.RegisterThunker is not implemented");
|
|
168
|
+
}
|
|
169
|
+
GetRtti() {
|
|
170
|
+
throw new Error("BlueClasses.GetRtti is not implemented");
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const NOT_YET = impl.reason("No consumer yet; ported when one needs it.");
|
|
174
|
+
CjsSchema.define(BlueClasses, {
|
|
175
|
+
className: "BlueClasses",
|
|
176
|
+
family: "blue",
|
|
177
|
+
fields: {},
|
|
178
|
+
methods: {
|
|
179
|
+
RegisterClasses: [carbon.method, impl.adapted, impl.reason("Carbon walks a null-terminated array; JavaScript takes any iterable of registrations.")],
|
|
180
|
+
UnregisterClasses: [carbon.method, impl.implemented],
|
|
181
|
+
GetClassRegistration: [carbon.method, impl.adapted, impl.reason("A class id is the class name: there are no GUIDs to carry, and Carbon already forbids name clashes between modules.")],
|
|
182
|
+
FindClsid: [carbon.method, impl.adapted, impl.reason("Carbon's out-parameter overload and its module argument collapse: the id is the name, and Carbon ignores the module.")],
|
|
183
|
+
CreateInstance: [carbon.method, impl.adapted, impl.reason("Carbon returns bool and writes the instance through ppv after a QueryInterface for riid; JavaScript returns the instance or null, with no interface id to query.")],
|
|
184
|
+
CreateInstanceFromName: [carbon.method, impl.adapted, impl.reason("Carbon returns bool and writes the instance through ppv after a QueryInterface for riid; JavaScript returns the instance or null, with no interface id to query.")],
|
|
185
|
+
QueryThisInterface: [carbon.method, impl.notImplemented, NOT_YET],
|
|
186
|
+
FindVariable: [carbon.method, impl.notImplemented, NOT_YET],
|
|
187
|
+
UpdateObjectCount: [carbon.method, impl.notImplemented, NOT_YET],
|
|
188
|
+
CopyTo: [carbon.method, impl.notImplemented, NOT_YET],
|
|
189
|
+
CloneTo: [carbon.method, impl.notImplemented, NOT_YET],
|
|
190
|
+
ProcessPendingDeletes: [carbon.method, impl.notImplemented, NOT_YET],
|
|
191
|
+
ProcessAllPendingDeletes: [carbon.method, impl.notImplemented, NOT_YET],
|
|
192
|
+
SetPendingDeletesEnabled: [carbon.method, impl.notImplemented, NOT_YET],
|
|
193
|
+
IsPendingDeletesEnabled: [carbon.method, impl.notImplemented, NOT_YET],
|
|
194
|
+
RegisterThunker: [carbon.method, impl.notImplemented, NOT_YET],
|
|
195
|
+
GetRtti: [carbon.method, impl.notImplemented, NOT_YET]
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
export { BlueClasses };
|
|
200
|
+
//# sourceMappingURL=BlueClasses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlueClasses.js","sources":["../../../../src/global/blue/BlueClasses.js"],"sourcesContent":["// Source: blueexposure/BlueClasses.h\n// Source: blueexposure/BlueClasses.cpp\n// Source: blueexposure/include/BlueTypes.h:409-419 (Be::ClassRegistration)\n//\n// The registry behind `blue.classes` (`BeClasses`).\n//\n// ONE TABLE, NOT TWO. `CjsSchema` already keeps the by-name constructor table\n// (`SetConstructor`/`GetConstructor`) and fills it for every class it defines;\n// it currently does four or five Carbon jobs at once (ClassInfo, BeClasses,\n// RTTI, the copier, the exposure macros), and its class registry is\n// BeClasses' job (operator, 2026-09-22; /docs/architecture/blue-service-ownership.md).\n// Until that splits out, this class is the Carbon-named face over the same table, so a\n// class registered either way is found either way. A class with no schema\n// (HostBitmap, for one) registers here.\n//\n// It answers truthfully\n// before anything is composed - an empty registry finds nothing, which is what\n// Carbon returns for a class nobody registered - so the slot holds this class\n// directly rather than a throwing interface.\n//\n// A REGISTRATION IS { name, type, createFn, flags }. `type`, `createFn` and\n// `flags` are Carbon's `mType`, `mCreateFn` and `mFlags`. In JavaScript a\n// class is its own type information, so `type` is the constructor itself:\n// `GetClassRegistration(\"X\").type` is how a caller reaches a class's statics\n// or subclasses it without importing it. `name` is the class name Carbon's\n// `ClassInfo` carries; it is given explicitly and never read from\n// `type.name`, because a minifier renames classes and the lookup would\n// then silently miss in production.\n//\n// A CLASS ID IS THE CLASS NAME. Carbon's `Be::Clsid` is a GUID paired with a\n// module and name, and `FindClsid` already ignores the module (\"we don't allow\n// name clashes between modules\", BlueClasses.cpp:340-343). With no GUIDs to\n// carry, the name is the only identity there is.\nimport { CjsSchema, carbon, impl } from \"#schema\";\nimport { IBlueClasses } from \"./IBlueClasses.js\";\n\n\n/** `BlueClasses` - the class registry `blue.classes` holds, per blueexposure/BlueClasses.cpp. */\nexport class BlueClasses extends IBlueClasses\n{\n\n /** Carbon's `Be::ClassRegistration::Flags` (BlueTypes.h:415-418). */\n static Flags = {\n DISABLE_PYTHON_CONSTRUCTION: 1\n };\n\n /** Carbon's per-registration createFn and flags, where they differ from `new type()` and 0. */\n _extras = new Map();\n\n /**\n * Register every entry of a table (BlueClasses.cpp:296-302).\n *\n * @param {Array<{name: string, type: Function, createFn?: Function, flags?: number}>} table Registrations.\n */\n RegisterClasses(table)\n {\n for (const registration of table)\n {\n this._RegisterSingleClass(registration);\n }\n }\n\n /**\n * Remove every entry of a table (BlueClasses.cpp:304-310, 282-294).\n *\n * @param {Array<{name: string}>} table Registrations to remove.\n */\n UnregisterClasses(table)\n {\n for (const registration of table)\n {\n this._extras.delete(registration.name);\n CjsSchema.DeleteConstructor(registration.name);\n }\n }\n\n /**\n * The registration for a class id, or null (BlueClasses.cpp:331-336).\n *\n * @param {string} clsid Class id, which is the class name.\n * @returns {{name: string, type: Function, createFn: Function, flags: number}|null} Registration.\n */\n GetClassRegistration(clsid)\n {\n const type = CjsSchema.GetConstructor(clsid);\n\n if (!type) return null;\n\n const extras = this._extras.get(clsid);\n\n return {\n name: clsid,\n type,\n createFn: extras?.createFn ?? (() => new type()),\n flags: extras?.flags ?? 0\n };\n }\n\n /**\n * The class id registered under a name, or null (BlueClasses.cpp:355-364).\n *\n * @param {string} name Class name.\n * @returns {string|null} Class id.\n */\n FindClsid(name)\n {\n return CjsSchema.GetConstructor(name) ? name : null;\n }\n\n /**\n * A new instance of the class with this id, or null (BlueClasses.cpp:429-445).\n *\n * @param {string} clsid Class id, which is the class name.\n * @returns {object|null} New instance.\n */\n CreateInstance(clsid)\n {\n const registration = this.GetClassRegistration(clsid);\n\n return registration ? registration.createFn() : null;\n }\n\n /**\n * A new instance of the class registered under a name, or null (BlueClasses.cpp:448-464).\n *\n * @param {string} className Class name.\n * @returns {object|null} New instance.\n */\n CreateInstanceFromName(className)\n {\n return this.CreateInstance(className);\n }\n\n /** Register one entry, refusing a name already taken (BlueClasses.cpp:266-280). */\n _RegisterSingleClass(registration)\n {\n const { name, type } = registration;\n\n if (CjsSchema.GetConstructor(name))\n {\n // Carbon: CCP_LOGERR(\"Class %s.%s is already registered!\") and keeps the\n // first registration (BlueClasses.cpp:272-276).\n return;\n }\n\n CjsSchema.SetConstructor(name, type);\n\n if (registration.createFn || registration.flags)\n {\n this._extras.set(name, { createFn: registration.createFn, flags: registration.flags ?? 0 });\n }\n }\n\n QueryThisInterface() { throw new Error(\"BlueClasses.QueryThisInterface is not implemented\"); }\n\n FindVariable() { throw new Error(\"BlueClasses.FindVariable is not implemented\"); }\n\n UpdateObjectCount() { throw new Error(\"BlueClasses.UpdateObjectCount is not implemented\"); }\n\n CopyTo() { throw new Error(\"BlueClasses.CopyTo is not implemented\"); }\n\n CloneTo() { throw new Error(\"BlueClasses.CloneTo is not implemented\"); }\n\n ProcessPendingDeletes() { throw new Error(\"BlueClasses.ProcessPendingDeletes is not implemented\"); }\n\n ProcessAllPendingDeletes() { throw new Error(\"BlueClasses.ProcessAllPendingDeletes is not implemented\"); }\n\n SetPendingDeletesEnabled() { throw new Error(\"BlueClasses.SetPendingDeletesEnabled is not implemented\"); }\n\n IsPendingDeletesEnabled() { throw new Error(\"BlueClasses.IsPendingDeletesEnabled is not implemented\"); }\n\n RegisterThunker() { throw new Error(\"BlueClasses.RegisterThunker is not implemented\"); }\n\n GetRtti() { throw new Error(\"BlueClasses.GetRtti is not implemented\"); }\n\n}\n\nconst NOT_YET = impl.reason(\"No consumer yet; ported when one needs it.\");\n\nCjsSchema.define(BlueClasses, {\n className: \"BlueClasses\",\n family: \"blue\",\n fields: {},\n methods: {\n RegisterClasses: [ carbon.method, impl.adapted, impl.reason(\"Carbon walks a null-terminated array; JavaScript takes any iterable of registrations.\") ],\n UnregisterClasses: [ carbon.method, impl.implemented ],\n GetClassRegistration: [ carbon.method, impl.adapted, impl.reason(\"A class id is the class name: there are no GUIDs to carry, and Carbon already forbids name clashes between modules.\") ],\n FindClsid: [ carbon.method, impl.adapted, impl.reason(\"Carbon's out-parameter overload and its module argument collapse: the id is the name, and Carbon ignores the module.\") ],\n CreateInstance: [ carbon.method, impl.adapted, impl.reason(\"Carbon returns bool and writes the instance through ppv after a QueryInterface for riid; JavaScript returns the instance or null, with no interface id to query.\") ],\n CreateInstanceFromName: [ carbon.method, impl.adapted, impl.reason(\"Carbon returns bool and writes the instance through ppv after a QueryInterface for riid; JavaScript returns the instance or null, with no interface id to query.\") ],\n QueryThisInterface: [ carbon.method, impl.notImplemented, NOT_YET ],\n FindVariable: [ carbon.method, impl.notImplemented, NOT_YET ],\n UpdateObjectCount: [ carbon.method, impl.notImplemented, NOT_YET ],\n CopyTo: [ carbon.method, impl.notImplemented, NOT_YET ],\n CloneTo: [ carbon.method, impl.notImplemented, NOT_YET ],\n ProcessPendingDeletes: [ carbon.method, impl.notImplemented, NOT_YET ],\n ProcessAllPendingDeletes: [ carbon.method, impl.notImplemented, NOT_YET ],\n SetPendingDeletesEnabled: [ carbon.method, impl.notImplemented, NOT_YET ],\n IsPendingDeletesEnabled: [ carbon.method, impl.notImplemented, NOT_YET ],\n RegisterThunker: [ carbon.method, impl.notImplemented, NOT_YET ],\n GetRtti: [ carbon.method, impl.notImplemented, NOT_YET ]\n }\n});\n"],"names":["BlueClasses","IBlueClasses","Flags","DISABLE_PYTHON_CONSTRUCTION","_extras","Map","RegisterClasses","table","registration","_RegisterSingleClass","UnregisterClasses","delete","name","CjsSchema","DeleteConstructor","GetClassRegistration","clsid","type","GetConstructor","extras","get","createFn","flags","FindClsid","CreateInstance","CreateInstanceFromName","className","SetConstructor","set","QueryThisInterface","Error","FindVariable","UpdateObjectCount","CopyTo","CloneTo","ProcessPendingDeletes","ProcessAllPendingDeletes","SetPendingDeletesEnabled","IsPendingDeletesEnabled","RegisterThunker","GetRtti","NOT_YET","impl","reason","define","family","fields","methods","carbon","method","adapted","implemented","notImplemented"],"mappings":"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"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { CjsSchema, compose, impl } from '#schema';
|
|
2
|
+
|
|
3
|
+
// Source: blueexposure/include/IBlueClasses.h
|
|
4
|
+
//
|
|
5
|
+
// The class registry as its CONSUMERS see it. Carbon reaches it through its
|
|
6
|
+
// own extern, `BeClasses` (`blueexposure/BlueClasses.cpp:28`), which is how a
|
|
7
|
+
// subsystem builds an object it does not import: `BlackReader.cpp:347` creates
|
|
8
|
+
// every loaded object through `BeClasses->CreateInstanceFromName`.
|
|
9
|
+
//
|
|
10
|
+
// That is also why it matters here. `resource` and `trinityal` are sibling
|
|
11
|
+
// layers that may not import each other; both may import `blue`, so a class
|
|
12
|
+
// one of them owns is reached by the other through this registry. A class
|
|
13
|
+
// nobody registered is simply not found, and the caller fails at the call.
|
|
14
|
+
|
|
15
|
+
/** `IBlueClasses` - class registration and creation by name, per blueexposure/include/IBlueClasses.h. */
|
|
16
|
+
class IBlueClasses {
|
|
17
|
+
/** `RegisterClasses` - register every entry of a class-registration table. */
|
|
18
|
+
RegisterClasses(_table) {}
|
|
19
|
+
|
|
20
|
+
/** `UnregisterClasses` - remove every entry of a class-registration table. */
|
|
21
|
+
UnregisterClasses(_table) {}
|
|
22
|
+
|
|
23
|
+
/** `GetClassRegistration` - the registration for a class id, or null. */
|
|
24
|
+
GetClassRegistration(_clsid) {}
|
|
25
|
+
|
|
26
|
+
/** `FindClsid` - the class id registered under a name, or null. */
|
|
27
|
+
FindClsid(_name) {}
|
|
28
|
+
|
|
29
|
+
/** `CreateInstance` - a new instance of the class with this id, or null. */
|
|
30
|
+
CreateInstance(_clsid) {}
|
|
31
|
+
|
|
32
|
+
/** `CreateInstanceFromName` - a new instance of the class registered under this name, or null. */
|
|
33
|
+
CreateInstanceFromName(_className) {}
|
|
34
|
+
|
|
35
|
+
/** `QueryThisInterface` - cast an object to an interface it implements. */
|
|
36
|
+
QueryThisInterface(_self, _riid) {}
|
|
37
|
+
|
|
38
|
+
/** `FindVariable` - the exposed member entry for a name on a class type. */
|
|
39
|
+
FindVariable(_name, _type) {}
|
|
40
|
+
|
|
41
|
+
/** `UpdateObjectCount` - adjust the live and lock counts of an object's class. */
|
|
42
|
+
UpdateObjectCount(_obj, _inst, _lock) {}
|
|
43
|
+
|
|
44
|
+
/** `CopyTo` - deep-copy an object through its exposed members. */
|
|
45
|
+
CopyTo(_source) {}
|
|
46
|
+
|
|
47
|
+
/** `CloneTo` - clone an object through its exposed members. */
|
|
48
|
+
CloneTo(_source) {}
|
|
49
|
+
|
|
50
|
+
/** `ProcessPendingDeletes` - release objects whose deletion was deferred. */
|
|
51
|
+
ProcessPendingDeletes() {}
|
|
52
|
+
|
|
53
|
+
/** `ProcessAllPendingDeletes` - release every deferred deletion. */
|
|
54
|
+
ProcessAllPendingDeletes() {}
|
|
55
|
+
|
|
56
|
+
/** `SetPendingDeletesEnabled` - turn deferred deletion on or off. */
|
|
57
|
+
SetPendingDeletesEnabled(_enabled) {}
|
|
58
|
+
|
|
59
|
+
/** `IsPendingDeletesEnabled` - whether deletion is deferred. */
|
|
60
|
+
IsPendingDeletesEnabled() {}
|
|
61
|
+
|
|
62
|
+
/** `RegisterThunker` - register a script method-thunk table for an interface. */
|
|
63
|
+
RegisterThunker(_defs, _riid) {}
|
|
64
|
+
|
|
65
|
+
/** `GetRtti` - the runtime type information for a class type. */
|
|
66
|
+
GetRtti(_type) {}
|
|
67
|
+
}
|
|
68
|
+
for (const method of ["RegisterClasses", "UnregisterClasses", "GetClassRegistration", "FindClsid", "CreateInstance", "CreateInstanceFromName", "QueryThisInterface", "FindVariable", "UpdateObjectCount", "CopyTo", "CloneTo", "ProcessPendingDeletes", "ProcessAllPendingDeletes", "SetPendingDeletesEnabled", "IsPendingDeletesEnabled", "RegisterThunker", "GetRtti"]) {
|
|
69
|
+
CjsSchema.decorateMethod(IBlueClasses, method, compose.abstract, impl.abstract);
|
|
70
|
+
}
|
|
71
|
+
CjsSchema.define(IBlueClasses, {
|
|
72
|
+
className: "IBlueClasses",
|
|
73
|
+
carbon: "IBlueClasses",
|
|
74
|
+
family: "blue",
|
|
75
|
+
fields: {}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export { IBlueClasses };
|
|
79
|
+
//# sourceMappingURL=IBlueClasses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IBlueClasses.js","sources":["../../../../src/global/blue/IBlueClasses.js"],"sourcesContent":["// Source: blueexposure/include/IBlueClasses.h\n//\n// The class registry as its CONSUMERS see it. Carbon reaches it through its\n// own extern, `BeClasses` (`blueexposure/BlueClasses.cpp:28`), which is how a\n// subsystem builds an object it does not import: `BlackReader.cpp:347` creates\n// every loaded object through `BeClasses->CreateInstanceFromName`.\n//\n// That is also why it matters here. `resource` and `trinityal` are sibling\n// layers that may not import each other; both may import `blue`, so a class\n// one of them owns is reached by the other through this registry. A class\n// nobody registered is simply not found, and the caller fails at the call.\nimport { CjsSchema, compose, impl } from \"#schema\";\n\n/** `IBlueClasses` - class registration and creation by name, per blueexposure/include/IBlueClasses.h. */\nexport class IBlueClasses\n{\n /** `RegisterClasses` - register every entry of a class-registration table. */\n RegisterClasses(_table) {}\n\n /** `UnregisterClasses` - remove every entry of a class-registration table. */\n UnregisterClasses(_table) {}\n\n /** `GetClassRegistration` - the registration for a class id, or null. */\n GetClassRegistration(_clsid) {}\n\n /** `FindClsid` - the class id registered under a name, or null. */\n FindClsid(_name) {}\n\n /** `CreateInstance` - a new instance of the class with this id, or null. */\n CreateInstance(_clsid) {}\n\n /** `CreateInstanceFromName` - a new instance of the class registered under this name, or null. */\n CreateInstanceFromName(_className) {}\n\n /** `QueryThisInterface` - cast an object to an interface it implements. */\n QueryThisInterface(_self, _riid) {}\n\n /** `FindVariable` - the exposed member entry for a name on a class type. */\n FindVariable(_name, _type) {}\n\n /** `UpdateObjectCount` - adjust the live and lock counts of an object's class. */\n UpdateObjectCount(_obj, _inst, _lock) {}\n\n /** `CopyTo` - deep-copy an object through its exposed members. */\n CopyTo(_source) {}\n\n /** `CloneTo` - clone an object through its exposed members. */\n CloneTo(_source) {}\n\n /** `ProcessPendingDeletes` - release objects whose deletion was deferred. */\n ProcessPendingDeletes() {}\n\n /** `ProcessAllPendingDeletes` - release every deferred deletion. */\n ProcessAllPendingDeletes() {}\n\n /** `SetPendingDeletesEnabled` - turn deferred deletion on or off. */\n SetPendingDeletesEnabled(_enabled) {}\n\n /** `IsPendingDeletesEnabled` - whether deletion is deferred. */\n IsPendingDeletesEnabled() {}\n\n /** `RegisterThunker` - register a script method-thunk table for an interface. */\n RegisterThunker(_defs, _riid) {}\n\n /** `GetRtti` - the runtime type information for a class type. */\n GetRtti(_type) {}\n}\n\nfor (const method of [\n \"RegisterClasses\", \"UnregisterClasses\", \"GetClassRegistration\", \"FindClsid\", \"CreateInstance\",\n \"CreateInstanceFromName\", \"QueryThisInterface\", \"FindVariable\", \"UpdateObjectCount\", \"CopyTo\",\n \"CloneTo\", \"ProcessPendingDeletes\", \"ProcessAllPendingDeletes\", \"SetPendingDeletesEnabled\",\n \"IsPendingDeletesEnabled\", \"RegisterThunker\", \"GetRtti\"\n])\n{\n CjsSchema.decorateMethod(IBlueClasses, method, compose.abstract, impl.abstract);\n}\n\nCjsSchema.define(IBlueClasses, { className: \"IBlueClasses\", carbon: \"IBlueClasses\", family: \"blue\", fields: {} });\n"],"names":["IBlueClasses","RegisterClasses","_table","UnregisterClasses","GetClassRegistration","_clsid","FindClsid","_name","CreateInstance","CreateInstanceFromName","_className","QueryThisInterface","_self","_riid","FindVariable","_type","UpdateObjectCount","_obj","_inst","_lock","CopyTo","_source","CloneTo","ProcessPendingDeletes","ProcessAllPendingDeletes","SetPendingDeletesEnabled","_enabled","IsPendingDeletesEnabled","RegisterThunker","_defs","GetRtti","method","CjsSchema","decorateMethod","compose","abstract","impl","define","className","carbon","family","fields"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACO,MAAMA,YAAY,CACzB;AACE;EACAC,eAAeA,CAACC,MAAM,EAAE,CAAC;;AAEzB;EACAC,iBAAiBA,CAACD,MAAM,EAAE,CAAC;;AAE3B;EACAE,oBAAoBA,CAACC,MAAM,EAAE,CAAC;;AAE9B;EACAC,SAASA,CAACC,KAAK,EAAE,CAAC;;AAElB;EACAC,cAAcA,CAACH,MAAM,EAAE,CAAC;;AAExB;EACAI,sBAAsBA,CAACC,UAAU,EAAE,CAAC;;AAEpC;AACAC,EAAAA,kBAAkBA,CAACC,KAAK,EAAEC,KAAK,EAAE,CAAC;;AAElC;AACAC,EAAAA,YAAYA,CAACP,KAAK,EAAEQ,KAAK,EAAE,CAAC;;AAE5B;AACAC,EAAAA,iBAAiBA,CAACC,IAAI,EAAEC,KAAK,EAAEC,KAAK,EAAE,CAAC;;AAEvC;EACAC,MAAMA,CAACC,OAAO,EAAE,CAAC;;AAEjB;EACAC,OAAOA,CAACD,OAAO,EAAE,CAAC;;AAElB;EACAE,qBAAqBA,GAAG,CAAC;;AAEzB;EACAC,wBAAwBA,GAAG,CAAC;;AAE5B;EACAC,wBAAwBA,CAACC,QAAQ,EAAE,CAAC;;AAEpC;EACAC,uBAAuBA,GAAG,CAAC;;AAE3B;AACAC,EAAAA,eAAeA,CAACC,KAAK,EAAEhB,KAAK,EAAE,CAAC;;AAE/B;EACAiB,OAAOA,CAACf,KAAK,EAAE,CAAC;AAClB;AAEA,KAAK,MAAMgB,MAAM,IAAI,CACnB,iBAAiB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,WAAW,EAAE,gBAAgB,EAC7F,wBAAwB,EAAE,oBAAoB,EAAE,cAAc,EAAE,mBAAmB,EAAE,QAAQ,EAC7F,SAAS,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,0BAA0B,EAC1F,yBAAyB,EAAE,iBAAiB,EAAE,SAAS,CACxD,EACD;AACEC,EAAAA,SAAS,CAACC,cAAc,CAACjC,YAAY,EAAE+B,MAAM,EAAEG,OAAO,CAACC,QAAQ,EAAEC,IAAI,CAACD,QAAQ,CAAC;AACjF;AAEAH,SAAS,CAACK,MAAM,CAACrC,YAAY,EAAE;AAAEsC,EAAAA,SAAS,EAAE,cAAc;AAAEC,EAAAA,MAAM,EAAE,cAAc;AAAEC,EAAAA,MAAM,EAAE,MAAM;AAAEC,EAAAA,MAAM,EAAE;AAAG,CAAC,CAAC;;;;"}
|
|
@@ -16,8 +16,24 @@ import { CjsSchema, compose, impl } from '#schema';
|
|
|
16
16
|
class IBlueDynamicResourceConstructor {
|
|
17
17
|
/** `GetResource` - construct the resource this query describes. */
|
|
18
18
|
GetResource(_query) {}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Whether the resource this constructor builds may stay in the cache once
|
|
22
|
+
* nothing holds it.
|
|
23
|
+
*
|
|
24
|
+
* Not Carbon: Carbon inserts every dynamic resource with
|
|
25
|
+
* `CACHING_NOT_ALLOWED` (`BlueResMan.cpp:233`) because it rebuilds from local
|
|
26
|
+
* disk. We pay a network fetch and a decode, so each constructor says what its
|
|
27
|
+
* resource costs to rebuild. The default is Carbon's.
|
|
28
|
+
*
|
|
29
|
+
* @returns {boolean} True to keep the resource cached after release.
|
|
30
|
+
*/
|
|
31
|
+
IsCacheable() {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
19
34
|
}
|
|
20
35
|
CjsSchema.decorateMethod(IBlueDynamicResourceConstructor, "GetResource", compose.abstract, impl.abstract);
|
|
36
|
+
CjsSchema.decorateMethod(IBlueDynamicResourceConstructor, "IsCacheable", impl.custom);
|
|
21
37
|
CjsSchema.define(IBlueDynamicResourceConstructor, {
|
|
22
38
|
className: "IBlueDynamicResourceConstructor",
|
|
23
39
|
carbon: "IBlueDynamicResourceConstructor",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IBlueDynamicResourceConstructor.js","sources":["../../../../src/global/blue/IBlueDynamicResourceConstructor.js"],"sourcesContent":["// Source: blue/include/IBlueResMan.h:39-44\n//\n// The factory behind a `dynamic:/<name>/<query>` path. The manager knows\n// nothing about what it builds: the thing that knows registers itself, as\n// Carbon's procedural textures do from their own files -\n// `BeResMan->RegisterResourceConstructor( L\"gradient_1d\", this )`\n// (`Resources/Procedural/GradientTexture.cpp:35`) and `L\"color\"`\n// (`SolidColorTexture.cpp:21`).\n//\n// Declared beside IBlueResMan in Carbon's one header; here it takes its own\n// file, because a class is found by its own name.\nimport { CjsSchema, compose, impl } from \"#schema\";\n\n/** `IBlueDynamicResourceConstructor` - builds a resource for a `dynamic:/<name>` path. */\nexport class IBlueDynamicResourceConstructor\n{\n /** `GetResource` - construct the resource this query describes. */\n GetResource(_query) {}\n}\n\nCjsSchema.decorateMethod(IBlueDynamicResourceConstructor, \"GetResource\", compose.abstract, impl.abstract);\nCjsSchema.define(IBlueDynamicResourceConstructor, {\n className: \"IBlueDynamicResourceConstructor\", carbon: \"IBlueDynamicResourceConstructor\", family: \"blue\", fields: {}\n});\n"],"names":["IBlueDynamicResourceConstructor","GetResource","_query","CjsSchema","decorateMethod","compose","abstract","impl","define","className","carbon","family","fields"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACO,MAAMA,+BAA+B,CAC5C;AACE;EACAC,WAAWA,CAACC,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"IBlueDynamicResourceConstructor.js","sources":["../../../../src/global/blue/IBlueDynamicResourceConstructor.js"],"sourcesContent":["// Source: blue/include/IBlueResMan.h:39-44\n//\n// The factory behind a `dynamic:/<name>/<query>` path. The manager knows\n// nothing about what it builds: the thing that knows registers itself, as\n// Carbon's procedural textures do from their own files -\n// `BeResMan->RegisterResourceConstructor( L\"gradient_1d\", this )`\n// (`Resources/Procedural/GradientTexture.cpp:35`) and `L\"color\"`\n// (`SolidColorTexture.cpp:21`).\n//\n// Declared beside IBlueResMan in Carbon's one header; here it takes its own\n// file, because a class is found by its own name.\nimport { CjsSchema, compose, impl } from \"#schema\";\n\n/** `IBlueDynamicResourceConstructor` - builds a resource for a `dynamic:/<name>` path. */\nexport class IBlueDynamicResourceConstructor\n{\n /** `GetResource` - construct the resource this query describes. */\n GetResource(_query) {}\n\n /**\n * Whether the resource this constructor builds may stay in the cache once\n * nothing holds it.\n *\n * Not Carbon: Carbon inserts every dynamic resource with\n * `CACHING_NOT_ALLOWED` (`BlueResMan.cpp:233`) because it rebuilds from local\n * disk. We pay a network fetch and a decode, so each constructor says what its\n * resource costs to rebuild. The default is Carbon's.\n *\n * @returns {boolean} True to keep the resource cached after release.\n */\n IsCacheable() {\n return false;\n }\n}\n\nCjsSchema.decorateMethod(IBlueDynamicResourceConstructor, \"GetResource\", compose.abstract, impl.abstract);\nCjsSchema.decorateMethod(IBlueDynamicResourceConstructor, \"IsCacheable\", impl.custom);\nCjsSchema.define(IBlueDynamicResourceConstructor, {\n className: \"IBlueDynamicResourceConstructor\", carbon: \"IBlueDynamicResourceConstructor\", family: \"blue\", fields: {}\n});\n"],"names":["IBlueDynamicResourceConstructor","GetResource","_query","IsCacheable","CjsSchema","decorateMethod","compose","abstract","impl","custom","define","className","carbon","family","fields"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACO,MAAMA,+BAA+B,CAC5C;AACE;EACAC,WAAWA,CAACC,MAAM,EAAE,CAAC;;AAErB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,WAAWA,GAAG;AACZ,IAAA,OAAO,KAAK;AACd,EAAA;AACF;AAEAC,SAAS,CAACC,cAAc,CAACL,+BAA+B,EAAE,aAAa,EAAEM,OAAO,CAACC,QAAQ,EAAEC,IAAI,CAACD,QAAQ,CAAC;AACzGH,SAAS,CAACC,cAAc,CAACL,+BAA+B,EAAE,aAAa,EAAEQ,IAAI,CAACC,MAAM,CAAC;AACrFL,SAAS,CAACM,MAAM,CAACV,+BAA+B,EAAE;AAChDW,EAAAA,SAAS,EAAE,iCAAiC;AAAEC,EAAAA,MAAM,EAAE,iCAAiC;AAAEC,EAAAA,MAAM,EAAE,MAAM;AAAEC,EAAAA,MAAM,EAAE;AACnH,CAAC,CAAC;;;;"}
|
package/dist/global/blue/blue.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IBlueResMan } from './IBlueResMan.js';
|
|
2
2
|
import { CjsBluePaths } from './CjsBluePaths.js';
|
|
3
3
|
import { CjsBlueOS } from './CjsBlueOS.js';
|
|
4
|
+
import { BlueClasses } from './BlueClasses.js';
|
|
4
5
|
import { blueEnums } from './enums/CjsBlueEnumRegistry.js';
|
|
5
6
|
|
|
6
7
|
// Source: blue/include/IBlueResMan.h:135, blue/include/IBluePaths.h:49,
|
|
@@ -36,7 +37,7 @@ import { blueEnums } from './enums/CjsBlueEnumRegistry.js';
|
|
|
36
37
|
// failing later on a null. One CarbonEngineJS per page; see
|
|
37
38
|
// /docs/internal/decisions/composition-root-is-the-wrapper.md.
|
|
38
39
|
|
|
39
|
-
/** Carbon's process-wide Blue facilities: `blue.resMan`, `blue.paths` and `blue.
|
|
40
|
+
/** Carbon's process-wide Blue facilities: `blue.resMan`, `blue.paths`, `blue.os` and `blue.classes`. */
|
|
40
41
|
const blue = {
|
|
41
42
|
/** EnumRegistration and BlueEnum responsibilities combined for JavaScript. */
|
|
42
43
|
enums: blueEnums,
|
|
@@ -54,7 +55,12 @@ const blue = {
|
|
|
54
55
|
// clock the whole render path reads. Composed like the others, and answering
|
|
55
56
|
// truthfully before anything composes it - see CjsBlueOS.
|
|
56
57
|
/** `BeOS` (IBlueOS.h:226) - the clock, the pump, and the tick registry. */
|
|
57
|
-
os: new CjsBlueOS()
|
|
58
|
+
os: new CjsBlueOS(),
|
|
59
|
+
// The class registry. Like paths it answers truthfully uncomposed: nothing
|
|
60
|
+
// registered means nothing found, which is Carbon's answer too. It is how a
|
|
61
|
+
// layer builds a class another layer owns without importing it.
|
|
62
|
+
/** `BeClasses` (blueexposure/BlueClasses.cpp:28) - class registration and creation by name. */
|
|
63
|
+
classes: new BlueClasses()
|
|
58
64
|
};
|
|
59
65
|
|
|
60
66
|
export { blue };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blue.js","sources":["../../../../src/global/blue/blue.js"],"sourcesContent":["// Source: blue/include/IBlueResMan.h:135, blue/include/IBluePaths.h:49,\n// blue/include/IBlueOS.h:226\n//\n// Carbon's process-wide Blue facilities, which it declares as externs beside\n// the interfaces they point at:\n//\n// extern BLUEIMPORT IBlueResMan* BeResMan;\n// extern BLUEIMPORT IBluePaths* BePaths;\n// extern BLUEIMPORT IBlueOS* BeOS;\n//\n// `Be` is Blue, so `BeResMan` is `blue.resMan` with the prefix spelled out.\n//\n// WHY A HOLDER RATHER THAN EXPORTED SERVICES. Reach a service THROUGH `blue`\n// and never capture it: `blue.resMan.GetResource(...)`, not\n// `const resMan = blue.resMan` at module scope. The holder owns the reference,\n// so whatever sits behind it can be replaced at any time - a stub, a recording\n// manager, one with a different cache - without anyone's cooperation. ccpwgl\n// had this right on `tw2` and lost it by re-exporting `resMan` and `device` as\n// module bindings, after which 120 files held the implementation directly:\n// that one shortcut fixed the instance count at one AND gave away the\n// swappability the arrangement existed to provide.\n//\n// WHY IT IMPORTS NOTHING BUT ITS OWN INTERFACES. A holder that constructs\n// nothing has no dependency on what it holds, so every layer may read it\n// without the import cycle ccpwgl pays for (`global` imports the root, the\n// root constructs the services, the services import `global`). Composition\n// fills the slots from above.\n//\n// The slots are never empty. Each starts as its interface, whose methods\n// throw, so a call before composition says so at the call site instead of\n// failing later on a null. One CarbonEngineJS per page; see\n// /docs/internal/decisions/composition-root-is-the-wrapper.md.\nimport { IBlueResMan } from \"./IBlueResMan.js\";\nimport { CjsBluePaths } from \"./CjsBluePaths.js\";\nimport { CjsBlueOS } from \"./CjsBlueOS.js\";\nimport { blueEnums } from \"./enums/CjsBlueEnumRegistry.js\";\n\n/** Carbon's process-wide Blue facilities: `blue.resMan`, `blue.paths` and `blue.
|
|
1
|
+
{"version":3,"file":"blue.js","sources":["../../../../src/global/blue/blue.js"],"sourcesContent":["// Source: blue/include/IBlueResMan.h:135, blue/include/IBluePaths.h:49,\n// blue/include/IBlueOS.h:226\n//\n// Carbon's process-wide Blue facilities, which it declares as externs beside\n// the interfaces they point at:\n//\n// extern BLUEIMPORT IBlueResMan* BeResMan;\n// extern BLUEIMPORT IBluePaths* BePaths;\n// extern BLUEIMPORT IBlueOS* BeOS;\n//\n// `Be` is Blue, so `BeResMan` is `blue.resMan` with the prefix spelled out.\n//\n// WHY A HOLDER RATHER THAN EXPORTED SERVICES. Reach a service THROUGH `blue`\n// and never capture it: `blue.resMan.GetResource(...)`, not\n// `const resMan = blue.resMan` at module scope. The holder owns the reference,\n// so whatever sits behind it can be replaced at any time - a stub, a recording\n// manager, one with a different cache - without anyone's cooperation. ccpwgl\n// had this right on `tw2` and lost it by re-exporting `resMan` and `device` as\n// module bindings, after which 120 files held the implementation directly:\n// that one shortcut fixed the instance count at one AND gave away the\n// swappability the arrangement existed to provide.\n//\n// WHY IT IMPORTS NOTHING BUT ITS OWN INTERFACES. A holder that constructs\n// nothing has no dependency on what it holds, so every layer may read it\n// without the import cycle ccpwgl pays for (`global` imports the root, the\n// root constructs the services, the services import `global`). Composition\n// fills the slots from above.\n//\n// The slots are never empty. Each starts as its interface, whose methods\n// throw, so a call before composition says so at the call site instead of\n// failing later on a null. One CarbonEngineJS per page; see\n// /docs/internal/decisions/composition-root-is-the-wrapper.md.\nimport { IBlueResMan } from \"./IBlueResMan.js\";\nimport { CjsBluePaths } from \"./CjsBluePaths.js\";\nimport { CjsBlueOS } from \"./CjsBlueOS.js\";\nimport { BlueClasses } from \"./BlueClasses.js\";\nimport { blueEnums } from \"./enums/CjsBlueEnumRegistry.js\";\n\n/** Carbon's process-wide Blue facilities: `blue.resMan`, `blue.paths`, `blue.os` and `blue.classes`. */\nexport const blue = {\n /** EnumRegistration and BlueEnum responsibilities combined for JavaScript. */\n enums: blueEnums,\n /** `BeResMan` (IBlueResMan.h:135) - the resource manager every consumer asks. */\n resMan: new IBlueResMan(),\n\n // Paths differs from the manager: an uncomposed one can still answer its\n // main question truthfully - no, that file is not here - which is what\n // Carbon returns for a file absent from the local machine, and what every\n // caller is already written for. The verbs it cannot answer without a real\n // file system stay refused. See CjsBluePaths.\n /** `BePaths` (IBluePaths.h:49) - search paths, resolution, existence and streams. */\n paths: new CjsBluePaths(),\n\n // The OS is the ROOT CLOCK, and the reason this slot matters beyond time:\n // its pump is what calls TriDevice.OnTick, which advances the animation\n // clock the whole render path reads. Composed like the others, and answering\n // truthfully before anything composes it - see CjsBlueOS.\n /** `BeOS` (IBlueOS.h:226) - the clock, the pump, and the tick registry. */\n os: new CjsBlueOS(),\n\n // The class registry. Like paths it answers truthfully uncomposed: nothing\n // registered means nothing found, which is Carbon's answer too. It is how a\n // layer builds a class another layer owns without importing it.\n /** `BeClasses` (blueexposure/BlueClasses.cpp:28) - class registration and creation by name. */\n classes: new BlueClasses()\n};\n"],"names":["blue","enums","blueEnums","resMan","IBlueResMan","paths","CjsBluePaths","os","CjsBlueOS","classes","BlueClasses"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACO,MAAMA,IAAI,GAAG;AAClB;AACAC,EAAAA,KAAK,EAAEC,SAAS;AAChB;AACAC,EAAAA,MAAM,EAAE,IAAIC,WAAW,EAAE;AAEzB;AACA;AACA;AACA;AACA;AACA;AACAC,EAAAA,KAAK,EAAE,IAAIC,YAAY,EAAE;AAEzB;AACA;AACA;AACA;AACA;AACAC,EAAAA,EAAE,EAAE,IAAIC,SAAS,EAAE;AAEnB;AACA;AACA;AACA;EACAC,OAAO,EAAE,IAAIC,WAAW;AAC1B;;;;"}
|
|
@@ -16,6 +16,8 @@ export { IListNotify } from './IListNotify.js';
|
|
|
16
16
|
export { INotify, IsMatch } from './INotify.js';
|
|
17
17
|
export { CjsBluePaths } from './CjsBluePaths.js';
|
|
18
18
|
export { IBluePaths } from './IBluePaths.js';
|
|
19
|
+
export { IBlueClasses } from './IBlueClasses.js';
|
|
20
|
+
export { BlueClasses } from './BlueClasses.js';
|
|
19
21
|
export { blue } from './blue.js';
|
|
20
22
|
export { CjsBlueEnumRegistry, EnumRegistrationType } from './enums/CjsBlueEnumRegistry.js';
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -7,7 +7,6 @@ export { AudioChannelLayout, AudioSampleFormat, normalizeAudioSampleFormat } fro
|
|
|
7
7
|
export { ShaderModel, ShaderStage, normalizeShaderStage } from './shader/shaderStages.js';
|
|
8
8
|
export { DxgiFormat, normalizeDxgiFormat } from './d3d/dxgiFormats.js';
|
|
9
9
|
export { D3dPrimitiveTopology } from './d3d/primitiveTopology.js';
|
|
10
|
-
export { CarbonPixelFormatToWebGpu, DxgiFormatToPixelFormat, GpuTextureFormat, PixelFormatToWebGpu, SrgbSiblingOf, dxgiToPixelFormat, toWebGpuTextureFormat } from './webgpu/textureFormats.js';
|
|
11
10
|
export { BLUEERROR, BLUELISTEVENT } from './blue.js';
|
|
12
11
|
export { Tr2Lod } from './trinity.js';
|
|
13
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -153,53 +153,54 @@ const COMPRESSED_FORMATS = new Set([PixelFormat.PIXEL_FORMAT_BC1_TYPELESS, Pixel
|
|
|
153
153
|
/** Eight-byte block formats; every other compressed format is sixteen. */
|
|
154
154
|
const EIGHT_BYTE_BLOCK_FORMATS = new Set([PixelFormat.PIXEL_FORMAT_BC1_TYPELESS, PixelFormat.PIXEL_FORMAT_BC1_UNORM, PixelFormat.PIXEL_FORMAT_BC1_UNORM_SRGB, PixelFormat.PIXEL_FORMAT_BC4_TYPELESS, PixelFormat.PIXEL_FORMAT_BC4_UNORM, PixelFormat.PIXEL_FORMAT_BC4_SNORM]);
|
|
155
155
|
|
|
156
|
-
/**
|
|
157
|
-
* Whether a format stores blocks rather than pixels.
|
|
158
|
-
*
|
|
159
|
-
* @param {number} format A `PixelFormat` value.
|
|
160
|
-
* @returns {boolean} True for the BC family.
|
|
156
|
+
/**
|
|
157
|
+
* Whether a format stores blocks rather than pixels.
|
|
158
|
+
*
|
|
159
|
+
* @param {number} format A `PixelFormat` value.
|
|
160
|
+
* @returns {boolean} True for the BC family.
|
|
161
161
|
*/
|
|
162
162
|
function IsCompressedFormat(format) {
|
|
163
163
|
return COMPRESSED_FORMATS.has(format);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
/**
|
|
167
|
-
* Bytes in one compressed block, or 0 when the format is not a block image.
|
|
168
|
-
*
|
|
169
|
-
* @param {number} format A `PixelFormat` value.
|
|
170
|
-
* @returns {number} Block size in bytes.
|
|
166
|
+
/**
|
|
167
|
+
* Bytes in one compressed block, or 0 when the format is not a block image.
|
|
168
|
+
*
|
|
169
|
+
* @param {number} format A `PixelFormat` value.
|
|
170
|
+
* @returns {number} Block size in bytes.
|
|
171
171
|
*/
|
|
172
172
|
function GetBlockByteSize(format) {
|
|
173
173
|
if (!COMPRESSED_FORMATS.has(format)) return 0;
|
|
174
174
|
return EIGHT_BYTE_BLOCK_FORMATS.has(format) ? 8 : 16;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
// CARBON'S TABLE,
|
|
178
|
-
//
|
|
179
|
-
// (`PixelFormat.h:
|
|
180
|
-
//
|
|
181
|
-
|
|
177
|
+
// CARBON'S TABLE, WITH ONE FIX. diverged: Carbon lists the R32G32B32 formats
|
|
178
|
+
// with the four-channel ones, so they report 16 bytes rather than 12
|
|
179
|
+
// (`PixelFormat.h:211-215`), and every size, pitch and offset for them is wrong.
|
|
180
|
+
// Fixed here (operator, 2026-09-22); reported upstream as issue 5 in
|
|
181
|
+
// /docs/research/carbon-imageio-issue.md.
|
|
182
|
+
const BYTES_PER_PIXEL = new Map([[16, [PixelFormat.PIXEL_FORMAT_R32G32B32A32_TYPELESS, PixelFormat.PIXEL_FORMAT_R32G32B32A32_FLOAT, PixelFormat.PIXEL_FORMAT_R32G32B32A32_UINT, PixelFormat.PIXEL_FORMAT_R32G32B32A32_SINT]], [12, [PixelFormat.PIXEL_FORMAT_R32G32B32_TYPELESS, PixelFormat.PIXEL_FORMAT_R32G32B32_FLOAT, PixelFormat.PIXEL_FORMAT_R32G32B32_UINT, PixelFormat.PIXEL_FORMAT_R32G32B32_SINT]], [8, [PixelFormat.PIXEL_FORMAT_R16G16B16A16_TYPELESS, PixelFormat.PIXEL_FORMAT_R16G16B16A16_FLOAT, PixelFormat.PIXEL_FORMAT_R16G16B16A16_UNORM, PixelFormat.PIXEL_FORMAT_R16G16B16A16_UINT, PixelFormat.PIXEL_FORMAT_R16G16B16A16_SNORM, PixelFormat.PIXEL_FORMAT_R16G16B16A16_SINT, PixelFormat.PIXEL_FORMAT_R32G32_TYPELESS, PixelFormat.PIXEL_FORMAT_R32G32_FLOAT, PixelFormat.PIXEL_FORMAT_R32G32_UINT, PixelFormat.PIXEL_FORMAT_R32G32_SINT, PixelFormat.PIXEL_FORMAT_R32G8X24_TYPELESS, PixelFormat.PIXEL_FORMAT_D32_FLOAT_S8X24_UINT, PixelFormat.PIXEL_FORMAT_R32_FLOAT_X8X24_TYPELESS, PixelFormat.PIXEL_FORMAT_X32_TYPELESS_G8X24_UINT]], [4, [PixelFormat.PIXEL_FORMAT_R10G10B10A2_TYPELESS, PixelFormat.PIXEL_FORMAT_R10G10B10A2_UNORM, PixelFormat.PIXEL_FORMAT_R10G10B10A2_UINT, PixelFormat.PIXEL_FORMAT_R11G11B10_FLOAT, PixelFormat.PIXEL_FORMAT_R8G8B8A8_TYPELESS, PixelFormat.PIXEL_FORMAT_R8G8B8A8_UNORM, PixelFormat.PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB, PixelFormat.PIXEL_FORMAT_R8G8B8A8_UINT, PixelFormat.PIXEL_FORMAT_R8G8B8A8_SNORM, PixelFormat.PIXEL_FORMAT_R8G8B8A8_SINT, PixelFormat.PIXEL_FORMAT_R16G16_TYPELESS, PixelFormat.PIXEL_FORMAT_R16G16_FLOAT, PixelFormat.PIXEL_FORMAT_R16G16_UNORM, PixelFormat.PIXEL_FORMAT_R16G16_UINT, PixelFormat.PIXEL_FORMAT_R16G16_SNORM, PixelFormat.PIXEL_FORMAT_R16G16_SINT, PixelFormat.PIXEL_FORMAT_R32_TYPELESS, PixelFormat.PIXEL_FORMAT_D32_FLOAT, PixelFormat.PIXEL_FORMAT_R32_FLOAT, PixelFormat.PIXEL_FORMAT_R32_UINT, PixelFormat.PIXEL_FORMAT_R32_SINT, PixelFormat.PIXEL_FORMAT_R24G8_TYPELESS, PixelFormat.PIXEL_FORMAT_D24_UNORM_S8_UINT, PixelFormat.PIXEL_FORMAT_R24_UNORM_X8_TYPELESS, PixelFormat.PIXEL_FORMAT_X24_TYPELESS_G8_UINT, PixelFormat.PIXEL_FORMAT_R9G9B9E5_SHAREDEXP, PixelFormat.PIXEL_FORMAT_R8G8_B8G8_UNORM, PixelFormat.PIXEL_FORMAT_G8R8_G8B8_UNORM, PixelFormat.PIXEL_FORMAT_B8G8R8A8_UNORM, PixelFormat.PIXEL_FORMAT_B8G8R8X8_UNORM, PixelFormat.PIXEL_FORMAT_R10G10B10_XR_BIAS_A2_UNORM, PixelFormat.PIXEL_FORMAT_B8G8R8A8_TYPELESS, PixelFormat.PIXEL_FORMAT_B8G8R8A8_UNORM_SRGB, PixelFormat.PIXEL_FORMAT_B8G8R8X8_TYPELESS, PixelFormat.PIXEL_FORMAT_B8G8R8X8_UNORM_SRGB]], [2, [PixelFormat.PIXEL_FORMAT_R8G8_TYPELESS, PixelFormat.PIXEL_FORMAT_R8G8_UNORM, PixelFormat.PIXEL_FORMAT_R8G8_UINT, PixelFormat.PIXEL_FORMAT_R8G8_SNORM, PixelFormat.PIXEL_FORMAT_R8G8_SINT, PixelFormat.PIXEL_FORMAT_R16_TYPELESS, PixelFormat.PIXEL_FORMAT_R16_FLOAT, PixelFormat.PIXEL_FORMAT_D16_UNORM, PixelFormat.PIXEL_FORMAT_R16_UNORM, PixelFormat.PIXEL_FORMAT_R16_UINT, PixelFormat.PIXEL_FORMAT_R16_SNORM, PixelFormat.PIXEL_FORMAT_R16_SINT, PixelFormat.PIXEL_FORMAT_B5G6R5_UNORM, PixelFormat.PIXEL_FORMAT_B5G5R5A1_UNORM]], [1, [PixelFormat.PIXEL_FORMAT_R8_TYPELESS, PixelFormat.PIXEL_FORMAT_R8_UNORM, PixelFormat.PIXEL_FORMAT_R8_UINT, PixelFormat.PIXEL_FORMAT_R8_SNORM, PixelFormat.PIXEL_FORMAT_R8_SINT, PixelFormat.PIXEL_FORMAT_A8_UNORM]]]);
|
|
182
183
|
const BYTES_BY_FORMAT = new Map();
|
|
183
184
|
for (const [bytes, formats] of BYTES_PER_PIXEL) {
|
|
184
185
|
for (const format of formats) BYTES_BY_FORMAT.set(format, bytes);
|
|
185
186
|
}
|
|
186
187
|
|
|
187
|
-
/**
|
|
188
|
-
* Bytes in one pixel, or 0 for a compressed or unknown format.
|
|
189
|
-
*
|
|
190
|
-
* @param {number} format A `PixelFormat` value.
|
|
191
|
-
* @returns {number} Size in bytes.
|
|
188
|
+
/**
|
|
189
|
+
* Bytes in one pixel, or 0 for a compressed or unknown format.
|
|
190
|
+
*
|
|
191
|
+
* @param {number} format A `PixelFormat` value.
|
|
192
|
+
* @returns {number} Size in bytes.
|
|
192
193
|
*/
|
|
193
194
|
function GetBytesPerPixel(format) {
|
|
194
195
|
const bytes = BYTES_BY_FORMAT.get(format);
|
|
195
196
|
return bytes === undefined ? 0 : bytes;
|
|
196
197
|
}
|
|
197
198
|
|
|
198
|
-
/**
|
|
199
|
-
* The canonical pixel-format STRING a texture payload carries
|
|
200
|
-
* (`graphics/pixelFormats.js`, what the DDS and image readers emit) to Carbon's
|
|
201
|
-
* numeric enum, which `Tr2BitmapDimensions` and every `Tr2TextureAL` speak.
|
|
202
|
-
* Typeless, depth and packed formats have no string and are absent.
|
|
199
|
+
/**
|
|
200
|
+
* The canonical pixel-format STRING a texture payload carries
|
|
201
|
+
* (`graphics/pixelFormats.js`, what the DDS and image readers emit) to Carbon's
|
|
202
|
+
* numeric enum, which `Tr2BitmapDimensions` and every `Tr2TextureAL` speak.
|
|
203
|
+
* Typeless, depth and packed formats have no string and are absent.
|
|
203
204
|
*/
|
|
204
205
|
const PixelFormatFromCanonical = Object.freeze({
|
|
205
206
|
"r8unorm": PixelFormat.PIXEL_FORMAT_R8_UNORM,
|