@forgeax/engine-runtime 0.1.4 → 0.1.6
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 +49 -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 +3 -3
- 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 +19 -81
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +105 -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 +575 -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 +0 -18
- 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 +1203 -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 +16 -500
- 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 +14 -21
- 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 +81 -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 +60 -558
- 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 +59 -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 +43 -261
- 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 +12 -11
- 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 +64 -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 +28 -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 +47 -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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// sprite-nineslice-mesh-bind.dawn.test.ts -- feat-20260527-sprite-nineslice
|
|
2
|
-
// M2 / w13. dawn-node smoke that the
|
|
2
|
+
// M2 / w13. dawn-node smoke that the HANDLE_NINESLICE_QUAD GPU buffers are
|
|
3
3
|
// resident and bind cleanly when a sprite material declares non-zero `slices`.
|
|
4
4
|
//
|
|
5
5
|
// Plan-strategy §M2 boundary clause: M2 must include at least one dawn fixture so
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
// It does NOT assert pixel content -- M3 / w15 (hello-sprite-nineslice-section
|
|
13
13
|
// dawn fixture) covers stretch + tile pixel parity.
|
|
14
14
|
|
|
15
|
+
import { AssetRegistry, HANDLE_QUAD } from '@forgeax/engine-assets-runtime';
|
|
15
16
|
import { World } from '@forgeax/engine-ecs';
|
|
16
|
-
import {
|
|
17
|
+
import { Camera, MeshFilter, MeshRenderer } from '@forgeax/engine-render';
|
|
17
18
|
import { SPRITE_PREMULTIPLIED_ALPHA_BLEND } from '@forgeax/engine-render/authoring';
|
|
18
|
-
import { Camera, MeshFilter, MeshRenderer } from '@forgeax/engine-render/internal';
|
|
19
|
-
import { createRenderer } from '@forgeax/engine-runtime';
|
|
20
19
|
import { Transform } from '@forgeax/engine-scene';
|
|
21
20
|
import type { MaterialAsset, SamplerAsset, TextureAsset } from '@forgeax/engine-types';
|
|
22
21
|
import { describe, expect, it } from 'vitest';
|
|
22
|
+
import { constructRuntimeRendererHost } from '../../renderer-host';
|
|
23
23
|
import { drawPublished } from '../draw-published';
|
|
24
24
|
|
|
25
25
|
const WIDTH = 64;
|
|
@@ -93,23 +93,25 @@ describe('feat-20260527-sprite-nineslice w13 dawn smoke (HANDLE_NINESLICE_QUAD b
|
|
|
93
93
|
removeEventListener() {},
|
|
94
94
|
} as unknown as HTMLCanvasElement;
|
|
95
95
|
|
|
96
|
-
let
|
|
96
|
+
let host: Awaited<ReturnType<typeof constructRuntimeRendererHost>>;
|
|
97
97
|
try {
|
|
98
|
-
|
|
98
|
+
host = await constructRuntimeRendererHost(
|
|
99
|
+
mockCanvas,
|
|
100
|
+
{},
|
|
101
|
+
{
|
|
102
|
+
shaderManifestUrl: ENGINE_MANIFEST_URL,
|
|
103
|
+
},
|
|
104
|
+
);
|
|
99
105
|
} finally {
|
|
100
106
|
globalThis.navigator.gpu.requestAdapter = originalRequestAdapter;
|
|
101
107
|
}
|
|
102
|
-
expect(
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
expect(
|
|
106
|
-
|
|
108
|
+
expect(host.ok).toBe(true);
|
|
109
|
+
if (!host.ok) throw host.error;
|
|
110
|
+
const { renderer, assets } = host.value;
|
|
111
|
+
expect(renderer.inspect().state).toBe('alive');
|
|
112
|
+
expect(assets).toBeInstanceOf(AssetRegistry);
|
|
107
113
|
|
|
108
114
|
const world = new World();
|
|
109
|
-
const nineSliceHandle = world.internSharedRef(
|
|
110
|
-
'MeshAsset',
|
|
111
|
-
createPrimitiveMesh('nine-slice-quad').unwrap(),
|
|
112
|
-
);
|
|
113
115
|
|
|
114
116
|
// ── Build a 4x4 RGBA texture (16 texels) with a recognizable pattern. ──
|
|
115
117
|
// The exact pixels are not asserted -- the frame just needs to render
|
|
@@ -132,18 +134,6 @@ describe('feat-20260527-sprite-nineslice w13 dawn smoke (HANDLE_NINESLICE_QUAD b
|
|
|
132
134
|
data: pixels,
|
|
133
135
|
};
|
|
134
136
|
const texHandle = world.allocSharedRef<'TextureAsset', TextureAsset>('TextureAsset', texAsset);
|
|
135
|
-
// feat-20260601-gpu-resource-store-extraction M1: explicit texture GPU upload.
|
|
136
|
-
const texUploadRes = await renderer.store.uploadTexture(texHandle, texAsset, {
|
|
137
|
-
bytes: pixels,
|
|
138
|
-
width: 4,
|
|
139
|
-
height: 4,
|
|
140
|
-
mime: 'image/png',
|
|
141
|
-
colorSpace: 'srgb',
|
|
142
|
-
mipmap: false,
|
|
143
|
-
});
|
|
144
|
-
expect(texUploadRes.ok).toBe(true);
|
|
145
|
-
if (!texUploadRes.ok) return;
|
|
146
|
-
|
|
147
137
|
const samplerAsset: SamplerAsset = {
|
|
148
138
|
kind: 'sampler',
|
|
149
139
|
addressModeU: 'repeat',
|
|
@@ -174,7 +164,7 @@ describe('feat-20260527-sprite-nineslice w13 dawn smoke (HANDLE_NINESLICE_QUAD b
|
|
|
174
164
|
// single asset-side SSOT; transparent routing now derives from
|
|
175
165
|
// `renderState.blend !== undefined`.
|
|
176
166
|
// The slices mesh routing decision (D-2 sentinel:
|
|
177
|
-
//
|
|
167
|
+
// HANDLE_QUAD -> HANDLE_NINESLICE_QUAD when slices != [0,0,0,0]) is
|
|
178
168
|
// unchanged; the record stage reads it via the materialShaderId ===
|
|
179
169
|
// 'forgeax::sprite' + non-zero `slicesAndMode.xyz` predicate.
|
|
180
170
|
const matHandle = world.allocSharedRef<'MaterialAsset', MaterialAsset>('MaterialAsset', {
|
|
@@ -191,22 +181,16 @@ describe('feat-20260527-sprite-nineslice w13 dawn smoke (HANDLE_NINESLICE_QUAD b
|
|
|
191
181
|
},
|
|
192
182
|
],
|
|
193
183
|
values: {
|
|
194
|
-
baseColorTexture: {
|
|
195
|
-
texture: texHandle as unknown as never,
|
|
196
|
-
coordinates: {
|
|
197
|
-
set: 0,
|
|
198
|
-
transform: { offset: [0, 0], scale: [1, 1], rotation: 0 },
|
|
199
|
-
physicalUvScale: [1, 1],
|
|
200
|
-
},
|
|
201
|
-
},
|
|
184
|
+
baseColorTexture: { texture: texHandle as unknown as never },
|
|
202
185
|
sampler: { texture: samplerHandle as unknown as never },
|
|
203
186
|
slicesAndMode: [0.25, 0.25, 0.25, 0.25],
|
|
204
187
|
},
|
|
205
188
|
});
|
|
206
189
|
|
|
207
190
|
const errors: unknown[] = [];
|
|
208
|
-
renderer.
|
|
209
|
-
|
|
191
|
+
renderer.subscribe((event) => {
|
|
192
|
+
if (event.kind !== 'error') return;
|
|
193
|
+
errors.push(event.error);
|
|
210
194
|
});
|
|
211
195
|
|
|
212
196
|
world.spawn(
|
|
@@ -218,7 +202,7 @@ describe('feat-20260527-sprite-nineslice w13 dawn smoke (HANDLE_NINESLICE_QUAD b
|
|
|
218
202
|
scale: [1, 1, 1],
|
|
219
203
|
},
|
|
220
204
|
},
|
|
221
|
-
{ component: MeshFilter, data: { assetHandle:
|
|
205
|
+
{ component: MeshFilter, data: { assetHandle: HANDLE_QUAD } },
|
|
222
206
|
{ component: MeshRenderer, data: { materials: [matHandle] } },
|
|
223
207
|
);
|
|
224
208
|
world.spawn(
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
// T-M3-02 dawn (real GPU) integration tests for AssetRegistry.uploadTexture
|
|
2
|
+
// (plan-strategy section 2.5 D Open Q-4 (c) consistency assertion + section
|
|
3
|
+
// 2.6 D Open Q-5 (a) mipmap-generator independent file; research F-3 sRGB
|
|
4
|
+
// mipmap math spec correctness; F-4 copyExternalImageToTexture entry).
|
|
5
|
+
//
|
|
6
|
+
// Why dawn integration tests:
|
|
7
|
+
// - Requirements AC-08 (uploadTexture path + sampler default + sRGB / linear
|
|
8
|
+
// explicit) needs real GPU verification: spec automatic decode / encode
|
|
9
|
+
// on `*-srgb` views must produce a mid-gray ~0.5 in linear space rather
|
|
10
|
+
// than the broken-OpenGL ~0.218 (research F-3 physical judgment).
|
|
11
|
+
// - The unit-only path cannot exercise queue.copyExternalImageToTexture +
|
|
12
|
+
// readBuffer pixel readback; the dawn project (vitest dawn) provides
|
|
13
|
+
// `globalThis.navigator.gpu` via webgpu npm package native binding
|
|
14
|
+
// (vitest.setup-webgpu.ts).
|
|
15
|
+
//
|
|
16
|
+
// Fixtures live alongside this file (T-M3-02 acceptanceCheck listed 6 fixtures
|
|
17
|
+
// originally; the unit-test layer in T-M3-01 already covers 1x1 / 2x2 / 256x256
|
|
18
|
+
// dimension boundaries + non-power-of-2 via the pure formula. The two real-
|
|
19
|
+
// pixel fixtures here are documentary -- the inline literal byte arrays match
|
|
20
|
+
// what the PNGs encode (sRGB byte 188 + linear byte 128) so the test is
|
|
21
|
+
// self-contained without node:fs file IO. Plan-strategy section 4 R4 explicitly
|
|
22
|
+
// notes mid-gray 0.5 not sinking to 0.218 as the binary judgment).
|
|
23
|
+
//
|
|
24
|
+
// Red-stage scaffolding: implementation lands in T-M3-05 (AssetRegistry.
|
|
25
|
+
// uploadTexture method + render-system materialBindGroup sampler / textureView
|
|
26
|
+
// injection); the GPU-upload path itself stays inert when configureGpuDevice
|
|
27
|
+
// is not called (M3-only deferred-upload semantics; M5 wires the device into
|
|
28
|
+
// render-system bootstrap).
|
|
29
|
+
|
|
30
|
+
import { resolveAssetHandle } from '@forgeax/engine-assets-runtime';
|
|
31
|
+
import { World } from '@forgeax/engine-ecs';
|
|
32
|
+
import { ok } from '@forgeax/engine-rhi';
|
|
33
|
+
import { rhi } from '@forgeax/engine-rhi-webgpu';
|
|
34
|
+
import type { DecodedImage, EquirectAsset, TextureAsset } from '@forgeax/engine-types';
|
|
35
|
+
import { toShared } from '@forgeax/engine-types';
|
|
36
|
+
import { describe, expect, it } from 'vitest';
|
|
37
|
+
import { GpuResidencyCache } from '../../../../render/src/device/gpu-residency';
|
|
38
|
+
|
|
39
|
+
const mockCaps = {
|
|
40
|
+
backendKind: 'webgpu' as const,
|
|
41
|
+
compute: true,
|
|
42
|
+
timestampQuery: false,
|
|
43
|
+
timestampPeriodNanoseconds: null,
|
|
44
|
+
indirectDrawing: false,
|
|
45
|
+
textureCompressionBc: false,
|
|
46
|
+
textureCompressionEtc2: false,
|
|
47
|
+
textureCompressionAstc: false,
|
|
48
|
+
multiDrawIndirect: false,
|
|
49
|
+
pushConstants: false,
|
|
50
|
+
textureBindingArray: false,
|
|
51
|
+
samplerAliasing: false,
|
|
52
|
+
firstInstanceIndirect: false,
|
|
53
|
+
storageBuffer: true,
|
|
54
|
+
storageTexture: false,
|
|
55
|
+
rgba16floatRenderable: true,
|
|
56
|
+
rg11b10ufloatRenderable: false,
|
|
57
|
+
float32Filterable: false,
|
|
58
|
+
maxColorAttachments: 8,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// feat-20260601-device/gpu-residency-extraction M1: uploadTexture moved to
|
|
62
|
+
// GpuResidencyCache (POD carries format, decoded carries colorSpace; D-2). The
|
|
63
|
+
// store holds no registry reference -- the asset-not-found arm now lives at the
|
|
64
|
+
// registry get the caller runs before reaching the store.
|
|
65
|
+
|
|
66
|
+
function makeTexture(
|
|
67
|
+
format: GPUTextureFormat,
|
|
68
|
+
width: number,
|
|
69
|
+
height: number,
|
|
70
|
+
colorSpace: 'srgb' | 'linear',
|
|
71
|
+
mipmap: boolean,
|
|
72
|
+
): TextureAsset {
|
|
73
|
+
return {
|
|
74
|
+
kind: 'texture',
|
|
75
|
+
width,
|
|
76
|
+
height,
|
|
77
|
+
format,
|
|
78
|
+
data: new Uint8Array(width * height * 4),
|
|
79
|
+
colorSpace,
|
|
80
|
+
mipmap,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function decodedFromBytes(
|
|
85
|
+
bytes: Uint8Array,
|
|
86
|
+
width: number,
|
|
87
|
+
height: number,
|
|
88
|
+
colorSpace: 'srgb' | 'linear',
|
|
89
|
+
mipmap: boolean,
|
|
90
|
+
): DecodedImage {
|
|
91
|
+
return {
|
|
92
|
+
bytes,
|
|
93
|
+
width,
|
|
94
|
+
height,
|
|
95
|
+
mime: 'image/png',
|
|
96
|
+
colorSpace,
|
|
97
|
+
mipmap,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
describe('T-M3-02 dawn uploadTexture format <-> colorSpace consistency', () => {
|
|
102
|
+
it('rejects format=rgba8unorm-srgb + decoded.colorSpace=linear (real GPU path)', async () => {
|
|
103
|
+
const store = new GpuResidencyCache();
|
|
104
|
+
const pod = makeTexture('rgba8unorm-srgb', 1, 1, 'srgb', false);
|
|
105
|
+
const handle = toShared<'TextureAsset'>(1);
|
|
106
|
+
const decoded = decodedFromBytes(new Uint8Array([188, 188, 188, 255]), 1, 1, 'linear', false);
|
|
107
|
+
const res = await store.uploadTexture(handle, pod, decoded);
|
|
108
|
+
expect(res.ok).toBe(false);
|
|
109
|
+
if (res.ok) return;
|
|
110
|
+
expect(res.error.code).toBe('image-format-unsupported');
|
|
111
|
+
if (res.error.code !== 'image-format-unsupported') return;
|
|
112
|
+
if (res.error.detail.code !== 'image-format-unsupported') return;
|
|
113
|
+
expect(res.error.detail.formatColorSpaceConflict?.expected).toBe('srgb');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('accepts format=rgba8unorm-srgb + decoded.colorSpace=srgb (1x1 mid-gray byte 188)', async () => {
|
|
117
|
+
const store = new GpuResidencyCache();
|
|
118
|
+
const pod = makeTexture('rgba8unorm-srgb', 1, 1, 'srgb', false);
|
|
119
|
+
const handle = toShared<'TextureAsset'>(1);
|
|
120
|
+
const decoded = decodedFromBytes(new Uint8Array([188, 188, 188, 255]), 1, 1, 'srgb', false);
|
|
121
|
+
const res = await store.uploadTexture(handle, pod, decoded);
|
|
122
|
+
expect(res.ok).toBe(true);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('accepts format=rgba8unorm + decoded.colorSpace=linear (1x1 linear byte 128)', async () => {
|
|
126
|
+
const store = new GpuResidencyCache();
|
|
127
|
+
const pod = makeTexture('rgba8unorm', 1, 1, 'linear', false);
|
|
128
|
+
const handle = toShared<'TextureAsset'>(1);
|
|
129
|
+
const decoded = decodedFromBytes(new Uint8Array([128, 64, 192, 255]), 1, 1, 'linear', false);
|
|
130
|
+
const res = await store.uploadTexture(handle, pod, decoded);
|
|
131
|
+
expect(res.ok).toBe(true);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('asset-not-found path: resolve against unregistered gen-0 handle (real GPU)', () => {
|
|
135
|
+
const world = new World();
|
|
136
|
+
// gen-0 user-tier handle for a never-allocated slot: passes the generation
|
|
137
|
+
// gate then misses the payload -> asset-not-found. A gen>0 handle would
|
|
138
|
+
// surface 'shared-ref-stale' instead (D-3/AC-10).
|
|
139
|
+
const fake = toShared<'TextureAsset'>(99999);
|
|
140
|
+
const podRes = resolveAssetHandle<TextureAsset>(world, fake);
|
|
141
|
+
expect(podRes.ok).toBe(false);
|
|
142
|
+
if (podRes.ok) return;
|
|
143
|
+
expect(podRes.error.code).toBe('asset-not-found');
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// AC-04 (bug-20260521): non-256-aligned width uploadTexture through
|
|
148
|
+
// real GPU path. Must call configureGpuDevice() to bypass the
|
|
149
|
+
// asset-registry.ts:770-773 short-circuit (device === undefined).
|
|
150
|
+
// The test name contains 'non-256-aligned' for grep discoverability.
|
|
151
|
+
// Plan-strategy section 5.3 + requirements AC-04 caveat:
|
|
152
|
+
// `grep -n 'configureGpuDevice('` must find at least one hit.
|
|
153
|
+
describe('AC-04: uploadTexture non-256-aligned width (real GPU path)', () => {
|
|
154
|
+
it('uploadTexture accepts non-256-aligned width (100x100 RGBA8, bytesPerRow=400, configureGpuDevice injected)', async () => {
|
|
155
|
+
const adapterResult = await rhi.requestAdapter();
|
|
156
|
+
if (!adapterResult.ok) return;
|
|
157
|
+
const deviceResult = await adapterResult.value.requestDevice();
|
|
158
|
+
if (!deviceResult.ok) return;
|
|
159
|
+
const device = deviceResult.value;
|
|
160
|
+
|
|
161
|
+
const store = new GpuResidencyCache();
|
|
162
|
+
const world = new World();
|
|
163
|
+
// Literal configureGpuDevice required -- this is the anti-short-circuit
|
|
164
|
+
// guard verified by acceptanceCheck grep gate. Wires the device + register
|
|
165
|
+
// relay onto the store (D-3/D-8).
|
|
166
|
+
store.configureGpuDevice(
|
|
167
|
+
// biome-ignore lint/suspicious/noExplicitAny: structural rhi device shim
|
|
168
|
+
device as any,
|
|
169
|
+
undefined,
|
|
170
|
+
(w: World, pod: EquirectAsset) => ok(w.allocSharedRef('EquirectAsset', pod)),
|
|
171
|
+
mockCaps,
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
const width = 100;
|
|
175
|
+
const height = 100;
|
|
176
|
+
const buf = new Uint8Array(width * height * 4);
|
|
177
|
+
// Fill with a deterministic pattern so any validator that inspects
|
|
178
|
+
// pixel data sees real content rather than an all-zeroes block.
|
|
179
|
+
for (let i = 0; i < buf.length; i++) {
|
|
180
|
+
buf[i] = (i * 17 + 64) & 0xff;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const tex: TextureAsset = {
|
|
184
|
+
kind: 'texture',
|
|
185
|
+
width,
|
|
186
|
+
height,
|
|
187
|
+
format: 'rgba8unorm',
|
|
188
|
+
data: buf,
|
|
189
|
+
colorSpace: 'linear',
|
|
190
|
+
mipmap: false,
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
const handle = world.allocSharedRef('TextureAsset', tex);
|
|
194
|
+
const decoded = decodedFromBytes(buf, width, height, 'linear', false);
|
|
195
|
+
const res = await store.uploadTexture(handle, tex, decoded);
|
|
196
|
+
expect(res.ok).toBe(true);
|
|
197
|
+
});
|
|
198
|
+
});
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// cube was silently culled (charter P3 explicit failure: the structured
|
|
13
13
|
// error fired, but the frame still composited pure clearColor).
|
|
14
14
|
//
|
|
15
|
-
// feat-20260601-gpu-
|
|
15
|
+
// feat-20260601-device/gpu-residency-extraction M1 closed the engine path via
|
|
16
16
|
// the pull model (the prior register-time auto-upload push was severed):
|
|
17
17
|
// - render-system-record.ts: a user-handle mesh (id >= 1024) misses the
|
|
18
18
|
// builtin `pipelineState.meshes` alias map, so the record stage pulls it
|
|
@@ -40,17 +40,17 @@
|
|
|
40
40
|
// COPY_SRC` GPUTexture pattern as
|
|
41
41
|
// apps/learn-render/.../4.textures/src/__tests__/textures-pixel.dawn.test.ts.
|
|
42
42
|
|
|
43
|
+
import { AssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
43
44
|
import { World } from '@forgeax/engine-ecs';
|
|
44
45
|
import { createBoxGeometry } from '@forgeax/engine-geometry';
|
|
45
46
|
import { AssetGuid } from '@forgeax/engine-pack/guid';
|
|
46
|
-
import { Camera, MeshFilter, MeshRenderer } from '@forgeax/engine-render
|
|
47
|
-
import { createRenderer } from '@forgeax/engine-runtime';
|
|
47
|
+
import { Camera, MeshFilter, MeshRenderer } from '@forgeax/engine-render';
|
|
48
48
|
import { Transform } from '@forgeax/engine-scene';
|
|
49
49
|
import type { MaterialAsset, MeshAsset } from '@forgeax/engine-types';
|
|
50
50
|
import { unwrapHandle } from '@forgeax/engine-types';
|
|
51
51
|
import { describe, expect, it } from 'vitest';
|
|
52
|
+
import { constructRuntimeRendererHost } from '../../renderer-host';
|
|
52
53
|
import { drawPublished } from '../draw-published';
|
|
53
|
-
import { createTestRenderAssetStore } from '../helpers/render-asset-port';
|
|
54
54
|
|
|
55
55
|
const WIDTH = 256;
|
|
56
56
|
const HEIGHT = 256;
|
|
@@ -145,25 +145,23 @@ describe('T-M2-1 user-handle mesh render regression (AC-10 / AC-11, dawn)', () =
|
|
|
145
145
|
removeEventListener() {},
|
|
146
146
|
} as unknown as HTMLCanvasElement;
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
let renderer: Awaited<ReturnType<typeof createRenderer>>;
|
|
148
|
+
let host: Awaited<ReturnType<typeof constructRuntimeRendererHost>>;
|
|
150
149
|
try {
|
|
151
|
-
|
|
150
|
+
host = await constructRuntimeRendererHost(
|
|
152
151
|
mockCanvas,
|
|
153
152
|
{},
|
|
154
153
|
{
|
|
155
154
|
shaderManifestUrl: ENGINE_MANIFEST_URL,
|
|
156
|
-
assetResolver: assetStore.resolver,
|
|
157
155
|
},
|
|
158
156
|
);
|
|
159
157
|
} finally {
|
|
160
158
|
globalThis.navigator.gpu.requestAdapter = originalRequestAdapter;
|
|
161
159
|
}
|
|
162
|
-
expect(
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
expect(
|
|
166
|
-
|
|
160
|
+
expect(host.ok).toBe(true);
|
|
161
|
+
if (!host.ok) throw host.error;
|
|
162
|
+
const { renderer, assets } = host.value;
|
|
163
|
+
expect(assets).toBeInstanceOf(AssetRegistry);
|
|
164
|
+
expect(renderer.inspect().state).toBe('alive');
|
|
167
165
|
|
|
168
166
|
// 1. Mint a procedural cube MeshAsset, catalogue it under a fresh UUIDv7
|
|
169
167
|
// GUID in the AssetRegistry (GUID->payload SSOT, no handle), then mint a
|
|
@@ -180,7 +178,7 @@ describe('T-M2-1 user-handle mesh render regression (AC-10 / AC-11, dawn)', () =
|
|
|
180
178
|
const world = new World();
|
|
181
179
|
|
|
182
180
|
const cubeGuid = AssetGuid.random();
|
|
183
|
-
|
|
181
|
+
assets.catalog(cubeGuid, cubeAsset);
|
|
184
182
|
const cubeHandle = world.allocSharedRef('MeshAsset', cubeAsset);
|
|
185
183
|
|
|
186
184
|
// The handle MUST be a user-tier handle (>= 1024 = BUILTIN_BASE). If this
|
|
@@ -26,10 +26,11 @@
|
|
|
26
26
|
import { World } from '@forgeax/engine-ecs';
|
|
27
27
|
import { createBoxGeometry, PROCEDURAL_FLOATS_PER_VERTEX } from '@forgeax/engine-geometry';
|
|
28
28
|
import { mat4 } from '@forgeax/engine-math';
|
|
29
|
-
import { GpuResourceStore } from '@forgeax/engine-render/internal';
|
|
30
29
|
import { ok } from '@forgeax/engine-rhi';
|
|
30
|
+
import { rhi } from '@forgeax/engine-rhi-webgpu';
|
|
31
31
|
import type { EquirectAsset, MaterialAsset, MeshAsset } from '@forgeax/engine-types';
|
|
32
32
|
import { describe, expect, it } from 'vitest';
|
|
33
|
+
import { GpuResidencyCache } from '../../../../render/src/device/gpu-residency';
|
|
33
34
|
|
|
34
35
|
const mockCaps = {
|
|
35
36
|
backendKind: 'webgpu' as const,
|
|
@@ -53,7 +54,7 @@ const mockCaps = {
|
|
|
53
54
|
maxColorAttachments: 8,
|
|
54
55
|
};
|
|
55
56
|
|
|
56
|
-
// feat-20260601-gpu-
|
|
57
|
+
// feat-20260601-device/gpu-residency-extraction M1: mesh GPU residency moved to
|
|
57
58
|
// the store; register no longer auto-uploads (push severed). The pull-model
|
|
58
59
|
// premise: register the POD, then explicit `store.ensureResident(handle, pod)`
|
|
59
60
|
// uploads the GPU buffers. The deferred-replay path is removed (no global
|
|
@@ -74,16 +75,18 @@ describe('w22.5 user-registered mesh GPU upload (AC-13, dawn)', () => {
|
|
|
74
75
|
if (!meshRes.ok) return;
|
|
75
76
|
const asset: MeshAsset = meshRes.value;
|
|
76
77
|
|
|
77
|
-
const
|
|
78
|
-
expect(
|
|
79
|
-
if (
|
|
80
|
-
const
|
|
78
|
+
const adapterResult = await rhi.requestAdapter();
|
|
79
|
+
expect(adapterResult.ok).toBe(true);
|
|
80
|
+
if (!adapterResult.ok) return;
|
|
81
|
+
const deviceResult = await adapterResult.value.requestDevice();
|
|
82
|
+
expect(deviceResult.ok).toBe(true);
|
|
83
|
+
if (!deviceResult.ok) return;
|
|
84
|
+
const device = deviceResult.value;
|
|
81
85
|
|
|
82
|
-
const store = new
|
|
86
|
+
const store = new GpuResidencyCache();
|
|
83
87
|
const world = new World();
|
|
84
88
|
store.configureGpuDevice(
|
|
85
|
-
|
|
86
|
-
device as any,
|
|
89
|
+
device,
|
|
87
90
|
undefined,
|
|
88
91
|
(w: World, pod: EquirectAsset) => ok(w.allocSharedRef('EquirectAsset', pod)),
|
|
89
92
|
mockCaps,
|
|
@@ -120,7 +123,7 @@ describe('w22.5 user-registered mesh GPU upload (AC-13, dawn)', () => {
|
|
|
120
123
|
it.skipIf(!dawnReady)(
|
|
121
124
|
'(b) pull-model: register then ensureResident surfaces the GPU buffers (no global replay)',
|
|
122
125
|
async () => {
|
|
123
|
-
// feat-20260601-gpu-
|
|
126
|
+
// feat-20260601-device/gpu-residency-extraction M1: the pre-extraction
|
|
124
127
|
// deferred-replay path is removed (no global replay). register only
|
|
125
128
|
// catalogues the CPU POD; getMeshGpuHandles is undefined until an
|
|
126
129
|
// explicit ensureResident pulls the GPU buffers (charter P9 graceful
|
|
@@ -130,19 +133,20 @@ describe('w22.5 user-registered mesh GPU upload (AC-13, dawn)', () => {
|
|
|
130
133
|
if (!meshRes.ok) return;
|
|
131
134
|
const asset: MeshAsset = meshRes.value;
|
|
132
135
|
|
|
133
|
-
const store = new
|
|
136
|
+
const store = new GpuResidencyCache();
|
|
134
137
|
const world = new World();
|
|
135
138
|
const handle = world.allocSharedRef('MeshAsset', asset);
|
|
136
139
|
// Before any ensureResident the store has no GPU residency for the handle.
|
|
137
140
|
const before = store.getMeshGpuHandles(handle);
|
|
138
141
|
expect(before).toBeUndefined();
|
|
139
142
|
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
142
|
-
const
|
|
143
|
+
const adapterResult = await rhi.requestAdapter();
|
|
144
|
+
if (!adapterResult.ok) return;
|
|
145
|
+
const deviceResult = await adapterResult.value.requestDevice();
|
|
146
|
+
if (!deviceResult.ok) return;
|
|
147
|
+
const device = deviceResult.value;
|
|
143
148
|
store.configureGpuDevice(
|
|
144
|
-
|
|
145
|
-
device as any,
|
|
149
|
+
device,
|
|
146
150
|
undefined,
|
|
147
151
|
(w: World, pod: EquirectAsset) => ok(w.allocSharedRef('EquirectAsset', pod)),
|
|
148
152
|
mockCaps,
|
|
@@ -159,15 +163,16 @@ describe('w22.5 user-registered mesh GPU upload (AC-13, dawn)', () => {
|
|
|
159
163
|
it.skipIf(!dawnReady)(
|
|
160
164
|
'(c) batch register 16 user meshes -> all 16 carry distinct GPU buffer handles (lifecycle does not re-allocate)',
|
|
161
165
|
async () => {
|
|
162
|
-
const
|
|
163
|
-
if (
|
|
164
|
-
const
|
|
166
|
+
const adapterResult = await rhi.requestAdapter();
|
|
167
|
+
if (!adapterResult.ok) return;
|
|
168
|
+
const deviceResult = await adapterResult.value.requestDevice();
|
|
169
|
+
if (!deviceResult.ok) return;
|
|
170
|
+
const device = deviceResult.value;
|
|
165
171
|
|
|
166
|
-
const store = new
|
|
172
|
+
const store = new GpuResidencyCache();
|
|
167
173
|
const world = new World();
|
|
168
174
|
store.configureGpuDevice(
|
|
169
|
-
|
|
170
|
-
device as any,
|
|
175
|
+
device,
|
|
171
176
|
undefined,
|
|
172
177
|
(w: World, pod: EquirectAsset) => ok(w.allocSharedRef('EquirectAsset', pod)),
|
|
173
178
|
mockCaps,
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
// preservation). plan-strategy D-3 + D-4 (test matrix migration: dawn
|
|
16
16
|
// project mirror).
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import { AssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
19
19
|
import type { MaterialAsset } from '@forgeax/engine-types';
|
|
20
20
|
import { describe, expect, it } from 'vitest';
|
|
21
|
-
import {
|
|
21
|
+
import { constructRuntimeRendererHost } from '../../renderer-host';
|
|
22
22
|
|
|
23
23
|
const WIDTH = 64;
|
|
24
24
|
const HEIGHT = 64;
|
|
@@ -83,40 +83,37 @@ describe('bug-20260519 AC-03 dawn mirror: mesh + zero manifest -> render-time fa
|
|
|
83
83
|
removeEventListener() {},
|
|
84
84
|
} as unknown as HTMLCanvasElement;
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
let renderer: Awaited<ReturnType<typeof createRenderer>>;
|
|
86
|
+
let host: Awaited<ReturnType<typeof constructRuntimeRendererHost>>;
|
|
88
87
|
try {
|
|
89
88
|
// Zero-manifest path: explicit `shaderManifestUrl: undefined` opts into
|
|
90
|
-
// zero-entry mode. Post-fix
|
|
89
|
+
// zero-entry mode. Post-fix host construction resolves ok; the
|
|
91
90
|
// asset registration fails at validation time (shader not registered).
|
|
92
|
-
|
|
93
|
-
mockCanvas,
|
|
94
|
-
{},
|
|
95
|
-
{
|
|
96
|
-
shaderManifestUrl: undefined,
|
|
97
|
-
assetResolver: assetStore.resolver,
|
|
98
|
-
},
|
|
99
|
-
);
|
|
91
|
+
host = await constructRuntimeRendererHost(mockCanvas, {}, { shaderManifestUrl: undefined });
|
|
100
92
|
} finally {
|
|
101
93
|
globalThis.navigator.gpu.requestAdapter = originalRequestAdapter;
|
|
102
94
|
}
|
|
103
|
-
expect(
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
expect(
|
|
95
|
+
expect(host.ok).toBe(true);
|
|
96
|
+
if (!host.ok) throw host.error;
|
|
97
|
+
const { renderer, assets } = host.value;
|
|
98
|
+
expect(renderer.inspect().state).toBe('alive');
|
|
99
|
+
expect(assets).toBeInstanceOf(AssetRegistry);
|
|
107
100
|
|
|
108
101
|
// Material parameter declarations now belong to MaterialAsset, so catalog
|
|
109
102
|
// validation does not depend on a shader-manifest registration side table.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
103
|
+
const matRes = assets.catalog<MaterialAsset>(
|
|
104
|
+
assets.parseGuid('00000000-0000-4000-8000-000000000a01'),
|
|
105
|
+
{
|
|
106
|
+
kind: 'material',
|
|
107
|
+
passes: [
|
|
108
|
+
{
|
|
109
|
+
name: 'Forward',
|
|
110
|
+
program: { module: 'forgeax::default-unlit' },
|
|
111
|
+
renderState: { tags: { LightMode: 'Forward' }, queue: 2000 },
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
values: { baseColor: [1, 0, 0, 1] },
|
|
115
|
+
} as MaterialAsset,
|
|
116
|
+
);
|
|
117
|
+
expect(matRes.ok).toBe(true);
|
|
121
118
|
});
|
|
122
119
|
});
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// gate: pre-fix the unconditional Step 2 entry-scan would reject because
|
|
9
9
|
// the empty manifest carries neither the `f_schlick` PBR entry nor the
|
|
10
10
|
// unlit entry; post-fix the gate skips Step 2 outright, the registry
|
|
11
|
-
// yields zero entries, and
|
|
11
|
+
// yields zero entries, and host construction reaches the ready state.
|
|
12
12
|
//
|
|
13
13
|
// AC: requirements section 4 AC-02 (Camera-only world reaches `ready ok`
|
|
14
14
|
// without forcing shader compilation) projected onto the dawn / rhi-wgpu
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
// matrix migration: dawn project mirror) + charter P4 (consistent
|
|
17
17
|
// abstraction across rhi-webgpu / rhi-wgpu).
|
|
18
18
|
|
|
19
|
-
import { createRenderer } from '@forgeax/engine-runtime';
|
|
20
19
|
import { describe, expect, it } from 'vitest';
|
|
20
|
+
import { constructRuntimeRendererHost } from '../../renderer-host';
|
|
21
21
|
|
|
22
22
|
const WIDTH = 64;
|
|
23
23
|
const HEIGHT = 64;
|
|
24
24
|
const TEXTURE_USAGE_COPY_SRC = 0x01;
|
|
25
25
|
const TEXTURE_USAGE_RENDER_ATTACHMENT = 0x10;
|
|
26
26
|
|
|
27
|
-
describe('bug-20260519 AC-02 dawn mirror: zero manifest -> ready
|
|
28
|
-
it('
|
|
27
|
+
describe('bug-20260519 AC-02 dawn mirror: zero manifest -> ready state', () => {
|
|
28
|
+
it('runtime host without shaderManifestUrl reaches ready state on dawn', async () => {
|
|
29
29
|
const dawnAvailable = typeof globalThis.navigator?.gpu?.requestAdapter === 'function';
|
|
30
30
|
if (!dawnAvailable) {
|
|
31
31
|
throw new Error('dawn-node navigator.gpu not injected; vitest.setup-webgpu.ts regressed');
|
|
@@ -82,18 +82,17 @@ describe('bug-20260519 AC-02 dawn mirror: zero manifest -> ready ok', () => {
|
|
|
82
82
|
removeEventListener() {},
|
|
83
83
|
} as unknown as HTMLCanvasElement;
|
|
84
84
|
|
|
85
|
-
let
|
|
85
|
+
let host: Awaited<ReturnType<typeof constructRuntimeRendererHost>>;
|
|
86
86
|
try {
|
|
87
87
|
// Explicit `shaderManifestUrl: undefined` opts into zero-entry mode.
|
|
88
88
|
// ShaderRegistry returns empty entries without issuing any fetch;
|
|
89
|
-
//
|
|
90
|
-
|
|
89
|
+
// Runtime host shader compilation is skipped entirely.
|
|
90
|
+
host = await constructRuntimeRendererHost(mockCanvas, {}, { shaderManifestUrl: undefined });
|
|
91
91
|
} finally {
|
|
92
92
|
globalThis.navigator.gpu.requestAdapter = originalRequestAdapter;
|
|
93
93
|
}
|
|
94
|
-
expect(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
expect(ready.ok).toBe(true);
|
|
94
|
+
expect(host.ok).toBe(true);
|
|
95
|
+
if (!host.ok) throw host.error;
|
|
96
|
+
expect(host.value.renderer.inspect().state).toBe('alive');
|
|
98
97
|
});
|
|
99
98
|
});
|
|
@@ -86,22 +86,22 @@ describe('demo sortScope migration (w15, round-2 production)', () => {
|
|
|
86
86
|
const tilemapCase = DEMO_CASES.find((c) => c.demo === 'hello-tilemap');
|
|
87
87
|
if (tilemapCase === undefined) throw new Error('hello-tilemap case missing');
|
|
88
88
|
const src = readFileSync(tilemapCase.mainTsPath, 'utf8');
|
|
89
|
-
expect(src).not.toMatch(/
|
|
89
|
+
expect(src).not.toMatch(/TilemapSort\.perCell/);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
it("asi-world demo encodes sortScope: 'per-cell' for the object TileLayer", () => {
|
|
93
93
|
const asiCase = DEMO_CASES.find((c) => c.demo === 'hello-asi-world');
|
|
94
94
|
if (asiCase === undefined) throw new Error('asi-world case missing');
|
|
95
95
|
const src = readFileSync(asiCase.mainTsPath, 'utf8');
|
|
96
|
-
expect(src).toMatch(/
|
|
96
|
+
expect(src).toMatch(/TilemapSort\.perCell/);
|
|
97
97
|
});
|
|
98
98
|
|
|
99
|
-
it('asi-world demo imports
|
|
99
|
+
it('asi-world demo imports the grouped TilemapSort authoring value', () => {
|
|
100
100
|
const asiCase = DEMO_CASES.find((c) => c.demo === 'hello-asi-world');
|
|
101
101
|
if (asiCase === undefined) throw new Error('asi-world case missing');
|
|
102
102
|
const src = readFileSync(asiCase.mainTsPath, 'utf8');
|
|
103
|
-
expect(src).toMatch(/
|
|
104
|
-
expect(src).toMatch(/@forgeax\/engine-
|
|
103
|
+
expect(src).toMatch(/TilemapSort/);
|
|
104
|
+
expect(src).toMatch(/@forgeax\/engine-render\/authoring/);
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
it('migration covers both terrain semantics (layer) and object semantics (per-cell)', () => {
|