@forgeax/engine-runtime 0.1.23 → 0.1.24
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 +15 -6
- package/dist/__tests__/advance-animation-player.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/advance-animation-player.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-aabb.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-aabb.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-bootstrap.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-bootstrap.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-builtin-nineslice.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-builtin-nineslice.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-d9-tile-sampler-soft-warn.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-d9-tile-sampler-soft-warn.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-guid.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-guid.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-material-validate.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-material-validate.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-mesh-fail-fast.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-mesh-fail-fast.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-scene.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-scene.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-sprite-slices-validate.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-sprite-slices-validate.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-renderer-assembly.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-renderer-assembly.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/asset.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/bloom-gating.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/bloom-gating.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/builtin-guid-ssot.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/builtin-guid-ssot.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/builtin-pack.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/builtin-pack.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/camera-antialias.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/camera-antialias.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/camera-bloom.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/camera-bloom.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/camera-clear-schema.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/camera-clear-schema.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/camera-ortho.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/camera-ortho.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/cluster-binner.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/cluster-binner.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/create-renderer-fallback-shader-manifest.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/create-renderer-fallback-shader-manifest.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/create-renderer-uniform-fallback.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/create-renderer-uniform-fallback.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/cubemap-upload.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/cubemap-upload.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/dev-import-transport.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/dev-import-transport.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/engine-metrics.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/engine-metrics.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/equirect-projection-error.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/equirect-projection-error.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/font-asset-load.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/font-asset-load.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/fxaa-intermediate-texture.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/fxaa-intermediate-texture.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/fxaa-pipeline.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/fxaa-pipeline.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-residency.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/gpu-residency.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-resource-release.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/gpu-resource-release.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/handle-quad.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/handle-quad.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/hdrp-bgl-slots.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/hdrp-bgl-slots.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/hdrp-grid-invalid.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/hdrp-grid-invalid.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/hdrp-index-list-overflow-once.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/hdrp-index-list-overflow-once.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/hdrp-light-budget.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/hdrp-light-budget.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/hdrp-pipeline-asset-config.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/hdrp-pipeline-asset-config.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/helpers/renderer-device-loss-dawn.d.ts +25 -0
- package/dist/__tests__/helpers/renderer-device-loss-dawn.d.ts.map +1 -0
- package/dist/__tests__/helpers/standard-material-manifest.d.ts +0 -1
- package/dist/__tests__/helpers/standard-material-manifest.d.ts.map +1 -1
- package/dist/__tests__/ibl-pipeline-cache.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/ibl-pipeline-cache.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/lazy-catalog.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/lazy-catalog.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/load-by-guid-hdr.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/load-by-guid-hdr.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/load-by-guid-prod-material-parent.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/load-by-guid-prod-material-parent.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/load-by-guid-prod.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/load-by-guid-prod.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/loader-registry.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/loader-registry.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/m7-hdrp-demo-shape.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/m7-hdrp-demo-shape.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mipmap-formula.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/mipmap-formula.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mipmap-pipeline-cache.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/mipmap-pipeline-cache.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/parse-asset-payload-material.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/parse-asset-payload-material.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/parse-asset-payload-texture.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/parse-asset-payload-texture.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/parse-scene-payload-refs.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/parse-scene-payload-refs.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/pass-selector.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/pass-selector.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline-builder.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/pipeline-builder.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline-cache-key-topology.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/pipeline-cache-key-topology.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline-vertex-stride-branch.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/pipeline-vertex-stride-branch.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/pipeline.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/post-process-register.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/post-process-register.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/propagate-transforms.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/propagate-transforms.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/record-all-topology.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/record-all-topology.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/record-draw-branch.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/record-draw-branch.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/record-strip-index-format.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/record-strip-index-format.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/register-with-guid-rgba16float.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/register-with-guid-rgba16float.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-data.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/render-data.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts.map +1 -1
- package/dist/__tests__/render-query-regression.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/render-query-regression.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-system-record-submesh.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/render-system-record-submesh.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-system-record-warn-once.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/render-system-record-warn-once.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-device-loss-multi-world.integration.test.d.ts +2 -0
- package/dist/__tests__/renderer-device-loss-multi-world.integration.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-device-loss-provider-feasibility.dawn.test.d.ts +2 -0
- package/dist/__tests__/renderer-device-loss-provider-feasibility.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-device-loss-recovery.dawn.test.d.ts +2 -0
- package/dist/__tests__/renderer-device-loss-recovery.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-draw-world.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/renderer-draw-world.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-recovery-consumer.integration.test.d.ts +2 -0
- package/dist/__tests__/renderer-recovery-consumer.integration.test.d.ts.map +1 -0
- package/dist/__tests__/renderstate-pipeline-cache.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/renderstate-pipeline-cache.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/resolve-scene-guids.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/resolve-scene-guids.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/shadow-skip-non-triangle.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/shadow-skip-non-triangle.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skin-errors-kebab-case.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skin-errors-kebab-case.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skin-instances-coexist.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skin-instances-coexist.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skin-m2-extract-happy.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skin-m2-extract-happy.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skin-m2-extract-joint-error.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skin-m2-extract-joint-error.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skin-m2-extract-null-assets.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skin-m2-extract-null-assets.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skin-m2-extract-skeleton-error.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skin-m2-extract-skeleton-error.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skin-m3-record-cache.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skin-m3-record-cache.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skin-palette-extract.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skin-palette-extract.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skin-pipeline-routing.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skin-pipeline-routing.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skin.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skin.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skybox-extract.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skybox-extract.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skybox-shader-compile.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skybox-shader-compile.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skylight-bind-group.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skylight-bind-group.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skylight-component.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skylight-component.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skylight-fallback-path.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skylight-fallback-path.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skylight-pipeline-layout.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skylight-pipeline-layout.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/skylight-solid-color-extract.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/skylight-solid-color-extract.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/sprite-animation-tick-boundary.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/sprite-animation-tick-boundary.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/sprite-animation-tick-clamp.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/sprite-animation-tick-clamp.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/sprite-animation-tick-frame-duration-negative.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/sprite-animation-tick-frame-duration-negative.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/sprite-animation-tick-frame-duration-zero.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/sprite-animation-tick-frame-duration-zero.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/sprite-animation-tick-loop.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/sprite-animation-tick-loop.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/sprite-animation-tick-override-probe.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/sprite-animation-tick-override-probe.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/sprite-animation-tick-regions-mismatch.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/sprite-animation-tick-regions-mismatch.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/storage-buffer-caps.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/storage-buffer-caps.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/systems.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/systems.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/tonemap-hdr-target.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/tonemap-hdr-target.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/tonemap-pipeline-split.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/tonemap-pipeline-split.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/tonemap.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/tonemap.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/transparent-sort-config-get.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/transparent-sort-config-get.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/transparent-sort-config-set.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/transparent-sort-config-set.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/transparent-sort.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/transparent-sort.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/upload-texture-consistency.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/upload-texture-consistency.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/verify-revisions.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/verify-revisions.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/wire-default-loaders.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/wire-default-loaders.cases.unit.test.d.ts.map +1 -0
- package/dist/__tests__/zero-camera-clear-fallback.cases.unit.test.d.ts +2 -0
- package/dist/__tests__/zero-camera-clear-fallback.cases.unit.test.d.ts.map +1 -0
- package/dist/dev-import-transport.d.ts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +30 -30
- package/src/__tests__/advance-animation-player.cases.unit.test.ts +1666 -0
- package/src/__tests__/asset-registry-aabb.cases.unit.test.ts +676 -0
- package/src/__tests__/asset-registry-bootstrap.cases.unit.test.ts +472 -0
- package/src/__tests__/asset-registry-builtin-nineslice.cases.unit.test.ts +481 -0
- package/src/__tests__/asset-registry-d9-tile-sampler-soft-warn.cases.unit.test.ts +568 -0
- package/src/__tests__/asset-registry-guid.cases.unit.test.ts +500 -0
- package/src/__tests__/asset-registry-material-validate.cases.unit.test.ts +756 -0
- package/src/__tests__/asset-registry-mesh-fail-fast.cases.unit.test.ts +591 -0
- package/src/__tests__/asset-registry-scene.cases.unit.test.ts +501 -0
- package/src/__tests__/asset-registry-sprite-slices-validate.cases.unit.test.ts +536 -0
- package/src/__tests__/asset-renderer-assembly.cases.unit.test.ts +496 -0
- package/src/__tests__/asset.cases.unit.test.ts +439 -0
- package/src/__tests__/bind-group-cache-keying.test.ts +6 -2
- package/src/__tests__/bloom-gating.cases.unit.test.ts +428 -0
- package/src/__tests__/builtin-guid-ssot.cases.unit.test.ts +472 -0
- package/src/__tests__/builtin-pack.cases.unit.test.ts +639 -0
- package/src/__tests__/builtin-shader-register-e2e.test.ts +1 -1
- package/src/__tests__/camera-antialias.cases.unit.test.ts +372 -0
- package/src/__tests__/camera-bloom.cases.unit.test.ts +396 -0
- package/src/__tests__/camera-clear-schema.cases.unit.test.ts +391 -0
- package/src/__tests__/camera-ortho.cases.unit.test.ts +484 -0
- package/src/__tests__/cluster-binner.cases.unit.test.ts +817 -0
- package/src/__tests__/collect-scene-mount-collapse.test.ts +5 -1
- package/src/__tests__/create-renderer-fallback-shader-manifest.cases.unit.test.ts +345 -0
- package/src/__tests__/create-renderer-uniform-fallback.cases.unit.test.ts +445 -0
- package/src/__tests__/cubemap-upload.cases.unit.test.ts +593 -0
- package/src/__tests__/dawn/ibl-precompute-readback.dawn.test.ts +184 -17
- package/src/__tests__/dawn/material-alpha.dawn.test.ts +17 -4
- package/src/__tests__/derive-bgl-integration.test.ts +8 -8
- package/src/__tests__/dev-import-transport.cases.unit.test.ts +503 -0
- package/src/__tests__/engine-metrics.cases.unit.test.ts +371 -0
- package/src/__tests__/equirect-projection-error.cases.unit.test.ts +416 -0
- package/src/__tests__/font-asset-load.cases.unit.test.ts +510 -0
- package/src/__tests__/fxaa-intermediate-texture.cases.unit.test.ts +690 -0
- package/src/__tests__/fxaa-pipeline.cases.unit.test.ts +546 -0
- package/src/__tests__/gpu-residency.cases.unit.test.ts +479 -0
- package/src/__tests__/gpu-resource-release.cases.unit.test.ts +929 -0
- package/src/__tests__/handle-quad.cases.unit.test.ts +491 -0
- package/src/__tests__/hdrp-bgl-slots.cases.unit.test.ts +451 -0
- package/src/__tests__/hdrp-grid-invalid.cases.unit.test.ts +408 -0
- package/src/__tests__/hdrp-index-list-overflow-once.cases.unit.test.ts +405 -0
- package/src/__tests__/hdrp-light-budget.cases.unit.test.ts +483 -0
- package/src/__tests__/hdrp-pipeline-asset-config.cases.unit.test.ts +441 -0
- package/src/__tests__/helpers/renderer-device-loss-dawn.ts +69 -0
- package/src/__tests__/helpers/standard-material-manifest.ts +11 -15
- package/src/__tests__/ibl-pipeline-cache.cases.unit.test.ts +415 -0
- package/src/__tests__/lazy-catalog.cases.unit.test.ts +848 -0
- package/src/__tests__/light-gpu-byte-neutral.unit.test.ts +6 -5
- package/src/__tests__/load-by-guid-hdr.cases.unit.test.ts +582 -0
- package/src/__tests__/load-by-guid-prod-material-parent.cases.unit.test.ts +1514 -0
- package/src/__tests__/load-by-guid-prod.cases.unit.test.ts +557 -0
- package/src/__tests__/loader-registry.cases.unit.test.ts +767 -0
- package/src/__tests__/m7-hdrp-demo-shape.cases.unit.test.ts +361 -0
- package/src/__tests__/material-texture-uv-scale.unit.test.ts +2 -2
- package/src/__tests__/materials.unit.test.ts +29 -10
- package/src/__tests__/mipmap-formula.cases.unit.test.ts +434 -0
- package/src/__tests__/mipmap-pipeline-cache.cases.unit.test.ts +490 -0
- package/src/__tests__/parse-asset-payload-material.cases.unit.test.ts +565 -0
- package/src/__tests__/parse-asset-payload-texture.cases.unit.test.ts +720 -0
- package/src/__tests__/parse-scene-payload-refs.cases.unit.test.ts +767 -0
- package/src/__tests__/pass-selector.cases.unit.test.ts +376 -0
- package/src/__tests__/pbr-pipeline.unit.test.ts +23 -5
- package/src/__tests__/pipeline-builder.cases.unit.test.ts +624 -0
- package/src/__tests__/pipeline-cache-key-topology.cases.unit.test.ts +807 -0
- package/src/__tests__/pipeline-vertex-stride-branch.cases.unit.test.ts +379 -0
- package/src/__tests__/pipeline.cases.unit.test.ts +370 -0
- package/src/__tests__/post-process-register.cases.unit.test.ts +405 -0
- package/src/__tests__/propagate-transforms.cases.unit.test.ts +502 -0
- package/src/__tests__/propagate-transforms.dawn.test.ts +19 -2
- package/src/__tests__/record-all-topology.cases.unit.test.ts +608 -0
- package/src/__tests__/record-draw-branch.cases.unit.test.ts +621 -0
- package/src/__tests__/record-strip-index-format.cases.unit.test.ts +419 -0
- package/src/__tests__/register-with-guid-rgba16float.cases.unit.test.ts +469 -0
- package/src/__tests__/render-data.cases.unit.test.ts +553 -0
- package/src/__tests__/render-error-exhaustive.test-d.ts +1 -0
- package/src/__tests__/render-query-regression.cases.unit.test.ts +531 -0
- package/src/__tests__/render-system-record-submesh.cases.unit.test.ts +740 -0
- package/src/__tests__/render-system-record-warn-once.cases.unit.test.ts +418 -0
- package/src/__tests__/render-system-record.test.ts +15 -33
- package/src/__tests__/renderer-device-loss-multi-world.integration.test.ts +103 -0
- package/src/__tests__/renderer-device-loss-provider-feasibility.dawn.test.ts +124 -0
- package/src/__tests__/renderer-device-loss-recovery.dawn.test.ts +50 -0
- package/src/__tests__/renderer-draw-world.cases.unit.test.ts +514 -0
- package/src/__tests__/renderer-recovery-consumer.integration.test.ts +96 -0
- package/src/__tests__/renderstate-pipeline-cache.cases.unit.test.ts +631 -0
- package/src/__tests__/resolve-scene-guids.cases.unit.test.ts +1123 -0
- package/src/__tests__/shadow-caster-empty-schema.test.ts +1 -1
- package/src/__tests__/shadow-fields-observable.dawn.test.ts +2 -2
- package/src/__tests__/shadow-m1.dawn.test.ts +1 -1
- package/src/__tests__/shadow-skip-non-triangle.cases.unit.test.ts +681 -0
- package/src/__tests__/skin-errors-kebab-case.cases.unit.test.ts +475 -0
- package/src/__tests__/skin-extract-getarrayview-count.unit.test.ts +5 -4
- package/src/__tests__/skin-instances-coexist.cases.unit.test.ts +375 -0
- package/src/__tests__/skin-m2-extract-happy.cases.unit.test.ts +592 -0
- package/src/__tests__/skin-m2-extract-joint-error.cases.unit.test.ts +619 -0
- package/src/__tests__/skin-m2-extract-null-assets.cases.unit.test.ts +569 -0
- package/src/__tests__/skin-m2-extract-skeleton-error.cases.unit.test.ts +585 -0
- package/src/__tests__/skin-m3-record-cache.cases.unit.test.ts +457 -0
- package/src/__tests__/skin-palette-extract.cases.unit.test.ts +635 -0
- package/src/__tests__/skin-pipeline-routing.cases.unit.test.ts +411 -0
- package/src/__tests__/skin.cases.unit.test.ts +421 -0
- package/src/__tests__/skybox-extract.cases.unit.test.ts +511 -0
- package/src/__tests__/skybox-shader-compile.cases.unit.test.ts +437 -0
- package/src/__tests__/skylight-bind-group.cases.unit.test.ts +642 -0
- package/src/__tests__/skylight-component.cases.unit.test.ts +386 -0
- package/src/__tests__/skylight-fallback-path.cases.unit.test.ts +566 -0
- package/src/__tests__/skylight-lazy-projection.test.ts +35 -20
- package/src/__tests__/skylight-pipeline-layout.cases.unit.test.ts +506 -0
- package/src/__tests__/skylight-solid-color-extract.cases.unit.test.ts +399 -0
- package/src/__tests__/sprite-animation-tick-boundary.cases.unit.test.ts +521 -0
- package/src/__tests__/sprite-animation-tick-clamp.cases.unit.test.ts +453 -0
- package/src/__tests__/sprite-animation-tick-frame-duration-negative.cases.unit.test.ts +447 -0
- package/src/__tests__/sprite-animation-tick-frame-duration-zero.cases.unit.test.ts +395 -0
- package/src/__tests__/sprite-animation-tick-loop.cases.unit.test.ts +494 -0
- package/src/__tests__/sprite-animation-tick-override-probe.cases.unit.test.ts +439 -0
- package/src/__tests__/sprite-animation-tick-regions-mismatch.cases.unit.test.ts +466 -0
- package/src/__tests__/sprite-lit-bgl-byte-identical.test.ts +5 -5
- package/src/__tests__/sprite-lit-pipeline-cache-key.test.ts +1 -1
- package/src/__tests__/ssao-pipelines.test.ts +1 -1
- package/src/__tests__/storage-buffer-caps.cases.unit.test.ts +373 -0
- package/src/__tests__/systems.cases.unit.test.ts +425 -0
- package/src/__tests__/tilemap-chunk-extract.overhang-bounds.test.ts +1 -1
- package/src/__tests__/tonemap-hdr-target.cases.unit.test.ts +670 -0
- package/src/__tests__/tonemap-pipeline-split.cases.unit.test.ts +867 -0
- package/src/__tests__/tonemap.cases.unit.test.ts +446 -0
- package/src/__tests__/transparent-sort-config-get.cases.unit.test.ts +395 -0
- package/src/__tests__/transparent-sort-config-set.cases.unit.test.ts +424 -0
- package/src/__tests__/transparent-sort.cases.unit.test.ts +684 -0
- package/src/__tests__/upload-texture-consistency.cases.unit.test.ts +478 -0
- package/src/__tests__/verify-revisions.cases.unit.test.ts +619 -0
- package/src/__tests__/wire-default-loaders.cases.unit.test.ts +461 -0
- package/src/__tests__/zero-camera-clear-fallback.cases.unit.test.ts +374 -0
- package/src/dev-import-transport.ts +2 -1
- package/dist/__tests__/asset.unit.test.d.ts +0 -2
- package/dist/__tests__/asset.unit.test.d.ts.map +0 -1
- package/dist/__tests__/pipeline.unit.test.d.ts +0 -2
- package/dist/__tests__/pipeline.unit.test.d.ts.map +0 -1
- package/dist/__tests__/systems.unit.test.d.ts +0 -2
- package/dist/__tests__/systems.unit.test.d.ts.map +0 -1
- package/src/__tests__/asset.unit.test.ts +0 -7113
- package/src/__tests__/pipeline.unit.test.ts +0 -5279
- package/src/__tests__/systems.unit.test.ts +0 -9061
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
// @ts-nocheck — merged file: cross-source type narrowing failures from blocks originally outside src/ rootDir
|
|
2
|
+
// Consolidated by feat-20260609-test-pool-startup-reduction-merge-tiny-test-files
|
|
3
|
+
// biome-ignore-all lint/complexity/noUselessLoneBlockStatements: block-scope isolation between merged source files (consolidation paradigm)
|
|
4
|
+
//
|
|
5
|
+
// Source files (N=33):
|
|
6
|
+
// - packages/runtime/__tests__/asset-registry.test.ts
|
|
7
|
+
// - packages/runtime/__tests__/loader-registry.test.ts
|
|
8
|
+
// - packages/runtime/__tests__/wire-default-loaders.test.ts
|
|
9
|
+
// - packages/runtime/src/__tests__/asset-registry-aabb.test.ts
|
|
10
|
+
// - packages/runtime/src/__tests__/asset-registry-builtin-nineslice.test.ts
|
|
11
|
+
// - packages/runtime/src/__tests__/asset-registry-d9-tile-sampler-soft-warn.test.ts
|
|
12
|
+
// - packages/runtime/src/__tests__/asset-registry-guid.test.ts
|
|
13
|
+
// - packages/runtime/src/__tests__/asset-registry-material-validate.test.ts
|
|
14
|
+
// - packages/runtime/src/__tests__/asset-registry-mesh-fail-fast.test.ts
|
|
15
|
+
// - packages/runtime/src/__tests__/asset-registry-scene.test.ts
|
|
16
|
+
// - packages/runtime/src/__tests__/asset-registry-sprite-slices-validate.test.ts
|
|
17
|
+
// - packages/runtime/src/__tests__/auto-select.test.ts
|
|
18
|
+
// - packages/runtime/src/__tests__/bindgroup-resize-invalidation.test.ts
|
|
19
|
+
// - packages/runtime/src/__tests__/builtin-guid-ssot.test.ts
|
|
20
|
+
// - packages/runtime/src/__tests__/builtin-pack.test.ts
|
|
21
|
+
// - packages/runtime/src/__tests__/cube-texture-narrowing.test.ts
|
|
22
|
+
// - packages/runtime/src/__tests__/cubemap-upload.test.ts
|
|
23
|
+
// - packages/runtime/src/__tests__/dev-import-transport.test.ts
|
|
24
|
+
// - packages/runtime/src/__tests__/font-asset-load.test.ts
|
|
25
|
+
// - packages/runtime/src/__tests__/handle-quad.test.ts
|
|
26
|
+
// - packages/runtime/src/__tests__/lazy-catalog.test.ts
|
|
27
|
+
// - packages/runtime/src/__tests__/load-by-guid-hdr.test.ts
|
|
28
|
+
// - packages/runtime/src/__tests__/load-by-guid-prod-material-parent.test.ts
|
|
29
|
+
// - packages/runtime/src/__tests__/load-by-guid-prod.test.ts
|
|
30
|
+
// - packages/runtime/src/__tests__/mipmap-formula.test.ts
|
|
31
|
+
// - packages/runtime/src/__tests__/mipmap-pipeline-cache.test.ts
|
|
32
|
+
// - packages/runtime/src/__tests__/parse-asset-payload-material.test.ts
|
|
33
|
+
// - packages/runtime/src/__tests__/parse-asset-payload-texture.test.ts
|
|
34
|
+
// - packages/runtime/src/__tests__/parse-scene-payload-refs.test.ts
|
|
35
|
+
// - packages/runtime/src/__tests__/register-with-guid-rgba16float.test.ts
|
|
36
|
+
// - packages/runtime/src/__tests__/resolve-scene-guids.test.ts
|
|
37
|
+
// - packages/runtime/src/__tests__/upload-texture-consistency.test.ts
|
|
38
|
+
// - packages/runtime/src/__tests__/verify-revisions.test.ts
|
|
39
|
+
//
|
|
40
|
+
// Paradigm: each block-scope wraps a source file. ancestorTitles[0] is the
|
|
41
|
+
// source-preserved inner describe (NOT the source filename for these 3 files
|
|
42
|
+
// — recovery path: vitest report ancestorTitles -> grep this file -> upstream
|
|
43
|
+
// `// ─── from <name>.test.ts ───` block separator -> source filename).
|
|
44
|
+
// Top-level imports merged + deduped.
|
|
45
|
+
|
|
46
|
+
import { readFileSync } from 'node:fs';
|
|
47
|
+
import { fileURLToPath } from 'node:url';
|
|
48
|
+
import * as assetRegistryModule from '@forgeax/engine-assets-runtime';
|
|
49
|
+
import {
|
|
50
|
+
AssetRegistry,
|
|
51
|
+
animationClipLoader,
|
|
52
|
+
buildSceneChildContext,
|
|
53
|
+
fontLoader,
|
|
54
|
+
getOrCreateMipmapPipeline,
|
|
55
|
+
HANDLE_CUBE,
|
|
56
|
+
HANDLE_CYLINDER,
|
|
57
|
+
HANDLE_QUAD,
|
|
58
|
+
HANDLE_SPHERE,
|
|
59
|
+
HANDLE_TRIANGLE,
|
|
60
|
+
INLINE_PACK_LOADERS,
|
|
61
|
+
LoaderRegistry,
|
|
62
|
+
materialLoader,
|
|
63
|
+
meshLoader,
|
|
64
|
+
mipmapCacheSize,
|
|
65
|
+
numMipLevels,
|
|
66
|
+
PACK_ARTIFACT_LOADERS,
|
|
67
|
+
resolveAssetHandle,
|
|
68
|
+
sceneLoader,
|
|
69
|
+
skeletonLoader,
|
|
70
|
+
skinLoader,
|
|
71
|
+
textureLoader,
|
|
72
|
+
walkMaterialPassesOverSharedRefs,
|
|
73
|
+
wireDefaultLoaders,
|
|
74
|
+
} from '@forgeax/engine-assets-runtime';
|
|
75
|
+
import { audioLoader } from '@forgeax/engine-audio-webaudio';
|
|
76
|
+
import { defineComponent, World } from '@forgeax/engine-ecs';
|
|
77
|
+
import {
|
|
78
|
+
createBoxGeometry,
|
|
79
|
+
createPlaneGeometry,
|
|
80
|
+
meshFromInterleaved,
|
|
81
|
+
PROCEDURAL_FLOATS_PER_VERTEX,
|
|
82
|
+
} from '@forgeax/engine-geometry';
|
|
83
|
+
import { AssetGuid } from '@forgeax/engine-pack/guid';
|
|
84
|
+
import { ok, ok as rhiOk } from '@forgeax/engine-rhi';
|
|
85
|
+
import { rhi } from '@forgeax/engine-rhi-null';
|
|
86
|
+
import { ShaderRegistry } from '@forgeax/engine-shader';
|
|
87
|
+
import type {
|
|
88
|
+
EquirectAsset,
|
|
89
|
+
Handle,
|
|
90
|
+
MaterialAsset,
|
|
91
|
+
MaterialPass,
|
|
92
|
+
SamplerAsset,
|
|
93
|
+
} from '@forgeax/engine-types';
|
|
94
|
+
import { AssetError, toShared, toUnique, unwrapHandle } from '@forgeax/engine-types';
|
|
95
|
+
import { afterEach, beforeEach, describe, expect, expectTypeOf, it, vi } from 'vitest';
|
|
96
|
+
import { deriveBuiltin } from '../../../pack/src/builtin';
|
|
97
|
+
import { DeviceScope } from '../../../render/src/device/device-scope';
|
|
98
|
+
import { GpuResidencyCache } from '../../../render/src/device/gpu-residency';
|
|
99
|
+
import { createEngineMetrics } from '../../../render/src/engine-metrics';
|
|
100
|
+
import { createRenderer as createRuntimeRenderer } from '../createRenderer';
|
|
101
|
+
import { createDevImportTransport, type ImportTransport } from '../dev-import-transport';
|
|
102
|
+
import { EngineEnvironmentError } from '../errors/environment';
|
|
103
|
+
import { makeMockShaderRegistry } from './helpers/mock-shader-registry';
|
|
104
|
+
import { requireRenderer } from './renderer-test-utils';
|
|
105
|
+
|
|
106
|
+
vi.mock('@forgeax/engine-rhi-webgpu', async () => {
|
|
107
|
+
spies.webgpuImportCount += 1;
|
|
108
|
+
const actualRhi =
|
|
109
|
+
await vi.importActual<typeof import('@forgeax/engine-rhi')>('@forgeax/engine-rhi');
|
|
110
|
+
spies.rhiErrorCtor = actualRhi.RhiError;
|
|
111
|
+
const fakeAdapter = {
|
|
112
|
+
features: new Set<string>(),
|
|
113
|
+
limits: {} as Readonly<Record<string, number>>,
|
|
114
|
+
async requestDevice() {
|
|
115
|
+
return actualRhi.ok(makeFakeRhiDevice());
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
rhi: {
|
|
120
|
+
requestAdapter: async () => {
|
|
121
|
+
if (spies.rhiWebgpuRequestAdapterShould === 'reject-rhi-not-available') {
|
|
122
|
+
return actualRhi.err(
|
|
123
|
+
new actualRhi.RhiError({
|
|
124
|
+
code: 'rhi-not-available',
|
|
125
|
+
expected: 'navigator.gpu available',
|
|
126
|
+
hint: 'unit-test: forced rhi-not-available',
|
|
127
|
+
}),
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
if (spies.rhiWebgpuRequestAdapterShould === 'reject-adapter-null') {
|
|
131
|
+
return actualRhi.err(
|
|
132
|
+
new actualRhi.RhiError({
|
|
133
|
+
code: 'adapter-unavailable',
|
|
134
|
+
expected: 'requestAdapter returns non-null',
|
|
135
|
+
hint: 'unit-test: forced adapter-unavailable',
|
|
136
|
+
}),
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
return actualRhi.ok(fakeAdapter);
|
|
140
|
+
},
|
|
141
|
+
acquireCanvasContext: (_canvas: unknown) => {
|
|
142
|
+
return actualRhi.ok({
|
|
143
|
+
configure: () => actualRhi.ok(undefined),
|
|
144
|
+
unconfigure: () => actualRhi.ok(undefined),
|
|
145
|
+
getCurrentTexture: () => actualRhi.ok({ __brand: 'TextureView' }),
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
createShaderModule: async () => actualRhi.ok({ __brand: 'ShaderModule' } as unknown as object),
|
|
150
|
+
translateErrorEventToRhiError: () =>
|
|
151
|
+
actualRhi.err(
|
|
152
|
+
new actualRhi.RhiError({
|
|
153
|
+
code: 'webgpu-runtime-error',
|
|
154
|
+
expected: 'GPU error event translates to RhiError',
|
|
155
|
+
hint: 'unit-test mock event translation',
|
|
156
|
+
}),
|
|
157
|
+
),
|
|
158
|
+
_internal_getRawDevice: () => undefined,
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
vi.mock('@forgeax/engine-rhi-wgpu', async () => {
|
|
162
|
+
spies.wgpuImportCount += 1;
|
|
163
|
+
const actualRhi =
|
|
164
|
+
await vi.importActual<typeof import('@forgeax/engine-rhi')>('@forgeax/engine-rhi');
|
|
165
|
+
const fakeAdapter = {
|
|
166
|
+
features: new Set<string>(),
|
|
167
|
+
limits: {} as Readonly<Record<string, number>>,
|
|
168
|
+
async requestDevice() {
|
|
169
|
+
return actualRhi.ok(makeFakeRhiDevice());
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
return {
|
|
173
|
+
rhi: {
|
|
174
|
+
requestAdapter: async () => {
|
|
175
|
+
if (spies.rhiWgpuRequestAdapterShould === 'reject-rhi-not-available') {
|
|
176
|
+
return actualRhi.err(
|
|
177
|
+
new actualRhi.RhiError({
|
|
178
|
+
code: 'rhi-not-available',
|
|
179
|
+
expected: 'wgpu webgl backend available',
|
|
180
|
+
hint: 'unit-test: forced rhi-not-available on rhi-wgpu',
|
|
181
|
+
}),
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
return actualRhi.ok(fakeAdapter);
|
|
185
|
+
},
|
|
186
|
+
acquireCanvasContext: (_canvas: unknown) => {
|
|
187
|
+
return actualRhi.ok({
|
|
188
|
+
configure: () => actualRhi.ok(undefined),
|
|
189
|
+
unconfigure: () => actualRhi.ok(undefined),
|
|
190
|
+
getCurrentTexture: () => actualRhi.ok({ __brand: 'TextureView' }),
|
|
191
|
+
});
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
ensureReady: async () => {
|
|
195
|
+
spies.ensureReadyCount += 1;
|
|
196
|
+
if (spies.rhiWgpuEnsureReadyShould === 'reject-load-failed') {
|
|
197
|
+
throw new Error('unit-test: forced rhi-wgpu wasm load failure');
|
|
198
|
+
}
|
|
199
|
+
return undefined;
|
|
200
|
+
},
|
|
201
|
+
createShaderModule: async () => actualRhi.ok({ __brand: 'ShaderModule' } as unknown as object),
|
|
202
|
+
translateErrorEventToRhiError: () =>
|
|
203
|
+
actualRhi.err(
|
|
204
|
+
new actualRhi.RhiError({
|
|
205
|
+
code: 'webgpu-runtime-error',
|
|
206
|
+
expected: 'GPU error event translates to RhiError',
|
|
207
|
+
hint: 'unit-test mock event translation',
|
|
208
|
+
}),
|
|
209
|
+
),
|
|
210
|
+
_internal_getRawDevice: () => undefined,
|
|
211
|
+
};
|
|
212
|
+
});
|
|
213
|
+
const spies = vi.hoisted(() => ({
|
|
214
|
+
webgpuImportCount: 0,
|
|
215
|
+
wgpuImportCount: 0,
|
|
216
|
+
ensureReadyCount: 0,
|
|
217
|
+
// Failure toggles set by individual tests before invoking createRenderer.
|
|
218
|
+
rhiWebgpuRequestAdapterShould: 'success' as
|
|
219
|
+
| 'success'
|
|
220
|
+
| 'reject-rhi-not-available'
|
|
221
|
+
| 'reject-adapter-null',
|
|
222
|
+
rhiWgpuEnsureReadyShould: 'success' as 'success' | 'reject-load-failed',
|
|
223
|
+
rhiWgpuRequestAdapterShould: 'success' as 'success' | 'reject-rhi-not-available',
|
|
224
|
+
rhiErrorCtor: undefined as undefined | (new (...args: never[]) => Error),
|
|
225
|
+
reset(): void {
|
|
226
|
+
this.webgpuImportCount = 0;
|
|
227
|
+
this.wgpuImportCount = 0;
|
|
228
|
+
this.ensureReadyCount = 0;
|
|
229
|
+
this.rhiWebgpuRequestAdapterShould = 'success';
|
|
230
|
+
this.rhiWgpuEnsureReadyShould = 'success';
|
|
231
|
+
this.rhiWgpuRequestAdapterShould = 'success';
|
|
232
|
+
},
|
|
233
|
+
}));
|
|
234
|
+
function makeFakeRhiDevice(): Record<string, unknown> {
|
|
235
|
+
let resolveLost!: (info: unknown) => void;
|
|
236
|
+
const lost = new Promise<unknown>((res) => {
|
|
237
|
+
resolveLost = res;
|
|
238
|
+
});
|
|
239
|
+
void resolveLost;
|
|
240
|
+
return {
|
|
241
|
+
__brand: 'RhiDevice',
|
|
242
|
+
lost,
|
|
243
|
+
features: new Set<string>(),
|
|
244
|
+
limits: {},
|
|
245
|
+
// feat-20260707 M5 / w33: createRenderer projects RhiCaps.textureCompression*
|
|
246
|
+
// into TranscodeCaps right after building the registry, so the fake device
|
|
247
|
+
// must expose a caps object (the real RhiDevice always carries one).
|
|
248
|
+
caps: {
|
|
249
|
+
textureCompressionBc: false,
|
|
250
|
+
textureCompressionEtc2: false,
|
|
251
|
+
textureCompressionAstc: false,
|
|
252
|
+
},
|
|
253
|
+
queue: {
|
|
254
|
+
submit: () => undefined,
|
|
255
|
+
writeBuffer: () => undefined,
|
|
256
|
+
},
|
|
257
|
+
createBuffer: () => ({ ok: true, value: { __brand: 'Buffer' } }),
|
|
258
|
+
createTexture: () => ({ ok: true, value: { __brand: 'Texture' } }),
|
|
259
|
+
createBindGroupLayout: () => ({ ok: true, value: { __brand: 'BindGroupLayout' } }),
|
|
260
|
+
createBindGroup: () => ({ ok: true, value: { __brand: 'BindGroup' } }),
|
|
261
|
+
createPipelineLayout: () => ({ ok: true, value: { __brand: 'PipelineLayout' } }),
|
|
262
|
+
createRenderPipeline: () => ({ ok: true, value: { __brand: 'RenderPipeline' } }),
|
|
263
|
+
createSampler: () => ({ ok: true, value: { __brand: 'Sampler' } }),
|
|
264
|
+
createShaderModule: () => ({
|
|
265
|
+
ok: true,
|
|
266
|
+
value: { __brand: 'ShaderModule' },
|
|
267
|
+
}),
|
|
268
|
+
createTextureView: () => ({ ok: true, value: { __brand: 'TextureView' } }),
|
|
269
|
+
createCommandEncoder: () => ({
|
|
270
|
+
ok: true,
|
|
271
|
+
value: {
|
|
272
|
+
beginRenderPass: () => ({
|
|
273
|
+
setPipeline: () => undefined,
|
|
274
|
+
setBindGroup: () => undefined,
|
|
275
|
+
setVertexBuffer: () => undefined,
|
|
276
|
+
setIndexBuffer: () => undefined,
|
|
277
|
+
draw: () => undefined,
|
|
278
|
+
drawIndexed: () => undefined,
|
|
279
|
+
end: () => undefined,
|
|
280
|
+
}),
|
|
281
|
+
finish: () => ({ __brand: 'CommandBuffer' }),
|
|
282
|
+
},
|
|
283
|
+
}),
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
function makeMockCanvas(opts: { webgpu?: 'context' | 'null'; webgl2?: 'context' | 'null' }) {
|
|
287
|
+
return {
|
|
288
|
+
width: 800,
|
|
289
|
+
height: 600,
|
|
290
|
+
getContext(kind: string): unknown {
|
|
291
|
+
if (kind === 'webgpu') {
|
|
292
|
+
if (opts.webgpu === 'context') {
|
|
293
|
+
return {
|
|
294
|
+
__mockTag: 'webgpu-canvas-context',
|
|
295
|
+
configure: () => undefined,
|
|
296
|
+
unconfigure: () => undefined,
|
|
297
|
+
getCurrentTexture: () => ({ createView: () => ({}) }),
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
if (kind === 'webgl2') {
|
|
303
|
+
if (opts.webgl2 === 'context') {
|
|
304
|
+
return {
|
|
305
|
+
__mockTag: 'webgl2',
|
|
306
|
+
getExtension: () => null,
|
|
307
|
+
getParameter: () => 1,
|
|
308
|
+
isContextLost: () => false,
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
return null;
|
|
314
|
+
},
|
|
315
|
+
addEventListener() {},
|
|
316
|
+
removeEventListener() {},
|
|
317
|
+
} as unknown as HTMLCanvasElement;
|
|
318
|
+
}
|
|
319
|
+
function _makeStubGPU(): unknown {
|
|
320
|
+
return {
|
|
321
|
+
requestAdapter: async () => ({
|
|
322
|
+
features: new Set<string>(),
|
|
323
|
+
limits: {},
|
|
324
|
+
requestDevice: async () => makeFakeRhiDevice(),
|
|
325
|
+
}),
|
|
326
|
+
getPreferredCanvasFormat: () => 'bgra8unorm',
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
void [
|
|
331
|
+
AssetError,
|
|
332
|
+
AssetGuid,
|
|
333
|
+
AssetRegistry,
|
|
334
|
+
DeviceScope,
|
|
335
|
+
EngineEnvironmentError,
|
|
336
|
+
GpuResidencyCache,
|
|
337
|
+
HANDLE_CUBE,
|
|
338
|
+
HANDLE_CYLINDER,
|
|
339
|
+
HANDLE_QUAD,
|
|
340
|
+
HANDLE_SPHERE,
|
|
341
|
+
HANDLE_TRIANGLE,
|
|
342
|
+
INLINE_PACK_LOADERS,
|
|
343
|
+
LoaderRegistry,
|
|
344
|
+
PACK_ARTIFACT_LOADERS,
|
|
345
|
+
PROCEDURAL_FLOATS_PER_VERTEX,
|
|
346
|
+
ShaderRegistry,
|
|
347
|
+
World,
|
|
348
|
+
_makeStubGPU,
|
|
349
|
+
afterEach,
|
|
350
|
+
animationClipLoader,
|
|
351
|
+
assetRegistryModule,
|
|
352
|
+
audioLoader,
|
|
353
|
+
beforeEach,
|
|
354
|
+
buildSceneChildContext,
|
|
355
|
+
createBoxGeometry,
|
|
356
|
+
createDevImportTransport,
|
|
357
|
+
createEngineMetrics,
|
|
358
|
+
createPlaneGeometry,
|
|
359
|
+
createRuntimeRenderer,
|
|
360
|
+
defineComponent,
|
|
361
|
+
deriveBuiltin,
|
|
362
|
+
describe,
|
|
363
|
+
expect,
|
|
364
|
+
expectTypeOf,
|
|
365
|
+
fileURLToPath,
|
|
366
|
+
fontLoader,
|
|
367
|
+
getOrCreateMipmapPipeline,
|
|
368
|
+
it,
|
|
369
|
+
makeFakeRhiDevice,
|
|
370
|
+
makeMockCanvas,
|
|
371
|
+
makeMockShaderRegistry,
|
|
372
|
+
materialLoader,
|
|
373
|
+
meshFromInterleaved,
|
|
374
|
+
meshLoader,
|
|
375
|
+
mipmapCacheSize,
|
|
376
|
+
numMipLevels,
|
|
377
|
+
ok,
|
|
378
|
+
readFileSync,
|
|
379
|
+
requireRenderer,
|
|
380
|
+
resolveAssetHandle,
|
|
381
|
+
rhi,
|
|
382
|
+
rhiOk,
|
|
383
|
+
sceneLoader,
|
|
384
|
+
skeletonLoader,
|
|
385
|
+
skinLoader,
|
|
386
|
+
spies,
|
|
387
|
+
textureLoader,
|
|
388
|
+
toShared,
|
|
389
|
+
toUnique,
|
|
390
|
+
unwrapHandle,
|
|
391
|
+
vi,
|
|
392
|
+
walkMaterialPassesOverSharedRefs,
|
|
393
|
+
wireDefaultLoaders,
|
|
394
|
+
];
|
|
395
|
+
type __MergedKeep =
|
|
396
|
+
| EquirectAsset
|
|
397
|
+
| Handle
|
|
398
|
+
| ImportTransport
|
|
399
|
+
| MaterialAsset
|
|
400
|
+
| MaterialPass
|
|
401
|
+
| SamplerAsset;
|
|
402
|
+
|
|
403
|
+
{
|
|
404
|
+
// --- from cubemap-upload.test.ts ---
|
|
405
|
+
// feat-20260601-device/gpu-residency-extraction M1: uploadCubemapFromEquirect
|
|
406
|
+
// moved to GpuResidencyCache. The store holds no registry reference (D-2/D-3);
|
|
407
|
+
// the cube POD register-relay is injected at configureGpuDevice (D-3) and the
|
|
408
|
+
// source POD is passed to the call. feat-20260614 M8: column handles are
|
|
409
|
+
// minted by the World, so the relay is `(world, pod) => ok(world.allocSharedRef(...))`.
|
|
410
|
+
|
|
411
|
+
interface SubmitProbe {
|
|
412
|
+
submitCalls: number;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque mock surface
|
|
416
|
+
function makeMockDevice(probe: SubmitProbe): any {
|
|
417
|
+
const okShim = <T>(v: T) => ({ ok: true as const, value: v });
|
|
418
|
+
const mockOpaque = { __mock: 'opaque' };
|
|
419
|
+
const makePass = () => ({
|
|
420
|
+
setPipeline: () => {},
|
|
421
|
+
setBindGroup: () => {},
|
|
422
|
+
setVertexBuffer: () => {},
|
|
423
|
+
draw: () => {},
|
|
424
|
+
end: () => {},
|
|
425
|
+
});
|
|
426
|
+
return {
|
|
427
|
+
createShaderModule: () => okShim(mockOpaque),
|
|
428
|
+
createBindGroupLayout: () => okShim(mockOpaque),
|
|
429
|
+
createPipelineLayout: () => okShim(mockOpaque),
|
|
430
|
+
createRenderPipeline: () => okShim(mockOpaque),
|
|
431
|
+
createBindGroup: () => okShim(mockOpaque),
|
|
432
|
+
createBuffer: () => okShim(mockOpaque),
|
|
433
|
+
createTexture: () => okShim(mockOpaque),
|
|
434
|
+
createTextureView: () => okShim(mockOpaque),
|
|
435
|
+
createSampler: () => okShim(mockOpaque),
|
|
436
|
+
createCommandEncoder: () =>
|
|
437
|
+
okShim({
|
|
438
|
+
beginRenderPass: () => makePass(),
|
|
439
|
+
finish: () => okShim(mockOpaque),
|
|
440
|
+
}),
|
|
441
|
+
queue: {
|
|
442
|
+
writeBuffer: () => okShim(undefined),
|
|
443
|
+
writeTexture: () => okShim(undefined),
|
|
444
|
+
submit: () => {
|
|
445
|
+
probe.submitCalls += 1;
|
|
446
|
+
return okShim(undefined);
|
|
447
|
+
},
|
|
448
|
+
onSubmittedWorkDone: async () => {},
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
const mockCaps: RhiCaps = {
|
|
454
|
+
backendKind: 'webgpu',
|
|
455
|
+
compute: true,
|
|
456
|
+
timestampQuery: false,
|
|
457
|
+
timestampPeriodNanoseconds: null,
|
|
458
|
+
indirectDrawing: false,
|
|
459
|
+
textureCompressionBc: false,
|
|
460
|
+
textureCompressionEtc2: false,
|
|
461
|
+
textureCompressionAstc: false,
|
|
462
|
+
multiDrawIndirect: false,
|
|
463
|
+
pushConstants: false,
|
|
464
|
+
textureBindingArray: false,
|
|
465
|
+
samplerAliasing: false,
|
|
466
|
+
firstInstanceIndirect: false,
|
|
467
|
+
storageBuffer: true,
|
|
468
|
+
storageTexture: false,
|
|
469
|
+
rgba16floatRenderable: true,
|
|
470
|
+
rg11b10ufloatRenderable: false,
|
|
471
|
+
float32Filterable: false,
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
function makeEquirect(): EquirectAsset {
|
|
475
|
+
return {
|
|
476
|
+
kind: 'equirect',
|
|
477
|
+
width: 4,
|
|
478
|
+
height: 2,
|
|
479
|
+
format: 'rgba16float' as TextureFormat,
|
|
480
|
+
data: new Uint8Array(4 * 2 * 8),
|
|
481
|
+
colorSpace: 'linear',
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
describe('t10 -- equirect-to-cubemap projection contract (internal)', () => {
|
|
486
|
+
it('(a) returns Handle<EquirectAsset> cube handle for a valid EquirectAsset source', async () => {
|
|
487
|
+
const probe: SubmitProbe = { submitCalls: 0 };
|
|
488
|
+
const device = makeMockDevice(probe);
|
|
489
|
+
const world = new World();
|
|
490
|
+
const store = new GpuResidencyCache();
|
|
491
|
+
const equirect = makeEquirect();
|
|
492
|
+
// feat-20260614 M8: column handles are minted by the World, not the
|
|
493
|
+
// registry. The cube register-relay also mints via world.allocSharedRef.
|
|
494
|
+
const sourceHandle = world.allocSharedRef('EquirectAsset', equirect);
|
|
495
|
+
store.configureGpuDevice(
|
|
496
|
+
device,
|
|
497
|
+
async (_d, desc) =>
|
|
498
|
+
// biome-ignore lint/suspicious/noExplicitAny: shader factory shim
|
|
499
|
+
rhiOk({ __mock: 'shader', label: desc.label ?? '' }) as any,
|
|
500
|
+
(w, pod: EquirectAsset) => rhiOk(w.allocSharedRef('EquirectAsset', pod)),
|
|
501
|
+
mockCaps,
|
|
502
|
+
);
|
|
503
|
+
store.configureIblDevice(
|
|
504
|
+
device,
|
|
505
|
+
async (_d, desc) => rhiOk({ __mock: 'shader', label: desc.label ?? '' }) as never,
|
|
506
|
+
);
|
|
507
|
+
store.bindDeviceScope(DeviceScope.create(0, 'asset-unit-t10'));
|
|
508
|
+
// biome-ignore lint/suspicious/noExplicitAny: package-internal projection reached via store cast
|
|
509
|
+
const result = await (store as any)._uploadCubemapFromEquirect(world, sourceHandle, equirect);
|
|
510
|
+
expect(result.ok).toBe(true);
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
it('(c) rejects non-HDR-float input with invalid-source-format', async () => {
|
|
514
|
+
const probe: SubmitProbe = { submitCalls: 0 };
|
|
515
|
+
const device = makeMockDevice(probe);
|
|
516
|
+
const world = new World();
|
|
517
|
+
const store = new GpuResidencyCache();
|
|
518
|
+
const ldr: EquirectAsset = {
|
|
519
|
+
kind: 'equirect',
|
|
520
|
+
width: 64,
|
|
521
|
+
height: 64,
|
|
522
|
+
format: 'rgba8unorm' as TextureFormat,
|
|
523
|
+
data: new Uint8Array(64 * 64 * 4),
|
|
524
|
+
colorSpace: 'srgb',
|
|
525
|
+
};
|
|
526
|
+
const sourceHandle = world.allocSharedRef('EquirectAsset', ldr);
|
|
527
|
+
store.configureGpuDevice(
|
|
528
|
+
device,
|
|
529
|
+
undefined,
|
|
530
|
+
(w, pod: EquirectAsset) => rhiOk(w.allocSharedRef('EquirectAsset', pod)),
|
|
531
|
+
mockCaps,
|
|
532
|
+
);
|
|
533
|
+
// biome-ignore lint/suspicious/noExplicitAny: package-internal projection reached via store cast
|
|
534
|
+
const result = await (store as any)._uploadCubemapFromEquirect(world, sourceHandle, ldr);
|
|
535
|
+
expect(result.ok).toBe(false);
|
|
536
|
+
if (!result.ok) {
|
|
537
|
+
expect(result.error.code).toBe('invalid-source-format');
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
it('(d) source POD fetch surfaces asset-not-found for unresolvable handle', () => {
|
|
542
|
+
// Pull-model migration: the cube upload takes a source POD; a missing
|
|
543
|
+
// source surfaces when the caller resolves the handle to a payload first.
|
|
544
|
+
const world = new World();
|
|
545
|
+
const bogus = toShared<'TextureAsset'>(99999);
|
|
546
|
+
const podRes = resolveAssetHandle<TextureAsset>(world, bogus);
|
|
547
|
+
expect(podRes.ok).toBe(false);
|
|
548
|
+
if (!podRes.ok) {
|
|
549
|
+
expect(podRes.error.code).toBe('asset-not-found');
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
describe('t54 (M3.5) -- AC-03 idempotent at GPU-dispatch layer', () => {
|
|
555
|
+
it('(b1) second uploadCubemapFromEquirect with same source does NOT re-dispatch', async () => {
|
|
556
|
+
const probe: SubmitProbe = { submitCalls: 0 };
|
|
557
|
+
const device = makeMockDevice(probe);
|
|
558
|
+
const world = new World();
|
|
559
|
+
const store = new GpuResidencyCache();
|
|
560
|
+
const equirect = makeEquirect();
|
|
561
|
+
const sourceHandle = world.allocSharedRef('EquirectAsset', equirect);
|
|
562
|
+
store.configureGpuDevice(
|
|
563
|
+
device,
|
|
564
|
+
async (_d, desc) =>
|
|
565
|
+
// biome-ignore lint/suspicious/noExplicitAny: shader factory shim
|
|
566
|
+
rhiOk({ __mock: 'shader', label: desc.label ?? '' }) as any,
|
|
567
|
+
(w, pod: EquirectAsset) => rhiOk(w.allocSharedRef('EquirectAsset', pod)),
|
|
568
|
+
mockCaps,
|
|
569
|
+
);
|
|
570
|
+
store.configureIblDevice(
|
|
571
|
+
device,
|
|
572
|
+
async (_d, desc) => rhiOk({ __mock: 'shader', label: desc.label ?? '' }) as never,
|
|
573
|
+
);
|
|
574
|
+
store.bindDeviceScope(DeviceScope.create(1, 'asset-unit-t54'));
|
|
575
|
+
|
|
576
|
+
// biome-ignore lint/suspicious/noExplicitAny: package-internal projection reached via store cast
|
|
577
|
+
const r1 = await (store as any)._uploadCubemapFromEquirect(world, sourceHandle, equirect);
|
|
578
|
+
const firstSubmits = probe.submitCalls;
|
|
579
|
+
expect(firstSubmits).toBeGreaterThanOrEqual(1);
|
|
580
|
+
|
|
581
|
+
// biome-ignore lint/suspicious/noExplicitAny: package-internal projection reached via store cast
|
|
582
|
+
const r2 = await (store as any)._uploadCubemapFromEquirect(world, sourceHandle, equirect);
|
|
583
|
+
// Second call returns the cached handle without dispatching again.
|
|
584
|
+
expect(probe.submitCalls).toBe(firstSubmits);
|
|
585
|
+
|
|
586
|
+
expect(r1.ok && r2.ok).toBe(true);
|
|
587
|
+
if (r1.ok && r2.ok) {
|
|
588
|
+
// (b3) returned Handle has identical numeric id.
|
|
589
|
+
expect(JSON.stringify(r1.value)).toBe(JSON.stringify(r2.value));
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
});
|
|
593
|
+
}
|