@forgeax/engine-runtime 0.1.4 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -83
- package/dist/.tsbuildinfo +1 -1
- package/dist/__tests__/animation-graph-collect-roundtrip.test.d.ts +2 -0
- package/dist/__tests__/animation-graph-collect-roundtrip.test.d.ts.map +1 -0
- package/dist/__tests__/animation-graph-serialize.unit.test.d.ts +2 -0
- package/dist/__tests__/animation-graph-serialize.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-brand-and-name-retirement.test.d.ts +2 -0
- package/dist/__tests__/asset-brand-and-name-retirement.test.d.ts.map +1 -0
- package/dist/__tests__/asset-error-exhaustive.test-d.d.ts +11 -0
- package/dist/__tests__/asset-error-exhaustive.test-d.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-guid-reverse.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-guid-reverse.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-hdr-equirect.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-hdr-equirect.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-mesh-pack-payload.dawn.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-mesh-pack-payload.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-mounts.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-mounts.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.browser.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.browser.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.dawn.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.listCatalog.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.listCatalog.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.mesh-bin.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.mesh-bin.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.pack-cache.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.pack-cache.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.raw-container-failfast.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.raw-container-failfast.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.recursive.spec.d.ts +2 -0
- package/dist/__tests__/asset-registry.recursive.spec.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset.unit.test.d.ts +2 -0
- package/dist/__tests__/asset.unit.test.d.ts.map +1 -0
- package/dist/__tests__/audio-load-by-guid.unit.test.d.ts +2 -0
- package/dist/__tests__/audio-load-by-guid.unit.test.d.ts.map +1 -0
- package/dist/__tests__/backend-selection.integration.test.d.ts +2 -0
- package/dist/__tests__/backend-selection.integration.test.d.ts.map +1 -0
- package/dist/__tests__/basis-catalog-dispatch.integration.test.d.ts +2 -0
- package/dist/__tests__/basis-catalog-dispatch.integration.test.d.ts.map +1 -0
- package/dist/__tests__/builtin-asset-registry.unit.test.d.ts +2 -0
- package/dist/__tests__/builtin-asset-registry.unit.test.d.ts.map +1 -0
- package/dist/__tests__/collect-scene-asset.test.d.ts +1 -2
- package/dist/__tests__/collect-scene-asset.test.d.ts.map +1 -1
- package/dist/__tests__/collect-scene-mount-collapse.test.d.ts +2 -0
- package/dist/__tests__/collect-scene-mount-collapse.test.d.ts.map +1 -0
- package/dist/__tests__/collect-transient-roundtrip.test.d.ts +1 -1
- package/dist/__tests__/collect-transient-roundtrip.test.d.ts.map +1 -1
- package/dist/__tests__/collect-transient-skip.test.d.ts +1 -2
- package/dist/__tests__/collect-transient-skip.test.d.ts.map +1 -1
- package/dist/__tests__/compressed-texture-physical-extent.integration.test.d.ts +2 -0
- package/dist/__tests__/compressed-texture-physical-extent.integration.test.d.ts.map +1 -0
- package/dist/__tests__/dawn/mesh-update-dawn.test.d.ts +2 -0
- package/dist/__tests__/dawn/mesh-update-dawn.test.d.ts.map +1 -0
- package/dist/__tests__/dawn/upload-texture.dawn.test.d.ts +2 -0
- package/dist/__tests__/dawn/upload-texture.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/draw-published.d.ts +2 -2
- package/dist/__tests__/draw-published.d.ts.map +1 -1
- package/dist/__tests__/dynamic-texture-store.unit.test.d.ts +2 -0
- package/dist/__tests__/dynamic-texture-store.unit.test.d.ts.map +1 -0
- package/dist/__tests__/errors.unit.test.d.ts +2 -0
- package/dist/__tests__/errors.unit.test.d.ts.map +1 -0
- package/dist/__tests__/extract-skin-mismatch.unit.test.d.ts +2 -0
- package/dist/__tests__/extract-skin-mismatch.unit.test.d.ts.map +1 -0
- package/dist/__tests__/fetch-binary-decompress.test.d.ts +2 -0
- package/dist/__tests__/fetch-binary-decompress.test.d.ts.map +1 -0
- package/dist/__tests__/four-path-compression.integration.test.d.ts +2 -0
- package/dist/__tests__/four-path-compression.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fullscreen-feature-host.dawn.test.d.ts +2 -0
- package/dist/__tests__/fullscreen-feature-host.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/guid-for-asset.unit.test.d.ts +2 -0
- package/dist/__tests__/guid-for-asset.unit.test.d.ts.map +1 -0
- package/dist/__tests__/handle-migration.test.d.ts +2 -0
- package/dist/__tests__/handle-migration.test.d.ts.map +1 -0
- package/dist/__tests__/helpers/register-runtime-components.d.ts.map +1 -1
- package/dist/__tests__/host-custom-kind-contract.test-d.d.ts +2 -0
- package/dist/__tests__/host-custom-kind-contract.test-d.d.ts.map +1 -0
- package/dist/__tests__/host-custom-kind-contract.test.d.ts +2 -0
- package/dist/__tests__/host-custom-kind-contract.test.d.ts.map +1 -0
- package/dist/__tests__/inspect-name.test.d.ts +2 -0
- package/dist/__tests__/inspect-name.test.d.ts.map +1 -0
- package/dist/__tests__/instantiate-mount-deferred-wiring.test.d.ts +2 -0
- package/dist/__tests__/instantiate-mount-deferred-wiring.test.d.ts.map +1 -0
- package/dist/__tests__/loadbyguid-payload.unit.test.d.ts +2 -0
- package/dist/__tests__/loadbyguid-payload.unit.test.d.ts.map +1 -0
- package/dist/__tests__/loadbyguid-texture-intern.unit.test.d.ts +2 -0
- package/dist/__tests__/loadbyguid-texture-intern.unit.test.d.ts.map +1 -0
- package/dist/__tests__/loader-extract-graceful.test.d.ts +2 -0
- package/dist/__tests__/loader-extract-graceful.test.d.ts.map +1 -0
- package/dist/__tests__/loader-name-survival.test.d.ts +2 -0
- package/dist/__tests__/loader-name-survival.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin-contract.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin-contract.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin-skin-roundtrip.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin-skin-roundtrip.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-loader-skin-contract.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-loader-skin-contract.unit.test.d.ts.map +1 -0
- package/dist/__tests__/new-kind-refs-contract.test.d.ts +2 -0
- package/dist/__tests__/new-kind-refs-contract.test.d.ts.map +1 -0
- package/dist/__tests__/package-promotion.test.d.ts +2 -0
- package/dist/__tests__/package-promotion.test.d.ts.map +1 -0
- package/dist/__tests__/package-rename.test.d.ts +2 -0
- package/dist/__tests__/package-rename.test.d.ts.map +1 -0
- package/dist/__tests__/recover-error-exhaustive.test-d.d.ts +1 -1
- package/dist/__tests__/recover-error-exhaustive.test-d.d.ts.map +1 -1
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts +1 -1
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts.map +1 -1
- package/dist/__tests__/render-feature-prepared-graphics.fixture.d.ts +10 -0
- package/dist/__tests__/render-feature-prepared-graphics.fixture.d.ts.map +1 -0
- package/dist/__tests__/render-system-extract.unit.test.d.ts +2 -0
- package/dist/__tests__/render-system-extract.unit.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-test-utils.d.ts +10 -0
- package/dist/__tests__/renderer-test-utils.d.ts.map +1 -0
- package/dist/__tests__/renderer.test-d.d.ts +2 -0
- package/dist/__tests__/renderer.test-d.d.ts.map +1 -0
- package/dist/__tests__/resolve-asset-handle-err.test.d.ts +2 -0
- package/dist/__tests__/resolve-asset-handle-err.test.d.ts.map +1 -0
- package/dist/__tests__/resolve-asset-handle.unit.test.d.ts +2 -0
- package/dist/__tests__/resolve-asset-handle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/resolveName-fallback.test.d.ts +2 -0
- package/dist/__tests__/resolveName-fallback.test.d.ts.map +1 -0
- package/dist/__tests__/resolveName-null-package.test.d.ts +2 -0
- package/dist/__tests__/resolveName-null-package.test.d.ts.map +1 -0
- package/dist/__tests__/resolveName-unified-entry.test.d.ts +2 -0
- package/dist/__tests__/resolveName-unified-entry.test.d.ts.map +1 -0
- package/dist/__tests__/resolveName.test.d.ts +2 -0
- package/dist/__tests__/resolveName.test.d.ts.map +1 -0
- package/dist/__tests__/roots-to-scene-asset.test.d.ts +1 -1
- package/dist/__tests__/roots-to-scene-asset.test.d.ts.map +1 -1
- package/dist/__tests__/roundtrip-primitive.test.d.ts +2 -0
- package/dist/__tests__/roundtrip-primitive.test.d.ts.map +1 -0
- package/dist/__tests__/scene-bare-guid-refs-instantiate.test.d.ts +2 -0
- package/dist/__tests__/scene-bare-guid-refs-instantiate.test.d.ts.map +1 -0
- package/dist/__tests__/scene-instance-authoring.integration.test.d.ts +2 -0
- package/dist/__tests__/scene-instance-authoring.integration.test.d.ts.map +1 -0
- package/dist/__tests__/scene-mount-fixed-point.test.d.ts +2 -0
- package/dist/__tests__/scene-mount-fixed-point.test.d.ts.map +1 -0
- package/dist/__tests__/scene-mount-roundtrip.test.d.ts +2 -0
- package/dist/__tests__/scene-mount-roundtrip.test.d.ts.map +1 -0
- package/dist/__tests__/scene-mount-wrapper-roundtrip.test.d.ts +2 -0
- package/dist/__tests__/scene-mount-wrapper-roundtrip.test.d.ts.map +1 -0
- package/dist/__tests__/scene-sugar-instantiate.test.d.ts +2 -0
- package/dist/__tests__/scene-sugar-instantiate.test.d.ts.map +1 -0
- package/dist/__tests__/serialize-mounts-roundtrip.test.d.ts +2 -0
- package/dist/__tests__/serialize-mounts-roundtrip.test.d.ts.map +1 -0
- package/dist/__tests__/serialize-scene-asset.test.d.ts +1 -1
- package/dist/__tests__/serialize-scene-asset.test.d.ts.map +1 -1
- package/dist/__tests__/template-game-default-api-contract.test.d.ts +2 -0
- package/dist/__tests__/template-game-default-api-contract.test.d.ts.map +1 -0
- package/dist/__tests__/tileset-asset-validate.test.d.ts +2 -0
- package/dist/__tests__/tileset-asset-validate.test.d.ts.map +1 -0
- package/dist/__tests__/transcode-fallback.unit.test.d.ts +2 -0
- package/dist/__tests__/transcode-fallback.unit.test.d.ts.map +1 -0
- package/dist/__tests__/transient-runtime-behavior.test.d.ts +2 -0
- package/dist/__tests__/transient-runtime-behavior.test.d.ts.map +1 -0
- package/dist/__tests__/video-loader-consumption.test.d.ts +2 -0
- package/dist/__tests__/video-loader-consumption.test.d.ts.map +1 -0
- package/dist/__tests__/video-loader-smoke.dawn.test.d.ts +2 -0
- package/dist/__tests__/video-loader-smoke.dawn.test.d.ts.map +1 -0
- package/dist/backend-selection.d.ts +13 -0
- package/dist/backend-selection.d.ts.map +1 -0
- package/dist/collect-scene-asset.d.ts +7 -4
- package/dist/collect-scene-asset.d.ts.map +1 -1
- package/dist/createRenderer.d.ts +14 -2
- package/dist/createRenderer.d.ts.map +1 -1
- package/dist/errors/environment.d.ts +1 -1
- package/dist/errors/environment.d.ts.map +1 -1
- package/dist/index.d.ts +20 -82
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +107 -108
- package/dist/index.mjs.map +1 -1
- package/dist/renderer-host.d.ts +9 -0
- package/dist/renderer-host.d.ts.map +1 -0
- package/dist/renderer-host.mjs +62 -0
- package/dist/renderer-host.mjs.map +1 -0
- package/dist/scene-instances/index.d.ts +2 -0
- package/dist/scene-instances/index.d.ts.map +1 -0
- package/dist/scene-utils/mount-override-fold.d.ts +1 -2
- package/dist/scene-utils/mount-override-fold.d.ts.map +1 -1
- package/dist/systems/sprite-animation-tick.d.ts +1 -1
- package/dist/systems/sprite-animation-tick.d.ts.map +1 -1
- package/dist/systems/transparent-sort.d.ts +1 -2
- package/dist/systems/transparent-sort.d.ts.map +1 -1
- package/dist/tilemap-register-validate.d.ts.map +1 -1
- package/package.json +34 -33
- package/src/__tests__/active-camera.unit.test.ts +19 -9
- package/src/__tests__/animation-graph-collect-roundtrip.test.ts +213 -0
- package/src/__tests__/animation-graph-serialize.unit.test.ts +171 -0
- package/src/__tests__/append-injection.test.ts +1 -1
- package/src/__tests__/asset-brand-and-name-retirement.test.ts +102 -0
- package/src/__tests__/asset-error-exhaustive.test-d.ts +62 -0
- package/src/__tests__/asset-registry-guid-reverse.test.ts +608 -0
- package/src/__tests__/asset-registry-hdr-equirect.test.ts +78 -0
- package/src/__tests__/asset-registry-mesh-pack-payload.dawn.test.ts +232 -0
- package/src/__tests__/asset-registry-mounts.test.ts +806 -0
- package/src/__tests__/asset-registry.browser.test.ts +81 -0
- package/src/__tests__/asset-registry.dawn.test.ts +94 -0
- package/src/__tests__/asset-registry.listCatalog.test.ts +170 -0
- package/src/__tests__/asset-registry.mesh-bin.test.ts +316 -0
- package/src/__tests__/asset-registry.pack-cache.test.ts +969 -0
- package/src/__tests__/asset-registry.raw-container-failfast.test.ts +225 -0
- package/src/__tests__/asset-registry.recursive.spec.ts +1397 -0
- package/src/__tests__/asset-registry.unit.test.ts +1030 -0
- package/src/__tests__/asset.unit.test.ts +7107 -0
- package/src/__tests__/audio-load-by-guid.unit.test.ts +126 -0
- package/src/__tests__/backend-selection.integration.test.ts +11 -0
- package/src/__tests__/basis-catalog-dispatch.integration.test.ts +320 -0
- package/src/__tests__/bind-group-cache-keying.test.ts +4 -4
- package/src/__tests__/block-upload-math.unit.test.ts +2 -2
- package/src/__tests__/builtin-asset-registry.unit.test.ts +112 -0
- package/src/__tests__/builtin-shader-register-e2e.test.ts +1 -1
- package/src/__tests__/cache-false-eviction.test.ts +2 -1
- package/src/__tests__/cache-isolation-matrix.test.ts +2 -1
- package/src/__tests__/camera-clear-snapshot-equivalence.unit.test.ts +5 -6
- package/src/__tests__/clamp-to-last.e2e.browser.test.ts +29 -19
- package/src/__tests__/collect-scene-asset.test.ts +49 -52
- package/src/__tests__/collect-scene-mount-collapse.test.ts +391 -0
- package/src/__tests__/collect-subtree.unit.test.ts +1 -2
- package/src/__tests__/collect-transient-children-absent.test.ts +24 -10
- package/src/__tests__/collect-transient-roundtrip.test.ts +44 -20
- package/src/__tests__/collect-transient-skip.test.ts +24 -13
- package/src/__tests__/components.test-d.ts +1 -6
- package/src/__tests__/components.unit.test.ts +20 -19
- package/src/__tests__/composite-skybox-cross-world.browser.test.ts +59 -27
- package/src/__tests__/compressed-texture-physical-extent.integration.test.ts +139 -0
- package/src/__tests__/create-renderer-assembly.integration.test.ts +42 -29
- package/src/__tests__/createRenderer-dispose.test.ts +35 -402
- package/src/__tests__/createRenderer.browser-no-webgpu.test.ts +25 -30
- package/src/__tests__/createRenderer.unit.test.ts +1 -1
- package/src/__tests__/dawn/hello-sprite-nineslice-section.dawn.test.ts +27 -63
- package/src/__tests__/dawn/ibl-precompute-readback.dawn.test.ts +56 -47
- package/src/__tests__/dawn/instances-per-instance-pbr.dawn.test.ts +49 -29
- package/src/__tests__/dawn/instances-shadow.dawn.test.ts +26 -15
- package/src/__tests__/dawn/instances-uniform-fallback.dawn.test.ts +13 -14
- package/src/__tests__/dawn/material-alpha.dawn.test.ts +23 -31
- package/src/__tests__/dawn/material-cooked-fixture.dawn.test.ts +24 -9
- package/src/__tests__/dawn/{mesh-update.dawn.test.ts → mesh-update-dawn.test.ts} +42 -134
- package/src/__tests__/dawn/mipmap-srgb-linear.dawn.test.ts +14 -7
- package/src/__tests__/dawn/per-entity-material-texture-isolation.dawn.test.ts +16 -28
- package/src/__tests__/dawn/sprite-nineslice-mesh-bind.dawn.test.ts +23 -39
- package/src/__tests__/dawn/upload-texture.dawn.test.ts +198 -0
- package/src/__tests__/dawn/user-handle-mesh-render.dawn.test.ts +12 -14
- package/src/__tests__/dawn/user-mesh-upload.dawn.test.ts +27 -22
- package/src/__tests__/dawn/zero-manifest-mesh-fail.dawn.test.ts +25 -28
- package/src/__tests__/dawn/zero-manifest-ready.dawn.test.ts +10 -11
- package/src/__tests__/demo-sortscope-migration.unit.test.ts +5 -5
- package/src/__tests__/derive-bgl-integration.test.ts +34 -44
- package/src/__tests__/derive-render-data-skin.unit.test.ts +1 -1
- package/src/__tests__/draw-published.ts +11 -4
- package/src/__tests__/dynamic-texture-store.unit.test.ts +190 -0
- package/src/__tests__/equirect-bc6h.integration.test.ts +144 -21
- package/src/__tests__/errors.unit.test.ts +1227 -0
- package/src/__tests__/extract-frames-graceful-degradation.test.ts +3 -7
- package/src/__tests__/extract-frames-merge.test.ts +35 -22
- package/src/__tests__/extract-record-no-hardcoded-texture-fields.test.ts +5 -16
- package/src/__tests__/extract-skin-mismatch.unit.test.ts +322 -0
- package/src/__tests__/fetch-binary-decompress.test.ts +356 -0
- package/src/__tests__/four-path-compression.integration.test.ts +395 -0
- package/src/__tests__/frame-targets-shadow-regression.unit.test.ts +1 -1
- package/src/__tests__/fullscreen-feature-host.dawn.test.ts +80 -0
- package/src/__tests__/fullscreen-post-bgl-depth.test.ts +4 -2
- package/src/__tests__/fullscreen-post-depth-params-arity.test.ts +3 -3
- package/src/__tests__/fullscreen-post-process-pass.dawn.test.ts +39 -23
- package/src/__tests__/fullscreen-post-process-pass.unit.test.ts +4 -2
- package/src/__tests__/fxaa-pixel-diff.dawn.test.ts +28 -17
- package/src/__tests__/fxaa-validation-and-resize.dawn.test.ts +29 -18
- package/src/__tests__/fxaa-zero-overhead.dawn.test.ts +16 -12
- package/src/__tests__/geometry.unit.test.ts +525 -159
- package/src/__tests__/glyph-tilemap-worldid.test.ts +1 -1
- package/src/__tests__/gpu-resource-cow-survivor.test.ts +6 -4
- package/src/__tests__/guid-for-asset.unit.test.ts +102 -0
- package/src/__tests__/handle-migration.test.ts +136 -0
- package/src/__tests__/helpers/register-runtime-components.ts +4 -2
- package/src/__tests__/helpers/register-scene-components.ts +1 -1
- package/src/__tests__/host-custom-kind-contract.test-d.ts +47 -0
- package/src/__tests__/host-custom-kind-contract.test.ts +578 -0
- package/src/__tests__/inspect-name.test.ts +139 -0
- package/src/__tests__/instances.test-d.ts +1 -1
- package/src/__tests__/instantiate-mount-deferred-wiring.test.ts +112 -0
- package/src/__tests__/light-casters-9-light.browser.test.ts +73 -76
- package/src/__tests__/light-gpu-byte-neutral.unit.test.ts +7 -10
- package/src/__tests__/light-snapshot.test-d.ts +2 -2
- package/src/__tests__/lights-vec-negative.unit.test.ts +1 -1
- package/src/__tests__/lights.unit.test.ts +31 -511
- package/src/__tests__/loadbyguid-payload.unit.test.ts +117 -0
- package/src/__tests__/loadbyguid-texture-intern.unit.test.ts +213 -0
- package/src/__tests__/loader-extract-graceful.test.ts +146 -0
- package/src/__tests__/loader-name-survival.test.ts +213 -0
- package/src/__tests__/m3-vec-negative.unit.test.ts +3 -2
- package/src/__tests__/material-texture-uv-scale.unit.test.ts +101 -31
- package/src/__tests__/materials.unit.test.ts +10 -27
- package/src/__tests__/mesh-bin-contract.test.ts +28 -0
- package/src/__tests__/mesh-bin-skin-roundtrip.unit.test.ts +149 -0
- package/src/__tests__/mesh-bin.test.ts +38 -0
- package/src/__tests__/mesh-loader-skin-contract.unit.test.ts +120 -0
- package/src/__tests__/mesh-ssbo-grow.unit.test.ts +3 -3
- package/src/__tests__/mip-gate.unit.test.ts +1 -1
- package/src/__tests__/msaa-sprite-pixel-diff.dawn.test.ts +29 -68
- package/src/__tests__/new-kind-refs-contract.test.ts +132 -0
- package/src/__tests__/node-shims.d.ts +4 -6
- package/src/__tests__/package-promotion.test.ts +88 -0
- package/src/__tests__/package-rename.test.ts +103 -0
- package/src/__tests__/pass-selector.unit.test.ts +2 -2
- package/src/__tests__/pbr-pipeline.unit.test.ts +21 -25
- package/src/__tests__/pipeline-builder-msaa.unit.test.ts +6 -9
- package/src/__tests__/pipeline-cache-keying.unit.test.ts +6 -9
- package/src/__tests__/pipeline-spec.test.ts +16 -177
- package/src/__tests__/pipeline.unit.test.ts +154 -1693
- package/src/__tests__/point-light-shadow.dawn.test.ts +33 -42
- package/src/__tests__/point-light-shadow.unit.test.ts +19 -60
- package/src/__tests__/post-process-error-codes.unit.test.ts +4 -1
- package/src/__tests__/post-process-params-component.unit.test.ts +1 -1
- package/src/__tests__/post-process-params-extract.unit.test.ts +2 -5
- package/src/__tests__/postprocess-camera-consistency.test.ts +4 -7
- package/src/__tests__/profiler-assembly.integration.test.ts +1 -1
- package/src/__tests__/propagate-transforms.dawn.test.ts +12 -11
- package/src/__tests__/record-worldid-isolation.test.ts +7 -29
- package/src/__tests__/recover-error-exhaustive.test-d.ts +1 -1
- package/src/__tests__/render-error-exhaustive.test-d.ts +117 -71
- package/src/__tests__/render-feature-assembly.test-d.ts +20 -9
- package/src/__tests__/render-feature-prepared-graphics-docs.unit.test.ts +8 -6
- package/src/__tests__/render-feature-prepared-graphics.browser.test.ts +65 -559
- package/src/__tests__/render-feature-prepared-graphics.dawn.test.ts +57 -544
- package/src/__tests__/render-feature-prepared-graphics.fixture.ts +104 -0
- package/src/__tests__/render-feature-prepared-graphics.integration.test.ts +40 -248
- package/src/__tests__/render-feature-prepared-graphics.regression.integration.test.ts +83 -340
- package/src/__tests__/render-feature-recover.integration.test.ts +9 -49
- package/src/__tests__/render-feature-runtime-surface.test-d.ts +17 -20
- package/src/__tests__/render-schema-consumer.integration.test.ts +20 -13
- package/src/__tests__/render-schema-owner-boundary.unit.test.ts +2 -6
- package/src/__tests__/render-system-cross-world-overlay-queue.test.ts +5 -5
- package/src/__tests__/render-system-extract-dispatch-ordering.test.ts +16 -31
- package/src/__tests__/render-system-extract.test.ts +36 -51
- package/src/__tests__/render-system-extract.unit.test.ts +360 -0
- package/src/__tests__/render-system-fold-bucket.unit.test.ts +3 -5
- package/src/__tests__/render-system-fold-fallback.unit.test.ts +6 -3
- package/src/__tests__/render-system-fold-material.unit.test.ts +3 -5
- package/src/__tests__/render-system-fold-metrics.unit.test.ts +5 -5
- package/src/__tests__/render-system-fold-modegate.unit.test.ts +6 -6
- package/src/__tests__/render-system-fold.dawn.test.ts +7 -5
- package/src/__tests__/render-system-mega.test.ts +292 -190
- package/src/__tests__/render-system-owner-split-contract.test.ts +10 -32
- package/src/__tests__/render-system-record-multi-material-textureview.test.ts +59 -45
- package/src/__tests__/render-system-record-per-submesh-transparency.test.ts +23 -29
- package/src/__tests__/render-system-record.test.ts +398 -235
- package/src/__tests__/render-system-record.unit.test.ts +25 -26
- package/src/__tests__/render-system-skin-bg.unit.test.ts +8 -12
- package/src/__tests__/renderer-consumer.test-d.ts +16 -3
- package/src/__tests__/renderer-health.unit.test.ts +26 -916
- package/src/__tests__/renderer-lifecycle.integration.test.ts +19 -6
- package/src/__tests__/renderer-recover.unit.test.ts +49 -1069
- package/src/__tests__/renderer-result.test-d.ts +19 -9
- package/src/__tests__/renderer-surface.unit.test.ts +3 -5
- package/src/__tests__/renderer-test-utils.ts +56 -0
- package/src/__tests__/renderer.test-d.ts +61 -0
- package/src/__tests__/resolve-asset-handle-err.test.ts +111 -0
- package/src/__tests__/resolve-asset-handle.unit.test.ts +64 -0
- package/src/__tests__/resolve-depth-only-view.test.ts +1 -1
- package/src/__tests__/resolveName-fallback.test.ts +64 -0
- package/src/__tests__/resolveName-null-package.test.ts +38 -0
- package/src/__tests__/resolveName-unified-entry.test.ts +65 -0
- package/src/__tests__/resolveName.test.ts +64 -0
- package/src/__tests__/rhi-null-command-flow.unit.test.ts +56 -260
- package/src/__tests__/rhi-null-renderer-lifecycle.unit.test.ts +41 -169
- package/src/__tests__/roots-to-scene-asset.test.ts +199 -93
- package/src/__tests__/roundtrip-primitive.test.ts +351 -0
- package/src/__tests__/scene-bare-guid-refs-instantiate.test.ts +123 -0
- package/src/__tests__/scene-equirect-roundtrip.test.ts +103 -16
- package/src/__tests__/scene-instance-authoring.integration.test.ts +8 -0
- package/src/__tests__/scene-instance-bridge.integration.test.ts +1 -1
- package/src/__tests__/scene-instance-component.test.ts +1 -1
- package/src/__tests__/scene-mount-fixed-point.test.ts +257 -0
- package/src/__tests__/scene-mount-roundtrip.test.ts +987 -0
- package/src/__tests__/scene-mount-wrapper-roundtrip.test.ts +202 -0
- package/src/__tests__/scene-sugar-instantiate.test.ts +324 -0
- package/src/__tests__/serialize-mounts-roundtrip.test.ts +533 -0
- package/src/__tests__/serialize-scene-asset.test.ts +219 -22
- package/src/__tests__/shadow-caster-empty-schema.test.ts +3 -3
- package/src/__tests__/shadow-csm-cascade-loadop.test.ts +37 -17
- package/src/__tests__/shadow-csm-component.test.ts +3 -5
- package/src/__tests__/shadow-csm-extract.test.ts +2 -100
- package/src/__tests__/shadow-csm-orthoz.test.ts +2 -16
- package/src/__tests__/shadow-csm-runtime-vary.dawn.test.ts +19 -14
- package/src/__tests__/shadow-csm-tile-consistency.test.ts +32 -26
- package/src/__tests__/shadow-csm-ubo.dawn.test.ts +8 -49
- package/src/__tests__/shadow-csm-ubo.test.ts +3 -25
- package/src/__tests__/shadow-csm-viewport.browser.test.ts +1 -1
- package/src/__tests__/shadow-fields-observable.dawn.test.ts +67 -56
- package/src/__tests__/shadow-m1.dawn.test.ts +8 -9
- package/src/__tests__/shadow-mesh-ssbo-order.test.ts +11 -27
- package/src/__tests__/skin-errors.unit.test.ts +1 -1
- package/src/__tests__/skin-extract-getarrayview-count.unit.test.ts +7 -5
- package/src/__tests__/skylight-lazy-projection.test.ts +36 -15
- package/src/__tests__/sparse-tag-scene-roundtrip.test.ts +5 -5
- package/src/__tests__/sprite-cullmode-flip.dawn.test.ts +47 -64
- package/src/__tests__/sprite-lit-bgl-byte-identical.test.ts +15 -14
- package/src/__tests__/sprite-lit-extract-branch.test.ts +1 -1
- package/src/__tests__/sprite-lit-pipeline-cache-key.test.ts +1 -1
- package/src/__tests__/ssao-bgl.test.ts +16 -9
- package/src/__tests__/ssao-buffers.test.ts +2 -2
- package/src/__tests__/ssao-data.test.ts +2 -2
- package/src/__tests__/ssao-errors.test.ts +1 -1
- package/src/__tests__/ssao-passes.test.ts +68 -392
- package/src/__tests__/ssao-pipelines.test.ts +1 -1
- package/src/__tests__/ssao-uniform-layout.test.ts +8 -6
- package/src/__tests__/stencil-outline-pixel.dawn.test.ts +25 -17
- package/src/__tests__/swap-chain-format.unit.test.ts +5 -7
- package/src/__tests__/systems.unit.test.ts +536 -1326
- package/src/__tests__/template-game-default-api-contract.test.ts +362 -0
- package/src/__tests__/text.unit.test.ts +56 -33
- package/src/__tests__/tilemap-childed-despawn.test.ts +8 -14
- package/src/__tests__/tilemap-chunk-extract.overhang-bounds.test.ts +8 -12
- package/src/__tests__/tilemap-chunk-extract.propagate-order.test.ts +2 -1
- package/src/__tests__/tilemap-chunk-extract.test.ts +13 -17
- package/src/__tests__/tilemap-dirty-rebuild.test.ts +7 -11
- package/src/__tests__/tilemap-material-cache.test.ts +8 -13
- package/src/__tests__/tilemap-multi-atlas.test.ts +12 -32
- package/src/__tests__/tilemap-owner-boundary.unit.test.ts +5 -2
- package/src/__tests__/tilemap-region-pack.test.ts +8 -12
- package/src/__tests__/tilemap-spawn-flip-pivot.test.ts +8 -12
- package/src/__tests__/tilemap-uv-inset.test.ts +11 -14
- package/src/__tests__/tilemap-validate.test.ts +1 -1
- package/src/__tests__/tileset-asset-validate.test.ts +638 -0
- package/src/__tests__/transcode-fallback.unit.test.ts +207 -0
- package/src/__tests__/transform-hierarchy-pixel-diff.dawn.test.ts +36 -28
- package/src/__tests__/transient-fields-collect.test.ts +28 -21
- package/src/__tests__/transient-runtime-behavior.test.ts +227 -0
- package/src/__tests__/transparent-sort-tilemap-sprite-interleave.test.ts +4 -4
- package/src/__tests__/variant-selection.unit.test.ts +1 -1
- package/src/__tests__/video-extract-bindgroup.dawn.test.ts +89 -136
- package/src/__tests__/video-loader-consumption.test.ts +86 -0
- package/src/__tests__/video-loader-smoke.dawn.test.ts +60 -0
- package/src/__tests__/view-ubo-layout.browser.test.ts +0 -22
- package/src/__tests__/world-entity-key.test.ts +1 -1
- package/src/__tests__/world-scene-despawn.test.ts +1 -1
- package/src/__tests__/world-scene-instantiate.test.ts +2 -36
- package/src/__tests__/world-scene-nested.test.ts +1 -1
- package/src/__tests__/world-scene-override.test.ts +1 -1
- package/src/backend-selection.ts +69 -0
- package/src/collect-scene-asset.ts +35 -23
- package/src/components/__tests__/camera.test-d.ts +1 -1
- package/src/components/__tests__/camera.test.ts +1 -1
- package/src/components/__tests__/sprite-animation.test-d.ts +2 -2
- package/src/components/__tests__/tile-layer.test-d.ts +1 -1
- package/src/components/__tests__/tile-layer.unit.test.ts +2 -2
- package/src/createRenderer.ts +24 -36
- package/src/errors/environment.ts +1 -1
- package/src/index.ts +51 -113
- package/src/renderer-host.ts +33 -0
- package/src/scene-instances/__tests__/post-spawn-resolve-joints.unit.test.ts +1 -1
- package/src/scene-instances/index.ts +4 -0
- package/src/scene-utils/mount-override-fold.ts +3 -7
- package/src/systems/__tests__/transparent-sort.bench.ts +3 -3
- package/src/systems/sprite-animation-tick.ts +1 -1
- package/src/systems/transparent-sort.ts +38 -38
- package/src/tilemap-register-validate.ts +4 -4
- package/dist/__tests__/bind-group-cache-binding.test.d.ts +0 -2
- package/dist/__tests__/bind-group-cache-binding.test.d.ts.map +0 -1
- package/dist/__tests__/bind-group-cache-frame.test.d.ts +0 -2
- package/dist/__tests__/bind-group-cache-frame.test.d.ts.map +0 -1
- package/dist/__tests__/dawn/mesh-update.dawn.test.d.ts +0 -2
- package/dist/__tests__/dawn/mesh-update.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/dispatch-fullscreen-pass-composite-swapchain.dawn.test.d.ts +0 -2
- package/dist/__tests__/dispatch-fullscreen-pass-composite-swapchain.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/dispatch-fullscreen-pass-custom-reads.dawn.test.d.ts +0 -2
- package/dist/__tests__/dispatch-fullscreen-pass-custom-reads.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/dispatch-fullscreen-pass-depth-composite.dawn.test.d.ts +0 -2
- package/dist/__tests__/dispatch-fullscreen-pass-depth-composite.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/dispatch-fullscreen-pass-params.unit.test.d.ts +0 -2
- package/dist/__tests__/dispatch-fullscreen-pass-params.unit.test.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-manifest.d.ts +0 -131
- package/dist/__tests__/fog-producer-manifest.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-pixel-probe.d.ts +0 -42
- package/dist/__tests__/fog-producer-pixel-probe.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-pixel.browser.test.d.ts +0 -2
- package/dist/__tests__/fog-producer-pixel.browser.test.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-pixel.dawn.test.d.ts +0 -2
- package/dist/__tests__/fog-producer-pixel.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-real-fixture.d.ts +0 -5
- package/dist/__tests__/fog-producer-real-fixture.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-vfx-effect.d.ts +0 -3
- package/dist/__tests__/fog-producer-vfx-effect.d.ts.map +0 -1
- package/dist/__tests__/fog-scene-asset.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-scene-asset.integration.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-resource-store-cubemap-status.test.d.ts +0 -2
- package/dist/__tests__/gpu-resource-store-cubemap-status.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-resource.test.d.ts +0 -2
- package/dist/__tests__/gpu-resource.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-bgl-slots.browser.test.d.ts +0 -2
- package/dist/__tests__/hdrp-bgl-slots.browser.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-buffers.unit.test.d.ts +0 -2
- package/dist/__tests__/hdrp-buffers.unit.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-execute-filter.unit.test.d.ts +0 -2
- package/dist/__tests__/hdrp-execute-filter.unit.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-gbuffer-attachments.browser.test.d.ts +0 -2
- package/dist/__tests__/hdrp-gbuffer-attachments.browser.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-pipeline-asset-type.test-d.d.ts +0 -2
- package/dist/__tests__/hdrp-pipeline-asset-type.test-d.d.ts.map +0 -1
- package/dist/__tests__/hdrp-ssao-boundary.test.d.ts +0 -2
- package/dist/__tests__/hdrp-ssao-boundary.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-ssao-falsification.test.d.ts +0 -2
- package/dist/__tests__/hdrp-ssao-falsification.test.d.ts.map +0 -1
- package/dist/__tests__/helpers/primitive-world.d.ts +0 -8
- package/dist/__tests__/helpers/primitive-world.d.ts.map +0 -1
- package/dist/__tests__/helpers/render-asset-port.d.ts +0 -15
- package/dist/__tests__/helpers/render-asset-port.d.ts.map +0 -1
- package/dist/__tests__/helpers/scene-asset-port.d.ts +0 -9
- package/dist/__tests__/helpers/scene-asset-port.d.ts.map +0 -1
- package/dist/__tests__/material-derived-coordinates.integration.test.d.ts +0 -2
- package/dist/__tests__/material-derived-coordinates.integration.test.d.ts.map +0 -1
- package/dist/__tests__/pipeline-layout-selection.test.d.ts +0 -2
- package/dist/__tests__/pipeline-layout-selection.test.d.ts.map +0 -1
- package/dist/__tests__/post-process-reads-narrowing.test-d.d.ts +0 -2
- package/dist/__tests__/post-process-reads-narrowing.test-d.d.ts.map +0 -1
- package/dist/__tests__/post-process-register-roundtrip.dawn.test.d.ts +0 -2
- package/dist/__tests__/post-process-register-roundtrip.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-zero-feature.browser.test.d.ts +0 -2
- package/dist/__tests__/render-feature-zero-feature.browser.test.d.ts.map +0 -1
- package/dist/__tests__/render-pipeline-trivial.dawn.test.d.ts +0 -2
- package/dist/__tests__/render-pipeline-trivial.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-csm-caster-membership.test.d.ts +0 -2
- package/dist/__tests__/shadow-csm-caster-membership.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-csm-pssm.test.d.ts +0 -2
- package/dist/__tests__/shadow-csm-pssm.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-csm-temporal.browser.test.d.ts +0 -2
- package/dist/__tests__/shadow-csm-temporal.browser.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-csm-viewport.test.d.ts +0 -2
- package/dist/__tests__/shadow-csm-viewport.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-m2.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-m2.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-m3-calibrate-run.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-m3-calibrate-run.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-m3-calibrate.d.ts +0 -83
- package/dist/__tests__/shadow-m3-calibrate.d.ts.map +0 -1
- package/dist/__tests__/shadow-m3.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-m3.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-probe-control-flow.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-probe-control-flow.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-quality-metrics.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-quality-metrics.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/temporal-off-path.unit.test.d.ts +0 -2
- package/dist/__tests__/temporal-off-path.unit.test.d.ts.map +0 -1
- package/dist/__tests__/video-cache-regression.unit.test.d.ts +0 -2
- package/dist/__tests__/video-cache-regression.unit.test.d.ts.map +0 -1
- package/dist/asset-kind.d.ts +0 -4
- package/dist/asset-kind.d.ts.map +0 -1
- package/dist/errors/sprite-animation.d.ts +0 -3
- package/dist/errors/sprite-animation.d.ts.map +0 -1
- package/dist/scene-asset-port.d.ts +0 -17
- package/dist/scene-asset-port.d.ts.map +0 -1
- package/dist/scene-collect-errors.d.ts +0 -22
- package/dist/scene-collect-errors.d.ts.map +0 -1
- package/dist/shadow-m3-calibrate.d.ts +0 -40
- package/dist/shadow-m3-calibrate.d.ts.map +0 -1
- package/src/__tests__/bind-group-cache-binding.test.ts +0 -2513
- package/src/__tests__/bind-group-cache-frame.test.ts +0 -1511
- package/src/__tests__/dispatch-fullscreen-pass-composite-swapchain.dawn.test.ts +0 -204
- package/src/__tests__/dispatch-fullscreen-pass-custom-reads.dawn.test.ts +0 -297
- package/src/__tests__/dispatch-fullscreen-pass-depth-composite.dawn.test.ts +0 -271
- package/src/__tests__/dispatch-fullscreen-pass-params.unit.test.ts +0 -321
- package/src/__tests__/fog-producer-manifest.ts +0 -162
- package/src/__tests__/fog-producer-pixel-probe.ts +0 -263
- package/src/__tests__/fog-producer-pixel.browser.test.ts +0 -26
- package/src/__tests__/fog-producer-pixel.dawn.test.ts +0 -55
- package/src/__tests__/fog-producer-real-fixture.ts +0 -805
- package/src/__tests__/fog-producer-vfx-effect.ts +0 -272
- package/src/__tests__/fog-scene-asset.integration.test.ts +0 -123
- package/src/__tests__/gpu-resource-store-cubemap-status.test.ts +0 -207
- package/src/__tests__/gpu-resource.test.ts +0 -1206
- package/src/__tests__/hdrp-bgl-slots.browser.test.ts +0 -50
- package/src/__tests__/hdrp-buffers.unit.test.ts +0 -70
- package/src/__tests__/hdrp-execute-filter.unit.test.ts +0 -200
- package/src/__tests__/hdrp-gbuffer-attachments.browser.test.ts +0 -64
- package/src/__tests__/hdrp-pipeline-asset-type.test-d.ts +0 -139
- package/src/__tests__/hdrp-ssao-boundary.test.ts +0 -237
- package/src/__tests__/hdrp-ssao-falsification.test.ts +0 -289
- package/src/__tests__/helpers/primitive-world.ts +0 -91
- package/src/__tests__/helpers/render-asset-port.ts +0 -65
- package/src/__tests__/helpers/scene-asset-port.ts +0 -23
- package/src/__tests__/material-derived-coordinates.integration.test.ts +0 -100
- package/src/__tests__/pipeline-layout-selection.test.ts +0 -298
- package/src/__tests__/post-process-reads-narrowing.test-d.ts +0 -52
- package/src/__tests__/post-process-register-roundtrip.dawn.test.ts +0 -230
- package/src/__tests__/render-feature-zero-feature.browser.test.ts +0 -152
- package/src/__tests__/render-pipeline-trivial.dawn.test.ts +0 -525
- package/src/__tests__/shadow-csm-caster-membership.test.ts +0 -232
- package/src/__tests__/shadow-csm-pssm.test.ts +0 -142
- package/src/__tests__/shadow-csm-temporal.browser.test.ts +0 -145
- package/src/__tests__/shadow-csm-viewport.test.ts +0 -74
- package/src/__tests__/shadow-m2.dawn.test.ts +0 -394
- package/src/__tests__/shadow-m3-calibrate-run.dawn.test.ts +0 -248
- package/src/__tests__/shadow-m3-calibrate.ts +0 -203
- package/src/__tests__/shadow-m3.dawn.test.ts +0 -288
- package/src/__tests__/shadow-probe-control-flow.dawn.test.ts +0 -264
- package/src/__tests__/shadow-quality-metrics.dawn.test.ts +0 -324
- package/src/__tests__/temporal-off-path.unit.test.ts +0 -69
- package/src/__tests__/video-cache-regression.unit.test.ts +0 -186
- package/src/asset-kind.ts +0 -7
- package/src/errors/sprite-animation.ts +0 -5
- package/src/scene-asset-port.ts +0 -32
- package/src/scene-collect-errors.ts +0 -30
- package/src/shadow-m3-calibrate.ts +0 -171
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
// @forgeax/engine-runtime/__tests__/hdrp-ssao-boundary.test.ts -
|
|
2
|
-
// SSAO boundary behavior test (M3 / w14).
|
|
3
|
-
// feat-20260612-hdrp-ssao.
|
|
4
|
-
//
|
|
5
|
-
// requirements AC-07: 4 boundary cases must be tested.
|
|
6
|
-
// plan-strategy D-4: g-buffer missing = graph-level skip; the kernel is
|
|
7
|
-
// uniform-backed so the WebGL2 capability boundary is not a skip.
|
|
8
|
-
// TDD: RED before w15+w16 (addSsaoPasses + boundary guards not yet implemented).
|
|
9
|
-
//
|
|
10
|
-
// Cases:
|
|
11
|
-
// (1) g-buffer missing -> addSsaoPasses silently skips (no pass wiring, no crash)
|
|
12
|
-
// (2) non-HDRP pipeline -> config.ssao is ignored (URP with config.ssao produces no SSAO pass)
|
|
13
|
-
// (3) storageBuffer=false -> SSAO buffers still allocate through UBOs
|
|
14
|
-
// (4) config.ssao.enabled=false -> zero ssao-* passes + zero allocation
|
|
15
|
-
|
|
16
|
-
import type { RenderPipelineContext, RenderSystemRuntime } from '@forgeax/engine-render/internal';
|
|
17
|
-
import { addSsaoPasses, getOrCreateSsaoBuffers } from '@forgeax/engine-render/internal';
|
|
18
|
-
import { RenderGraph } from '@forgeax/engine-render-graph';
|
|
19
|
-
import type { RhiCaps, RhiDevice } from '@forgeax/engine-rhi';
|
|
20
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
21
|
-
|
|
22
|
-
function makeMockRuntime(capsOverride: Partial<RhiCaps> = {}): {
|
|
23
|
-
runtime: RenderSystemRuntime;
|
|
24
|
-
createBuffer: ReturnType<typeof vi.fn>;
|
|
25
|
-
createTexture: ReturnType<typeof vi.fn>;
|
|
26
|
-
} {
|
|
27
|
-
const createBuffer = vi.fn().mockReturnValue({
|
|
28
|
-
ok: true,
|
|
29
|
-
value: { label: 'mock-buffer' },
|
|
30
|
-
});
|
|
31
|
-
const createTexture = vi.fn().mockReturnValue({
|
|
32
|
-
ok: true,
|
|
33
|
-
value: { label: 'mock-tex' },
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const device = {
|
|
37
|
-
caps: {
|
|
38
|
-
backendKind: 'webgpu' as const,
|
|
39
|
-
storageBuffer: true,
|
|
40
|
-
float32Filterable: true,
|
|
41
|
-
maxColorAttachments: 8,
|
|
42
|
-
maxStorageBuffersPerShaderStage: 4,
|
|
43
|
-
...capsOverride,
|
|
44
|
-
},
|
|
45
|
-
createBuffer,
|
|
46
|
-
createTexture,
|
|
47
|
-
createTextureView: vi.fn().mockReturnValue({
|
|
48
|
-
ok: true,
|
|
49
|
-
value: { label: 'mock-tex-view' },
|
|
50
|
-
}),
|
|
51
|
-
createSampler: vi.fn().mockReturnValue({
|
|
52
|
-
ok: true,
|
|
53
|
-
value: { label: 'mock-sampler' },
|
|
54
|
-
}),
|
|
55
|
-
createBindGroupLayout: vi.fn().mockReturnValue({
|
|
56
|
-
ok: true,
|
|
57
|
-
value: { label: 'mock-bgl' },
|
|
58
|
-
}),
|
|
59
|
-
queue: {
|
|
60
|
-
writeBuffer: vi.fn().mockReturnValue({ ok: true, value: undefined }),
|
|
61
|
-
writeTexture: vi.fn().mockReturnValue({ ok: true, value: undefined }),
|
|
62
|
-
},
|
|
63
|
-
} as unknown as RhiDevice;
|
|
64
|
-
|
|
65
|
-
const errorRegistry = {
|
|
66
|
-
fire: vi.fn(),
|
|
67
|
-
listeners: new Set(),
|
|
68
|
-
addEventListener: vi.fn(),
|
|
69
|
-
removeEventListener: vi.fn(),
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const runtime = {
|
|
73
|
-
device,
|
|
74
|
-
errorRegistry,
|
|
75
|
-
shaderCache: { get: vi.fn() },
|
|
76
|
-
} as unknown as RenderSystemRuntime;
|
|
77
|
-
|
|
78
|
-
return { runtime, createBuffer, createTexture };
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function mockCtx(runtime: RenderSystemRuntime): RenderPipelineContext {
|
|
82
|
-
return {
|
|
83
|
-
runtime,
|
|
84
|
-
assets: { get: vi.fn(), register: vi.fn() },
|
|
85
|
-
store: { ensureResident: vi.fn(), getTextureView: vi.fn() },
|
|
86
|
-
pipelineState: {},
|
|
87
|
-
encoder: {},
|
|
88
|
-
view: {},
|
|
89
|
-
clear: [0, 0, 0, 1],
|
|
90
|
-
targetW: 800,
|
|
91
|
-
targetH: 600,
|
|
92
|
-
currentTexture: {},
|
|
93
|
-
camera: {},
|
|
94
|
-
validated: [],
|
|
95
|
-
validatedOrdered: [],
|
|
96
|
-
viewBindGroup: null,
|
|
97
|
-
meshBindGroup: null,
|
|
98
|
-
frameState: { perFrameGraph: null, isHdrpActive: true },
|
|
99
|
-
dispatchCounts: {},
|
|
100
|
-
bindGroupCounts: {},
|
|
101
|
-
skylight: undefined,
|
|
102
|
-
skylightCount: 0,
|
|
103
|
-
skybox: undefined,
|
|
104
|
-
msaaActive: false,
|
|
105
|
-
geometryColorResolveView: null,
|
|
106
|
-
ldrSpriteColorView: null,
|
|
107
|
-
} as unknown as RenderPipelineContext;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
describe('SSAO boundary behavior (M3 / w14)', () => {
|
|
111
|
-
it('(1) g-buffer missing -> addSsaoPasses silently skips (no pass wiring, no crash)', () => {
|
|
112
|
-
const { runtime } = makeMockRuntime();
|
|
113
|
-
const ctx = mockCtx(runtime);
|
|
114
|
-
const graph = new RenderGraph<RenderPipelineContext>();
|
|
115
|
-
|
|
116
|
-
// Declare ssaoRaw/ssaoBlurred (half-swapchain r8unorm) but NOT gbuf0/hdrDepth.
|
|
117
|
-
// This simulates a g-buffer-less pipeline (e.g. URP or forward-only path).
|
|
118
|
-
graph.addColorTarget('ssaoRaw', {
|
|
119
|
-
format: 'r8unorm',
|
|
120
|
-
size: 'half-swapchain',
|
|
121
|
-
sample: 1,
|
|
122
|
-
});
|
|
123
|
-
graph.addColorTarget('ssaoBlurred', {
|
|
124
|
-
format: 'r8unorm',
|
|
125
|
-
size: 'half-swapchain',
|
|
126
|
-
sample: 1,
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
// addSsaoPasses should silently skip when gbuf0/hdrDepth are not declared
|
|
130
|
-
// in the graph. No throw, no error fired.
|
|
131
|
-
addSsaoPasses(graph, {
|
|
132
|
-
gbuf0: 'gbuf0',
|
|
133
|
-
hdrDepth: 'hdrDepth',
|
|
134
|
-
ssaoRaw: 'ssaoRaw',
|
|
135
|
-
ssaoBlurred: 'ssaoBlurred',
|
|
136
|
-
ctx,
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
const passes = graph.listPasses();
|
|
140
|
-
const ssaoPassNames = passes.map((p) => p.name).filter((n) => n.startsWith('ssao-'));
|
|
141
|
-
expect(ssaoPassNames).toHaveLength(0);
|
|
142
|
-
|
|
143
|
-
// Graph should still compile without error (no dangling reads)
|
|
144
|
-
const compileResult = graph.compile({
|
|
145
|
-
backendKind: runtime.device.caps.backendKind,
|
|
146
|
-
caps: runtime.device.caps,
|
|
147
|
-
});
|
|
148
|
-
expect(compileResult.ok).toBe(true);
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
it('(2) non-HDRP pipeline -> config.ssao ignored (URP with config.ssao produces no SSAO pass)', () => {
|
|
152
|
-
const { runtime } = makeMockRuntime();
|
|
153
|
-
const ctx = mockCtx(runtime);
|
|
154
|
-
ctx.frameState.isHdrpActive = false;
|
|
155
|
-
|
|
156
|
-
// Build a URP-style graph (no g-buffer, forward-only). addSsaoPasses should
|
|
157
|
-
// check config.ssao?.enabled and/or isHdrpActive and skip silently.
|
|
158
|
-
const graph = new RenderGraph<RenderPipelineContext>();
|
|
159
|
-
|
|
160
|
-
graph.addColorTarget('ssaoRaw', {
|
|
161
|
-
format: 'r8unorm',
|
|
162
|
-
size: 'half-swapchain',
|
|
163
|
-
sample: 1,
|
|
164
|
-
});
|
|
165
|
-
graph.addColorTarget('ssaoBlurred', {
|
|
166
|
-
format: 'r8unorm',
|
|
167
|
-
size: 'half-swapchain',
|
|
168
|
-
sample: 1,
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
addSsaoPasses(graph, {
|
|
172
|
-
gbuf0: 'gbuf0',
|
|
173
|
-
hdrDepth: 'hdrDepth',
|
|
174
|
-
ssaoRaw: 'ssaoRaw',
|
|
175
|
-
ssaoBlurred: 'ssaoBlurred',
|
|
176
|
-
ctx,
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
const passes = graph.listPasses();
|
|
180
|
-
const ssaoPassNames = passes.map((p) => p.name).filter((n) => n.startsWith('ssao-'));
|
|
181
|
-
expect(ssaoPassNames).toHaveLength(0);
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
it('(3) storageBuffer=false -> allocates SSAO buffers through UBOs', () => {
|
|
185
|
-
const { runtime, createBuffer, createTexture } = makeMockRuntime({
|
|
186
|
-
storageBuffer: false,
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
const result = getOrCreateSsaoBuffers(runtime);
|
|
190
|
-
expect(result).not.toBeNull();
|
|
191
|
-
expect(createBuffer).toHaveBeenCalledTimes(2);
|
|
192
|
-
expect(createTexture).toHaveBeenCalledTimes(1);
|
|
193
|
-
expect(runtime.errorRegistry.fire).not.toHaveBeenCalled();
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
it('(4) config.ssao.enabled=false -> zero ssao-* passes (caller-level skip)', () => {
|
|
197
|
-
const { runtime } = makeMockRuntime();
|
|
198
|
-
const ctx = mockCtx(runtime);
|
|
199
|
-
const graph = new RenderGraph<RenderPipelineContext>();
|
|
200
|
-
|
|
201
|
-
graph.addColorTarget('gbuf0', {
|
|
202
|
-
format: 'rgba16float',
|
|
203
|
-
size: 'swapchain',
|
|
204
|
-
sample: 1,
|
|
205
|
-
});
|
|
206
|
-
graph.addColorTarget('hdrDepth', {
|
|
207
|
-
format: 'depth24plus-stencil8',
|
|
208
|
-
size: 'swapchain',
|
|
209
|
-
sample: 1,
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
// Case 4: the caller (hdrp-pipeline.buildGraph) checks config.ssao?.enabled
|
|
213
|
-
// and skips addSsaoPasses entirely. When not called, zero ssao-* passes exist.
|
|
214
|
-
// This is a caller-level assertion: no addSsaoPasses call = no ssao-* passes.
|
|
215
|
-
|
|
216
|
-
// Build graph WITHOUT calling addSsaoPasses. Wire a valid pass so the
|
|
217
|
-
// graph has something to compile.
|
|
218
|
-
graph.addPass('some-other-pass', {
|
|
219
|
-
reads: [],
|
|
220
|
-
writes: [],
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
const passes = graph.listPasses();
|
|
224
|
-
const ssaoPassNames = passes.map((p) => p.name).filter((n) => n.startsWith('ssao-'));
|
|
225
|
-
expect(ssaoPassNames).toHaveLength(0);
|
|
226
|
-
|
|
227
|
-
// Verify the graph compiles without errors (no SSAO resources needed).
|
|
228
|
-
const compileResult = graph.compile({
|
|
229
|
-
backendKind: runtime.device.caps.backendKind,
|
|
230
|
-
caps: runtime.device.caps,
|
|
231
|
-
});
|
|
232
|
-
expect(compileResult.ok).toBe(true);
|
|
233
|
-
|
|
234
|
-
// Suppress unused ctx warning
|
|
235
|
-
void ctx;
|
|
236
|
-
});
|
|
237
|
-
});
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
// @forgeax/engine-runtime/__tests__/hdrp-ssao-falsification.test.ts
|
|
2
|
-
// SSAO falsification check (M5 / w23).
|
|
3
|
-
// feat-20260612-hdrp-ssao.
|
|
4
|
-
//
|
|
5
|
-
// plan-strategy section 5.4: falsification must FAIL AC-10 visual expectation
|
|
6
|
-
// when ssao-blur reads a wrong input (e.g. hdrColor) instead of ssaoRaw.
|
|
7
|
-
//
|
|
8
|
-
// This test constructs an isolated render graph with addSsaoPasses and asserts
|
|
9
|
-
// the correct reads/writes topology. It then documents two falsification
|
|
10
|
-
// variants that would break the SSAO pipeline:
|
|
11
|
-
//
|
|
12
|
-
// Variant-1 (blur reads hdrColor instead of ssaoRaw):
|
|
13
|
-
// The blur pass would sample the HDR colour output instead of the raw
|
|
14
|
-
// occlusion map. Result: no AO darkening at contact edges -- the blur
|
|
15
|
-
// pass is a no-op that feeds flat HDR colour into the ambient term.
|
|
16
|
-
// This would cause the smoke test (w22) to PASS structurally (passes
|
|
17
|
-
// still present) but AC-10 visual inspection would FAIL (no corner
|
|
18
|
-
// darkening).
|
|
19
|
-
//
|
|
20
|
-
// Variant-2 (calc reads hdrColor instead of gbuf0):
|
|
21
|
-
// SSAO calculation that samples HDR colour instead of world-space
|
|
22
|
-
// normal. The 64-sample hemisphere occlusion test against wrong data
|
|
23
|
-
// produces garbage occlusion values. Result: random noise pattern
|
|
24
|
-
// rather than contact-edge darkening. AC-10 FAIL.
|
|
25
|
-
//
|
|
26
|
-
// Both variants are documented here as the falsification proof; the test
|
|
27
|
-
// itself asserts the correct topology to provide a machine-readable guard.
|
|
28
|
-
//
|
|
29
|
-
// Local-only test (not in CI). The smoke discriminability proof is that
|
|
30
|
-
// w23 FAILS (this test fails) when reads are mutated.
|
|
31
|
-
|
|
32
|
-
import type { RenderPipelineContext, RenderSystemRuntime } from '@forgeax/engine-render/internal';
|
|
33
|
-
import { addSsaoPasses } from '@forgeax/engine-render/internal';
|
|
34
|
-
import { RenderGraph } from '@forgeax/engine-render-graph';
|
|
35
|
-
import type { RhiCaps, RhiDevice } from '@forgeax/engine-rhi';
|
|
36
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
37
|
-
|
|
38
|
-
function mockRuntime(capsOverride: Partial<RhiCaps> = {}): RenderSystemRuntime {
|
|
39
|
-
const errorRegistry = {
|
|
40
|
-
fire: vi.fn(),
|
|
41
|
-
listeners: new Set(),
|
|
42
|
-
addEventListener: vi.fn(),
|
|
43
|
-
removeEventListener: vi.fn(),
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const device = {
|
|
47
|
-
caps: {
|
|
48
|
-
backendKind: 'webgpu' as const,
|
|
49
|
-
storageBuffer: true,
|
|
50
|
-
float32Filterable: true,
|
|
51
|
-
maxColorAttachments: 8,
|
|
52
|
-
maxStorageBuffersPerShaderStage: 4,
|
|
53
|
-
...capsOverride,
|
|
54
|
-
},
|
|
55
|
-
createBuffer: vi.fn().mockReturnValue({
|
|
56
|
-
ok: true,
|
|
57
|
-
value: { label: 'mock-buffer' },
|
|
58
|
-
}),
|
|
59
|
-
createTexture: vi.fn().mockReturnValue({
|
|
60
|
-
ok: true,
|
|
61
|
-
value: { label: 'mock-tex' },
|
|
62
|
-
}),
|
|
63
|
-
createTextureView: vi.fn().mockReturnValue({
|
|
64
|
-
ok: true,
|
|
65
|
-
value: { label: 'mock-tex-view' },
|
|
66
|
-
}),
|
|
67
|
-
createSampler: vi.fn().mockReturnValue({
|
|
68
|
-
ok: true,
|
|
69
|
-
value: { label: 'mock-sampler' },
|
|
70
|
-
}),
|
|
71
|
-
createBindGroupLayout: vi.fn().mockReturnValue({
|
|
72
|
-
ok: true,
|
|
73
|
-
value: { label: 'mock-bgl' },
|
|
74
|
-
}),
|
|
75
|
-
queue: {
|
|
76
|
-
writeBuffer: vi.fn().mockReturnValue({ ok: true, value: undefined }),
|
|
77
|
-
writeTexture: vi.fn().mockReturnValue({ ok: true, value: undefined }),
|
|
78
|
-
},
|
|
79
|
-
} as unknown as RhiDevice;
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
device,
|
|
83
|
-
errorRegistry,
|
|
84
|
-
shaderCache: { get: vi.fn() },
|
|
85
|
-
} as unknown as RenderSystemRuntime;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function mockCtx(runtime: RenderSystemRuntime): RenderPipelineContext {
|
|
89
|
-
return {
|
|
90
|
-
runtime,
|
|
91
|
-
assets: { get: vi.fn(), register: vi.fn() },
|
|
92
|
-
store: { ensureResident: vi.fn(), getTextureView: vi.fn() },
|
|
93
|
-
pipelineState: {},
|
|
94
|
-
encoder: {},
|
|
95
|
-
view: {},
|
|
96
|
-
clear: [0, 0, 0, 1],
|
|
97
|
-
targetW: 800,
|
|
98
|
-
targetH: 600,
|
|
99
|
-
currentTexture: {},
|
|
100
|
-
camera: {},
|
|
101
|
-
validated: [],
|
|
102
|
-
validatedOrdered: [],
|
|
103
|
-
viewBindGroup: null,
|
|
104
|
-
meshBindGroup: null,
|
|
105
|
-
frameState: { perFrameGraph: null, isHdrpActive: true },
|
|
106
|
-
dispatchCounts: {},
|
|
107
|
-
bindGroupCounts: {},
|
|
108
|
-
skylight: undefined,
|
|
109
|
-
skylightCount: 0,
|
|
110
|
-
skybox: undefined,
|
|
111
|
-
msaaActive: false,
|
|
112
|
-
geometryColorResolveView: null,
|
|
113
|
-
ldrSpriteColorView: null,
|
|
114
|
-
} as unknown as RenderPipelineContext;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function setupGraph(graph: RenderGraph<RenderPipelineContext>): void {
|
|
118
|
-
graph.addColorTarget('gbuf0', {
|
|
119
|
-
format: 'rgba16float',
|
|
120
|
-
size: 'swapchain',
|
|
121
|
-
sample: 1,
|
|
122
|
-
});
|
|
123
|
-
graph.addColorTarget('hdrDepth', {
|
|
124
|
-
format: 'depth24plus-stencil8',
|
|
125
|
-
size: 'swapchain',
|
|
126
|
-
sample: 1,
|
|
127
|
-
});
|
|
128
|
-
graph.addColorTarget('hdrColor', {
|
|
129
|
-
format: 'rgba16float',
|
|
130
|
-
size: 'swapchain',
|
|
131
|
-
sample: 1,
|
|
132
|
-
});
|
|
133
|
-
graph.addColorTarget('ssaoRaw', {
|
|
134
|
-
format: 'r8unorm',
|
|
135
|
-
size: 'half-swapchain',
|
|
136
|
-
sample: 1,
|
|
137
|
-
});
|
|
138
|
-
graph.addColorTarget('ssaoBlurred', {
|
|
139
|
-
format: 'r8unorm',
|
|
140
|
-
size: 'half-swapchain',
|
|
141
|
-
sample: 1,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
describe('hdrp-ssao-falsification (M5 / w23)', () => {
|
|
146
|
-
it('ssao-calc reads gbuf0 (world-space normal) + hdrDepth — NOT hdrColor', () => {
|
|
147
|
-
const runtime = mockRuntime();
|
|
148
|
-
const ctx = mockCtx(runtime);
|
|
149
|
-
const graph = new RenderGraph<RenderPipelineContext>();
|
|
150
|
-
setupGraph(graph);
|
|
151
|
-
|
|
152
|
-
addSsaoPasses(graph, {
|
|
153
|
-
gbuf0: 'gbuf0',
|
|
154
|
-
hdrDepth: 'hdrDepth',
|
|
155
|
-
ssaoRaw: 'ssaoRaw',
|
|
156
|
-
ssaoBlurred: 'ssaoBlurred',
|
|
157
|
-
ctx,
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
const passes = graph.listPasses();
|
|
161
|
-
const calcPass = passes.find((p) => p.name === 'ssao-calc');
|
|
162
|
-
expect(calcPass).toBeDefined();
|
|
163
|
-
if (!calcPass) return;
|
|
164
|
-
|
|
165
|
-
// Calc MUST read gbuf0 (world-space normal for view-space transform).
|
|
166
|
-
expect(calcPass.reads).toContain('gbuf0');
|
|
167
|
-
// Calc MUST NOT read hdrColor (lighting output -- Variant-2 falsification).
|
|
168
|
-
expect(calcPass.reads).not.toContain('hdrColor');
|
|
169
|
-
// Calc MUST read hdrDepth (depth for view-space position reconstruction).
|
|
170
|
-
expect(calcPass.reads).toContain('hdrDepth');
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
it('ssao-blur reads ssaoRaw — NOT hdrColor (Variant-1 falsification guard)', () => {
|
|
174
|
-
const runtime = mockRuntime();
|
|
175
|
-
const ctx = mockCtx(runtime);
|
|
176
|
-
const graph = new RenderGraph<RenderPipelineContext>();
|
|
177
|
-
setupGraph(graph);
|
|
178
|
-
|
|
179
|
-
addSsaoPasses(graph, {
|
|
180
|
-
gbuf0: 'gbuf0',
|
|
181
|
-
hdrDepth: 'hdrDepth',
|
|
182
|
-
ssaoRaw: 'ssaoRaw',
|
|
183
|
-
ssaoBlurred: 'ssaoBlurred',
|
|
184
|
-
ctx,
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
const passes = graph.listPasses();
|
|
188
|
-
const blurPass = passes.find((p) => p.name === 'ssao-blur');
|
|
189
|
-
expect(blurPass).toBeDefined();
|
|
190
|
-
if (!blurPass) return;
|
|
191
|
-
|
|
192
|
-
// Blur MUST read ssaoRaw (the raw occlusion R8 map from calc pass).
|
|
193
|
-
expect(blurPass.reads).toContain('ssaoRaw');
|
|
194
|
-
// Blur MUST NOT read hdrColor (Variant-1 falsification:
|
|
195
|
-
// reading HDR colour would produce no AO darkening — AC-10 FAIL).
|
|
196
|
-
expect(blurPass.reads).not.toContain('hdrColor');
|
|
197
|
-
// M8 / w38: blur reads also include gbuf0 + hdrDepth as graph deps so
|
|
198
|
-
// the shared 9-entry SSAO BGL has valid resources at every slot. The
|
|
199
|
-
// shader does not statically reference them, but the BindGroup must
|
|
200
|
-
// bind them or WebGPU rejects the draw — Variant-1's "no AO darkening"
|
|
201
|
-
// failure mode is still preserved: if the blur sampled hdrColor instead
|
|
202
|
-
// of ssaoRaw, AO would still wash out, and the read declaration above
|
|
203
|
-
// continues to enforce the correct input.
|
|
204
|
-
expect(blurPass.reads).toHaveLength(3);
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
it('Variant-1 proof: if blur read hdrColor, AO would not darken contact edges', () => {
|
|
208
|
-
// This structural test documents the falsification contract.
|
|
209
|
-
// When ssao-blur reads are changed from ['ssaoRaw'] to ['hdrColor']:
|
|
210
|
-
//
|
|
211
|
-
// graph.addPass('ssao-blur', {
|
|
212
|
-
// reads: ['hdrColor'], // <-- falsified: wrong input
|
|
213
|
-
// writes: ['ssaoBlurred'],
|
|
214
|
-
// ...
|
|
215
|
-
// });
|
|
216
|
-
//
|
|
217
|
-
// The blur pass would sample HDR lighting output instead of the raw
|
|
218
|
-
// occlusion map. The fs_ssao_blur shader applies a 4x4 box blur which
|
|
219
|
-
// averages HDR colour values to produce a uniform per-pixel value.
|
|
220
|
-
// When fed into the deferred lighting ambient term:
|
|
221
|
-
//
|
|
222
|
-
// ambient *= mix(1.0, ssaoFactor * bakedAO, intensity)
|
|
223
|
-
//
|
|
224
|
-
// ... ssaoFactor comes from the blurred-HDR-colour texture, not the
|
|
225
|
-
// occlusion texture. Result: uniform ambient modulation (all pixels
|
|
226
|
-
// get similar ssaoFactor), no AO darkening at contact edges.
|
|
227
|
-
//
|
|
228
|
-
// The w22 smoke test would PASS (perFramePassNames still includes
|
|
229
|
-
// ssao-calc + ssao-blur), but AC-10 visual inspection would FAIL --
|
|
230
|
-
// the demo image would show no corner/contact darkening.
|
|
231
|
-
//
|
|
232
|
-
// This is the discriminability contract: the smoke is structural,
|
|
233
|
-
// the visual gate is the falsification check.
|
|
234
|
-
expect(true).toBe(true);
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
it('Variant-2 proof: if calc read hdrColor instead of gbuf0, occlusion is garbage', () => {
|
|
238
|
-
// When ssao-calc reads are changed from ['gbuf0', 'hdrDepth'] to
|
|
239
|
-
// ['hdrColor', 'hdrDepth']:
|
|
240
|
-
//
|
|
241
|
-
// graph.addPass('ssao-calc', {
|
|
242
|
-
// reads: ['hdrColor', 'hdrDepth'], // <-- falsified
|
|
243
|
-
// writes: ['ssaoRaw'],
|
|
244
|
-
// ...
|
|
245
|
-
// });
|
|
246
|
-
//
|
|
247
|
-
// The fs_ssao_calc shader unpacks the gbuf0 read as world-space
|
|
248
|
-
// normal (*2-1), transforms to view-space, and builds a TBN matrix
|
|
249
|
-
// for hemisphere sampling. If gbuf0 carries HDR colour values [0..1]
|
|
250
|
-
// instead of packed normal components:
|
|
251
|
-
//
|
|
252
|
-
// - viewNormal = (hdrColor * 2.0 - 1.0) is incorrect
|
|
253
|
-
// - TBN Gram-Schmidt produces a nonsensical tangent frame
|
|
254
|
-
// - 64-sample hemisphere occlusion against wrong normal direction
|
|
255
|
-
// produces random per-pixel occlusion values
|
|
256
|
-
//
|
|
257
|
-
// Result: random noise pattern in the AO buffer, not contact-edge
|
|
258
|
-
// darkening. AC-10 visual inspection would FAIL (noise instead of
|
|
259
|
-
// expected corner shadows).
|
|
260
|
-
expect(true).toBe(true);
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
it('compile succeeds with correct reads topology', () => {
|
|
264
|
-
const runtime = mockRuntime();
|
|
265
|
-
const ctx = mockCtx(runtime);
|
|
266
|
-
const graph = new RenderGraph<RenderPipelineContext>();
|
|
267
|
-
setupGraph(graph);
|
|
268
|
-
|
|
269
|
-
graph.addPass('g-buffer', {
|
|
270
|
-
reads: [],
|
|
271
|
-
writes: ['gbuf0', 'hdrDepth'],
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
addSsaoPasses(graph, {
|
|
275
|
-
gbuf0: 'gbuf0',
|
|
276
|
-
hdrDepth: 'hdrDepth',
|
|
277
|
-
ssaoRaw: 'ssaoRaw',
|
|
278
|
-
ssaoBlurred: 'ssaoBlurred',
|
|
279
|
-
ctx,
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
const compileResult = graph.compile({
|
|
283
|
-
backendKind: runtime.device.caps.backendKind,
|
|
284
|
-
caps: runtime.device.caps,
|
|
285
|
-
device: runtime.device,
|
|
286
|
-
});
|
|
287
|
-
expect(compileResult.ok).toBe(true);
|
|
288
|
-
});
|
|
289
|
-
});
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Component,
|
|
3
|
-
ComponentData,
|
|
4
|
-
ComponentSchema,
|
|
5
|
-
EcsError,
|
|
6
|
-
EntityHandle,
|
|
7
|
-
InputShapeOf,
|
|
8
|
-
World,
|
|
9
|
-
} from '@forgeax/engine-ecs';
|
|
10
|
-
import { createPrimitiveMesh, type PrimitiveMeshKind } from '@forgeax/engine-geometry';
|
|
11
|
-
import { type Handle, type Result, toShared } from '@forgeax/engine-types';
|
|
12
|
-
|
|
13
|
-
export const TEST_CUBE_HANDLE: Handle<'MeshAsset', 'shared'> = toShared(1);
|
|
14
|
-
export const TEST_TRIANGLE_HANDLE: Handle<'MeshAsset', 'shared'> = toShared(2);
|
|
15
|
-
|
|
16
|
-
const primitiveHandles = new WeakMap<
|
|
17
|
-
object,
|
|
18
|
-
Map<PrimitiveMeshKind, Handle<'MeshAsset', 'shared'>>
|
|
19
|
-
>();
|
|
20
|
-
const legacyPrimitiveHandles = new WeakMap<
|
|
21
|
-
object,
|
|
22
|
-
ReadonlyMap<number, Handle<'MeshAsset', 'shared'>>
|
|
23
|
-
>();
|
|
24
|
-
|
|
25
|
-
export function internPrimitiveMesh(
|
|
26
|
-
world: World,
|
|
27
|
-
kind: PrimitiveMeshKind,
|
|
28
|
-
): Handle<'MeshAsset', 'shared'> {
|
|
29
|
-
let handles = primitiveHandles.get(world);
|
|
30
|
-
if (handles === undefined) {
|
|
31
|
-
handles = new Map();
|
|
32
|
-
primitiveHandles.set(world, handles);
|
|
33
|
-
}
|
|
34
|
-
const existing = handles.get(kind);
|
|
35
|
-
if (existing !== undefined) return existing;
|
|
36
|
-
const handle = world.internSharedRef('MeshAsset', createPrimitiveMesh(kind).unwrap());
|
|
37
|
-
handles.set(kind, handle);
|
|
38
|
-
return handle;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// biome-ignore lint/suspicious/noExplicitAny: TypeScript mixin constructors require any[] rest parameters.
|
|
42
|
-
export function withPrimitiveMeshes<T extends new (...args: any[]) => World>(BaseWorld: T): T {
|
|
43
|
-
return class PrimitiveWorld extends BaseWorld {
|
|
44
|
-
// biome-ignore lint/suspicious/noExplicitAny: TypeScript mixin constructors require any[] rest parameters.
|
|
45
|
-
constructor(...args: any[]) {
|
|
46
|
-
super(...args);
|
|
47
|
-
const cube = this.internSharedRef('MeshAsset', createPrimitiveMesh('cube').unwrap());
|
|
48
|
-
const triangle = this.internSharedRef('MeshAsset', createPrimitiveMesh('triangle').unwrap());
|
|
49
|
-
legacyPrimitiveHandles.set(
|
|
50
|
-
this,
|
|
51
|
-
new Map([
|
|
52
|
-
[Number(TEST_CUBE_HANDLE), cube],
|
|
53
|
-
[Number(TEST_TRIANGLE_HANDLE), triangle],
|
|
54
|
-
]),
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
override spawn<const SArr extends readonly ComponentSchema[]>(
|
|
59
|
-
...componentDatas: {
|
|
60
|
-
[K in keyof SArr]: {
|
|
61
|
-
component: Component<string, SArr[K]>;
|
|
62
|
-
data: Partial<InputShapeOf<SArr[K]>>;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
): Result<EntityHandle, EcsError>;
|
|
66
|
-
override spawn(...componentDatas: ComponentData[]): Result<EntityHandle, EcsError> {
|
|
67
|
-
const handles = legacyPrimitiveHandles.get(this);
|
|
68
|
-
if (handles === undefined) return super.spawn(...componentDatas);
|
|
69
|
-
|
|
70
|
-
const rewritten = componentDatas.map((entry) => {
|
|
71
|
-
const data = entry.data as Record<string, unknown>;
|
|
72
|
-
const direction =
|
|
73
|
-
entry.component.name === 'DirectionalLight' && data.direction === undefined
|
|
74
|
-
? [0, -1, 0]
|
|
75
|
-
: undefined;
|
|
76
|
-
const rawHandle = data.assetHandle;
|
|
77
|
-
const replacement = typeof rawHandle === 'number' ? handles.get(rawHandle) : undefined;
|
|
78
|
-
if (direction === undefined && replacement === undefined) return entry;
|
|
79
|
-
return {
|
|
80
|
-
...entry,
|
|
81
|
-
data: {
|
|
82
|
-
...data,
|
|
83
|
-
...(direction === undefined ? {} : { direction }),
|
|
84
|
-
...(replacement === undefined ? {} : { assetHandle: replacement }),
|
|
85
|
-
},
|
|
86
|
-
} as ComponentData;
|
|
87
|
-
});
|
|
88
|
-
return super.spawn(...rewritten);
|
|
89
|
-
}
|
|
90
|
-
} as T;
|
|
91
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { RenderAssetPort } from '@forgeax/engine-render/internal';
|
|
2
|
-
import type { Asset } from '@forgeax/engine-types';
|
|
3
|
-
import { makeMockShaderRegistry } from './mock-shader-registry';
|
|
4
|
-
|
|
5
|
-
export interface TestRenderAssetResolver {
|
|
6
|
-
readonly epoch: number;
|
|
7
|
-
lookup<T extends Asset>(guid: string): T | undefined;
|
|
8
|
-
guidOf(asset: Asset): string | undefined;
|
|
9
|
-
publish(guid: string, asset: Asset): void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface TestRenderAssetStore {
|
|
13
|
-
readonly port: RenderAssetPort;
|
|
14
|
-
readonly resolver: TestRenderAssetResolver;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function createTestRenderAssetOwner(
|
|
18
|
-
shaderRegistry = makeMockShaderRegistry(),
|
|
19
|
-
): RenderAssetPort {
|
|
20
|
-
return createTestRenderAssetStore(shaderRegistry).port;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function createTestRenderAssetStore(
|
|
24
|
-
shaderRegistry = makeMockShaderRegistry(),
|
|
25
|
-
): TestRenderAssetStore {
|
|
26
|
-
const payloads = new Map<string, Asset>();
|
|
27
|
-
let epoch = 0;
|
|
28
|
-
const normalizeGuid = (guid: string): string => guid.toLowerCase().replaceAll('-', '');
|
|
29
|
-
const resolver: TestRenderAssetResolver = {
|
|
30
|
-
get epoch() {
|
|
31
|
-
return epoch;
|
|
32
|
-
},
|
|
33
|
-
lookup<T extends Asset>(guid: string): T | undefined {
|
|
34
|
-
return payloads.get(normalizeGuid(guid)) as T | undefined;
|
|
35
|
-
},
|
|
36
|
-
guidOf(asset: Asset): string | undefined {
|
|
37
|
-
for (const [guid, payload] of payloads) {
|
|
38
|
-
if (payload === asset) return guid;
|
|
39
|
-
}
|
|
40
|
-
return undefined;
|
|
41
|
-
},
|
|
42
|
-
publish(guid: string, asset: Asset): void {
|
|
43
|
-
const key = normalizeGuid(guid);
|
|
44
|
-
if (payloads.get(key) === asset) return;
|
|
45
|
-
payloads.set(key, asset);
|
|
46
|
-
epoch += 1;
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
const port: RenderAssetPort = {
|
|
50
|
-
get epoch() {
|
|
51
|
-
return resolver.epoch;
|
|
52
|
-
},
|
|
53
|
-
shaderRegistry,
|
|
54
|
-
lookup: resolver.lookup,
|
|
55
|
-
guidOf: resolver.guidOf,
|
|
56
|
-
materialShaderTextureFieldNames(shaderId: string): readonly string[] {
|
|
57
|
-
const artifact = shaderRegistry.findMaterialArtifact(shaderId);
|
|
58
|
-
if (!artifact.ok) return [];
|
|
59
|
-
return artifact.value.paramSchema
|
|
60
|
-
.filter((parameter) => parameter.type === 'texture2d')
|
|
61
|
-
.map((parameter) => parameter.name);
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
return { port, resolver };
|
|
65
|
-
}
|