@forgeax/engine-runtime 0.1.4 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -83
- package/dist/.tsbuildinfo +1 -1
- package/dist/__tests__/animation-graph-collect-roundtrip.test.d.ts +2 -0
- package/dist/__tests__/animation-graph-collect-roundtrip.test.d.ts.map +1 -0
- package/dist/__tests__/animation-graph-serialize.unit.test.d.ts +2 -0
- package/dist/__tests__/animation-graph-serialize.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-brand-and-name-retirement.test.d.ts +2 -0
- package/dist/__tests__/asset-brand-and-name-retirement.test.d.ts.map +1 -0
- package/dist/__tests__/asset-error-exhaustive.test-d.d.ts +11 -0
- package/dist/__tests__/asset-error-exhaustive.test-d.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-guid-reverse.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-guid-reverse.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-hdr-equirect.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-hdr-equirect.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-mesh-pack-payload.dawn.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-mesh-pack-payload.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-mounts.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-mounts.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.browser.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.browser.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.dawn.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.listCatalog.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.listCatalog.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.mesh-bin.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.mesh-bin.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.pack-cache.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.pack-cache.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.raw-container-failfast.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.raw-container-failfast.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.recursive.spec.d.ts +2 -0
- package/dist/__tests__/asset-registry.recursive.spec.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset.unit.test.d.ts +2 -0
- package/dist/__tests__/asset.unit.test.d.ts.map +1 -0
- package/dist/__tests__/audio-load-by-guid.unit.test.d.ts +2 -0
- package/dist/__tests__/audio-load-by-guid.unit.test.d.ts.map +1 -0
- package/dist/__tests__/backend-selection.integration.test.d.ts +2 -0
- package/dist/__tests__/backend-selection.integration.test.d.ts.map +1 -0
- package/dist/__tests__/basis-catalog-dispatch.integration.test.d.ts +2 -0
- package/dist/__tests__/basis-catalog-dispatch.integration.test.d.ts.map +1 -0
- package/dist/__tests__/builtin-asset-registry.unit.test.d.ts +2 -0
- package/dist/__tests__/builtin-asset-registry.unit.test.d.ts.map +1 -0
- package/dist/__tests__/collect-scene-asset.test.d.ts +1 -2
- package/dist/__tests__/collect-scene-asset.test.d.ts.map +1 -1
- package/dist/__tests__/collect-scene-mount-collapse.test.d.ts +2 -0
- package/dist/__tests__/collect-scene-mount-collapse.test.d.ts.map +1 -0
- package/dist/__tests__/collect-transient-roundtrip.test.d.ts +1 -1
- package/dist/__tests__/collect-transient-roundtrip.test.d.ts.map +1 -1
- package/dist/__tests__/collect-transient-skip.test.d.ts +1 -2
- package/dist/__tests__/collect-transient-skip.test.d.ts.map +1 -1
- package/dist/__tests__/compressed-texture-physical-extent.integration.test.d.ts +2 -0
- package/dist/__tests__/compressed-texture-physical-extent.integration.test.d.ts.map +1 -0
- package/dist/__tests__/dawn/mesh-update-dawn.test.d.ts +2 -0
- package/dist/__tests__/dawn/mesh-update-dawn.test.d.ts.map +1 -0
- package/dist/__tests__/dawn/upload-texture.dawn.test.d.ts +2 -0
- package/dist/__tests__/dawn/upload-texture.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/draw-published.d.ts +2 -2
- package/dist/__tests__/draw-published.d.ts.map +1 -1
- package/dist/__tests__/dynamic-texture-store.unit.test.d.ts +2 -0
- package/dist/__tests__/dynamic-texture-store.unit.test.d.ts.map +1 -0
- package/dist/__tests__/errors.unit.test.d.ts +2 -0
- package/dist/__tests__/errors.unit.test.d.ts.map +1 -0
- package/dist/__tests__/extract-skin-mismatch.unit.test.d.ts +2 -0
- package/dist/__tests__/extract-skin-mismatch.unit.test.d.ts.map +1 -0
- package/dist/__tests__/fetch-binary-decompress.test.d.ts +2 -0
- package/dist/__tests__/fetch-binary-decompress.test.d.ts.map +1 -0
- package/dist/__tests__/four-path-compression.integration.test.d.ts +2 -0
- package/dist/__tests__/four-path-compression.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fullscreen-feature-host.dawn.test.d.ts +2 -0
- package/dist/__tests__/fullscreen-feature-host.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/guid-for-asset.unit.test.d.ts +2 -0
- package/dist/__tests__/guid-for-asset.unit.test.d.ts.map +1 -0
- package/dist/__tests__/handle-migration.test.d.ts +2 -0
- package/dist/__tests__/handle-migration.test.d.ts.map +1 -0
- package/dist/__tests__/helpers/register-runtime-components.d.ts.map +1 -1
- package/dist/__tests__/host-custom-kind-contract.test-d.d.ts +2 -0
- package/dist/__tests__/host-custom-kind-contract.test-d.d.ts.map +1 -0
- package/dist/__tests__/host-custom-kind-contract.test.d.ts +2 -0
- package/dist/__tests__/host-custom-kind-contract.test.d.ts.map +1 -0
- package/dist/__tests__/inspect-name.test.d.ts +2 -0
- package/dist/__tests__/inspect-name.test.d.ts.map +1 -0
- package/dist/__tests__/instantiate-mount-deferred-wiring.test.d.ts +2 -0
- package/dist/__tests__/instantiate-mount-deferred-wiring.test.d.ts.map +1 -0
- package/dist/__tests__/loadbyguid-payload.unit.test.d.ts +2 -0
- package/dist/__tests__/loadbyguid-payload.unit.test.d.ts.map +1 -0
- package/dist/__tests__/loadbyguid-texture-intern.unit.test.d.ts +2 -0
- package/dist/__tests__/loadbyguid-texture-intern.unit.test.d.ts.map +1 -0
- package/dist/__tests__/loader-extract-graceful.test.d.ts +2 -0
- package/dist/__tests__/loader-extract-graceful.test.d.ts.map +1 -0
- package/dist/__tests__/loader-name-survival.test.d.ts +2 -0
- package/dist/__tests__/loader-name-survival.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin-contract.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin-contract.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin-skin-roundtrip.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin-skin-roundtrip.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-loader-skin-contract.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-loader-skin-contract.unit.test.d.ts.map +1 -0
- package/dist/__tests__/new-kind-refs-contract.test.d.ts +2 -0
- package/dist/__tests__/new-kind-refs-contract.test.d.ts.map +1 -0
- package/dist/__tests__/package-promotion.test.d.ts +2 -0
- package/dist/__tests__/package-promotion.test.d.ts.map +1 -0
- package/dist/__tests__/package-rename.test.d.ts +2 -0
- package/dist/__tests__/package-rename.test.d.ts.map +1 -0
- package/dist/__tests__/recover-error-exhaustive.test-d.d.ts +1 -1
- package/dist/__tests__/recover-error-exhaustive.test-d.d.ts.map +1 -1
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts +1 -1
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts.map +1 -1
- package/dist/__tests__/render-feature-prepared-graphics.fixture.d.ts +10 -0
- package/dist/__tests__/render-feature-prepared-graphics.fixture.d.ts.map +1 -0
- package/dist/__tests__/render-system-extract.unit.test.d.ts +2 -0
- package/dist/__tests__/render-system-extract.unit.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-test-utils.d.ts +10 -0
- package/dist/__tests__/renderer-test-utils.d.ts.map +1 -0
- package/dist/__tests__/renderer.test-d.d.ts +2 -0
- package/dist/__tests__/renderer.test-d.d.ts.map +1 -0
- package/dist/__tests__/resolve-asset-handle-err.test.d.ts +2 -0
- package/dist/__tests__/resolve-asset-handle-err.test.d.ts.map +1 -0
- package/dist/__tests__/resolve-asset-handle.unit.test.d.ts +2 -0
- package/dist/__tests__/resolve-asset-handle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/resolveName-fallback.test.d.ts +2 -0
- package/dist/__tests__/resolveName-fallback.test.d.ts.map +1 -0
- package/dist/__tests__/resolveName-null-package.test.d.ts +2 -0
- package/dist/__tests__/resolveName-null-package.test.d.ts.map +1 -0
- package/dist/__tests__/resolveName-unified-entry.test.d.ts +2 -0
- package/dist/__tests__/resolveName-unified-entry.test.d.ts.map +1 -0
- package/dist/__tests__/resolveName.test.d.ts +2 -0
- package/dist/__tests__/resolveName.test.d.ts.map +1 -0
- package/dist/__tests__/roots-to-scene-asset.test.d.ts +1 -1
- package/dist/__tests__/roots-to-scene-asset.test.d.ts.map +1 -1
- package/dist/__tests__/roundtrip-primitive.test.d.ts +2 -0
- package/dist/__tests__/roundtrip-primitive.test.d.ts.map +1 -0
- package/dist/__tests__/scene-bare-guid-refs-instantiate.test.d.ts +2 -0
- package/dist/__tests__/scene-bare-guid-refs-instantiate.test.d.ts.map +1 -0
- package/dist/__tests__/scene-instance-authoring.integration.test.d.ts +2 -0
- package/dist/__tests__/scene-instance-authoring.integration.test.d.ts.map +1 -0
- package/dist/__tests__/scene-mount-fixed-point.test.d.ts +2 -0
- package/dist/__tests__/scene-mount-fixed-point.test.d.ts.map +1 -0
- package/dist/__tests__/scene-mount-roundtrip.test.d.ts +2 -0
- package/dist/__tests__/scene-mount-roundtrip.test.d.ts.map +1 -0
- package/dist/__tests__/scene-mount-wrapper-roundtrip.test.d.ts +2 -0
- package/dist/__tests__/scene-mount-wrapper-roundtrip.test.d.ts.map +1 -0
- package/dist/__tests__/scene-sugar-instantiate.test.d.ts +2 -0
- package/dist/__tests__/scene-sugar-instantiate.test.d.ts.map +1 -0
- package/dist/__tests__/serialize-mounts-roundtrip.test.d.ts +2 -0
- package/dist/__tests__/serialize-mounts-roundtrip.test.d.ts.map +1 -0
- package/dist/__tests__/serialize-scene-asset.test.d.ts +1 -1
- package/dist/__tests__/serialize-scene-asset.test.d.ts.map +1 -1
- package/dist/__tests__/template-game-default-api-contract.test.d.ts +2 -0
- package/dist/__tests__/template-game-default-api-contract.test.d.ts.map +1 -0
- package/dist/__tests__/tileset-asset-validate.test.d.ts +2 -0
- package/dist/__tests__/tileset-asset-validate.test.d.ts.map +1 -0
- package/dist/__tests__/transcode-fallback.unit.test.d.ts +2 -0
- package/dist/__tests__/transcode-fallback.unit.test.d.ts.map +1 -0
- package/dist/__tests__/transient-runtime-behavior.test.d.ts +2 -0
- package/dist/__tests__/transient-runtime-behavior.test.d.ts.map +1 -0
- package/dist/__tests__/video-loader-consumption.test.d.ts +2 -0
- package/dist/__tests__/video-loader-consumption.test.d.ts.map +1 -0
- package/dist/__tests__/video-loader-smoke.dawn.test.d.ts +2 -0
- package/dist/__tests__/video-loader-smoke.dawn.test.d.ts.map +1 -0
- package/dist/backend-selection.d.ts +13 -0
- package/dist/backend-selection.d.ts.map +1 -0
- package/dist/collect-scene-asset.d.ts +7 -4
- package/dist/collect-scene-asset.d.ts.map +1 -1
- package/dist/createRenderer.d.ts +14 -2
- package/dist/createRenderer.d.ts.map +1 -1
- package/dist/errors/environment.d.ts +1 -1
- package/dist/errors/environment.d.ts.map +1 -1
- package/dist/index.d.ts +20 -82
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +107 -108
- package/dist/index.mjs.map +1 -1
- package/dist/renderer-host.d.ts +9 -0
- package/dist/renderer-host.d.ts.map +1 -0
- package/dist/renderer-host.mjs +62 -0
- package/dist/renderer-host.mjs.map +1 -0
- package/dist/scene-instances/index.d.ts +2 -0
- package/dist/scene-instances/index.d.ts.map +1 -0
- package/dist/scene-utils/mount-override-fold.d.ts +1 -2
- package/dist/scene-utils/mount-override-fold.d.ts.map +1 -1
- package/dist/systems/sprite-animation-tick.d.ts +1 -1
- package/dist/systems/sprite-animation-tick.d.ts.map +1 -1
- package/dist/systems/transparent-sort.d.ts +1 -2
- package/dist/systems/transparent-sort.d.ts.map +1 -1
- package/dist/tilemap-register-validate.d.ts.map +1 -1
- package/package.json +34 -33
- package/src/__tests__/active-camera.unit.test.ts +19 -9
- package/src/__tests__/animation-graph-collect-roundtrip.test.ts +213 -0
- package/src/__tests__/animation-graph-serialize.unit.test.ts +171 -0
- package/src/__tests__/append-injection.test.ts +1 -1
- package/src/__tests__/asset-brand-and-name-retirement.test.ts +102 -0
- package/src/__tests__/asset-error-exhaustive.test-d.ts +62 -0
- package/src/__tests__/asset-registry-guid-reverse.test.ts +608 -0
- package/src/__tests__/asset-registry-hdr-equirect.test.ts +78 -0
- package/src/__tests__/asset-registry-mesh-pack-payload.dawn.test.ts +232 -0
- package/src/__tests__/asset-registry-mounts.test.ts +806 -0
- package/src/__tests__/asset-registry.browser.test.ts +81 -0
- package/src/__tests__/asset-registry.dawn.test.ts +94 -0
- package/src/__tests__/asset-registry.listCatalog.test.ts +170 -0
- package/src/__tests__/asset-registry.mesh-bin.test.ts +316 -0
- package/src/__tests__/asset-registry.pack-cache.test.ts +969 -0
- package/src/__tests__/asset-registry.raw-container-failfast.test.ts +225 -0
- package/src/__tests__/asset-registry.recursive.spec.ts +1397 -0
- package/src/__tests__/asset-registry.unit.test.ts +1030 -0
- package/src/__tests__/asset.unit.test.ts +7107 -0
- package/src/__tests__/audio-load-by-guid.unit.test.ts +126 -0
- package/src/__tests__/backend-selection.integration.test.ts +11 -0
- package/src/__tests__/basis-catalog-dispatch.integration.test.ts +320 -0
- package/src/__tests__/bind-group-cache-keying.test.ts +4 -4
- package/src/__tests__/block-upload-math.unit.test.ts +2 -2
- package/src/__tests__/builtin-asset-registry.unit.test.ts +112 -0
- package/src/__tests__/builtin-shader-register-e2e.test.ts +1 -1
- package/src/__tests__/cache-false-eviction.test.ts +2 -1
- package/src/__tests__/cache-isolation-matrix.test.ts +2 -1
- package/src/__tests__/camera-clear-snapshot-equivalence.unit.test.ts +5 -6
- package/src/__tests__/clamp-to-last.e2e.browser.test.ts +29 -19
- package/src/__tests__/collect-scene-asset.test.ts +49 -52
- package/src/__tests__/collect-scene-mount-collapse.test.ts +391 -0
- package/src/__tests__/collect-subtree.unit.test.ts +1 -2
- package/src/__tests__/collect-transient-children-absent.test.ts +24 -10
- package/src/__tests__/collect-transient-roundtrip.test.ts +44 -20
- package/src/__tests__/collect-transient-skip.test.ts +24 -13
- package/src/__tests__/components.test-d.ts +1 -6
- package/src/__tests__/components.unit.test.ts +20 -19
- package/src/__tests__/composite-skybox-cross-world.browser.test.ts +59 -27
- package/src/__tests__/compressed-texture-physical-extent.integration.test.ts +139 -0
- package/src/__tests__/create-renderer-assembly.integration.test.ts +42 -29
- package/src/__tests__/createRenderer-dispose.test.ts +35 -402
- package/src/__tests__/createRenderer.browser-no-webgpu.test.ts +25 -30
- package/src/__tests__/createRenderer.unit.test.ts +1 -1
- package/src/__tests__/dawn/hello-sprite-nineslice-section.dawn.test.ts +27 -63
- package/src/__tests__/dawn/ibl-precompute-readback.dawn.test.ts +56 -47
- package/src/__tests__/dawn/instances-per-instance-pbr.dawn.test.ts +49 -29
- package/src/__tests__/dawn/instances-shadow.dawn.test.ts +26 -15
- package/src/__tests__/dawn/instances-uniform-fallback.dawn.test.ts +13 -14
- package/src/__tests__/dawn/material-alpha.dawn.test.ts +23 -31
- package/src/__tests__/dawn/material-cooked-fixture.dawn.test.ts +24 -9
- package/src/__tests__/dawn/{mesh-update.dawn.test.ts → mesh-update-dawn.test.ts} +42 -134
- package/src/__tests__/dawn/mipmap-srgb-linear.dawn.test.ts +14 -7
- package/src/__tests__/dawn/per-entity-material-texture-isolation.dawn.test.ts +16 -28
- package/src/__tests__/dawn/sprite-nineslice-mesh-bind.dawn.test.ts +23 -39
- package/src/__tests__/dawn/upload-texture.dawn.test.ts +198 -0
- package/src/__tests__/dawn/user-handle-mesh-render.dawn.test.ts +12 -14
- package/src/__tests__/dawn/user-mesh-upload.dawn.test.ts +27 -22
- package/src/__tests__/dawn/zero-manifest-mesh-fail.dawn.test.ts +25 -28
- package/src/__tests__/dawn/zero-manifest-ready.dawn.test.ts +10 -11
- package/src/__tests__/demo-sortscope-migration.unit.test.ts +5 -5
- package/src/__tests__/derive-bgl-integration.test.ts +34 -44
- package/src/__tests__/derive-render-data-skin.unit.test.ts +1 -1
- package/src/__tests__/draw-published.ts +11 -4
- package/src/__tests__/dynamic-texture-store.unit.test.ts +190 -0
- package/src/__tests__/equirect-bc6h.integration.test.ts +144 -21
- package/src/__tests__/errors.unit.test.ts +1227 -0
- package/src/__tests__/extract-frames-graceful-degradation.test.ts +3 -7
- package/src/__tests__/extract-frames-merge.test.ts +35 -22
- package/src/__tests__/extract-record-no-hardcoded-texture-fields.test.ts +5 -16
- package/src/__tests__/extract-skin-mismatch.unit.test.ts +322 -0
- package/src/__tests__/fetch-binary-decompress.test.ts +356 -0
- package/src/__tests__/four-path-compression.integration.test.ts +395 -0
- package/src/__tests__/frame-targets-shadow-regression.unit.test.ts +1 -1
- package/src/__tests__/fullscreen-feature-host.dawn.test.ts +80 -0
- package/src/__tests__/fullscreen-post-bgl-depth.test.ts +4 -2
- package/src/__tests__/fullscreen-post-depth-params-arity.test.ts +3 -3
- package/src/__tests__/fullscreen-post-process-pass.dawn.test.ts +39 -23
- package/src/__tests__/fullscreen-post-process-pass.unit.test.ts +4 -2
- package/src/__tests__/fxaa-pixel-diff.dawn.test.ts +28 -17
- package/src/__tests__/fxaa-validation-and-resize.dawn.test.ts +29 -18
- package/src/__tests__/fxaa-zero-overhead.dawn.test.ts +16 -12
- package/src/__tests__/geometry.unit.test.ts +525 -159
- package/src/__tests__/glyph-tilemap-worldid.test.ts +1 -1
- package/src/__tests__/gpu-resource-cow-survivor.test.ts +6 -4
- package/src/__tests__/guid-for-asset.unit.test.ts +102 -0
- package/src/__tests__/handle-migration.test.ts +136 -0
- package/src/__tests__/helpers/register-runtime-components.ts +4 -2
- package/src/__tests__/helpers/register-scene-components.ts +1 -1
- package/src/__tests__/host-custom-kind-contract.test-d.ts +47 -0
- package/src/__tests__/host-custom-kind-contract.test.ts +578 -0
- package/src/__tests__/inspect-name.test.ts +139 -0
- package/src/__tests__/instances.test-d.ts +1 -1
- package/src/__tests__/instantiate-mount-deferred-wiring.test.ts +112 -0
- package/src/__tests__/light-casters-9-light.browser.test.ts +73 -76
- package/src/__tests__/light-gpu-byte-neutral.unit.test.ts +7 -10
- package/src/__tests__/light-snapshot.test-d.ts +2 -2
- package/src/__tests__/lights-vec-negative.unit.test.ts +1 -1
- package/src/__tests__/lights.unit.test.ts +31 -511
- package/src/__tests__/loadbyguid-payload.unit.test.ts +117 -0
- package/src/__tests__/loadbyguid-texture-intern.unit.test.ts +213 -0
- package/src/__tests__/loader-extract-graceful.test.ts +146 -0
- package/src/__tests__/loader-name-survival.test.ts +213 -0
- package/src/__tests__/m3-vec-negative.unit.test.ts +3 -2
- package/src/__tests__/material-texture-uv-scale.unit.test.ts +101 -31
- package/src/__tests__/materials.unit.test.ts +10 -27
- package/src/__tests__/mesh-bin-contract.test.ts +28 -0
- package/src/__tests__/mesh-bin-skin-roundtrip.unit.test.ts +149 -0
- package/src/__tests__/mesh-bin.test.ts +38 -0
- package/src/__tests__/mesh-loader-skin-contract.unit.test.ts +120 -0
- package/src/__tests__/mesh-ssbo-grow.unit.test.ts +3 -3
- package/src/__tests__/mip-gate.unit.test.ts +1 -1
- package/src/__tests__/msaa-sprite-pixel-diff.dawn.test.ts +29 -68
- package/src/__tests__/new-kind-refs-contract.test.ts +132 -0
- package/src/__tests__/node-shims.d.ts +4 -6
- package/src/__tests__/package-promotion.test.ts +88 -0
- package/src/__tests__/package-rename.test.ts +103 -0
- package/src/__tests__/pass-selector.unit.test.ts +2 -2
- package/src/__tests__/pbr-pipeline.unit.test.ts +21 -25
- package/src/__tests__/pipeline-builder-msaa.unit.test.ts +6 -9
- package/src/__tests__/pipeline-cache-keying.unit.test.ts +6 -9
- package/src/__tests__/pipeline-spec.test.ts +16 -177
- package/src/__tests__/pipeline.unit.test.ts +154 -1693
- package/src/__tests__/point-light-shadow.dawn.test.ts +33 -42
- package/src/__tests__/point-light-shadow.unit.test.ts +19 -60
- package/src/__tests__/post-process-error-codes.unit.test.ts +4 -1
- package/src/__tests__/post-process-params-component.unit.test.ts +1 -1
- package/src/__tests__/post-process-params-extract.unit.test.ts +2 -5
- package/src/__tests__/postprocess-camera-consistency.test.ts +4 -7
- package/src/__tests__/profiler-assembly.integration.test.ts +1 -1
- package/src/__tests__/propagate-transforms.dawn.test.ts +12 -11
- package/src/__tests__/record-worldid-isolation.test.ts +7 -29
- package/src/__tests__/recover-error-exhaustive.test-d.ts +1 -1
- package/src/__tests__/render-error-exhaustive.test-d.ts +117 -71
- package/src/__tests__/render-feature-assembly.test-d.ts +20 -9
- package/src/__tests__/render-feature-prepared-graphics-docs.unit.test.ts +8 -6
- package/src/__tests__/render-feature-prepared-graphics.browser.test.ts +65 -559
- package/src/__tests__/render-feature-prepared-graphics.dawn.test.ts +57 -544
- package/src/__tests__/render-feature-prepared-graphics.fixture.ts +104 -0
- package/src/__tests__/render-feature-prepared-graphics.integration.test.ts +40 -248
- package/src/__tests__/render-feature-prepared-graphics.regression.integration.test.ts +83 -340
- package/src/__tests__/render-feature-recover.integration.test.ts +9 -49
- package/src/__tests__/render-feature-runtime-surface.test-d.ts +17 -20
- package/src/__tests__/render-schema-consumer.integration.test.ts +20 -13
- package/src/__tests__/render-schema-owner-boundary.unit.test.ts +2 -6
- package/src/__tests__/render-system-cross-world-overlay-queue.test.ts +5 -5
- package/src/__tests__/render-system-extract-dispatch-ordering.test.ts +16 -31
- package/src/__tests__/render-system-extract.test.ts +36 -51
- package/src/__tests__/render-system-extract.unit.test.ts +360 -0
- package/src/__tests__/render-system-fold-bucket.unit.test.ts +3 -5
- package/src/__tests__/render-system-fold-fallback.unit.test.ts +6 -3
- package/src/__tests__/render-system-fold-material.unit.test.ts +3 -5
- package/src/__tests__/render-system-fold-metrics.unit.test.ts +5 -5
- package/src/__tests__/render-system-fold-modegate.unit.test.ts +6 -6
- package/src/__tests__/render-system-fold.dawn.test.ts +7 -5
- package/src/__tests__/render-system-mega.test.ts +292 -190
- package/src/__tests__/render-system-owner-split-contract.test.ts +10 -32
- package/src/__tests__/render-system-record-multi-material-textureview.test.ts +59 -45
- package/src/__tests__/render-system-record-per-submesh-transparency.test.ts +23 -29
- package/src/__tests__/render-system-record.test.ts +398 -235
- package/src/__tests__/render-system-record.unit.test.ts +25 -26
- package/src/__tests__/render-system-skin-bg.unit.test.ts +8 -12
- package/src/__tests__/renderer-consumer.test-d.ts +16 -3
- package/src/__tests__/renderer-health.unit.test.ts +26 -916
- package/src/__tests__/renderer-lifecycle.integration.test.ts +19 -6
- package/src/__tests__/renderer-recover.unit.test.ts +49 -1069
- package/src/__tests__/renderer-result.test-d.ts +19 -9
- package/src/__tests__/renderer-surface.unit.test.ts +3 -5
- package/src/__tests__/renderer-test-utils.ts +56 -0
- package/src/__tests__/renderer.test-d.ts +61 -0
- package/src/__tests__/resolve-asset-handle-err.test.ts +111 -0
- package/src/__tests__/resolve-asset-handle.unit.test.ts +64 -0
- package/src/__tests__/resolve-depth-only-view.test.ts +1 -1
- package/src/__tests__/resolveName-fallback.test.ts +64 -0
- package/src/__tests__/resolveName-null-package.test.ts +38 -0
- package/src/__tests__/resolveName-unified-entry.test.ts +65 -0
- package/src/__tests__/resolveName.test.ts +64 -0
- package/src/__tests__/rhi-null-command-flow.unit.test.ts +56 -260
- package/src/__tests__/rhi-null-renderer-lifecycle.unit.test.ts +41 -169
- package/src/__tests__/roots-to-scene-asset.test.ts +199 -93
- package/src/__tests__/roundtrip-primitive.test.ts +351 -0
- package/src/__tests__/scene-bare-guid-refs-instantiate.test.ts +123 -0
- package/src/__tests__/scene-equirect-roundtrip.test.ts +103 -16
- package/src/__tests__/scene-instance-authoring.integration.test.ts +8 -0
- package/src/__tests__/scene-instance-bridge.integration.test.ts +1 -1
- package/src/__tests__/scene-instance-component.test.ts +1 -1
- package/src/__tests__/scene-mount-fixed-point.test.ts +257 -0
- package/src/__tests__/scene-mount-roundtrip.test.ts +987 -0
- package/src/__tests__/scene-mount-wrapper-roundtrip.test.ts +202 -0
- package/src/__tests__/scene-sugar-instantiate.test.ts +324 -0
- package/src/__tests__/serialize-mounts-roundtrip.test.ts +533 -0
- package/src/__tests__/serialize-scene-asset.test.ts +219 -22
- package/src/__tests__/shadow-caster-empty-schema.test.ts +3 -3
- package/src/__tests__/shadow-csm-cascade-loadop.test.ts +37 -17
- package/src/__tests__/shadow-csm-component.test.ts +3 -5
- package/src/__tests__/shadow-csm-extract.test.ts +2 -100
- package/src/__tests__/shadow-csm-orthoz.test.ts +2 -16
- package/src/__tests__/shadow-csm-runtime-vary.dawn.test.ts +19 -14
- package/src/__tests__/shadow-csm-tile-consistency.test.ts +32 -26
- package/src/__tests__/shadow-csm-ubo.dawn.test.ts +8 -49
- package/src/__tests__/shadow-csm-ubo.test.ts +3 -25
- package/src/__tests__/shadow-csm-viewport.browser.test.ts +1 -1
- package/src/__tests__/shadow-fields-observable.dawn.test.ts +67 -56
- package/src/__tests__/shadow-m1.dawn.test.ts +8 -9
- package/src/__tests__/shadow-mesh-ssbo-order.test.ts +11 -27
- package/src/__tests__/skin-errors.unit.test.ts +1 -1
- package/src/__tests__/skin-extract-getarrayview-count.unit.test.ts +7 -5
- package/src/__tests__/skylight-lazy-projection.test.ts +36 -15
- package/src/__tests__/sparse-tag-scene-roundtrip.test.ts +5 -5
- package/src/__tests__/sprite-cullmode-flip.dawn.test.ts +47 -64
- package/src/__tests__/sprite-lit-bgl-byte-identical.test.ts +15 -14
- package/src/__tests__/sprite-lit-extract-branch.test.ts +1 -1
- package/src/__tests__/sprite-lit-pipeline-cache-key.test.ts +1 -1
- package/src/__tests__/ssao-bgl.test.ts +16 -9
- package/src/__tests__/ssao-buffers.test.ts +2 -2
- package/src/__tests__/ssao-data.test.ts +2 -2
- package/src/__tests__/ssao-errors.test.ts +1 -1
- package/src/__tests__/ssao-passes.test.ts +68 -392
- package/src/__tests__/ssao-pipelines.test.ts +1 -1
- package/src/__tests__/ssao-uniform-layout.test.ts +8 -6
- package/src/__tests__/stencil-outline-pixel.dawn.test.ts +25 -17
- package/src/__tests__/swap-chain-format.unit.test.ts +5 -7
- package/src/__tests__/systems.unit.test.ts +536 -1326
- package/src/__tests__/template-game-default-api-contract.test.ts +362 -0
- package/src/__tests__/text.unit.test.ts +56 -33
- package/src/__tests__/tilemap-childed-despawn.test.ts +8 -14
- package/src/__tests__/tilemap-chunk-extract.overhang-bounds.test.ts +8 -12
- package/src/__tests__/tilemap-chunk-extract.propagate-order.test.ts +2 -1
- package/src/__tests__/tilemap-chunk-extract.test.ts +13 -17
- package/src/__tests__/tilemap-dirty-rebuild.test.ts +7 -11
- package/src/__tests__/tilemap-material-cache.test.ts +8 -13
- package/src/__tests__/tilemap-multi-atlas.test.ts +12 -32
- package/src/__tests__/tilemap-owner-boundary.unit.test.ts +5 -2
- package/src/__tests__/tilemap-region-pack.test.ts +8 -12
- package/src/__tests__/tilemap-spawn-flip-pivot.test.ts +8 -12
- package/src/__tests__/tilemap-uv-inset.test.ts +11 -14
- package/src/__tests__/tilemap-validate.test.ts +1 -1
- package/src/__tests__/tileset-asset-validate.test.ts +638 -0
- package/src/__tests__/transcode-fallback.unit.test.ts +207 -0
- package/src/__tests__/transform-hierarchy-pixel-diff.dawn.test.ts +36 -28
- package/src/__tests__/transient-fields-collect.test.ts +28 -21
- package/src/__tests__/transient-runtime-behavior.test.ts +227 -0
- package/src/__tests__/transparent-sort-tilemap-sprite-interleave.test.ts +4 -4
- package/src/__tests__/variant-selection.unit.test.ts +1 -1
- package/src/__tests__/video-extract-bindgroup.dawn.test.ts +89 -136
- package/src/__tests__/video-loader-consumption.test.ts +86 -0
- package/src/__tests__/video-loader-smoke.dawn.test.ts +60 -0
- package/src/__tests__/view-ubo-layout.browser.test.ts +0 -22
- package/src/__tests__/world-entity-key.test.ts +1 -1
- package/src/__tests__/world-scene-despawn.test.ts +1 -1
- package/src/__tests__/world-scene-instantiate.test.ts +2 -36
- package/src/__tests__/world-scene-nested.test.ts +1 -1
- package/src/__tests__/world-scene-override.test.ts +1 -1
- package/src/backend-selection.ts +69 -0
- package/src/collect-scene-asset.ts +35 -23
- package/src/components/__tests__/camera.test-d.ts +1 -1
- package/src/components/__tests__/camera.test.ts +1 -1
- package/src/components/__tests__/sprite-animation.test-d.ts +2 -2
- package/src/components/__tests__/tile-layer.test-d.ts +1 -1
- package/src/components/__tests__/tile-layer.unit.test.ts +2 -2
- package/src/createRenderer.ts +24 -36
- package/src/errors/environment.ts +1 -1
- package/src/index.ts +51 -113
- package/src/renderer-host.ts +33 -0
- package/src/scene-instances/__tests__/post-spawn-resolve-joints.unit.test.ts +1 -1
- package/src/scene-instances/index.ts +4 -0
- package/src/scene-utils/mount-override-fold.ts +3 -7
- package/src/systems/__tests__/transparent-sort.bench.ts +3 -3
- package/src/systems/sprite-animation-tick.ts +1 -1
- package/src/systems/transparent-sort.ts +38 -38
- package/src/tilemap-register-validate.ts +4 -4
- package/dist/__tests__/bind-group-cache-binding.test.d.ts +0 -2
- package/dist/__tests__/bind-group-cache-binding.test.d.ts.map +0 -1
- package/dist/__tests__/bind-group-cache-frame.test.d.ts +0 -2
- package/dist/__tests__/bind-group-cache-frame.test.d.ts.map +0 -1
- package/dist/__tests__/dawn/mesh-update.dawn.test.d.ts +0 -2
- package/dist/__tests__/dawn/mesh-update.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/dispatch-fullscreen-pass-composite-swapchain.dawn.test.d.ts +0 -2
- package/dist/__tests__/dispatch-fullscreen-pass-composite-swapchain.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/dispatch-fullscreen-pass-custom-reads.dawn.test.d.ts +0 -2
- package/dist/__tests__/dispatch-fullscreen-pass-custom-reads.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/dispatch-fullscreen-pass-depth-composite.dawn.test.d.ts +0 -2
- package/dist/__tests__/dispatch-fullscreen-pass-depth-composite.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/dispatch-fullscreen-pass-params.unit.test.d.ts +0 -2
- package/dist/__tests__/dispatch-fullscreen-pass-params.unit.test.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-manifest.d.ts +0 -131
- package/dist/__tests__/fog-producer-manifest.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-pixel-probe.d.ts +0 -42
- package/dist/__tests__/fog-producer-pixel-probe.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-pixel.browser.test.d.ts +0 -2
- package/dist/__tests__/fog-producer-pixel.browser.test.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-pixel.dawn.test.d.ts +0 -2
- package/dist/__tests__/fog-producer-pixel.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-real-fixture.d.ts +0 -5
- package/dist/__tests__/fog-producer-real-fixture.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-vfx-effect.d.ts +0 -3
- package/dist/__tests__/fog-producer-vfx-effect.d.ts.map +0 -1
- package/dist/__tests__/fog-scene-asset.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-scene-asset.integration.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-resource-store-cubemap-status.test.d.ts +0 -2
- package/dist/__tests__/gpu-resource-store-cubemap-status.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-resource.test.d.ts +0 -2
- package/dist/__tests__/gpu-resource.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-bgl-slots.browser.test.d.ts +0 -2
- package/dist/__tests__/hdrp-bgl-slots.browser.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-buffers.unit.test.d.ts +0 -2
- package/dist/__tests__/hdrp-buffers.unit.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-execute-filter.unit.test.d.ts +0 -2
- package/dist/__tests__/hdrp-execute-filter.unit.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-gbuffer-attachments.browser.test.d.ts +0 -2
- package/dist/__tests__/hdrp-gbuffer-attachments.browser.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-pipeline-asset-type.test-d.d.ts +0 -2
- package/dist/__tests__/hdrp-pipeline-asset-type.test-d.d.ts.map +0 -1
- package/dist/__tests__/hdrp-ssao-boundary.test.d.ts +0 -2
- package/dist/__tests__/hdrp-ssao-boundary.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-ssao-falsification.test.d.ts +0 -2
- package/dist/__tests__/hdrp-ssao-falsification.test.d.ts.map +0 -1
- package/dist/__tests__/helpers/primitive-world.d.ts +0 -8
- package/dist/__tests__/helpers/primitive-world.d.ts.map +0 -1
- package/dist/__tests__/helpers/render-asset-port.d.ts +0 -15
- package/dist/__tests__/helpers/render-asset-port.d.ts.map +0 -1
- package/dist/__tests__/helpers/scene-asset-port.d.ts +0 -9
- package/dist/__tests__/helpers/scene-asset-port.d.ts.map +0 -1
- package/dist/__tests__/material-derived-coordinates.integration.test.d.ts +0 -2
- package/dist/__tests__/material-derived-coordinates.integration.test.d.ts.map +0 -1
- package/dist/__tests__/pipeline-layout-selection.test.d.ts +0 -2
- package/dist/__tests__/pipeline-layout-selection.test.d.ts.map +0 -1
- package/dist/__tests__/post-process-reads-narrowing.test-d.d.ts +0 -2
- package/dist/__tests__/post-process-reads-narrowing.test-d.d.ts.map +0 -1
- package/dist/__tests__/post-process-register-roundtrip.dawn.test.d.ts +0 -2
- package/dist/__tests__/post-process-register-roundtrip.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-zero-feature.browser.test.d.ts +0 -2
- package/dist/__tests__/render-feature-zero-feature.browser.test.d.ts.map +0 -1
- package/dist/__tests__/render-pipeline-trivial.dawn.test.d.ts +0 -2
- package/dist/__tests__/render-pipeline-trivial.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-csm-caster-membership.test.d.ts +0 -2
- package/dist/__tests__/shadow-csm-caster-membership.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-csm-pssm.test.d.ts +0 -2
- package/dist/__tests__/shadow-csm-pssm.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-csm-temporal.browser.test.d.ts +0 -2
- package/dist/__tests__/shadow-csm-temporal.browser.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-csm-viewport.test.d.ts +0 -2
- package/dist/__tests__/shadow-csm-viewport.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-m2.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-m2.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-m3-calibrate-run.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-m3-calibrate-run.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-m3-calibrate.d.ts +0 -83
- package/dist/__tests__/shadow-m3-calibrate.d.ts.map +0 -1
- package/dist/__tests__/shadow-m3.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-m3.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-probe-control-flow.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-probe-control-flow.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-quality-metrics.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-quality-metrics.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/temporal-off-path.unit.test.d.ts +0 -2
- package/dist/__tests__/temporal-off-path.unit.test.d.ts.map +0 -1
- package/dist/__tests__/video-cache-regression.unit.test.d.ts +0 -2
- package/dist/__tests__/video-cache-regression.unit.test.d.ts.map +0 -1
- package/dist/asset-kind.d.ts +0 -4
- package/dist/asset-kind.d.ts.map +0 -1
- package/dist/errors/sprite-animation.d.ts +0 -3
- package/dist/errors/sprite-animation.d.ts.map +0 -1
- package/dist/scene-asset-port.d.ts +0 -17
- package/dist/scene-asset-port.d.ts.map +0 -1
- package/dist/scene-collect-errors.d.ts +0 -22
- package/dist/scene-collect-errors.d.ts.map +0 -1
- package/dist/shadow-m3-calibrate.d.ts +0 -40
- package/dist/shadow-m3-calibrate.d.ts.map +0 -1
- package/src/__tests__/bind-group-cache-binding.test.ts +0 -2513
- package/src/__tests__/bind-group-cache-frame.test.ts +0 -1511
- package/src/__tests__/dispatch-fullscreen-pass-composite-swapchain.dawn.test.ts +0 -204
- package/src/__tests__/dispatch-fullscreen-pass-custom-reads.dawn.test.ts +0 -297
- package/src/__tests__/dispatch-fullscreen-pass-depth-composite.dawn.test.ts +0 -271
- package/src/__tests__/dispatch-fullscreen-pass-params.unit.test.ts +0 -321
- package/src/__tests__/fog-producer-manifest.ts +0 -162
- package/src/__tests__/fog-producer-pixel-probe.ts +0 -263
- package/src/__tests__/fog-producer-pixel.browser.test.ts +0 -26
- package/src/__tests__/fog-producer-pixel.dawn.test.ts +0 -55
- package/src/__tests__/fog-producer-real-fixture.ts +0 -805
- package/src/__tests__/fog-producer-vfx-effect.ts +0 -272
- package/src/__tests__/fog-scene-asset.integration.test.ts +0 -123
- package/src/__tests__/gpu-resource-store-cubemap-status.test.ts +0 -207
- package/src/__tests__/gpu-resource.test.ts +0 -1206
- package/src/__tests__/hdrp-bgl-slots.browser.test.ts +0 -50
- package/src/__tests__/hdrp-buffers.unit.test.ts +0 -70
- package/src/__tests__/hdrp-execute-filter.unit.test.ts +0 -200
- package/src/__tests__/hdrp-gbuffer-attachments.browser.test.ts +0 -64
- package/src/__tests__/hdrp-pipeline-asset-type.test-d.ts +0 -139
- package/src/__tests__/hdrp-ssao-boundary.test.ts +0 -237
- package/src/__tests__/hdrp-ssao-falsification.test.ts +0 -289
- package/src/__tests__/helpers/primitive-world.ts +0 -91
- package/src/__tests__/helpers/render-asset-port.ts +0 -65
- package/src/__tests__/helpers/scene-asset-port.ts +0 -23
- package/src/__tests__/material-derived-coordinates.integration.test.ts +0 -100
- package/src/__tests__/pipeline-layout-selection.test.ts +0 -298
- package/src/__tests__/post-process-reads-narrowing.test-d.ts +0 -52
- package/src/__tests__/post-process-register-roundtrip.dawn.test.ts +0 -230
- package/src/__tests__/render-feature-zero-feature.browser.test.ts +0 -152
- package/src/__tests__/render-pipeline-trivial.dawn.test.ts +0 -525
- package/src/__tests__/shadow-csm-caster-membership.test.ts +0 -232
- package/src/__tests__/shadow-csm-pssm.test.ts +0 -142
- package/src/__tests__/shadow-csm-temporal.browser.test.ts +0 -145
- package/src/__tests__/shadow-csm-viewport.test.ts +0 -74
- package/src/__tests__/shadow-m2.dawn.test.ts +0 -394
- package/src/__tests__/shadow-m3-calibrate-run.dawn.test.ts +0 -248
- package/src/__tests__/shadow-m3-calibrate.ts +0 -203
- package/src/__tests__/shadow-m3.dawn.test.ts +0 -288
- package/src/__tests__/shadow-probe-control-flow.dawn.test.ts +0 -264
- package/src/__tests__/shadow-quality-metrics.dawn.test.ts +0 -324
- package/src/__tests__/temporal-off-path.unit.test.ts +0 -69
- package/src/__tests__/video-cache-regression.unit.test.ts +0 -186
- package/src/asset-kind.ts +0 -7
- package/src/errors/sprite-animation.ts +0 -5
- package/src/scene-asset-port.ts +0 -32
- package/src/scene-collect-errors.ts +0 -30
- package/src/shadow-m3-calibrate.ts +0 -171
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { AssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
2
|
+
import { audioLoader } from '@forgeax/engine-audio-webaudio';
|
|
3
|
+
import { AssetGuid } from '@forgeax/engine-pack/guid';
|
|
4
|
+
import type { AudioClipAsset } from '@forgeax/engine-types';
|
|
5
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
6
|
+
import { makeMockShaderRegistry } from './helpers/mock-shader-registry';
|
|
7
|
+
|
|
8
|
+
const AUDIO_GUID = 'db30f00d-0000-4000-8000-000000000001';
|
|
9
|
+
const PACK_INDEX_URL = '/pack-index.json';
|
|
10
|
+
const PACKAGE_URL = '/assets/audio.pack.json';
|
|
11
|
+
const ARTIFACT_URL = '/assets/audio/source.bin';
|
|
12
|
+
|
|
13
|
+
function audioPack(byteLength = 16) {
|
|
14
|
+
return {
|
|
15
|
+
schemaVersion: '2.0.0',
|
|
16
|
+
kind: 'internal-text-package',
|
|
17
|
+
assets: [
|
|
18
|
+
{
|
|
19
|
+
guid: AUDIO_GUID,
|
|
20
|
+
kind: 'audio',
|
|
21
|
+
payload: { kind: 'audio', mediaType: 'audio/wav' },
|
|
22
|
+
refs: [],
|
|
23
|
+
artifacts: {
|
|
24
|
+
source: {
|
|
25
|
+
path: 'audio/source.bin',
|
|
26
|
+
mediaType: 'audio/wav',
|
|
27
|
+
assetCodec: { name: 'browser-audio' },
|
|
28
|
+
contentEncoding: 'identity',
|
|
29
|
+
byteLength,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
describe('audio loadByGuid', () => {
|
|
38
|
+
const originalFetch = globalThis.fetch;
|
|
39
|
+
const originalAudioContext = globalThis.AudioContext;
|
|
40
|
+
|
|
41
|
+
afterEach(() => {
|
|
42
|
+
globalThis.fetch = originalFetch;
|
|
43
|
+
globalThis.AudioContext = originalAudioContext;
|
|
44
|
+
vi.restoreAllMocks();
|
|
45
|
+
vi.unstubAllGlobals();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('loads and catalogues an audio GUID through its Pack v2 artifact', async () => {
|
|
49
|
+
const audioData = new ArrayBuffer(16);
|
|
50
|
+
const audioContext = vi.fn();
|
|
51
|
+
const fetchMock = vi.fn().mockImplementation((url: string) => {
|
|
52
|
+
if (url === PACK_INDEX_URL) {
|
|
53
|
+
return Promise.resolve({
|
|
54
|
+
ok: true,
|
|
55
|
+
json: async () => [{ guid: AUDIO_GUID, packageUrl: PACKAGE_URL, kind: 'audio' }],
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (url === PACKAGE_URL) {
|
|
59
|
+
return Promise.resolve({ ok: true, json: async () => audioPack() });
|
|
60
|
+
}
|
|
61
|
+
if (url === ARTIFACT_URL) {
|
|
62
|
+
return Promise.resolve({ ok: true, arrayBuffer: async () => audioData });
|
|
63
|
+
}
|
|
64
|
+
return Promise.resolve({ ok: false, status: 404, statusText: 'Not Found' });
|
|
65
|
+
});
|
|
66
|
+
globalThis.fetch = fetchMock as typeof globalThis.fetch;
|
|
67
|
+
globalThis.AudioContext = audioContext as unknown as typeof AudioContext;
|
|
68
|
+
|
|
69
|
+
const registry = new AssetRegistry(makeMockShaderRegistry(), undefined, [audioLoader]);
|
|
70
|
+
registry.configurePackIndex(PACK_INDEX_URL);
|
|
71
|
+
const parsed = AssetGuid.parse(AUDIO_GUID);
|
|
72
|
+
if (!parsed.ok) throw new Error('test GUID must be valid');
|
|
73
|
+
|
|
74
|
+
const first = await registry.loadByGuid<AudioClipAsset>(parsed.value);
|
|
75
|
+
const second = await registry.loadByGuid<AudioClipAsset>(parsed.value);
|
|
76
|
+
|
|
77
|
+
expect(first.ok).toBe(true);
|
|
78
|
+
expect(second.ok).toBe(true);
|
|
79
|
+
if (!first.ok) throw first.error;
|
|
80
|
+
if (!second.ok) throw second.error;
|
|
81
|
+
expect(first.value).toEqual({
|
|
82
|
+
kind: 'audio',
|
|
83
|
+
sourceKey: AUDIO_GUID,
|
|
84
|
+
mediaType: 'audio/wav',
|
|
85
|
+
bytes: new Uint8Array(audioData),
|
|
86
|
+
});
|
|
87
|
+
expect(second.value).toBe(first.value);
|
|
88
|
+
expect(registry.lookup(parsed.value)).toBe(first.value);
|
|
89
|
+
expect(fetchMock).toHaveBeenCalledTimes(3);
|
|
90
|
+
expect(audioContext).not.toHaveBeenCalled();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('defers malformed-byte rejection to the Host audio consumer', async () => {
|
|
94
|
+
const fetchMock = vi.fn().mockImplementation((url: string) => {
|
|
95
|
+
if (url === PACK_INDEX_URL) {
|
|
96
|
+
return Promise.resolve({
|
|
97
|
+
ok: true,
|
|
98
|
+
json: async () => [{ guid: AUDIO_GUID, packageUrl: PACKAGE_URL, kind: 'audio' }],
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (url === PACKAGE_URL) {
|
|
102
|
+
return Promise.resolve({ ok: true, json: async () => audioPack(8) });
|
|
103
|
+
}
|
|
104
|
+
return Promise.resolve({ ok: true, arrayBuffer: async () => new ArrayBuffer(8) });
|
|
105
|
+
});
|
|
106
|
+
globalThis.fetch = fetchMock as typeof globalThis.fetch;
|
|
107
|
+
globalThis.AudioContext = vi.fn().mockImplementation(function AudioContextMock() {
|
|
108
|
+
return {
|
|
109
|
+
decodeAudioData: vi.fn().mockRejectedValue(new Error('bad audio')),
|
|
110
|
+
close: vi.fn(),
|
|
111
|
+
} as unknown as AudioContext;
|
|
112
|
+
}) as unknown as typeof AudioContext;
|
|
113
|
+
|
|
114
|
+
const registry = new AssetRegistry(makeMockShaderRegistry(), undefined, [audioLoader]);
|
|
115
|
+
registry.configurePackIndex(PACK_INDEX_URL);
|
|
116
|
+
const parsed = AssetGuid.parse(AUDIO_GUID);
|
|
117
|
+
if (!parsed.ok) throw new Error('test GUID must be valid');
|
|
118
|
+
|
|
119
|
+
const result = await registry.loadByGuid<AudioClipAsset>(parsed.value);
|
|
120
|
+
|
|
121
|
+
expect(result.ok).toBe(true);
|
|
122
|
+
if (!result.ok) throw result.error;
|
|
123
|
+
expect(result.value.sourceKey).toBe(AUDIO_GUID);
|
|
124
|
+
expect(result.value.bytes).toEqual(new Uint8Array(8));
|
|
125
|
+
});
|
|
126
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { rhi } from '@forgeax/engine-rhi-null';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { loadBackendPack } from '../backend-selection';
|
|
4
|
+
|
|
5
|
+
describe('backend selection', () => {
|
|
6
|
+
it('uses an explicitly injected backend without probing global state', async () => {
|
|
7
|
+
const result = await loadBackendPack({ rhi });
|
|
8
|
+
expect(result.ok).toBe(true);
|
|
9
|
+
if (result.ok) expect(result.value.rhi).toBe(rhi);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
// basis-catalog-dispatch.integration.test.ts -- feat-20260707 M6 fix regression.
|
|
2
|
+
//
|
|
3
|
+
// End-to-end witness for the catalog round-trip bug: the pack-index ROW must
|
|
4
|
+
// carry the resolved `compression: 'basis-*'` discriminant so the runtime
|
|
5
|
+
// `loadTextureAsset` dispatches its transcode arm. Before the fix, the build /
|
|
6
|
+
// dev texture arms stamped the row with the STRATEGY_TABLE 'none' default (the
|
|
7
|
+
// resolved basis-* lived only in `metadata.compression`), so loadTextureAsset
|
|
8
|
+
// missed the transcode arm and the scheme=1 (BasisLZ / ETC1S) KTX2 fell through
|
|
9
|
+
// to `ktx2LevelsToRGBA`, which rejects it with `ktx2-unsupported-scheme`.
|
|
10
|
+
//
|
|
11
|
+
// This test uses the REAL encoder + REAL transcoder WASM (no mocks) so it
|
|
12
|
+
// exercises the exact scheme=1 payload the pipeline ships:
|
|
13
|
+
// (bug witness) row compression='none' -> scheme=1 reject (load fails)
|
|
14
|
+
// (fix) row compression='basis-etc1s' -> transcode arm succeeds
|
|
15
|
+
//
|
|
16
|
+
// pkg/ (encoder + transcoder glue) is a gitignored emcc artefact (AC-12); CI's
|
|
17
|
+
// build-artifacts job builds it. Skip when absent (contributor without emsdk).
|
|
18
|
+
|
|
19
|
+
import { existsSync } from 'node:fs';
|
|
20
|
+
import { fileURLToPath } from 'node:url';
|
|
21
|
+
import { AssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
22
|
+
// NOTE: @forgeax/engine-codec/encode is the build-time encoder subpath. The
|
|
23
|
+
// image-pipeline isolation gate (path d) forbids a STATIC import of it from
|
|
24
|
+
// packages/runtime/src (encode is build-time only). This test needs the real
|
|
25
|
+
// encoder to mint a Basis KTX2 fixture, so it uses a DYNAMIC import inside the
|
|
26
|
+
// pkg-gated beforeAll — build-time-only, never reached in shipped runtime code.
|
|
27
|
+
import { AssetGuid } from '@forgeax/engine-pack/guid';
|
|
28
|
+
import type { TranscodeCaps } from '@forgeax/engine-types';
|
|
29
|
+
import { afterEach, beforeAll, beforeEach, describe, expect, it } from 'vitest';
|
|
30
|
+
import type { BasisEncoderModule, BasisModuleFactory } from '../../../codec/src/wasm/basis-types';
|
|
31
|
+
import { makeMockShaderRegistry } from './helpers/mock-shader-registry';
|
|
32
|
+
|
|
33
|
+
const ENCODER_GLUE = new URL('../../../codec/pkg/encode/basis_encoder.mjs', import.meta.url);
|
|
34
|
+
const TRANSCODER_GLUE = new URL('../../../codec/pkg/basis_transcoder.mjs', import.meta.url);
|
|
35
|
+
const pkgBuilt =
|
|
36
|
+
existsSync(fileURLToPath(ENCODER_GLUE)) && existsSync(fileURLToPath(TRANSCODER_GLUE));
|
|
37
|
+
|
|
38
|
+
const GUID_TEX = 'c0000000-0000-4000-a000-0000626173a1';
|
|
39
|
+
const PACK_INDEX_URL = '/basis-catalog-dispatch-pack-index.json';
|
|
40
|
+
const PACK_URL = `/ddc/${GUID_TEX}.pack.json`;
|
|
41
|
+
const W = 16;
|
|
42
|
+
const H = 16;
|
|
43
|
+
const CAPABILITY_CELLS = [
|
|
44
|
+
[{ bc: false, etc2: false, astc: false }, 'rgba'],
|
|
45
|
+
[{ bc: false, etc2: false, astc: true }, 'astc'],
|
|
46
|
+
[{ bc: true, etc2: false, astc: false }, 'bc'],
|
|
47
|
+
[{ bc: false, etc2: true, astc: false }, 'etc'],
|
|
48
|
+
[{ bc: true, etc2: true, astc: true }, 'all'],
|
|
49
|
+
] as const;
|
|
50
|
+
const NO_CAPS = CAPABILITY_CELLS[0][0];
|
|
51
|
+
|
|
52
|
+
let basisKtx2: Uint8Array;
|
|
53
|
+
let uastcLdrKtx2: Uint8Array;
|
|
54
|
+
let uastcHdrKtx2: Uint8Array;
|
|
55
|
+
let rawBasis: Uint8Array;
|
|
56
|
+
let originalFetch: typeof globalThis.fetch;
|
|
57
|
+
|
|
58
|
+
type TextureFixture = {
|
|
59
|
+
readonly bytes: Uint8Array;
|
|
60
|
+
readonly extension: 'ktx2' | 'basis';
|
|
61
|
+
readonly mediaType: 'image/ktx2' | 'image/basis';
|
|
62
|
+
readonly container: 'ktx2' | 'basis';
|
|
63
|
+
readonly profile: 'etc1s' | 'uastc-ldr' | 'uastc-hdr';
|
|
64
|
+
readonly colorSpace: 'srgb' | 'linear';
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
function parseGuid(g: string): AssetGuid {
|
|
68
|
+
const parsed = AssetGuid.parse(g);
|
|
69
|
+
if (!parsed.ok) throw new Error(`bad guid ${g}`);
|
|
70
|
+
return parsed.value;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Build a deterministic RGBA gradient and encode it to a real ETC1S Basis KTX2
|
|
74
|
+
// (scheme=1). The exact payload the vite-plugin-pack image arm ships for a
|
|
75
|
+
// compressionMode:'auto' sRGB texture.
|
|
76
|
+
beforeAll(async () => {
|
|
77
|
+
if (!pkgBuilt) return;
|
|
78
|
+
const { basisEncode } = await import('@forgeax/engine-codec/encode');
|
|
79
|
+
const pixels = new Uint8Array(W * H * 4);
|
|
80
|
+
for (let y = 0; y < H; y++) {
|
|
81
|
+
for (let x = 0; x < W; x++) {
|
|
82
|
+
const i = (y * W + x) * 4;
|
|
83
|
+
pixels[i] = (x * 16) & 0xff;
|
|
84
|
+
pixels[i + 1] = (y * 16) & 0xff;
|
|
85
|
+
pixels[i + 2] = 128;
|
|
86
|
+
pixels[i + 3] = 255;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async function encode(mode: 'etc1s' | 'uastc-ldr' | 'uastc-hdr', source: Uint8Array) {
|
|
90
|
+
const enc = await basisEncode(source, {
|
|
91
|
+
mode,
|
|
92
|
+
width: W,
|
|
93
|
+
height: H,
|
|
94
|
+
srgb: mode !== 'uastc-hdr',
|
|
95
|
+
perceptual: mode !== 'uastc-hdr',
|
|
96
|
+
uastcSupercompression: mode === 'uastc-ldr',
|
|
97
|
+
mipGen: false,
|
|
98
|
+
});
|
|
99
|
+
if (!enc.ok) throw new Error(`basisEncode failed: ${enc.error.code}`);
|
|
100
|
+
return enc.value;
|
|
101
|
+
}
|
|
102
|
+
basisKtx2 = await encode('etc1s', pixels);
|
|
103
|
+
uastcLdrKtx2 = await encode('uastc-ldr', pixels);
|
|
104
|
+
uastcHdrKtx2 = await encode('uastc-hdr', new Uint8Array(W * H * 8));
|
|
105
|
+
|
|
106
|
+
const factory = (
|
|
107
|
+
(await import(/* @vite-ignore */ ENCODER_GLUE.href)) as {
|
|
108
|
+
default: BasisModuleFactory<BasisEncoderModule>;
|
|
109
|
+
}
|
|
110
|
+
).default;
|
|
111
|
+
const mod = await factory({
|
|
112
|
+
locateFile: () => new URL('../../../codec/pkg/encode/basis_encoder.wasm', import.meta.url).href,
|
|
113
|
+
});
|
|
114
|
+
mod.initializeBasis();
|
|
115
|
+
const encoder = new mod.BasisEncoder();
|
|
116
|
+
try {
|
|
117
|
+
encoder.setSliceSourceImage(0, pixels, W, H, 0);
|
|
118
|
+
encoder.setCreateKTX2File(false);
|
|
119
|
+
encoder.setFormatMode(mod.basis_tex_format.cUASTC_LDR_4x4.value);
|
|
120
|
+
encoder.setPerceptual(false);
|
|
121
|
+
encoder.setMipGen(false);
|
|
122
|
+
const bytes = new Uint8Array(1 << 20);
|
|
123
|
+
const length = encoder.encode(bytes);
|
|
124
|
+
if (length <= 0) throw new Error('raw Basis encode failed');
|
|
125
|
+
rawBasis = bytes.slice(0, length);
|
|
126
|
+
} finally {
|
|
127
|
+
encoder.delete();
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
function wireFetch(
|
|
132
|
+
includeCodec: boolean,
|
|
133
|
+
fixture: TextureFixture = {
|
|
134
|
+
bytes: basisKtx2,
|
|
135
|
+
extension: 'ktx2',
|
|
136
|
+
mediaType: 'image/ktx2',
|
|
137
|
+
container: 'ktx2',
|
|
138
|
+
profile: 'etc1s',
|
|
139
|
+
colorSpace: 'srgb',
|
|
140
|
+
},
|
|
141
|
+
): void {
|
|
142
|
+
globalThis.fetch = ((input: string) => {
|
|
143
|
+
const url = typeof input === 'string' ? input : String(input);
|
|
144
|
+
if (url === PACK_INDEX_URL) {
|
|
145
|
+
return Promise.resolve({
|
|
146
|
+
ok: true,
|
|
147
|
+
json: () =>
|
|
148
|
+
Promise.resolve([
|
|
149
|
+
{
|
|
150
|
+
guid: GUID_TEX,
|
|
151
|
+
packageUrl: PACK_URL,
|
|
152
|
+
kind: 'texture',
|
|
153
|
+
},
|
|
154
|
+
]),
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
if (url === PACK_URL) {
|
|
158
|
+
return Promise.resolve({
|
|
159
|
+
ok: true,
|
|
160
|
+
json: () =>
|
|
161
|
+
Promise.resolve({
|
|
162
|
+
schemaVersion: '2.0.0',
|
|
163
|
+
kind: 'internal-text-package',
|
|
164
|
+
assets: [
|
|
165
|
+
{
|
|
166
|
+
guid: GUID_TEX,
|
|
167
|
+
kind: 'texture',
|
|
168
|
+
payload: {
|
|
169
|
+
width: W,
|
|
170
|
+
height: H,
|
|
171
|
+
format: fixture.colorSpace === 'srgb' ? 'rgba8unorm-srgb' : 'rgba16float',
|
|
172
|
+
colorSpace: fixture.colorSpace,
|
|
173
|
+
},
|
|
174
|
+
refs: [],
|
|
175
|
+
artifacts: {
|
|
176
|
+
body: {
|
|
177
|
+
path: `${GUID_TEX}.${fixture.extension}`,
|
|
178
|
+
mediaType: fixture.mediaType,
|
|
179
|
+
...(includeCodec
|
|
180
|
+
? {
|
|
181
|
+
assetCodec: {
|
|
182
|
+
name: 'basis',
|
|
183
|
+
container: fixture.container,
|
|
184
|
+
profile: fixture.profile,
|
|
185
|
+
},
|
|
186
|
+
}
|
|
187
|
+
: {}),
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
}),
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
// Serve the real Basis KTX2 bytes for the artifact URL.
|
|
196
|
+
return Promise.resolve({
|
|
197
|
+
ok: true,
|
|
198
|
+
arrayBuffer: () =>
|
|
199
|
+
Promise.resolve(
|
|
200
|
+
fixture.bytes.buffer.slice(
|
|
201
|
+
fixture.bytes.byteOffset,
|
|
202
|
+
fixture.bytes.byteOffset + fixture.bytes.byteLength,
|
|
203
|
+
),
|
|
204
|
+
),
|
|
205
|
+
});
|
|
206
|
+
}) as unknown as typeof globalThis.fetch;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
async function loadWith(
|
|
210
|
+
includeCodec: boolean,
|
|
211
|
+
fixture?: TextureFixture,
|
|
212
|
+
caps: TranscodeCaps = NO_CAPS,
|
|
213
|
+
) {
|
|
214
|
+
wireFetch(includeCodec, fixture);
|
|
215
|
+
const reg = new AssetRegistry(makeMockShaderRegistry());
|
|
216
|
+
reg.configurePackIndex(PACK_INDEX_URL);
|
|
217
|
+
reg.setTranscodeCaps(caps);
|
|
218
|
+
return reg.loadByGuid(parseGuid(GUID_TEX));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
describe.skipIf(!pkgBuilt)('Basis catalog dispatch round-trip (M6 fix)', () => {
|
|
222
|
+
beforeEach(() => {
|
|
223
|
+
originalFetch = globalThis.fetch;
|
|
224
|
+
});
|
|
225
|
+
afterEach(() => {
|
|
226
|
+
globalThis.fetch = originalFetch;
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it('loads a Basis texture when the artifact has no optional codec hint', async () => {
|
|
230
|
+
// Catalog v2 carries package navigation only. The optional codec hint is
|
|
231
|
+
// owned by the artifact descriptor, so a valid KTX2 artifact remains
|
|
232
|
+
// loadable when that hint is absent from the package row.
|
|
233
|
+
const result = await loadWith(false);
|
|
234
|
+
expect(result.ok).toBe(true);
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
it('artifact codec=basis-etc1s takes the transcode arm and loads', async () => {
|
|
238
|
+
const result = await loadWith(true);
|
|
239
|
+
expect(result.ok).toBe(true);
|
|
240
|
+
if (!result.ok) throw new Error(`load failed: ${result.error.code}`);
|
|
241
|
+
const tex = result.value as { kind: string; width: number; height: number; format: string };
|
|
242
|
+
expect(tex.kind).toBe('texture');
|
|
243
|
+
expect(tex.width).toBe(W);
|
|
244
|
+
expect(tex.height).toBe(H);
|
|
245
|
+
// NO_CAPS -> the transcode arm degrades to the uncompressed sRGB fallback
|
|
246
|
+
// (section 8 P3), never a scheme=1 reject.
|
|
247
|
+
expect(tex.format).toBe('rgba8unorm-srgb');
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it('loads every real KTX2/Basis profile through Catalog and loadByGuid', async () => {
|
|
251
|
+
const fixtures: readonly TextureFixture[] = [
|
|
252
|
+
{
|
|
253
|
+
bytes: basisKtx2,
|
|
254
|
+
extension: 'ktx2',
|
|
255
|
+
mediaType: 'image/ktx2',
|
|
256
|
+
container: 'ktx2',
|
|
257
|
+
profile: 'etc1s',
|
|
258
|
+
colorSpace: 'srgb',
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
bytes: uastcLdrKtx2,
|
|
262
|
+
extension: 'ktx2',
|
|
263
|
+
mediaType: 'image/ktx2',
|
|
264
|
+
container: 'ktx2',
|
|
265
|
+
profile: 'uastc-ldr',
|
|
266
|
+
colorSpace: 'srgb',
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
bytes: uastcHdrKtx2,
|
|
270
|
+
extension: 'ktx2',
|
|
271
|
+
mediaType: 'image/ktx2',
|
|
272
|
+
container: 'ktx2',
|
|
273
|
+
profile: 'uastc-hdr',
|
|
274
|
+
colorSpace: 'linear',
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
bytes: rawBasis,
|
|
278
|
+
extension: 'basis',
|
|
279
|
+
mediaType: 'image/basis',
|
|
280
|
+
container: 'basis',
|
|
281
|
+
profile: 'uastc-ldr',
|
|
282
|
+
colorSpace: 'srgb',
|
|
283
|
+
},
|
|
284
|
+
];
|
|
285
|
+
|
|
286
|
+
for (const fixture of fixtures) {
|
|
287
|
+
for (const [caps, arm] of CAPABILITY_CELLS) {
|
|
288
|
+
const result = await loadWith(true, fixture, caps);
|
|
289
|
+
expect(result.ok, `${fixture.container}:${fixture.profile}:${arm}`).toBe(true);
|
|
290
|
+
if (!result.ok) continue;
|
|
291
|
+
const texture = result.value as {
|
|
292
|
+
kind: string;
|
|
293
|
+
width: number;
|
|
294
|
+
height: number;
|
|
295
|
+
format: string;
|
|
296
|
+
data: Uint8Array;
|
|
297
|
+
colorSpace: string;
|
|
298
|
+
};
|
|
299
|
+
expect(texture.kind).toBe('texture');
|
|
300
|
+
expect(texture.width).toBe(W);
|
|
301
|
+
expect(texture.height).toBe(H);
|
|
302
|
+
expect(texture.data.byteLength).toBeGreaterThan(0);
|
|
303
|
+
expect(texture.colorSpace).toBe(fixture.colorSpace);
|
|
304
|
+
const expected =
|
|
305
|
+
fixture.profile === 'uastc-hdr'
|
|
306
|
+
? caps.bc
|
|
307
|
+
? 'bc6h-rgb-ufloat'
|
|
308
|
+
: 'rgba16float'
|
|
309
|
+
: caps.bc
|
|
310
|
+
? `bc7-rgba-unorm${fixture.colorSpace === 'srgb' ? '-srgb' : ''}`
|
|
311
|
+
: caps.astc
|
|
312
|
+
? `astc-4x4-unorm${fixture.colorSpace === 'srgb' ? '-srgb' : ''}`
|
|
313
|
+
: caps.etc2
|
|
314
|
+
? `etc2-rgba8unorm${fixture.colorSpace === 'srgb' ? '-srgb' : ''}`
|
|
315
|
+
: `rgba8unorm${fixture.colorSpace === 'srgb' ? '-srgb' : ''}`;
|
|
316
|
+
expect(texture.format, `${fixture.container}:${fixture.profile}:${arm}`).toBe(expected);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
});
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
// w5: cleanup eviction (cleanPerEntityCache — red until w8 rewrites it)
|
|
8
8
|
// + getOrCreatePerEntity existence (red until w8 implements it).
|
|
9
9
|
|
|
10
|
+
import type { BindGroup } from '@forgeax/engine-rhi';
|
|
11
|
+
import { describe, expect, it } from 'vitest';
|
|
12
|
+
import type { BindGroupCounts } from '../../../render/src/record/frame-snapshot';
|
|
10
13
|
import {
|
|
11
|
-
type BindGroupCounts,
|
|
12
14
|
cleanPerEntityCache,
|
|
13
15
|
getOrCreateFromChain,
|
|
14
16
|
getOrCreatePerEntity,
|
|
15
|
-
} from '
|
|
16
|
-
import type { BindGroup } from '@forgeax/engine-rhi';
|
|
17
|
-
import { describe, expect, it } from 'vitest';
|
|
17
|
+
} from '../../../render/src/record/mesh-ssbo';
|
|
18
18
|
|
|
19
19
|
// ─── helpers ────────────────────────────────────────────────────────────────
|
|
20
20
|
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
// - no re-test of the block table contents (codec w9 owns that)
|
|
17
17
|
// - pure node unit, no browser / dawn dependency
|
|
18
18
|
|
|
19
|
+
import { describe, expect, it } from 'vitest';
|
|
19
20
|
import {
|
|
20
21
|
deriveMipUploadLayout,
|
|
21
22
|
deriveTextureExtent,
|
|
22
23
|
type MipUploadLevel,
|
|
23
|
-
} from '
|
|
24
|
-
import { describe, expect, it } from 'vitest';
|
|
24
|
+
} from '../../../render/src/render-data';
|
|
25
25
|
|
|
26
26
|
/** Sum of every level's byte length -- the total block-byte buffer size. */
|
|
27
27
|
function totalBytes(layout: readonly MipUploadLevel[]): number {
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// M6 w46 (AC-30): BuiltinAssetRegistry process-static resolution TDD.
|
|
2
|
+
//
|
|
3
|
+
// D-15 two-tier asset resolution: builtin payloads live in a process-static
|
|
4
|
+
// const keyed by fixed slot u32 (1..6), resolved without any World. Slots
|
|
5
|
+
// >= BUILTIN_BASE belong to the user tier (World.sharedRefs) and resolve to
|
|
6
|
+
// null here. R-13: module init order — importing BuiltinAssetRegistry then
|
|
7
|
+
// immediately resolving all 6 handles must not throw / return undefined.
|
|
8
|
+
// M6 w46 (AC-30): BuiltinAssetRegistry process-static resolution TDD.
|
|
9
|
+
//
|
|
10
|
+
// D-15 two-tier asset resolution: builtin payloads live in a process-static
|
|
11
|
+
// const keyed by fixed slot u32 (1..6), resolved without any World. Slots
|
|
12
|
+
// >= BUILTIN_BASE belong to the user tier (World.sharedRefs) and resolve to
|
|
13
|
+
// null here. R-13: module init order — importing BuiltinAssetRegistry then
|
|
14
|
+
// immediately resolving all 6 handles must not throw / return undefined.
|
|
15
|
+
import {
|
|
16
|
+
BUILTIN_BASE,
|
|
17
|
+
BUILTIN_CUBE,
|
|
18
|
+
BUILTIN_CYLINDER,
|
|
19
|
+
BUILTIN_NINESLICE_QUAD,
|
|
20
|
+
BUILTIN_QUAD,
|
|
21
|
+
BUILTIN_SPHERE,
|
|
22
|
+
BUILTIN_TRIANGLE,
|
|
23
|
+
BuiltinAssetRegistry,
|
|
24
|
+
HANDLE_CUBE,
|
|
25
|
+
HANDLE_CYLINDER,
|
|
26
|
+
HANDLE_NINESLICE_QUAD,
|
|
27
|
+
HANDLE_QUAD,
|
|
28
|
+
HANDLE_SPHERE,
|
|
29
|
+
HANDLE_TRIANGLE,
|
|
30
|
+
} from '@forgeax/engine-assets-runtime';
|
|
31
|
+
import { toShared } from '@forgeax/engine-types';
|
|
32
|
+
import { describe, expect, it } from 'vitest';
|
|
33
|
+
|
|
34
|
+
describe('BuiltinAssetRegistry.resolve (AC-30)', () => {
|
|
35
|
+
it('resolves each builtin slot 1..6 to its frozen payload', () => {
|
|
36
|
+
expect(BuiltinAssetRegistry.resolve(HANDLE_CUBE)).toBe(BUILTIN_CUBE);
|
|
37
|
+
expect(BuiltinAssetRegistry.resolve(HANDLE_TRIANGLE)).toBe(BUILTIN_TRIANGLE);
|
|
38
|
+
expect(BuiltinAssetRegistry.resolve(HANDLE_QUAD)).toBe(BUILTIN_QUAD);
|
|
39
|
+
expect(BuiltinAssetRegistry.resolve(HANDLE_SPHERE)).toBe(BUILTIN_SPHERE);
|
|
40
|
+
expect(BuiltinAssetRegistry.resolve(HANDLE_NINESLICE_QUAD)).toBe(BUILTIN_NINESLICE_QUAD);
|
|
41
|
+
expect(BuiltinAssetRegistry.resolve(HANDLE_CYLINDER)).toBe(BUILTIN_CYLINDER);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('returns frozen payloads (Object.isFrozen)', () => {
|
|
45
|
+
expect(Object.isFrozen(BUILTIN_CUBE)).toBe(true);
|
|
46
|
+
expect(Object.isFrozen(BUILTIN_TRIANGLE)).toBe(true);
|
|
47
|
+
expect(Object.isFrozen(BUILTIN_QUAD)).toBe(true);
|
|
48
|
+
expect(Object.isFrozen(BUILTIN_SPHERE)).toBe(true);
|
|
49
|
+
expect(Object.isFrozen(BUILTIN_NINESLICE_QUAD)).toBe(true);
|
|
50
|
+
expect(Object.isFrozen(BUILTIN_CYLINDER)).toBe(true);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('returns null for user-tier slots (slot >= BUILTIN_BASE)', () => {
|
|
54
|
+
expect(BuiltinAssetRegistry.resolve(toShared<'MeshAsset'>(BUILTIN_BASE))).toBeNull();
|
|
55
|
+
expect(BuiltinAssetRegistry.resolve(toShared<'MeshAsset'>(BUILTIN_BASE + 1))).toBeNull();
|
|
56
|
+
expect(BuiltinAssetRegistry.resolve(toShared<'MeshAsset'>(99999))).toBeNull();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('returns null for slot 0 (no builtin reserves slot 0)', () => {
|
|
60
|
+
expect(BuiltinAssetRegistry.resolve(toShared<'MeshAsset'>(0))).toBeNull();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('R-13: module-first-import probe resolves all 6 handles without throwing or undefined', () => {
|
|
64
|
+
// Importing BuiltinAssetRegistry then resolving must observe fully
|
|
65
|
+
// constructed frozen payloads — no init-order hazard (synchronous,
|
|
66
|
+
// module-level, no side effect).
|
|
67
|
+
for (const handle of [
|
|
68
|
+
HANDLE_CUBE,
|
|
69
|
+
HANDLE_TRIANGLE,
|
|
70
|
+
HANDLE_QUAD,
|
|
71
|
+
HANDLE_SPHERE,
|
|
72
|
+
HANDLE_NINESLICE_QUAD,
|
|
73
|
+
HANDLE_CYLINDER,
|
|
74
|
+
]) {
|
|
75
|
+
const payload = BuiltinAssetRegistry.resolve(handle);
|
|
76
|
+
expect(payload).not.toBeUndefined();
|
|
77
|
+
expect(payload).not.toBeNull();
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// bug-20260709-builtin-quad-withoutaabb-disables-sprite-frustum-cu M2 / AC-02.
|
|
83
|
+
//
|
|
84
|
+
// Flat aabb layout is `Float32Array` of length 6 [minX, minY, minZ,
|
|
85
|
+
// maxX, maxY, maxZ] per `packages/types/src/index.ts:308` — the requirements
|
|
86
|
+
// wording "min/max both length-3 arrays with min[i] <= max[i]" reads as
|
|
87
|
+
// index [0..2] vs [3..5] within that flat array (no {min,max} object wrap).
|
|
88
|
+
describe('builtin payloads carry finite local-space AABBs (AC-02)', () => {
|
|
89
|
+
it.each([
|
|
90
|
+
['HANDLE_CUBE', HANDLE_CUBE, BUILTIN_CUBE],
|
|
91
|
+
['HANDLE_TRIANGLE', HANDLE_TRIANGLE, BUILTIN_TRIANGLE],
|
|
92
|
+
['HANDLE_QUAD', HANDLE_QUAD, BUILTIN_QUAD],
|
|
93
|
+
['HANDLE_SPHERE', HANDLE_SPHERE, BUILTIN_SPHERE],
|
|
94
|
+
['HANDLE_NINESLICE_QUAD', HANDLE_NINESLICE_QUAD, BUILTIN_NINESLICE_QUAD],
|
|
95
|
+
['HANDLE_CYLINDER', HANDLE_CYLINDER, BUILTIN_CYLINDER],
|
|
96
|
+
])('%s exposes the same valid local AABB through registry and export', (_name, handle, exportedConst) => {
|
|
97
|
+
const payload = BuiltinAssetRegistry.resolve(handle);
|
|
98
|
+
expect(payload).not.toBeNull();
|
|
99
|
+
expect(payload).toBe(exportedConst);
|
|
100
|
+
const aabb = payload?.aabb;
|
|
101
|
+
expect(aabb).toBeInstanceOf(Float32Array);
|
|
102
|
+
expect(aabb).toHaveLength(6);
|
|
103
|
+
if (aabb === undefined) return;
|
|
104
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
105
|
+
const minV = aabb[axis];
|
|
106
|
+
const maxV = aabb[axis + 3];
|
|
107
|
+
expect(Number.isFinite(minV)).toBe(true);
|
|
108
|
+
expect(Number.isFinite(maxV)).toBe(true);
|
|
109
|
+
expect(minV as number).toBeLessThanOrEqual(maxV as number);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
// this test and packages/shader/src/*.material.json surfaces immediately
|
|
18
18
|
// (charter F2: structural, falsifiable).
|
|
19
19
|
|
|
20
|
-
import { appendInjection } from '@forgeax/engine-render/internal';
|
|
21
20
|
import type { ParamSchemaEntry } from '@forgeax/engine-types';
|
|
22
21
|
import { derive } from '@forgeax/engine-types';
|
|
23
22
|
import { describe, expect, it } from 'vitest';
|
|
23
|
+
import { appendInjection } from '../../../render/src/pbr-pipeline';
|
|
24
24
|
|
|
25
25
|
// ─── post-w18 default-standard-pbr sidecar ──────────────────────────────────
|
|
26
26
|
const STANDARD_PBR_SIDECAR: readonly ParamSchemaEntry[] = [
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
// plan-strategy D-1a #4
|
|
15
15
|
// requirements AC-13
|
|
16
16
|
|
|
17
|
-
import { cleanPerEntityCache, worldEntityKey } from '@forgeax/engine-render/internal';
|
|
18
17
|
import { describe, expect, it } from 'vitest';
|
|
18
|
+
import { worldEntityKey } from '../../../render/src/record/frame-snapshot';
|
|
19
|
+
import { cleanPerEntityCache } from '../../../render/src/record/mesh-ssbo';
|
|
19
20
|
|
|
20
21
|
// ── Helpers ─────────────────────────────────────────────────────────────────
|
|
21
22
|
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
// plan-strategy D-1a #1-#3
|
|
14
14
|
// requirements AC-07
|
|
15
15
|
|
|
16
|
-
import { cleanPerEntityCache, worldEntityKey } from '@forgeax/engine-render/internal';
|
|
17
16
|
import { describe, expect, it } from 'vitest';
|
|
17
|
+
import { worldEntityKey } from '../../../render/src/record/frame-snapshot';
|
|
18
|
+
import { cleanPerEntityCache } from '../../../render/src/record/mesh-ssbo';
|
|
18
19
|
|
|
19
20
|
// ── Helpers ─────────────────────────────────────────────────────────────────
|
|
20
21
|
|
|
@@ -14,15 +14,14 @@
|
|
|
14
14
|
// mixed-TDD form).
|
|
15
15
|
|
|
16
16
|
import { World } from '@forgeax/engine-ecs';
|
|
17
|
+
import { Camera } from '@forgeax/engine-render';
|
|
18
|
+
import { propagateTransforms, Transform } from '@forgeax/engine-scene';
|
|
19
|
+
import { describe, expect, it } from 'vitest';
|
|
17
20
|
import {
|
|
18
|
-
Camera,
|
|
19
|
-
extractFrame,
|
|
20
21
|
makeZeroCameraFallbackSnapshot,
|
|
21
|
-
prepareExtractContext,
|
|
22
22
|
ZERO_CAMERA_CLEAR_FALLBACK,
|
|
23
|
-
} from '
|
|
24
|
-
import {
|
|
25
|
-
import { describe, expect, it } from 'vitest';
|
|
23
|
+
} from '../../../render/src/record/frame-snapshot';
|
|
24
|
+
import { extractFrame, prepareExtractContext } from '../../../render/src/render-system-extract';
|
|
26
25
|
|
|
27
26
|
function spawnCameraWithClear(world: World, clear: readonly [number, number, number, number]) {
|
|
28
27
|
world
|