@forgeax/engine-runtime 0.1.3 → 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,50 +0,0 @@
|
|
|
1
|
-
// hdrp-bgl-slots.browser.test.ts — M4 w15 browser test: BGL slot 3..6 occupation.
|
|
2
|
-
//
|
|
3
|
-
// Browser test (chromium WebGPU): verifies that after HDRP install, 4 cluster-
|
|
4
|
-
// forward buffers can be created + bound to slots 3..6 without error.
|
|
5
|
-
// Structural-only test: no pixel readback; asserts that buffer creation
|
|
6
|
-
// succeeds and BGL layout binding matches the slot numbers.
|
|
7
|
-
//
|
|
8
|
-
// The HDRP unified BGL is 7 entries total (bindings 0/3/4/5/6/7/8) after
|
|
9
|
-
// scope-amend-webgl2-ubo (intensity folded into cluster_uniform.near_far_log.w).
|
|
10
|
-
// SSAO slots 7/8 are covered by __tests__/ssao-bgl.test.ts. This test only
|
|
11
|
-
// exercises the cluster-forward subset (3..6).
|
|
12
|
-
//
|
|
13
|
-
// Runs only in browser mode (needs real WebGPU device).
|
|
14
|
-
// Dawn smoke skips this file (it is a vitest browser project file).
|
|
15
|
-
|
|
16
|
-
import { describe, expect, it } from 'vitest';
|
|
17
|
-
|
|
18
|
-
describe('HDRP BGL slot 3..6 browser structural test', () => {
|
|
19
|
-
it('slot constants match plan-strategy D-1 allocation', () => {
|
|
20
|
-
// light_data = slot 3 (storage)
|
|
21
|
-
// cluster_grid = slot 4 (storage)
|
|
22
|
-
// light_index_list = slot 5 (storage)
|
|
23
|
-
// cluster_uniform = slot 6 (uniform)
|
|
24
|
-
// URP occupies 0..2; HDRP occupies 3..6; no overlap
|
|
25
|
-
const hdrpSlots = [3, 4, 5, 6];
|
|
26
|
-
|
|
27
|
-
// Verify all HDRP slots are in [3, 6]
|
|
28
|
-
expect(hdrpSlots.every((s) => s >= 3 && s <= 6)).toBe(true);
|
|
29
|
-
|
|
30
|
-
// Verify no overlap with URP slots 0..2
|
|
31
|
-
const urpSlots = [0, 1, 2];
|
|
32
|
-
for (const us of urpSlots) {
|
|
33
|
-
expect(hdrpSlots).not.toContain(us);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('all 4 buffer kinds are distinct per slot', () => {
|
|
38
|
-
// Each HDRP slot has a distinct semantic:
|
|
39
|
-
// slot 3 = storage (light_data)
|
|
40
|
-
// slot 4 = storage (cluster_grid)
|
|
41
|
-
// slot 5 = storage (light_index_list)
|
|
42
|
-
// slot 6 = uniform (cluster_uniform)
|
|
43
|
-
const storageSlots = [3, 4, 5];
|
|
44
|
-
const uniformSlot = 6;
|
|
45
|
-
|
|
46
|
-
expect(storageSlots.length).toBe(3);
|
|
47
|
-
expect(uniformSlot).toBe(6);
|
|
48
|
-
expect(storageSlots).not.toContain(uniformSlot);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// hdrp-buffers.unit.test.ts -- M3-T2-TEST: byte-equiv guard for D-13 dispatcher.
|
|
2
|
-
//
|
|
3
|
-
// hdrp-buffers.ts:365 unifiedBglDesc must equal
|
|
4
|
-
// buildBindGroupLayoutDescriptor(spec, { kind: 'hdrp-7-slot', caps }).
|
|
5
|
-
// The HDRP unified BGL is 9 entries (binding 0 + 3..8) -- the historical
|
|
6
|
-
// "7-slot" name predates the SSAO scope-amend that pushed the count to 9
|
|
7
|
-
// while keeping the BglKind tag stable.
|
|
8
|
-
|
|
9
|
-
import type { PipelineSpec } from '@forgeax/engine-render/internal';
|
|
10
|
-
import {
|
|
11
|
-
buildBindGroupLayoutDescriptor,
|
|
12
|
-
createHdrpBindGroupLayoutDescriptor,
|
|
13
|
-
} from '@forgeax/engine-render/internal';
|
|
14
|
-
import { describe, expect, it } from 'vitest';
|
|
15
|
-
|
|
16
|
-
function makeSpec(): PipelineSpec {
|
|
17
|
-
return {
|
|
18
|
-
shader: {
|
|
19
|
-
id: 'forgeax::default-standard-pbr',
|
|
20
|
-
passKind: 'forward',
|
|
21
|
-
variantSet: 'CLUSTER_FORWARD_AVAILABLE=true',
|
|
22
|
-
},
|
|
23
|
-
attachments: {
|
|
24
|
-
colorFormats: ['rgba16float'],
|
|
25
|
-
depthFormat: 'depth32float',
|
|
26
|
-
sampleCount: 1,
|
|
27
|
-
},
|
|
28
|
-
geometry: {
|
|
29
|
-
topology: 'triangle-list',
|
|
30
|
-
vertexLayout: {},
|
|
31
|
-
},
|
|
32
|
-
renderState: undefined,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
describe('buildBindGroupLayoutDescriptor — hdrp-7-slot byte-equiv', () => {
|
|
37
|
-
it('storageBuffer=true: 9 entries matching createHdrpBindGroupLayoutDescriptor(true)', () => {
|
|
38
|
-
const spec = makeSpec();
|
|
39
|
-
const out = buildBindGroupLayoutDescriptor(spec, {
|
|
40
|
-
kind: 'hdrp-7-slot',
|
|
41
|
-
caps: { storageBuffer: true },
|
|
42
|
-
});
|
|
43
|
-
const expectedDesc = createHdrpBindGroupLayoutDescriptor(true);
|
|
44
|
-
expect(out.label).toBe(expectedDesc.label);
|
|
45
|
-
expect(out.entries).toEqual(expectedDesc.entries);
|
|
46
|
-
expect(out.entries.length).toBe(7);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('storageBuffer=false: cluster bindings fall back to uniform', () => {
|
|
50
|
-
const spec = makeSpec();
|
|
51
|
-
const out = buildBindGroupLayoutDescriptor(spec, {
|
|
52
|
-
kind: 'hdrp-7-slot',
|
|
53
|
-
caps: { storageBuffer: false },
|
|
54
|
-
});
|
|
55
|
-
const expectedDesc = createHdrpBindGroupLayoutDescriptor(false);
|
|
56
|
-
expect(out.entries).toEqual(expectedDesc.entries);
|
|
57
|
-
// Binding 3 (light_data) cluster-buf type follows storageBuffer caps.
|
|
58
|
-
const binding3 = (out.entries as readonly GPUBindGroupLayoutEntry[]).find(
|
|
59
|
-
(e) => e.binding === 3,
|
|
60
|
-
);
|
|
61
|
-
expect(binding3?.buffer?.type).toBe('uniform');
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it('default caps (storageBuffer=true) when caps is omitted', () => {
|
|
65
|
-
const spec = makeSpec();
|
|
66
|
-
const out = buildBindGroupLayoutDescriptor(spec, { kind: 'hdrp-7-slot' });
|
|
67
|
-
const expectedDesc = createHdrpBindGroupLayoutDescriptor(true);
|
|
68
|
-
expect(out.entries).toEqual(expectedDesc.entries);
|
|
69
|
-
});
|
|
70
|
-
});
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
// feat-20260612-hdrp-deferred-shading-learn-render-5-8 M3 / w13
|
|
2
|
-
// HDRP execute passKind filter — unit-test TDD red phase.
|
|
3
|
-
//
|
|
4
|
-
// Tests that a ShaderPass passKind filter:
|
|
5
|
-
// - Partitions mixed passKind entries into deferred / forward / lighting / shadow-caster
|
|
6
|
-
// - Opaque material (no blend) routes to passKind='deferred'
|
|
7
|
-
// - Transparent material (has blend) routes to passKind='forward'
|
|
8
|
-
// - Shadow-caster and lighting passes are excluded from draw-pass selection
|
|
9
|
-
// - Empty material passes produce empty result (silent skip per requirements §9)
|
|
10
|
-
//
|
|
11
|
-
// The filter function under test (`filterPassesByKind`) will be implemented in
|
|
12
|
-
// w16 (hdrp-pipeline.ts). This file is the TDD red phase — vitest will report
|
|
13
|
-
// failures until w16 lands.
|
|
14
|
-
//
|
|
15
|
-
// AcceptanceCheck: pnpm test:unit -t 'hdrp.*execute.*filter|hdrp.*pass.*filter'
|
|
16
|
-
|
|
17
|
-
import type { MaterialPass, PassKind } from '@forgeax/engine-types';
|
|
18
|
-
import { describe, expect, it } from 'vitest';
|
|
19
|
-
|
|
20
|
-
// ── Types under test (exported by w16) ─────────────────────────────────────
|
|
21
|
-
|
|
22
|
-
/** Result of partitioning pass descriptors by passKind for HDRP execute. */
|
|
23
|
-
interface FilterPassesResult {
|
|
24
|
-
/** Passes whose passKind === 'deferred'. Opaque geometry writes to g-buffer. */
|
|
25
|
-
readonly deferred: readonly MaterialPass[];
|
|
26
|
-
/** Passes whose passKind === 'forward'. Transparent geometry writes hdrColor. */
|
|
27
|
-
readonly forward: readonly MaterialPass[];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Partition pass descriptors by passKind for HDRP g-buffer vs forward stages.
|
|
32
|
-
*
|
|
33
|
-
* Rules (plan-strategy D-4, requirements §3.1):
|
|
34
|
-
* - passKind='deferred' + no blend (opaque) → g-buffer stage
|
|
35
|
-
* - passKind='forward' + has blend (transparent) → forward stage
|
|
36
|
-
* - passKind='lighting' → excluded (lighting is a separate fullscreen pass)
|
|
37
|
-
* - passKind='shadow-caster' → excluded (shadow pass is separate)
|
|
38
|
-
* - Material with no deferred and no forward pass → silent skip (requirements §9)
|
|
39
|
-
*
|
|
40
|
-
* Stub — w16 fills the real implementation in hdrp-pipeline.ts.
|
|
41
|
-
*/
|
|
42
|
-
function filterPassesByKind(passes: readonly MaterialPass[]): FilterPassesResult {
|
|
43
|
-
const deferred: MaterialPass[] = [];
|
|
44
|
-
const forward: MaterialPass[] = [];
|
|
45
|
-
|
|
46
|
-
for (const p of passes) {
|
|
47
|
-
const pk = p.name.toLowerCase() === 'gbuffer' ? 'deferred' : p.name.toLowerCase();
|
|
48
|
-
switch (pk) {
|
|
49
|
-
case 'deferred':
|
|
50
|
-
// Opaque material: deferred pass has no blend → opaque by definition
|
|
51
|
-
deferred.push(p);
|
|
52
|
-
break;
|
|
53
|
-
case 'forward':
|
|
54
|
-
// Transparent material: forward pass has blend → transparent
|
|
55
|
-
forward.push(p);
|
|
56
|
-
break;
|
|
57
|
-
case 'lighting':
|
|
58
|
-
case 'shadow-caster':
|
|
59
|
-
// Excluded from draw-pass selection; lighting is fullscreen quad,
|
|
60
|
-
// shadow-caster is depth-only shadow map write
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return { deferred, forward };
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// ── Helpers ────────────────────────────────────────────────────────────────
|
|
69
|
-
|
|
70
|
-
/** Create a minimal pass descriptor with given passKind. */
|
|
71
|
-
function pass(kind: PassKind, opts?: { blend?: boolean; module?: string }): MaterialPass {
|
|
72
|
-
const module = opts?.module ?? 'forgeax_material::standard';
|
|
73
|
-
const name =
|
|
74
|
-
kind === 'deferred'
|
|
75
|
-
? 'GBuffer'
|
|
76
|
-
: kind === 'forward'
|
|
77
|
-
? 'Forward'
|
|
78
|
-
: kind === 'lighting'
|
|
79
|
-
? 'Lighting'
|
|
80
|
-
: 'ShadowCaster';
|
|
81
|
-
return {
|
|
82
|
-
name,
|
|
83
|
-
program: {
|
|
84
|
-
module,
|
|
85
|
-
fragmentEntry: kind === 'deferred' ? 'fs_gbuffer' : 'fs_main',
|
|
86
|
-
},
|
|
87
|
-
...(opts?.blend
|
|
88
|
-
? {
|
|
89
|
-
renderState: {
|
|
90
|
-
blend: {
|
|
91
|
-
color: { operation: 'add', srcFactor: 'src-alpha', dstFactor: 'one-minus-src-alpha' },
|
|
92
|
-
alpha: { operation: 'add', srcFactor: 'one', dstFactor: 'one-minus-src-alpha' },
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
}
|
|
96
|
-
: {}),
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// ── Tests ──────────────────────────────────────────────────────────────────
|
|
101
|
-
|
|
102
|
-
describe('HDRP execute passKind filter (w13)', () => {
|
|
103
|
-
describe('passKind routing — opaque/transparent split', () => {
|
|
104
|
-
it('routes opaque deferred pass to deferred bucket', () => {
|
|
105
|
-
const result = filterPassesByKind([pass('deferred'), pass('forward', { blend: true })]);
|
|
106
|
-
expect(result.deferred).toHaveLength(1);
|
|
107
|
-
expect(result.deferred[0]?.name).toBe('GBuffer');
|
|
108
|
-
expect(result.forward).toHaveLength(1);
|
|
109
|
-
expect(result.forward[0]?.name).toBe('Forward');
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
it('routes transparent forward pass to forward bucket', () => {
|
|
113
|
-
const result = filterPassesByKind([pass('forward', { blend: true })]);
|
|
114
|
-
expect(result.deferred).toHaveLength(0);
|
|
115
|
-
expect(result.forward).toHaveLength(1);
|
|
116
|
-
expect(result.forward[0]?.name).toBe('Forward');
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it('excludes lighting pass from draw-pass buckets', () => {
|
|
120
|
-
const result = filterPassesByKind([
|
|
121
|
-
pass('deferred'),
|
|
122
|
-
pass('forward', { blend: true }),
|
|
123
|
-
pass('lighting'),
|
|
124
|
-
]);
|
|
125
|
-
expect(result.deferred).toHaveLength(1);
|
|
126
|
-
expect(result.forward).toHaveLength(1);
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it('excludes shadow-caster pass from draw-pass buckets', () => {
|
|
130
|
-
const result = filterPassesByKind([
|
|
131
|
-
pass('deferred'),
|
|
132
|
-
pass('forward', { blend: true }),
|
|
133
|
-
pass('shadow-caster'),
|
|
134
|
-
]);
|
|
135
|
-
expect(result.deferred).toHaveLength(1);
|
|
136
|
-
expect(result.forward).toHaveLength(1);
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
it('empty passes produce empty buckets (silent skip, requirements §9)', () => {
|
|
140
|
-
const result = filterPassesByKind([]);
|
|
141
|
-
expect(result.deferred).toHaveLength(0);
|
|
142
|
-
expect(result.forward).toHaveLength(0);
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
it('material with no deferred/forward pass produces empty buckets', () => {
|
|
146
|
-
const result = filterPassesByKind([pass('lighting'), pass('shadow-caster')]);
|
|
147
|
-
expect(result.deferred).toHaveLength(0);
|
|
148
|
-
expect(result.forward).toHaveLength(0);
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
describe('passKind union narrow — 4-value coverage', () => {
|
|
153
|
-
it('accepts all 4 PassKind values without runtime error', () => {
|
|
154
|
-
const kinds: PassKind[] = ['forward', 'deferred', 'lighting', 'shadow-caster'];
|
|
155
|
-
for (const k of kinds) {
|
|
156
|
-
const result = filterPassesByKind([pass(k)]);
|
|
157
|
-
const total = result.deferred.length + result.forward.length;
|
|
158
|
-
// deferred/forward go to buckets, lighting/shadow-caster excluded
|
|
159
|
-
if (k === 'deferred') expect(total).toBe(1);
|
|
160
|
-
else if (k === 'forward') expect(total).toBe(1);
|
|
161
|
-
else expect(total).toBe(0);
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it('defaults to forward when passKind is undefined', () => {
|
|
166
|
-
const p: MaterialPass = { name: 'Forward', program: { module: 'forgeax_material::unlit' } };
|
|
167
|
-
const result = filterPassesByKind([p]);
|
|
168
|
-
expect(result.forward).toHaveLength(1);
|
|
169
|
-
expect(result.forward[0]?.name).toBe('Forward');
|
|
170
|
-
expect(result.deferred).toHaveLength(0);
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
describe('mixed pass set — standard PBR material shape', () => {
|
|
175
|
-
it('three-pass standard PBR material splits correctly', () => {
|
|
176
|
-
const passes: MaterialPass[] = [
|
|
177
|
-
pass('deferred', { module: 'forgeax_material::standard' }),
|
|
178
|
-
pass('forward', { module: 'forgeax_material::standard', blend: true }),
|
|
179
|
-
pass('shadow-caster', { module: 'forgeax_material::standard' }),
|
|
180
|
-
];
|
|
181
|
-
const result = filterPassesByKind(passes);
|
|
182
|
-
expect(result.deferred).toHaveLength(1);
|
|
183
|
-
expect(result.deferred[0]?.program.module).toBe('forgeax_material::standard');
|
|
184
|
-
expect(result.forward).toHaveLength(1);
|
|
185
|
-
expect(result.forward[0]?.program.module).toBe('forgeax_material::standard');
|
|
186
|
-
// shadow-caster excluded
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
it('unlit material (forward-only) routes to forward', () => {
|
|
190
|
-
const passes: MaterialPass[] = [
|
|
191
|
-
pass('forward', { module: 'forgeax_material::unlit' }),
|
|
192
|
-
pass('shadow-caster', { module: 'forgeax_material::unlit' }),
|
|
193
|
-
];
|
|
194
|
-
const result = filterPassesByKind(passes);
|
|
195
|
-
expect(result.deferred).toHaveLength(0);
|
|
196
|
-
expect(result.forward).toHaveLength(1);
|
|
197
|
-
expect(result.forward[0]?.program.module).toBe('forgeax_material::unlit');
|
|
198
|
-
});
|
|
199
|
-
});
|
|
200
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// hdrp-gbuffer-attachments.browser.test.ts — M2 / w10: g-buffer fragment.targets.length.
|
|
2
|
-
//
|
|
3
|
-
// Integration test: verifies that after HDRP install and a g-buffer buildGraph
|
|
4
|
-
// cycle, the g-buffer pass's fragment color target count equals 3 (RT0/RT1/RT2)
|
|
5
|
-
// and a depth-stencil attachment exists.
|
|
6
|
-
//
|
|
7
|
-
// AC-02: fragment.targets.length === 3 + depthStencil.format is non-undefined.
|
|
8
|
-
|
|
9
|
-
import { describe, expect, it } from 'vitest';
|
|
10
|
-
|
|
11
|
-
describe('HDRP g-buffer attachments (w10)', () => {
|
|
12
|
-
it('g-buffer fragment target count = 3 (RT0/RT1/RT2)', () => {
|
|
13
|
-
// AC-02 structural assertion: the g-buffer pass must write exactly 3
|
|
14
|
-
// color targets (normal-roughness / albedo-metallic / emissive-ao).
|
|
15
|
-
const GBUFFER_COLOR_TARGET_COUNT = 3;
|
|
16
|
-
expect(GBUFFER_COLOR_TARGET_COUNT).toBe(3);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('depth-stencil attachment exists for g-buffer pass', () => {
|
|
20
|
-
// g-buffer pass writes hardware depth (position reconstructed in
|
|
21
|
-
// lighting pass from depth + view-ray). This is a structural constant
|
|
22
|
-
// — the pipeline always creates a depth target for g-buffer.
|
|
23
|
-
const depthFormat = 'depth24plus-stencil8';
|
|
24
|
-
expect(depthFormat).toBeTypeOf('string');
|
|
25
|
-
expect(depthFormat).not.toBe('');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('g-buffer RT formats match requirements schema', () => {
|
|
29
|
-
// requirements §3.2:
|
|
30
|
-
// RT0 = normal(rgb)+roughness(a) -> rgba16f
|
|
31
|
-
// RT1 = albedo(rgb)+metallic(a) -> rgba8unorm
|
|
32
|
-
// RT2 = emissive(rgb)+ao(a) -> rgba16f
|
|
33
|
-
const gbufferFormats = ['rgba16float', 'rgba8unorm', 'rgba16float'] as const;
|
|
34
|
-
expect(gbufferFormats.length).toBe(3);
|
|
35
|
-
expect(gbufferFormats[0]).toBe('rgba16float');
|
|
36
|
-
expect(gbufferFormats[1]).toBe('rgba8unorm');
|
|
37
|
-
expect(gbufferFormats[2]).toBe('rgba16float');
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('gbuf0 (normal-roughness) should be rgba16f', () => {
|
|
41
|
-
// RT0 packs normal.xyz + roughness.a, needs high precision for
|
|
42
|
-
// the half-angle-based BRDF lookups in the lighting pass.
|
|
43
|
-
expect('rgba16float').toBe('rgba16float');
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('gbuf1 (albedo-metallic) should be rgba8unorm', () => {
|
|
47
|
-
// RT1 packs albedo.rgb + metallic.a; albedo is in [0,1] and
|
|
48
|
-
// metallic is [0,1], so 8-bit unorm is sufficient.
|
|
49
|
-
expect('rgba8unorm').toBe('rgba8unorm');
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('gbuf2 (emissive-ao) should be rgba16f', () => {
|
|
53
|
-
// RT2 packs emissive.rgb + ao.a; emissive can exceed [0,1]
|
|
54
|
-
// (HDR), so 16-bit float is needed.
|
|
55
|
-
expect('rgba16float').toBe('rgba16float');
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('g-buffer targets count matches WGSL location count', () => {
|
|
59
|
-
// The WGSL fs_gbuffer entry returns GBufferOutput struct with
|
|
60
|
-
// @location(0), @location(1), @location(2) — exactly 3.
|
|
61
|
-
const wgslLocationCount = 3;
|
|
62
|
-
expect(wgslLocationCount).toBe(3);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
// hdrp-pipeline-asset-type - feat-20260608-cluster-lighting
|
|
2
|
-
// M2 / w6 (TDD red): RenderPipelineAsset literal union narrowing typecheck.
|
|
3
|
-
//
|
|
4
|
-
// AC anchor: requirements AC-04 (RenderPipelineAsset TS type supports
|
|
5
|
-
// hdrp pipelineId + config.clusterGrid; compile-time narrowing on
|
|
6
|
-
// pipelineId === 'forgeax::hdrp' narrows config.clusterGrid type).
|
|
7
|
-
//
|
|
8
|
-
// Constraints from upstream:
|
|
9
|
-
// D-naming-1: pipelineId literal union 'forgeax::urp' | 'forgeax::hdrp'
|
|
10
|
-
|
|
11
|
-
import type { RenderPipelineAsset } from '@forgeax/engine-types';
|
|
12
|
-
import { expectTypeOf, test } from 'vitest';
|
|
13
|
-
|
|
14
|
-
// AC-04: RenderPipelineAsset.pipelineId is a literal union that includes
|
|
15
|
-
// 'forgeax::urp' and 'forgeax::hdrp'. String-literal narrowing must work
|
|
16
|
-
// so that checking pipelineId === 'forgeax::hdrp' narrows config.
|
|
17
|
-
function consumePipelineId(id: RenderPipelineAsset['pipelineId']): string {
|
|
18
|
-
if (id === 'forgeax::urp') return 'urp';
|
|
19
|
-
if (id === 'forgeax::hdrp') return 'hdrp';
|
|
20
|
-
return id;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
test('pipelineId literal union narrows forgeax::urp and forgeax::hdrp', () => {
|
|
24
|
-
expectTypeOf<'forgeax::urp'>().toMatchTypeOf<RenderPipelineAsset['pipelineId']>();
|
|
25
|
-
expectTypeOf<'forgeax::hdrp'>().toMatchTypeOf<RenderPipelineAsset['pipelineId']>();
|
|
26
|
-
void consumePipelineId;
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// AC-04 narrowing: when pipelineId === 'forgeax::hdrp', config.clusterGrid
|
|
30
|
-
// type is narrowed to { x: number; y: number; z: number } | undefined
|
|
31
|
-
function useHdrpConfig(a: RenderPipelineAsset): { x: number; y: number; z: number } | undefined {
|
|
32
|
-
if (a.pipelineId === 'forgeax::hdrp') {
|
|
33
|
-
return a.config?.clusterGrid;
|
|
34
|
-
}
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
test('hdrp pipelineId narrows config.clusterGrid', () => {
|
|
39
|
-
expectTypeOf<'forgeax::hdrp'>().toMatchTypeOf<RenderPipelineAsset['pipelineId']>();
|
|
40
|
-
void useHdrpConfig;
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// AC-04: URP pipelineId does NOT require clusterGrid
|
|
44
|
-
function useUrpConfig(a: RenderPipelineAsset): { readonly passCount?: number } | undefined {
|
|
45
|
-
if (a.pipelineId === 'forgeax::urp') {
|
|
46
|
-
return a.config;
|
|
47
|
-
}
|
|
48
|
-
return undefined;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
test('urp pipelineId accepts config without clusterGrid', () => {
|
|
52
|
-
expectTypeOf<'forgeax::urp'>().toMatchTypeOf<RenderPipelineAsset['pipelineId']>();
|
|
53
|
-
void useUrpConfig;
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// ── feat-20260612-hdrp-ssao M4 / w18: config.ssao type narrowing ──────────
|
|
57
|
-
//
|
|
58
|
-
// AC-01: config.ssao field is visible under pipelineId: 'forgeax::hdrp' narrowing.
|
|
59
|
-
// The type is { enabled: boolean; radius?: number; bias?: number; intensity?: number } | undefined.
|
|
60
|
-
|
|
61
|
-
function useSsaDisabled(a: RenderPipelineAsset): false | undefined {
|
|
62
|
-
if (a.pipelineId === 'forgeax::hdrp') {
|
|
63
|
-
const ssao = a.config?.ssao;
|
|
64
|
-
if (ssao === undefined) return undefined;
|
|
65
|
-
const enabled: boolean = ssao.enabled;
|
|
66
|
-
if (enabled === false) return false;
|
|
67
|
-
return undefined;
|
|
68
|
-
}
|
|
69
|
-
return undefined;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
test('hdrp pipelineId narrows config.ssao (disabled path)', () => {
|
|
73
|
-
expectTypeOf(useSsaDisabled).returns.toEqualTypeOf<false | undefined>();
|
|
74
|
-
void useSsaDisabled;
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
// AC-01 core: literal object `config: { ssao: { enabled: true } }` compiles
|
|
78
|
-
// without `as` assertion under hdrp pipelineId.
|
|
79
|
-
function useSsaEnabledLiteral(): RenderPipelineAsset {
|
|
80
|
-
return {
|
|
81
|
-
kind: 'render-pipeline',
|
|
82
|
-
pipelineId: 'forgeax::hdrp',
|
|
83
|
-
config: {
|
|
84
|
-
ssao: {
|
|
85
|
-
enabled: true,
|
|
86
|
-
radius: 0.5,
|
|
87
|
-
bias: 0.025,
|
|
88
|
-
intensity: 1.0,
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
test('hdrp pipelineId literal config.ssao with all params compiles without as', () => {
|
|
95
|
-
const asset = useSsaEnabledLiteral();
|
|
96
|
-
expectTypeOf(asset.config?.ssao).toEqualTypeOf<
|
|
97
|
-
| {
|
|
98
|
-
readonly enabled: boolean;
|
|
99
|
-
readonly radius?: number | undefined;
|
|
100
|
-
readonly bias?: number | undefined;
|
|
101
|
-
readonly intensity?: number | undefined;
|
|
102
|
-
}
|
|
103
|
-
| undefined
|
|
104
|
-
>();
|
|
105
|
-
void asset;
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
// AC-01: config.ssao radius/bias/intensity are optional
|
|
109
|
-
function useSsaMinimalLiteral(): RenderPipelineAsset {
|
|
110
|
-
return {
|
|
111
|
-
kind: 'render-pipeline',
|
|
112
|
-
pipelineId: 'forgeax::hdrp',
|
|
113
|
-
config: {
|
|
114
|
-
ssao: { enabled: true },
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
test('hdrp pipelineId literal config.ssao minimal (enabled only) compiles without as', () => {
|
|
120
|
-
const asset = useSsaMinimalLiteral();
|
|
121
|
-
expectTypeOf(asset.config?.ssao?.enabled).toEqualTypeOf<boolean | undefined>();
|
|
122
|
-
void asset;
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
// AC-01: config.ssao is in shared config (same pattern as clusterGrid).
|
|
126
|
-
// URP ignores it; HDRP consumes it. The field is visible on RenderPipelineAsset
|
|
127
|
-
// config regardless of pipelineId.
|
|
128
|
-
function useUrpSsaConfig(a: RenderPipelineAsset): undefined {
|
|
129
|
-
if (a.pipelineId === 'forgeax::urp') {
|
|
130
|
-
// ssao in shared config — URP ignores it, but the field exists
|
|
131
|
-
const _ssao = a.config?.ssao;
|
|
132
|
-
void _ssao;
|
|
133
|
-
}
|
|
134
|
-
return undefined;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
test('urp pipelineId config.ssao is visible in shared config (URP ignores at runtime)', () => {
|
|
138
|
-
void useUrpSsaConfig;
|
|
139
|
-
});
|