@carbonenginejs/runtime-resource 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +3 -2
- package/README.md +47 -6
- package/dist/CjsMotherLode.js +88 -88
- package/dist/CjsMotherLode.js.map +1 -1
- package/dist/CjsResMan.js +717 -228
- package/dist/CjsResMan.js.map +1 -1
- package/dist/CjsResManFetchProvider.js +94 -0
- package/dist/CjsResManFetchProvider.js.map +1 -0
- package/dist/{CjsResManQueue.js → CjsResManWorkQueue.js} +112 -25
- package/dist/CjsResManWorkQueue.js.map +1 -0
- package/dist/format/CjsBlueReader.js +89 -0
- package/dist/format/CjsBlueReader.js.map +1 -1
- package/dist/format/CjsFormat.js +42 -16
- package/dist/format/CjsFormat.js.map +1 -1
- package/dist/format/CjsReader.js +4 -0
- package/dist/format/CjsReader.js.map +1 -1
- package/dist/format/CjsResourceProbe.js +2 -0
- package/dist/format/CjsResourceProbe.js.map +1 -1
- package/dist/format/payloadContract.js +20 -0
- package/dist/format/payloadContract.js.map +1 -1
- package/dist/formats/black/CjsBlackFormat.js +15 -1
- package/dist/formats/black/CjsBlackFormat.js.map +1 -1
- package/dist/formats/black/core/CjsBlackBinaryReader.js +103 -0
- package/dist/formats/black/core/CjsBlackBinaryReader.js.map +1 -1
- package/dist/formats/black/core/CjsBlackPropertyReaders.js +61 -0
- package/dist/formats/black/core/CjsBlackPropertyReaders.js.map +1 -1
- package/dist/formats/black/core/CjsBlackReader.js +125 -0
- package/dist/formats/black/core/CjsBlackReader.js.map +1 -1
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js +103 -0
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js.map +1 -1
- package/dist/formats/black/core/helpers.js +17 -0
- package/dist/formats/black/core/helpers.js.map +1 -1
- package/dist/formats/bnk/CjsBnkFormat.js +8 -0
- package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/formats/bnk/core/helpers.js +20 -0
- package/dist/formats/bnk/core/helpers.js.map +1 -1
- package/dist/formats/bnk/core/musicNodes.js +40 -3
- package/dist/formats/bnk/core/musicNodes.js.map +1 -1
- package/dist/formats/bnk/core/soundbanksInfo.js +2 -0
- package/dist/formats/bnk/core/soundbanksInfo.js.map +1 -1
- package/dist/formats/cmf/core/binary.js +71 -0
- package/dist/formats/cmf/core/binary.js.map +1 -1
- package/dist/formats/cmf/core/buffers.js +4 -0
- package/dist/formats/cmf/core/buffers.js.map +1 -1
- package/dist/formats/cmf/core/helpers.js +31 -0
- package/dist/formats/cmf/core/helpers.js.map +1 -1
- package/dist/formats/cmf/core/schema.js +10 -0
- package/dist/formats/cmf/core/schema.js.map +1 -1
- package/dist/formats/cmf/core/shared.js +9 -0
- package/dist/formats/cmf/core/shared.js.map +1 -1
- package/dist/formats/cmf/core/writer.js +54 -0
- package/dist/formats/cmf/core/writer.js.map +1 -1
- package/dist/formats/dds/core/bc6h.js +10 -0
- package/dist/formats/dds/core/bc6h.js.map +1 -1
- package/dist/formats/dds/core/bc7.js +16 -0
- package/dist/formats/dds/core/bc7.js.map +1 -1
- package/dist/formats/dds/core/helpers.js +47 -0
- package/dist/formats/dds/core/helpers.js.map +1 -1
- package/dist/formats/fbx/core/helpers.js +21 -0
- package/dist/formats/fbx/core/helpers.js.map +1 -1
- package/dist/formats/flac/CjsFlacFormat.js +49 -0
- package/dist/formats/flac/CjsFlacFormat.js.map +1 -1
- package/dist/formats/flac/core/helpers.js +20 -0
- package/dist/formats/flac/core/helpers.js.map +1 -1
- package/dist/formats/gif/CjsGifFormat.js +49 -0
- package/dist/formats/gif/CjsGifFormat.js.map +1 -1
- package/dist/formats/gif/core/helpers.js +20 -0
- package/dist/formats/gif/core/helpers.js.map +1 -1
- package/dist/formats/gltf/core/helpers.js +15 -0
- package/dist/formats/gltf/core/helpers.js.map +1 -1
- package/dist/formats/gltf/core/parser.js +13 -0
- package/dist/formats/gltf/core/parser.js.map +1 -1
- package/dist/formats/gltf/core/targets.js +10 -0
- package/dist/formats/gltf/core/targets.js.map +1 -1
- package/dist/formats/gr2/core/bitknit2.js +2 -0
- package/dist/formats/gr2/core/bitknit2.js.map +1 -1
- package/dist/formats/gr2/core/helpers.js +20 -0
- package/dist/formats/gr2/core/helpers.js.map +1 -1
- package/dist/formats/gr2/core/targets.js +10 -0
- package/dist/formats/gr2/core/targets.js.map +1 -1
- package/dist/formats/jpeg/core/helpers.js +52 -0
- package/dist/formats/jpeg/core/helpers.js.map +1 -1
- package/dist/formats/jpeg/core/jpeg.js +93 -0
- package/dist/formats/jpeg/core/jpeg.js.map +1 -1
- package/dist/formats/mp3/core/helpers.js +37 -0
- package/dist/formats/mp3/core/helpers.js.map +1 -1
- package/dist/formats/mp4/core/helpers.js +35 -0
- package/dist/formats/mp4/core/helpers.js.map +1 -1
- package/dist/formats/ogg/CjsOggFormat.js +49 -0
- package/dist/formats/ogg/CjsOggFormat.js.map +1 -1
- package/dist/formats/ogg/core/helpers.js +23 -0
- package/dist/formats/ogg/core/helpers.js.map +1 -1
- package/dist/formats/ogg/core/vorbis.js +13 -0
- package/dist/formats/ogg/core/vorbis.js.map +1 -1
- package/dist/formats/png/core/helpers.js +52 -0
- package/dist/formats/png/core/helpers.js.map +1 -1
- package/dist/formats/red/CjsRedFormat.js +2 -0
- package/dist/formats/red/CjsRedFormat.js.map +1 -1
- package/dist/formats/red/core/CjsRedReader.js +52 -0
- package/dist/formats/red/core/CjsRedReader.js.map +1 -1
- package/dist/formats/red/core/helpers.js +19 -0
- package/dist/formats/red/core/helpers.js.map +1 -1
- package/dist/formats/stl/core/stl.js +8 -0
- package/dist/formats/stl/core/stl.js.map +1 -1
- package/dist/formats/stl/core/targets.js +10 -0
- package/dist/formats/stl/core/targets.js.map +1 -1
- package/dist/formats/tga/core/helpers.js +47 -0
- package/dist/formats/tga/core/helpers.js.map +1 -1
- package/dist/formats/wav/core/helpers.js +37 -0
- package/dist/formats/wav/core/helpers.js.map +1 -1
- package/dist/formats/webm/core/helpers.js +35 -0
- package/dist/formats/webm/core/helpers.js.map +1 -1
- package/dist/formats/webp/CjsWebpFormat.js +49 -0
- package/dist/formats/webp/CjsWebpFormat.js.map +1 -1
- package/dist/formats/webp/core/helpers.js +23 -0
- package/dist/formats/webp/core/helpers.js.map +1 -1
- package/dist/formats/wem/CjsWemFormat.js +8 -0
- package/dist/formats/wem/CjsWemFormat.js.map +1 -1
- package/dist/formats/wem/core/bitStream.js +2 -0
- package/dist/formats/wem/core/bitStream.js.map +1 -1
- package/dist/formats/wem/core/helpers.js +20 -0
- package/dist/formats/wem/core/helpers.js.map +1 -1
- package/dist/formats/yaml/CjsYamlFormat.js +45 -0
- package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
- package/dist/formats/yaml/core/CjsYamlReader.js +91 -0
- package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -1
- package/dist/formats/yaml/core/helpers.js +10 -0
- package/dist/formats/yaml/core/helpers.js.map +1 -1
- package/dist/index.js +56 -43
- package/dist/index.js.map +1 -1
- package/dist/{CjsResource.js → resource/CjsResource.js} +232 -17
- package/dist/resource/CjsResource.js.map +1 -0
- package/dist/{resources → resource}/Tr2LightProfileRes.js +4 -3
- package/dist/resource/Tr2LightProfileRes.js.map +1 -0
- package/dist/{resources → resource/audio}/AudioGeometryResData.js +1 -1
- package/dist/resource/audio/AudioGeometryResData.js.map +1 -0
- package/dist/resource/audio/CjsAudioBufferRes.js +86 -0
- package/dist/resource/audio/CjsAudioBufferRes.js.map +1 -0
- package/dist/resource/audio/CjsAudioRes.js +213 -0
- package/dist/resource/audio/CjsAudioRes.js.map +1 -0
- package/dist/resource/audio/index.js +4 -0
- package/dist/resource/audio/index.js.map +1 -0
- package/dist/{resources → resource/geometry}/MeshDecalData.js +1 -1
- package/dist/resource/geometry/MeshDecalData.js.map +1 -0
- package/dist/{resources → resource/geometry}/MeshDecalLodData.js +1 -1
- package/dist/resource/geometry/MeshDecalLodData.js.map +1 -0
- package/dist/resource/geometry/TriGeometryRes.js +656 -0
- package/dist/resource/geometry/TriGeometryRes.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResAreaData.js +1 -1
- package/dist/resource/geometry/TriGeometryResAreaData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResJointData.js +1 -1
- package/dist/resource/geometry/TriGeometryResJointData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResLodData.js +1 -1
- package/dist/resource/geometry/TriGeometryResLodData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResMeshData.js +1 -1
- package/dist/resource/geometry/TriGeometryResMeshData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResSkeletonData.js +1 -1
- package/dist/resource/geometry/TriGeometryResSkeletonData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriJointBinding.js +1 -1
- package/dist/resource/geometry/TriJointBinding.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriMorphTargetGeometryConstants.js +1 -1
- package/dist/resource/geometry/TriMorphTargetGeometryConstants.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriRtGeometryConstants.js +1 -1
- package/dist/resource/geometry/TriRtGeometryConstants.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/GStateBindingCallbackData.js +1 -1
- package/dist/resource/geometry/granny/GStateBindingCallbackData.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/Tr2GrannyIntersectionResult.js +1 -1
- package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/Tr2GrannyStateRes.js +6 -5
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/TriGrannyRes.js +6 -5
- package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/enums.js +1 -9
- package/dist/resource/geometry/granny/enums.js.map +1 -0
- package/dist/resource/geometry/granny/index.js +6 -0
- package/dist/resource/geometry/granny/index.js.map +1 -0
- package/dist/resource/geometry/index.js +17 -0
- package/dist/resource/geometry/index.js.map +1 -0
- package/dist/resource/index.js +52 -0
- package/dist/resource/index.js.map +1 -0
- package/dist/resource/resourceBoundary.js +64 -0
- package/dist/resource/resourceBoundary.js.map +1 -0
- package/dist/resource/shader/Tr2EffectRes.js +420 -0
- package/dist/resource/shader/Tr2EffectRes.js.map +1 -0
- package/dist/{resources → resource/shader}/Tr2MaterialArea.js +9 -4
- package/dist/resource/shader/Tr2MaterialArea.js.map +1 -0
- package/dist/{resources → resource/shader}/Tr2MaterialMesh.js +8 -3
- package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -0
- package/dist/{resources → resource/shader}/Tr2MaterialRes.js +10 -4
- package/dist/resource/shader/Tr2MaterialRes.js.map +1 -0
- package/dist/resource/shader/Tr2Shader.js +250 -0
- package/dist/resource/shader/Tr2Shader.js.map +1 -0
- package/dist/{resources → resource/shader}/Tr2ShaderPermutation.js +13 -7
- package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -0
- package/dist/resource/shader/index.js +17 -0
- package/dist/resource/shader/index.js.map +1 -0
- package/dist/resource/shader/portable.js +33 -0
- package/dist/resource/shader/portable.js.map +1 -0
- package/dist/resource/shader/portableValidation.js +461 -0
- package/dist/resource/shader/portableValidation.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectConstant.js +100 -0
- package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectDefine.js +34 -0
- package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectDescription.js +113 -0
- package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js +141 -0
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +107 -0
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectResource.js +90 -0
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js +235 -0
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js +71 -0
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2Pass.js +111 -0
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -0
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js +80 -0
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -0
- package/dist/{texture → resource/texture}/CjsTextureArrayRes.js +83 -6
- package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -0
- package/dist/{texture/CjsTextureParameterProxy.js → resource/texture/CjsTextureArrayResParameterProxy.js} +56 -10
- package/dist/resource/texture/CjsTextureArrayResParameterProxy.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2ImageRes.js +6 -4
- package/dist/resource/texture/Tr2ImageRes.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TextureLodManager.js +3 -1
- package/dist/resource/texture/Tr2TextureLodManager.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TextureLodUpdateRequest.js +1 -1
- package/dist/resource/texture/Tr2TextureLodUpdateRequest.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePackChannel.js +1 -1
- package/dist/resource/texture/Tr2TexturePackChannel.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipeline.js +6 -4
- package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineParams.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineParams.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepCompress.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepGenerateMips.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepLimitSize.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepLoad.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepPack.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -0
- package/dist/{resources → resource/texture}/TriTextureRes.js +42 -26
- package/dist/resource/texture/TriTextureRes.js.map +1 -0
- package/dist/resource/texture/index.js +15 -0
- package/dist/resource/texture/index.js.map +1 -0
- package/dist/{resources → resource/texture}/texturePipelineBehavior.js +59 -59
- package/dist/resource/texture/texturePipelineBehavior.js.map +1 -0
- package/dist/worker/CjsResManMainThreadLoader.js +87 -0
- package/dist/worker/CjsResManMainThreadLoader.js.map +1 -0
- package/dist/worker/CjsResManWorker.js +217 -0
- package/dist/worker/CjsResManWorker.js.map +1 -0
- package/dist/worker/CjsResManWorkerLoader.js +434 -0
- package/dist/worker/CjsResManWorkerLoader.js.map +1 -0
- package/dist/worker/protocol.js +12 -0
- package/dist/worker/protocol.js.map +1 -0
- package/docs/README.md +16 -3
- package/docs/architecture.md +39 -16
- package/docs/concepts/resource-lifecycle.md +2 -1
- package/docs/formats/README.md +4 -0
- package/docs/reference/classes/README.md +6 -4
- package/docs/reference/classes/audio.md +30 -0
- package/docs/reference/classes/core.md +31 -11
- package/docs/reference/classes/resources.md +151 -41
- package/docs/reference/classes/texture.md +7 -7
- package/docs/reference/motherlode-cache.md +17 -0
- package/docs/reference/queues.md +9 -1
- package/docs/reference/workers.md +135 -0
- package/docs/roadmap.md +27 -1
- package/package.json +8 -1
- package/dist/CjsResManQueue.js.map +0 -1
- package/dist/CjsResource.js.map +0 -1
- package/dist/CjsResourceSource.js +0 -68
- package/dist/CjsResourceSource.js.map +0 -1
- package/dist/resourcePath.js +0 -18
- package/dist/resourcePath.js.map +0 -1
- package/dist/resourceStates.js +0 -9
- package/dist/resourceStates.js.map +0 -1
- package/dist/resources/AudioGeometryResData.js.map +0 -1
- package/dist/resources/GStateBindingCallbackData.js.map +0 -1
- package/dist/resources/MeshDecalData.js.map +0 -1
- package/dist/resources/MeshDecalLodData.js.map +0 -1
- package/dist/resources/Tr2EffectRes.js +0 -71
- package/dist/resources/Tr2EffectRes.js.map +0 -1
- package/dist/resources/Tr2GrannyIntersectionResult.js.map +0 -1
- package/dist/resources/Tr2GrannyStateRes.js.map +0 -1
- package/dist/resources/Tr2ImageRes.js.map +0 -1
- package/dist/resources/Tr2LightProfileRes.js.map +0 -1
- package/dist/resources/Tr2MaterialArea.js.map +0 -1
- package/dist/resources/Tr2MaterialMesh.js.map +0 -1
- package/dist/resources/Tr2MaterialRes.js.map +0 -1
- package/dist/resources/Tr2ShaderPermutation.js.map +0 -1
- package/dist/resources/Tr2TextureLodManager.js.map +0 -1
- package/dist/resources/Tr2TextureLodUpdateRequest.js.map +0 -1
- package/dist/resources/Tr2TexturePackChannel.js.map +0 -1
- package/dist/resources/Tr2TexturePipeline.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineParams.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepCompress.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepGenerateMips.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepLimitSize.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepLoad.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepPack.js.map +0 -1
- package/dist/resources/TriGeometryRes.js +0 -239
- package/dist/resources/TriGeometryRes.js.map +0 -1
- package/dist/resources/TriGeometryResAreaData.js.map +0 -1
- package/dist/resources/TriGeometryResJointData.js.map +0 -1
- package/dist/resources/TriGeometryResLodData.js.map +0 -1
- package/dist/resources/TriGeometryResMeshData.js.map +0 -1
- package/dist/resources/TriGeometryResSkeletonData.js.map +0 -1
- package/dist/resources/TriGrannyRes.js.map +0 -1
- package/dist/resources/TriJointBinding.js.map +0 -1
- package/dist/resources/TriMorphTargetGeometryConstants.js.map +0 -1
- package/dist/resources/TriRtGeometryConstants.js.map +0 -1
- package/dist/resources/TriTextureRes.js.map +0 -1
- package/dist/resources/enums.js.map +0 -1
- package/dist/resources/resourceBoundary.js +0 -47
- package/dist/resources/resourceBoundary.js.map +0 -1
- package/dist/resources/texturePipelineBehavior.js.map +0 -1
- package/dist/texture/CjsTextureArrayRes.js.map +0 -1
- package/dist/texture/CjsTextureParameterProxy.js.map +0 -1
package/docs/architecture.md
CHANGED
|
@@ -19,10 +19,13 @@ Engine adapters own device realization:
|
|
|
19
19
|
LOADED -> PREPARING -> PREPARED
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
The package selects and runs registered
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
The package selects and runs registered readers, hydrates or returns the
|
|
23
|
+
promised CPU outcome, and stores lifecycle state, cache entries, and loaded
|
|
24
|
+
payloads. For compiled effects it independently validates complete permutation
|
|
25
|
+
topology and the format package's plain portable reflection, selects a
|
|
26
|
+
permutation, and hydrates a canonical device-free `Tr2Shader` graph. It never
|
|
27
|
+
creates WebGL/WebGPU textures, buffers, shader modules, pipelines, or bind
|
|
28
|
+
groups, and it never inspects backend capability.
|
|
26
29
|
A realization failure destroys its candidate and returns the resource to
|
|
27
30
|
`LOADED` without discarding the valid CPU payload.
|
|
28
31
|
|
|
@@ -40,47 +43,67 @@ historical mapping.
|
|
|
40
43
|
- `CjsResMan` semantic resource construction, registered-format selection,
|
|
41
44
|
concurrency-limited source loading, staged prepare queues, layered
|
|
42
45
|
source/read/resource deduplication, object loader dispatch, and prefetch.
|
|
43
|
-
-
|
|
46
|
+
- Main-thread and browser-worker resource execution strategies, including
|
|
47
|
+
transferable fetch results and declared worker-safe CPU readers.
|
|
48
|
+
- `CjsTextureArrayRes` and `CjsTextureArrayResParameterProxy` for material-facing,
|
|
44
49
|
frame-coalesced texture-array inputs.
|
|
50
|
+
- `CjsAudioBufferRes` for physical audio-byte ownership and `CjsAudioRes` for
|
|
51
|
+
complete or windowed individually addressable audio files.
|
|
45
52
|
- Raw `CjsEventEmitter` (from `runtime-utils/model`) for manager/runtime events
|
|
46
53
|
without requiring `CjsModel` inheritance.
|
|
47
|
-
-
|
|
48
|
-
|
|
54
|
+
- Resource-path normalization and URL resolution, including prefix bases and
|
|
55
|
+
an injectable complete resolver, with fetch execution delegated to a
|
|
56
|
+
URL-only provider.
|
|
57
|
+
- Resource-specific geometry traversal and payload adaptation, composed with
|
|
58
|
+
shared vector, matrix, bounds, sphere, ray, and mesh math from
|
|
59
|
+
`runtime-utils` rather than maintaining another math implementation here.
|
|
49
60
|
- Plain reader/converter payload objects with focused shared validators.
|
|
50
61
|
- Canonical Carbon resource classes that validate and hold CPU payloads
|
|
51
62
|
privately: `TriTextureRes`, `TriGeometryRes`, `Tr2EffectRes`, `Tr2ImageRes`,
|
|
52
63
|
`TriGrannyRes`, `Tr2GrannyStateRes`, and `Tr2LightProfileRes`.
|
|
64
|
+
- Canonical device-free shader/reflection classes: `Tr2Shader`, its effect,
|
|
65
|
+
technique, pass, stage, constant, resource, sampler, annotation, and library
|
|
66
|
+
records; portable hydration; permutation selection; and per-index caching.
|
|
53
67
|
- `Tr2TexturePipeline` CPU-only texture steps and `Tr2TextureLodManager`
|
|
54
68
|
membership.
|
|
55
69
|
- Opaque engine-owned subobject slots for backend adapters.
|
|
56
|
-
-
|
|
70
|
+
- Format implementations as explicit tree-shakeable subpaths under
|
|
57
71
|
`@carbonenginejs/runtime-resource/formats/<name>`.
|
|
58
72
|
|
|
59
73
|
## What the package does not own
|
|
60
74
|
|
|
61
75
|
- WebGL/WebGPU realization, allocations, upload accounting, device budgets,
|
|
62
76
|
capability limits, and device-loss recovery (engine packages).
|
|
63
|
-
- Shader
|
|
64
|
-
|
|
77
|
+
- Shader binary decoding, backend translation, and package serialization remain
|
|
78
|
+
in the standalone shader-format packages. Backend shader objects remain in
|
|
79
|
+
engine packages.
|
|
65
80
|
- AudioBuffer construction, playback, or audio manager behavior.
|
|
81
|
+
- Audio-library document construction, enrichment, media-ID interpretation,
|
|
82
|
+
and delivery-route selection.
|
|
66
83
|
|
|
67
84
|
## Package relationships
|
|
68
85
|
|
|
69
86
|
- `runtime-core` may configure and expose a `CjsResMan`, but does not own its
|
|
70
87
|
implementation.
|
|
71
88
|
- `runtime-trinity` and `runtime-sof` may request GPU-free objects and
|
|
72
|
-
resources without selecting an engine.
|
|
89
|
+
resources without selecting an engine. Trinity owns the mutable
|
|
90
|
+
`Tr2Effect`/`Tr2Material` facade, parameters, options, and sampler overrides;
|
|
91
|
+
it consumes the resource-owned shader graph.
|
|
73
92
|
- `engine-webgpu` and future WebGL engines consume loaded resources and own
|
|
74
93
|
all backend allocations, preparation, replacement, and destruction.
|
|
75
94
|
|
|
76
95
|
Concrete formats are not imported or registered by the package root; see
|
|
77
96
|
[formats/README.md](formats/README.md) for the import rule and map.
|
|
97
|
+
Worker-safe formats provide their own exact module declaration and remain
|
|
98
|
+
explicit registrations; see [browser worker execution](reference/workers.md).
|
|
78
99
|
|
|
79
100
|
## Source layout
|
|
80
101
|
|
|
81
102
|
Authoring source is decorated JavaScript; published output is built ESM in
|
|
82
|
-
`npm/dist`.
|
|
83
|
-
`src/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
103
|
+
`npm/dist`. Resource owners and their direct Carbon data records live under
|
|
104
|
+
`src/resource`, grouped as `audio`, `geometry`, `geometry/granny`, `shader`,
|
|
105
|
+
and `texture`; worker execution and its message protocol live under `src/worker`;
|
|
106
|
+
`src/generated` is reserved for unresolved active ports and is currently
|
|
107
|
+
absent. Native shapes that JavaScript replaces or does not use are retained
|
|
108
|
+
only under `src/dropped`, with their disposition documented there, and are
|
|
109
|
+
never exported or bundled.
|
|
@@ -116,7 +116,8 @@ Application / runtime object
|
|
|
116
116
|
| - mark resource REQUESTED |
|
|
117
117
|
| - share one source operation per source/path |
|
|
118
118
|
| - obey maxConcurrentLoads |
|
|
119
|
-
| -
|
|
119
|
+
| - CjsResMan builds URL when provider needs it |
|
|
120
|
+
| - provider.Read(sourcePath) |
|
|
120
121
|
+===============================================+
|
|
121
122
|
|
|
|
122
123
|
| source bytes
|
package/docs/formats/README.md
CHANGED
|
@@ -29,6 +29,10 @@ through `SetPayload()`, validate their own required fields, and throw
|
|
|
29
29
|
`GetPayload()`, `HasPayload()`, and `ReleasePayload()` manage transient CPU
|
|
30
30
|
retention without introducing a parallel DTO class hierarchy.
|
|
31
31
|
|
|
32
|
+
Clone-safe formats may additionally declare browser-worker execution
|
|
33
|
+
metadata. Worker eligibility never changes the format's direct API; see
|
|
34
|
+
[browser worker execution](../reference/workers.md).
|
|
35
|
+
|
|
32
36
|
## Format map
|
|
33
37
|
|
|
34
38
|
| Format | Class | Import |
|
|
@@ -21,12 +21,14 @@ documentation check against the actual source tree.
|
|
|
21
21
|
|
|
22
22
|
## Catalog pages
|
|
23
23
|
|
|
24
|
-
- [core.md](core.md): the resource manager, MotherLode cache,
|
|
25
|
-
|
|
24
|
+
- [core.md](core.md): the resource manager, MotherLode cache, fetch provider,
|
|
25
|
+
core resource class, and the format/probe bases.
|
|
26
|
+
- [audio.md](audio.md): raw audio-byte owners and individually addressable
|
|
27
|
+
audio resource views.
|
|
26
28
|
- [resources.md](resources.md): the Carbon-shaped semantic resource and data
|
|
27
|
-
classes
|
|
29
|
+
classes in the `src/resource` family tree.
|
|
28
30
|
- [texture.md](texture.md): texture-array aggregation classes under
|
|
29
|
-
`src/texture`.
|
|
31
|
+
`src/resource/texture`.
|
|
30
32
|
- [formats.md](formats.md): format entry classes and their internal reader
|
|
31
33
|
machinery under `src/formats`.
|
|
32
34
|
- [dropped.md](dropped.md): retained native shapes under `src/dropped` that
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Audio resource class catalog
|
|
2
|
+
|
|
3
|
+
Status: Evolving
|
|
4
|
+
Scope: `@carbonenginejs/runtime-resource/resource/audio` classes
|
|
5
|
+
Audience: Users, maintainers, and automated readers
|
|
6
|
+
Summary: Catalogs raw audio-byte owners and individually addressable audio resource views.
|
|
7
|
+
|
|
8
|
+
<!-- class:CjsAudioBufferRes -->
|
|
9
|
+
## `CjsAudioBufferRes`
|
|
10
|
+
|
|
11
|
+
Physical audio byte-owner resource whose payload may back one complete file or several logical audio files.
|
|
12
|
+
|
|
13
|
+
- Export: `@carbonenginejs/runtime-resource/resource/audio`
|
|
14
|
+
- Source: `src/resource/audio/CjsAudioBufferRes.js`
|
|
15
|
+
- Visibility: Public
|
|
16
|
+
- Kind: Original CarbonEngineJS class
|
|
17
|
+
- Notes: Owns raw payload retention and locks without interpreting media IDs,
|
|
18
|
+
bank members, decoding, or playback.
|
|
19
|
+
|
|
20
|
+
<!-- class:CjsAudioRes -->
|
|
21
|
+
## `CjsAudioRes`
|
|
22
|
+
|
|
23
|
+
Individually addressable audio resource representing one complete file over either a complete or windowed physical source.
|
|
24
|
+
|
|
25
|
+
- Export: `@carbonenginejs/runtime-resource/resource/audio`
|
|
26
|
+
- Source: `src/resource/audio/CjsAudioRes.js`
|
|
27
|
+
- Visibility: Public
|
|
28
|
+
- Kind: Original CarbonEngineJS class
|
|
29
|
+
- Notes: Carries immutable media metadata, returns detached byte windows, and
|
|
30
|
+
delegates locks and payload liveness to its backing resource.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Core class catalog
|
|
2
2
|
|
|
3
3
|
Status: Evolving
|
|
4
|
-
Scope: `@carbonenginejs/runtime-resource` classes under `src
|
|
4
|
+
Scope: `@carbonenginejs/runtime-resource` classes under `src/`, `src/resource`, and `src/format/`
|
|
5
5
|
Audience: Users, maintainers, and automated readers
|
|
6
6
|
Summary: Provides one-sentence purpose descriptors for the resource manager, registry, resource, source, and format/probe base classes.
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ GPU-free resource manager that resolves paths through registered sources and for
|
|
|
31
31
|
Small FIFO executor used inside `CjsResMan` that tracks item ids, pause state, concurrency, cancellation, and sync/async completion while queue policy stays in the manager.
|
|
32
32
|
|
|
33
33
|
- Export: None
|
|
34
|
-
- Source: `src/
|
|
34
|
+
- Source: `src/CjsResManWorkQueue.js`
|
|
35
35
|
- Visibility: Internal
|
|
36
36
|
- Kind: Internal implementation class
|
|
37
37
|
|
|
@@ -41,27 +41,47 @@ Small FIFO executor used inside `CjsResMan` that tracks item ids, pause state, c
|
|
|
41
41
|
Base runtime resource handle that carries normalized path/extension/requirement identity, load state, and an attached CPU payload, with manager lifecycle callbacks supplied by `CjsResMan` after canonical insertion.
|
|
42
42
|
|
|
43
43
|
- Export: `@carbonenginejs/runtime-resource`
|
|
44
|
-
- Source: `src/CjsResource.js`
|
|
44
|
+
- Source: `src/resource/CjsResource.js`
|
|
45
45
|
- Visibility: Public
|
|
46
46
|
- Kind: Adapted Carbon concept
|
|
47
47
|
|
|
48
|
-
<!-- class:
|
|
49
|
-
## `
|
|
48
|
+
<!-- class:CjsResManMainThreadLoader -->
|
|
49
|
+
## `CjsResManMainThreadLoader`
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Direct execution strategy that reads through a structural source and invokes registered format facades on the caller thread.
|
|
52
52
|
|
|
53
53
|
- Export: `@carbonenginejs/runtime-resource`
|
|
54
|
-
- Source: `src/
|
|
54
|
+
- Source: `src/worker/CjsResManMainThreadLoader.js`
|
|
55
|
+
- Visibility: Public
|
|
56
|
+
- Kind: Adapted ccpwgl loader strategy
|
|
57
|
+
|
|
58
|
+
<!-- class:CjsResManWorkerLoader -->
|
|
59
|
+
## `CjsResManWorkerLoader`
|
|
60
|
+
|
|
61
|
+
Browser module-worker strategy that correlates source/format requests, transfers owned buffers, propagates cancellation and fatal failure, and delegates unsupported operations to a main-thread loader.
|
|
62
|
+
|
|
63
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
64
|
+
- Source: `src/worker/CjsResManWorkerLoader.js`
|
|
65
|
+
- Visibility: Public
|
|
66
|
+
- Kind: Adapted ccpwgl loader strategy
|
|
67
|
+
|
|
68
|
+
<!-- class:CjsResManWorker -->
|
|
69
|
+
## `CjsResManWorker`
|
|
70
|
+
|
|
71
|
+
Static browser-worker host that owns its operation/message vocabulary, executes clone-safe source and format operations, installs the message envelope, transfers owned buffers, and serializes failures for `CjsResMan`.
|
|
72
|
+
|
|
73
|
+
- Export: `@carbonenginejs/runtime-resource/worker`
|
|
74
|
+
- Source: `src/worker/CjsResManWorker.js`
|
|
55
75
|
- Visibility: Public
|
|
56
76
|
- Kind: Original CarbonEngineJS class
|
|
57
77
|
|
|
58
|
-
<!-- class:
|
|
59
|
-
## `
|
|
78
|
+
<!-- class:CjsResManFetchProvider -->
|
|
79
|
+
## `CjsResManFetchProvider`
|
|
60
80
|
|
|
61
|
-
|
|
81
|
+
`CjsResMan` provider that fetches an already-resolved URL on the caller thread or through the resource worker.
|
|
62
82
|
|
|
63
83
|
- Export: `@carbonenginejs/runtime-resource`
|
|
64
|
-
- Source: `src/
|
|
84
|
+
- Source: `src/CjsResManFetchProvider.js`
|
|
65
85
|
- Visibility: Public
|
|
66
86
|
- Kind: Original CarbonEngineJS class
|
|
67
87
|
|