@forgeax/engine-render 0.1.32 → 0.1.34
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 +1374 -142
- package/dist/assembly/analytic-fog-registration.d.ts +3 -0
- package/dist/assembly/analytic-fog-registration.d.ts.map +1 -0
- package/dist/assembly/backend-contract.d.ts +2 -0
- package/dist/assembly/backend-contract.d.ts.map +1 -1
- package/dist/assembly/barrel-distortion-inspection.d.ts +3 -0
- package/dist/assembly/barrel-distortion-inspection.d.ts.map +1 -0
- package/dist/assembly/canvas-draw-guard.d.ts +3 -0
- package/dist/assembly/canvas-draw-guard.d.ts.map +1 -0
- package/dist/assembly/cloud-shadow-entry.d.ts +4 -0
- package/dist/assembly/cloud-shadow-entry.d.ts.map +1 -0
- package/dist/assembly/dynamic-geometry-host.d.ts +4 -1
- package/dist/assembly/dynamic-geometry-host.d.ts.map +1 -1
- package/dist/assembly/dynamic-geometry-runtime.d.ts +1 -1
- package/dist/assembly/dynamic-geometry-runtime.d.ts.map +1 -1
- package/dist/assembly/factory.d.ts +1 -1
- package/dist/assembly/factory.d.ts.map +1 -1
- package/dist/assembly/fxaa-registration.d.ts +4 -0
- package/dist/assembly/fxaa-registration.d.ts.map +1 -0
- package/dist/assembly/host-contract.d.ts +3 -3
- package/dist/assembly/host-contract.d.ts.map +1 -1
- package/dist/assembly/lod-observation.d.ts +4 -0
- package/dist/assembly/lod-observation.d.ts.map +1 -0
- package/dist/assembly/material/assembly.d.ts.map +1 -1
- package/dist/assembly/material/pipeline-helpers.d.ts +5 -0
- package/dist/assembly/material/pipeline-helpers.d.ts.map +1 -1
- package/dist/assembly/material-shader-policy.d.ts +16 -2
- package/dist/assembly/material-shader-policy.d.ts.map +1 -1
- package/dist/assembly/material-shader-prewarm.d.ts.map +1 -1
- package/dist/assembly/motion-blur-registration.d.ts +3 -0
- package/dist/assembly/motion-blur-registration.d.ts.map +1 -0
- package/dist/assembly/recovery/device-loss-fanout.d.ts.map +1 -1
- package/dist/assembly/recovery/renderer-recover.d.ts +2 -0
- package/dist/assembly/recovery/renderer-recover.d.ts.map +1 -1
- package/dist/assembly/render-feature-post-processes.d.ts +6 -0
- package/dist/assembly/render-feature-post-processes.d.ts.map +1 -0
- package/dist/assembly/renderer-facade.d.ts.map +1 -1
- package/dist/assembly/renderer-feature-inspection.d.ts +1 -1
- package/dist/assembly/renderer-feature-inspection.d.ts.map +1 -1
- package/dist/assembly/renderer-frame-transaction.d.ts +12 -0
- package/dist/assembly/renderer-frame-transaction.d.ts.map +1 -1
- package/dist/assembly/renderer-inspection.d.ts +11 -0
- package/dist/assembly/renderer-inspection.d.ts.map +1 -1
- package/dist/assembly/temporal-post-process-prewarm.d.ts +13 -0
- package/dist/assembly/temporal-post-process-prewarm.d.ts.map +1 -0
- package/dist/assembly/webgpu-pbr-ready.d.ts +1 -0
- package/dist/assembly/webgpu-pbr-ready.d.ts.map +1 -1
- package/dist/assembly/webgpu-ready-contract.d.ts +4 -3
- package/dist/assembly/webgpu-ready-contract.d.ts.map +1 -1
- package/dist/assembly/webgpu-ready-per-pass.d.ts +39 -0
- package/dist/assembly/webgpu-ready-per-pass.d.ts.map +1 -0
- package/dist/assembly/webgpu-ready.d.ts +2 -2
- package/dist/assembly/webgpu-ready.d.ts.map +1 -1
- package/dist/assembly/webgpu-renderer-bootstrap.d.ts.map +1 -1
- package/dist/assembly/webgpu-renderer-observation-owner.d.ts +35 -0
- package/dist/assembly/webgpu-renderer-observation-owner.d.ts.map +1 -0
- package/dist/assembly/webgpu-renderer.d.ts +1 -1
- package/dist/assembly/webgpu-renderer.d.ts.map +1 -1
- package/dist/authoring.mjs +1 -1
- package/dist/barrel-distortion.d.ts +47 -0
- package/dist/barrel-distortion.d.ts.map +1 -0
- package/dist/bloom-admission.d.ts +13 -0
- package/dist/bloom-admission.d.ts.map +1 -0
- package/dist/{chunk-PA5DRJNI.mjs → chunk-ELJFJ2BU.mjs} +2 -2
- package/dist/chunk-ELJFJ2BU.mjs.map +1 -0
- package/dist/{chunk-JCIRYQ4V.mjs → chunk-HEB564WF.mjs} +10 -4
- package/dist/chunk-HEB564WF.mjs.map +1 -0
- package/dist/{chunk-JRIPCMYC.mjs → chunk-MKDIT2EM.mjs} +1584 -375
- package/dist/chunk-MKDIT2EM.mjs.map +1 -0
- package/dist/{chunk-S665NJNF.mjs → chunk-OCDLEI6I.mjs} +3 -3
- package/dist/{chunk-S665NJNF.mjs.map → chunk-OCDLEI6I.mjs.map} +1 -1
- package/dist/chunk-ODZWR6JQ.mjs +4927 -0
- package/dist/chunk-ODZWR6JQ.mjs.map +1 -0
- package/dist/{chunk-DRR7D3KX.mjs → chunk-SHFUFJ5N.mjs} +192 -18
- package/dist/chunk-SHFUFJ5N.mjs.map +1 -0
- package/dist/{chunk-4NNZQCL3.mjs → chunk-UI5SFODX.mjs} +223 -277
- package/dist/chunk-UI5SFODX.mjs.map +1 -0
- package/dist/{chunk-GWCEMDVR.mjs → chunk-UINHLCZA.mjs} +787 -80
- package/dist/chunk-UINHLCZA.mjs.map +1 -0
- package/dist/{chunk-6TFBXLRJ.mjs → chunk-WEX45HKH.mjs} +222 -337
- package/dist/chunk-WEX45HKH.mjs.map +1 -0
- package/dist/cloud/density.d.ts +55 -0
- package/dist/cloud/density.d.ts.map +1 -0
- package/dist/cloud/extract.d.ts +25 -0
- package/dist/cloud/extract.d.ts.map +1 -0
- package/dist/cloud/feature.d.ts +57 -0
- package/dist/cloud/feature.d.ts.map +1 -0
- package/dist/cloud/frame-context.d.ts +8 -0
- package/dist/cloud/frame-context.d.ts.map +1 -0
- package/dist/cloud/inspection.d.ts +59 -0
- package/dist/cloud/inspection.d.ts.map +1 -0
- package/dist/cloud/optics.d.ts +56 -0
- package/dist/cloud/optics.d.ts.map +1 -0
- package/dist/cloud/parameters.d.ts +73 -0
- package/dist/cloud/parameters.d.ts.map +1 -0
- package/dist/cloud/resources.d.ts +60 -0
- package/dist/cloud/resources.d.ts.map +1 -0
- package/dist/cloud/shadow.d.ts +42 -0
- package/dist/cloud/shadow.d.ts.map +1 -0
- package/dist/cloud/temporal.d.ts +74 -0
- package/dist/cloud/temporal.d.ts.map +1 -0
- package/dist/components/atmosphere.d.ts +2 -0
- package/dist/components/atmosphere.d.ts.map +1 -1
- package/dist/components/barrel-distortion.d.ts +13 -0
- package/dist/components/barrel-distortion.d.ts.map +1 -0
- package/dist/components/camera.d.ts +20 -4
- package/dist/components/camera.d.ts.map +1 -1
- package/dist/components/cloud-layer.d.ts +29 -0
- package/dist/components/cloud-layer.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/instances.d.ts +20 -6
- package/dist/components/instances.d.ts.map +1 -1
- package/dist/components/mesh-filter.d.ts +6 -5
- package/dist/components/mesh-filter.d.ts.map +1 -1
- package/dist/components/motion-blur.d.ts +1 -0
- package/dist/components/motion-blur.d.ts.map +1 -1
- package/dist/construct-renderer.d.ts +1 -1
- package/dist/construct-renderer.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +9751 -3528
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/gpu-residency.d.ts +6 -0
- package/dist/device/gpu-residency.d.ts.map +1 -1
- package/dist/dynamic-geometry.d.ts +5 -1
- package/dist/dynamic-geometry.d.ts.map +1 -1
- package/dist/environment/analytic-fog.d.ts +6 -0
- package/dist/environment/analytic-fog.d.ts.map +1 -0
- package/dist/errors/cloud.d.ts +59 -0
- package/dist/errors/cloud.d.ts.map +1 -0
- package/dist/errors/render.d.ts +23 -5
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/examples/single-layer-medium-surface.d.ts +47 -0
- package/dist/examples/single-layer-medium-surface.d.ts.map +1 -0
- package/dist/extract/camera.d.ts.map +1 -1
- package/dist/extract/contracts.d.ts +12 -1
- package/dist/extract/contracts.d.ts.map +1 -1
- package/dist/extract/environment.d.ts +2 -0
- package/dist/extract/environment.d.ts.map +1 -1
- package/dist/features/barrel-distortion.d.ts +29 -0
- package/dist/features/barrel-distortion.d.ts.map +1 -0
- package/dist/features/error-reporting.d.ts +17 -0
- package/dist/features/error-reporting.d.ts.map +1 -0
- package/dist/features/host.d.ts +15 -0
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/motion-blur/motion-blur-feature.d.ts +20 -2
- package/dist/features/motion-blur/motion-blur-feature.d.ts.map +1 -1
- package/dist/features/motion-blur/motion-blur-params.d.ts +21 -0
- package/dist/features/motion-blur/motion-blur-params.d.ts.map +1 -1
- package/dist/features/motion-blur/motion-blur-runtime.d.ts +54 -0
- package/dist/features/motion-blur/motion-blur-runtime.d.ts.map +1 -0
- package/dist/features/plan.d.ts +15 -4
- package/dist/features/plan.d.ts.map +1 -1
- package/dist/features/prepared-gpu-work.d.ts +9 -5
- package/dist/features/prepared-gpu-work.d.ts.map +1 -1
- package/dist/features/render-graph-compute.d.ts.map +1 -1
- package/dist/features/render-graph-contribution.d.ts +5 -0
- package/dist/features/render-graph-contribution.d.ts.map +1 -1
- package/dist/features/render-graph-raster.d.ts +1 -0
- package/dist/features/render-graph-raster.d.ts.map +1 -1
- package/dist/features/targets.d.ts +2 -0
- package/dist/features/targets.d.ts.map +1 -1
- package/dist/features/types.d.ts +44 -0
- package/dist/features/types.d.ts.map +1 -1
- package/dist/fullscreen-post-process-pass.d.ts +15 -7
- package/dist/fullscreen-post-process-pass.d.ts.map +1 -1
- package/dist/gpu-dirty-ranges.d.ts +11 -0
- package/dist/gpu-dirty-ranges.d.ts.map +1 -0
- package/dist/gpu-driven/batch-topology.d.ts +17 -0
- package/dist/gpu-driven/batch-topology.d.ts.map +1 -1
- package/dist/gpu-driven/material-artifacts.d.ts +6 -0
- package/dist/gpu-driven/material-artifacts.d.ts.map +1 -1
- package/dist/gpu-driven/prepared-draw.d.ts +7 -0
- package/dist/gpu-driven/prepared-draw.d.ts.map +1 -1
- package/dist/gpu-driven/production-raster-material.d.ts +178 -0
- package/dist/gpu-driven/production-raster-material.d.ts.map +1 -0
- package/dist/gpu-driven/production-raster.d.ts +50 -4
- package/dist/gpu-driven/production-raster.d.ts.map +1 -1
- package/dist/gpu-driven/resource-allocation.d.ts +31 -0
- package/dist/gpu-driven/resource-allocation.d.ts.map +1 -0
- package/dist/gpu-driven/shadow-ownership.d.ts +14 -0
- package/dist/gpu-driven/shadow-ownership.d.ts.map +1 -0
- package/dist/gpu-driven/view-gpu.d.ts +35 -2
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +11 -1
- package/dist/gpu-scene.d.ts.map +1 -1
- package/dist/hdrp-buffers.d.ts +2 -2
- package/dist/hdrp-buffers.d.ts.map +1 -1
- package/dist/ibl/skylight-bind-group.d.ts +10 -1
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -1
- package/dist/index.d.ts +31 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +258 -8
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +178 -3
- package/dist/inspection-types.d.ts.map +1 -1
- package/dist/instance-buffer-cache.d.ts +4 -4
- package/dist/instance-buffer-cache.d.ts.map +1 -1
- package/dist/instances.d.ts +49 -94
- package/dist/instances.d.ts.map +1 -1
- package/dist/internal.mjs +7 -7
- package/dist/pbr-pipeline.d.ts +19 -1
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/pipeline/single-layer-medium-passes.d.ts +73 -0
- package/dist/pipeline/single-layer-medium-passes.d.ts.map +1 -0
- package/dist/pipeline/standard-forward-lane.d.ts.map +1 -1
- package/dist/pipeline/standard-output/graph.d.ts.map +1 -1
- package/dist/pipeline/standard-output/types.d.ts +4 -2
- package/dist/pipeline/standard-output/types.d.ts.map +1 -1
- package/dist/pipeline/standard-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-post.d.ts +28 -19
- package/dist/pipeline/standard-post.d.ts.map +1 -1
- package/dist/pipeline-builder.d.ts +1 -1
- package/dist/pipeline-builder.d.ts.map +1 -1
- package/dist/pipeline-spec.d.ts +2 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/prepare/prepared-graphics-resolver.d.ts +2 -0
- package/dist/prepare/prepared-graphics-resolver.d.ts.map +1 -1
- package/dist/record/barrel-distortion-frame.d.ts +15 -0
- package/dist/record/barrel-distortion-frame.d.ts.map +1 -0
- package/dist/record/dynamic-geometry-consumption.d.ts +10 -2
- package/dist/record/dynamic-geometry-consumption.d.ts.map +1 -1
- package/dist/record/fold-buckets.d.ts +95 -0
- package/dist/record/fold-buckets.d.ts.map +1 -0
- package/dist/record/fold-instance-buffer.d.ts +6 -0
- package/dist/record/fold-instance-buffer.d.ts.map +1 -0
- package/dist/record/frame-lighting.d.ts +1 -0
- package/dist/record/frame-lighting.d.ts.map +1 -1
- package/dist/record/frame-snapshot.d.ts +40 -3
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame-targets.d.ts.map +1 -1
- package/dist/record/frame.d.ts +14 -62
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/gpu-draw-receipts.d.ts +11 -0
- package/dist/record/gpu-draw-receipts.d.ts.map +1 -0
- package/dist/record/gpu-timing.d.ts +8 -0
- package/dist/record/gpu-timing.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +21 -5
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +7 -1
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass-sprite-draws.d.ts.map +1 -1
- package/dist/record/main-pass.d.ts +13 -2
- package/dist/record/main-pass.d.ts.map +1 -1
- package/dist/record/mesh-ssbo.d.ts +6 -5
- package/dist/record/mesh-ssbo.d.ts.map +1 -1
- package/dist/record/motion-blur-receipt.d.ts +11 -0
- package/dist/record/motion-blur-receipt.d.ts.map +1 -0
- package/dist/record/probe-blend-buffer.d.ts +16 -0
- package/dist/record/probe-blend-buffer.d.ts.map +1 -0
- package/dist/record/recovery-pipeline.d.ts.map +1 -1
- package/dist/record/render-context.d.ts +34 -31
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/shadow-pass.d.ts +2 -0
- package/dist/record/shadow-pass.d.ts.map +1 -1
- package/dist/record/skybox-post-pass.d.ts +6 -4
- package/dist/record/skybox-post-pass.d.ts.map +1 -1
- package/dist/record/typed-frame-graph.d.ts +22 -2
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/record/view-ubo.d.ts +11 -3
- package/dist/record/view-ubo.d.ts.map +1 -1
- package/dist/record/volume-params.d.ts +9 -0
- package/dist/record/volume-params.d.ts.map +1 -0
- package/dist/recovery/render-system-candidate.d.ts +10 -0
- package/dist/recovery/render-system-candidate.d.ts.map +1 -1
- package/dist/reflection/record-owner.d.ts.map +1 -1
- package/dist/render-contract.d.ts +66 -8
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-graph-primitives.d.ts.map +1 -1
- package/dist/render-pipeline.d.ts +106 -3
- package/dist/render-pipeline.d.ts.map +1 -1
- package/dist/render-system-extract-tail.d.ts +3 -2
- package/dist/render-system-extract-tail.d.ts.map +1 -1
- package/dist/render-system-extract.d.ts +24 -10
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system-presentation.d.ts +23 -0
- package/dist/render-system-presentation.d.ts.map +1 -0
- package/dist/render-system-producer-roots.d.ts +10 -0
- package/dist/render-system-producer-roots.d.ts.map +1 -0
- package/dist/render-system-residency.d.ts +12 -0
- package/dist/render-system-residency.d.ts.map +1 -0
- package/dist/render-system.d.ts +26 -15
- package/dist/render-system.d.ts.map +1 -1
- package/dist/scene/probe-blend.d.ts +27 -0
- package/dist/scene/probe-blend.d.ts.map +1 -1
- package/dist/scene/render-scene.d.ts +14 -5
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/ssao-buffers.d.ts +9 -0
- package/dist/ssao-buffers.d.ts.map +1 -1
- package/dist/surface/dynamic-input.d.ts +133 -0
- package/dist/surface/dynamic-input.d.ts.map +1 -0
- package/dist/surface/gpu-driven.d.ts +41 -0
- package/dist/surface/gpu-driven.d.ts.map +1 -0
- package/dist/surface/submission-observation.d.ts +136 -0
- package/dist/surface/submission-observation.d.ts.map +1 -0
- package/dist/systems/skin-palette-allocator.d.ts.map +1 -1
- package/dist/temporal/frame-coordinator.d.ts.map +1 -1
- package/dist/temporal/frame.d.ts +7 -0
- package/dist/temporal/frame.d.ts.map +1 -1
- package/dist/temporal/gpu.d.ts +13 -1
- package/dist/temporal/gpu.d.ts.map +1 -1
- package/dist/temporal/index.mjs +5 -5
- package/dist/temporal/inspection.d.ts.map +1 -1
- package/dist/temporal/standard-scene-data.d.ts.map +1 -1
- package/dist/temporal/target-coverage-attachment.d.ts.map +1 -1
- package/dist/temporal/view.d.ts +6 -1
- package/dist/temporal/view.d.ts.map +1 -1
- package/dist/transmission/single-layer-medium.d.ts +89 -0
- package/dist/transmission/single-layer-medium.d.ts.map +1 -0
- package/dist/typed-render-graph-primitives.d.ts +24 -9
- package/dist/typed-render-graph-primitives.d.ts.map +1 -1
- package/dist/volume/component.d.ts +9 -5
- package/dist/volume/component.d.ts.map +1 -1
- package/dist/volume/extract.d.ts +1 -1
- package/dist/volume/extract.d.ts.map +1 -1
- package/dist/volume/inspection.d.ts +2 -0
- package/dist/volume/inspection.d.ts.map +1 -1
- package/dist/volume/passes.d.ts +4 -1
- package/dist/volume/passes.d.ts.map +1 -1
- package/dist/volume/resources.d.ts.map +1 -1
- package/dist/volume/temporal.d.ts +3 -1
- package/dist/volume/temporal.d.ts.map +1 -1
- package/package.json +22 -21
- package/src/__tests__/analytic-fog-graph.unit.test.ts +199 -0
- package/src/__tests__/analytic-fog-optics.unit.test.ts +38 -0
- package/src/__tests__/atmosphere-daylight.dawn.test.ts +72 -0
- package/src/__tests__/barrel-distortion-lkg.integration.test.ts +353 -0
- package/src/__tests__/barrel-distortion.dawn.test.ts +41 -0
- package/src/__tests__/barrel-distortion.unit.test.ts +364 -0
- package/src/__tests__/bloom-exact-zero.unit.test.ts +112 -18
- package/src/__tests__/bloom-lifecycle.integration.test.ts +17 -4
- package/src/__tests__/construct-renderer-identity.unit.test.ts +49 -0
- package/src/__tests__/detached-recovery-graph.unit.test.ts +277 -0
- package/src/__tests__/device-loss-fanout.unit.test.ts +36 -1
- package/src/__tests__/docs-gate-green.unit.test.ts +112 -1
- package/src/__tests__/dynamic-resolution-plugin.integration.test.ts +20 -0
- package/src/__tests__/environment-fog-lanes.integration.test.ts +14 -0
- package/src/__tests__/environment-selection.unit.test.ts +12 -0
- package/src/__tests__/factory-contract.integration.test.ts +626 -113
- package/src/__tests__/feature-depth-input.dawn.test.ts +129 -2
- package/src/__tests__/frame-camera-selection.unit.test.ts +39 -1
- package/src/__tests__/frame-plan-contract.unit.test.ts +2 -0
- package/src/__tests__/fullscreen-feature-plan.unit.test.ts +14 -3
- package/src/__tests__/gpu-dirty-ranges.unit.test.ts +22 -0
- package/src/__tests__/gpu-driven-baseline.characterization.test.ts +16 -3
- package/src/__tests__/gpu-driven-batch-topology-pbr.unit.test.ts +12 -0
- package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +2 -1
- package/src/__tests__/gpu-driven-material-artifacts.unit.test.ts +143 -0
- package/src/__tests__/gpu-driven-pbr.dawn.test.ts +2 -2
- package/src/__tests__/gpu-driven-production.integration.test.ts +482 -3
- package/src/__tests__/gpu-driven-shadow-views.dawn.test.ts +7 -6
- package/src/__tests__/gpu-driven-shadow-views.integration.test.ts +1 -1
- package/src/__tests__/gpu-driven-view-gpu-evidence.ts +103 -4
- package/src/__tests__/gpu-driven-view-graph.integration.test.ts +18 -2
- package/src/__tests__/gpu-driven-view.browser.test.ts +5 -8
- package/src/__tests__/gpu-driven-view.dawn.test.ts +6 -2
- package/src/__tests__/gpu-driven-view.unit.test.ts +1 -1
- package/src/__tests__/gpu-pass-timing-lifecycle.integration.test.ts +1 -0
- package/src/__tests__/gpu-pass-timing.browser.test.ts +6 -4
- package/src/__tests__/gpu-pass-timing.rhi-null.unit.test.ts +1 -0
- package/src/__tests__/gpu-resource-store-stride.unit.test.ts +12 -0
- package/src/__tests__/gpu-scene.unit.test.ts +210 -9
- package/src/__tests__/instance-allocation-failure.unit.test.ts +57 -0
- package/src/__tests__/instances-culling.integration.test.ts +10 -36
- package/src/__tests__/instances-store.unit.test.ts +105 -238
- package/src/__tests__/instances-world-ownership.integration.test.ts +62 -0
- package/src/__tests__/main-pass-material-medium-selection.unit.test.ts +146 -0
- package/src/__tests__/material-shader-prewarm.unit.test.ts +59 -0
- package/src/__tests__/material-snapshot-mutation.integration.test.ts +39 -1
- package/src/__tests__/mesh-submission-lifetime.unit.test.ts +31 -0
- package/src/__tests__/morph-culling-reentry.dawn.test.ts +5 -5
- package/src/__tests__/morph-visual-evidence.integration.test.ts +8 -7
- package/src/__tests__/motion-blur-compute.dawn.test.ts +589 -0
- package/src/__tests__/motion-blur.pixel.integration.test.ts +2 -2
- package/src/__tests__/nineslice-handle-surface.unit.test.ts +4 -4
- package/src/__tests__/pbr-view-layout.unit.test.ts +9 -0
- package/src/__tests__/physical-clearcoat.integration.test.ts +58 -0
- package/src/__tests__/prepared-gpu-driven-pbr.integration.test.ts +21 -0
- package/src/__tests__/prepared-graphics-capability.unit.test.ts +66 -2
- package/src/__tests__/prepared-graphics-lifecycle.unit.test.ts +86 -0
- package/src/__tests__/probe-bindings.unit.test.ts +582 -1
- package/src/__tests__/probe-scene-dirty.integration.test.ts +28 -1
- package/src/__tests__/public-surface.test-d.ts +8 -0
- package/src/__tests__/receipt-observation-retirement.unit.test.ts +65 -0
- package/src/__tests__/recovery-candidate-prepare.contract.test.ts +69 -0
- package/src/__tests__/render-error-code-owner.test-d.ts +9 -0
- package/src/__tests__/render-feature-diagnostics.unit.test.ts +15 -2
- package/src/__tests__/render-feature-error-reporting.unit.test.ts +44 -0
- package/src/__tests__/render-feature-prepared-diagnostics.unit.test.ts +10 -1
- package/src/__tests__/render-feature-retry.unit.test.ts +12 -1
- package/src/__tests__/render-feature-stage-fault-recovery.unit.test.ts +23 -0
- package/src/__tests__/render-scene-mixed-updates.integration.test.ts +145 -19
- package/src/__tests__/render-scene-projection.unit.test.ts +36 -11
- package/src/__tests__/render-scene-temporal-retry.unit.test.ts +37 -6
- package/src/__tests__/render-target-probe-soak.perf.test.ts +2 -2
- package/src/__tests__/render-temporal-environment-consumer.browser.test.ts +3 -3
- package/src/__tests__/render-temporal-environment-consumer.dawn.test.ts +5 -2
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +41 -7
- package/src/__tests__/renderer-frame-generation-fence.integration.test.ts +16 -0
- package/src/__tests__/renderer-frame-transaction.integration.test.ts +33 -11
- package/src/__tests__/resource-allocation.unit.test.ts +123 -0
- package/src/__tests__/shader-manifest-fixture.ts +4 -4
- package/src/__tests__/single-layer-medium-passes.unit.test.ts +275 -0
- package/src/__tests__/skin-motion-regression.unit.test.ts +70 -1
- package/src/__tests__/skin-palette-recycling.dawn.test.ts +97 -0
- package/src/__tests__/skinned-shadow-caster.test.ts +17 -0
- package/src/__tests__/ssr-carrier-public-contract.unit.test.ts +21 -0
- package/src/__tests__/ssr-gpu-dispatch.browser.test.ts +4 -4
- package/src/__tests__/ssr-gpu-dispatch.dawn.test.ts +2 -2
- package/src/__tests__/ssr-gpu-dispatch.ts +1 -1
- package/src/__tests__/ssr-receiver-coverage.dawn.test.ts +6 -2
- package/src/__tests__/standard-lighting-write.unit.test.ts +2 -1
- package/src/__tests__/standard-output-chain-contract.unit.test.ts +28 -0
- package/src/__tests__/standard-pbr-artifact-assembly.unit.test.ts +46 -1
- package/src/__tests__/standard-pipeline.dawn.test.ts +1 -1
- package/src/__tests__/standard-pipeline.integration.test.ts +200 -9
- package/src/__tests__/surface-dynamic-buffer-lifecycle.unit.test.ts +506 -0
- package/src/__tests__/surface-submission-observation.unit.test.ts +812 -0
- package/src/__tests__/temporal-history-lifecycle.unit.test.ts +32 -0
- package/src/__tests__/temporal-performance.integration.test.ts +3 -3
- package/src/__tests__/temporal-reset-matrix.unit.test.ts +10 -0
- package/src/__tests__/temporal-view.unit.test.ts +2 -1
- package/src/__tests__/typed-pipeline-topology.unit.test.ts +20 -4
- package/src/__tests__/visibility-instances.integration.test.ts +7 -19
- package/src/__tests__/visibility-producer-matrix.integration.test.ts +9 -20
- package/src/__tests__/volume-optics-oracle.unit.test.ts +7 -3
- package/src/__tests__/volumetric-fog-budget-recovery.integration.test.ts +189 -15
- package/src/__tests__/volumetric-fog-errors.unit.test.ts +4 -3
- package/src/__tests__/volumetric-fog-multiple.unit.test.ts +55 -0
- package/src/__tests__/volumetric-fog-spot-frame-optics.integration.test.ts +1 -1
- package/src/__tests__/volumetric-fog-stage-readback.dawn.test.ts +558 -68
- package/src/__tests__/volumetric-fog-temporal.unit.test.ts +27 -0
- package/src/__tests__/volumetric-fog-topology.unit.test.ts +23 -5
- package/src/assembly/analytic-fog-registration.ts +14 -0
- package/src/assembly/backend-contract.ts +30 -0
- package/src/assembly/barrel-distortion-inspection.ts +22 -0
- package/src/assembly/canvas-draw-guard.ts +11 -0
- package/src/assembly/cloud-shadow-entry.ts +22 -0
- package/src/assembly/dynamic-geometry-host.ts +65 -37
- package/src/assembly/dynamic-geometry-runtime.ts +7 -1
- package/src/assembly/factory.ts +2 -30
- package/src/assembly/fxaa-registration.ts +17 -0
- package/src/assembly/host-contract.ts +3 -3
- package/src/assembly/lod-observation.ts +12 -0
- package/src/assembly/material/assembly.ts +25 -13
- package/src/assembly/material/pipeline-helpers.ts +53 -12
- package/src/assembly/material-shader-policy.ts +55 -0
- package/src/assembly/material-shader-prewarm.ts +21 -10
- package/src/assembly/motion-blur-registration.ts +17 -0
- package/src/assembly/recovery/device-loss-fanout.ts +13 -0
- package/src/assembly/recovery/renderer-recover.ts +41 -18
- package/src/assembly/render-feature-post-processes.ts +54 -0
- package/src/assembly/renderer-facade.ts +6 -1
- package/src/assembly/renderer-feature-inspection.ts +8 -2
- package/src/assembly/renderer-frame-transaction.ts +23 -0
- package/src/assembly/renderer-inspection.ts +28 -0
- package/src/assembly/skin-palette-owner.ts +1 -1
- package/src/assembly/temporal-post-process-prewarm.ts +40 -0
- package/src/assembly/webgpu-pbr-ready.ts +9 -1
- package/src/assembly/webgpu-ready-contract.ts +8 -3
- package/src/assembly/webgpu-ready-per-pass.ts +104 -0
- package/src/assembly/webgpu-ready.ts +296 -306
- package/src/assembly/webgpu-renderer-bootstrap.ts +0 -12
- package/src/assembly/webgpu-renderer-observation-owner.ts +222 -0
- package/src/assembly/webgpu-renderer.ts +228 -281
- package/src/assembly/webgpu-vertex-layouts.ts +1 -1
- package/src/barrel-distortion.ts +247 -0
- package/src/bloom-admission.ts +21 -0
- package/src/cloud/__tests__/cloud-density-parity.dawn.test.ts +173 -0
- package/src/cloud/__tests__/cloud-layer-framebuffer-y.dawn.test.ts +265 -0
- package/src/cloud/__tests__/cloud-layer.browser.test.ts +432 -0
- package/src/cloud/__tests__/cloud-layer.unit.test.ts +634 -0
- package/src/cloud/density.ts +600 -0
- package/src/cloud/extract.ts +110 -0
- package/src/cloud/feature.ts +1810 -0
- package/src/cloud/frame-context.ts +42 -0
- package/src/cloud/inspection.ts +130 -0
- package/src/cloud/optics.ts +285 -0
- package/src/cloud/parameters.ts +255 -0
- package/src/cloud/resources.ts +122 -0
- package/src/cloud/shadow.ts +167 -0
- package/src/cloud/temporal.ts +226 -0
- package/src/components/__tests__/motion-blur.unit.test.ts +1 -0
- package/src/components/atmosphere.ts +4 -0
- package/src/components/barrel-distortion.ts +46 -0
- package/src/components/camera.ts +66 -10
- package/src/components/cloud-layer.ts +47 -0
- package/src/components/index.ts +2 -0
- package/src/components/instances.ts +18 -45
- package/src/components/mesh-filter.ts +11 -9
- package/src/components/motion-blur.ts +1 -0
- package/src/components/sprite-instances.ts +1 -1
- package/src/construct-renderer.ts +1 -1
- package/src/device/gpu-residency.ts +56 -12
- package/src/dynamic-geometry.ts +12 -1
- package/src/environment/analytic-fog.ts +44 -0
- package/src/environment/background.ts +2 -2
- package/src/errors/cloud.ts +103 -0
- package/src/errors/render.ts +58 -8
- package/src/examples/single-layer-medium-surface.ts +59 -0
- package/src/extract/camera.ts +35 -8
- package/src/extract/contracts.ts +12 -0
- package/src/extract/environment.ts +4 -0
- package/src/features/barrel-distortion.ts +172 -0
- package/src/features/error-reporting.ts +98 -0
- package/src/features/host.ts +138 -24
- package/src/features/motion-blur/__tests__/motion-blur-feature.unit.test.ts +111 -1
- package/src/features/motion-blur/__tests__/motion-blur-params.unit.test.ts +58 -3
- package/src/features/motion-blur/motion-blur-feature.ts +1519 -15
- package/src/features/motion-blur/motion-blur-params.ts +70 -2
- package/src/features/motion-blur/motion-blur-runtime.ts +176 -0
- package/src/features/plan.ts +33 -8
- package/src/features/prepared-gpu-work.ts +86 -35
- package/src/features/render-graph-compute.ts +13 -5
- package/src/features/render-graph-contribution.ts +11 -0
- package/src/features/render-graph-raster.ts +45 -3
- package/src/features/targets.ts +66 -0
- package/src/features/types.ts +47 -0
- package/src/fullscreen-post-process-pass.ts +41 -9
- package/src/gpu-dirty-ranges.ts +48 -0
- package/src/gpu-driven/batch-topology.ts +53 -0
- package/src/gpu-driven/material-artifacts.ts +35 -32
- package/src/gpu-driven/prepared-draw.ts +27 -14
- package/src/gpu-driven/production-raster-material.ts +1894 -0
- package/src/gpu-driven/production-raster.ts +904 -787
- package/src/gpu-driven/resource-allocation.ts +142 -0
- package/src/gpu-driven/shadow-ownership.ts +71 -0
- package/src/gpu-driven/view-gpu.ts +181 -10
- package/src/gpu-scene.ts +259 -101
- package/src/hdrp-buffers.ts +4 -3
- package/src/ibl/skylight-bind-group.ts +49 -7
- package/src/index.ts +228 -9
- package/src/inspection-types.ts +222 -2
- package/src/instance-buffer-cache.ts +4 -4
- package/src/instances.ts +151 -492
- package/src/pbr-pipeline.ts +219 -13
- package/src/pipeline/single-layer-medium-passes.ts +267 -0
- package/src/pipeline/standard-forward-lane.ts +313 -57
- package/src/pipeline/standard-output/graph.ts +8 -2
- package/src/pipeline/standard-output/types.ts +12 -1
- package/src/pipeline/standard-pipeline.ts +291 -18
- package/src/pipeline/standard-post.ts +397 -102
- package/src/pipeline-builder.ts +1 -1
- package/src/pipeline-spec.ts +5 -5
- package/src/plugin.ts +4 -0
- package/src/points-lines/__tests__/points-lines.bench.ts +17 -8
- package/src/points-lines/__tests__/view-ubo.unit.test.ts +2 -1
- package/src/prepare/prepared-graphics-resolver.ts +2 -0
- package/src/record/__tests__/main-pass-geometry.unit.test.ts +30 -0
- package/src/record/__tests__/sprite-material-abi.unit.test.ts +1 -1
- package/src/record/__tests__/temporal-payload.unit.test.ts +3 -2
- package/src/record/__tests__/transparent-group2-selection.unit.test.ts +11 -0
- package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +1 -0
- package/src/record/__tests__/view-ubo-layout.unit.test.ts +4 -3
- package/src/record/barrel-distortion-frame.ts +110 -0
- package/src/record/dynamic-geometry-consumption.ts +39 -9
- package/src/record/fold-buckets.ts +852 -0
- package/src/record/fold-instance-buffer.ts +51 -0
- package/src/record/frame-lighting.ts +36 -2
- package/src/record/frame-snapshot.ts +44 -4
- package/src/record/frame-targets.ts +10 -6
- package/src/record/frame.ts +373 -1099
- package/src/record/gpu-draw-receipts.ts +38 -0
- package/src/record/gpu-timing.ts +48 -5
- package/src/record/main-pass-geometry.ts +281 -83
- package/src/record/main-pass-material.ts +66 -4
- package/src/record/main-pass-sprite-draws.ts +13 -66
- package/src/record/main-pass.ts +156 -20
- package/src/record/mesh-ssbo.ts +43 -6
- package/src/record/motion-blur-receipt.ts +91 -0
- package/src/record/probe-blend-buffer.ts +180 -0
- package/src/record/recovery-pipeline.ts +35 -3
- package/src/record/render-context.ts +51 -31
- package/src/record/shadow-pass.ts +36 -2
- package/src/record/skybox-post-pass.ts +150 -200
- package/src/record/typed-frame-graph.ts +824 -44
- package/src/record/view-ubo.ts +26 -3
- package/src/record/volume-params.ts +225 -0
- package/src/recovery/render-system-candidate.ts +257 -52
- package/src/reflection/record-owner.ts +7 -3
- package/src/render-contract.ts +71 -8
- package/src/render-graph-primitives.ts +7 -1
- package/src/render-pipeline.ts +136 -1
- package/src/render-system-extract-tail.ts +72 -60
- package/src/render-system-extract.ts +117 -87
- package/src/render-system-presentation.ts +56 -0
- package/src/render-system-producer-roots.ts +96 -0
- package/src/render-system-residency.ts +159 -0
- package/src/render-system.ts +601 -482
- package/src/scene/probe-blend.ts +96 -4
- package/src/scene/render-scene.ts +431 -281
- package/src/ssao-buffers.ts +95 -2
- package/src/surface/__tests__/dynamic-input.unit.test.ts +374 -0
- package/src/surface/__tests__/gpu-driven.unit.test.ts +87 -0
- package/src/surface/dynamic-input.ts +658 -0
- package/src/surface/gpu-driven.ts +147 -0
- package/src/surface/submission-observation.ts +517 -0
- package/src/systems/skin-palette-allocator.ts +4 -1
- package/src/temporal/__tests__/temporal-frame-transaction.unit.test.ts +36 -0
- package/src/temporal/frame-coordinator.ts +8 -1
- package/src/temporal/frame.ts +20 -0
- package/src/temporal/gpu.ts +101 -17
- package/src/temporal/inspection.ts +7 -1
- package/src/temporal/standard-scene-data.ts +5 -0
- package/src/temporal/target-coverage-attachment.ts +4 -0
- package/src/temporal/view.ts +13 -2
- package/src/transmission/__tests__/single-layer-medium.unit.test.ts +149 -0
- package/src/transmission/__tests__/standard-transmission.dawn.test.ts +12 -11
- package/src/transmission/single-layer-medium.ts +322 -0
- package/src/typed-render-graph-primitives.ts +191 -50
- package/src/volume/component.ts +10 -10
- package/src/volume/extract.ts +11 -5
- package/src/volume/inspection.ts +3 -0
- package/src/volume/passes.ts +95 -8
- package/src/volume/resources.ts +2 -1
- package/src/volume/temporal.ts +11 -0
- package/dist/chunk-4NNZQCL3.mjs.map +0 -1
- package/dist/chunk-6TFBXLRJ.mjs.map +0 -1
- package/dist/chunk-DRR7D3KX.mjs.map +0 -1
- package/dist/chunk-GWCEMDVR.mjs.map +0 -1
- package/dist/chunk-JCIRYQ4V.mjs.map +0 -1
- package/dist/chunk-JRIPCMYC.mjs.map +0 -1
- package/dist/chunk-LULCA3OF.mjs +0 -1713
- package/dist/chunk-LULCA3OF.mjs.map +0 -1
- package/dist/chunk-PA5DRJNI.mjs.map +0 -1
|
@@ -0,0 +1,589 @@
|
|
|
1
|
+
import { expect, it } from 'vitest';
|
|
2
|
+
import { MOTION_BLUR_COMPUTE_WGSL } from '../features/motion-blur/motion-blur-feature';
|
|
3
|
+
|
|
4
|
+
// The ordinary render project intentionally does not install browser WebGPU
|
|
5
|
+
// globals. Keep this maintained Dawn assertion portable across the `render`
|
|
6
|
+
// and `dawn` Vitest projects by using the WebGPU spec's stable bit values.
|
|
7
|
+
const COMPUTE_STAGE = 0x4;
|
|
8
|
+
const TEXTURE_COPY_SRC = 0x1;
|
|
9
|
+
const TEXTURE_COPY_DST = 0x2;
|
|
10
|
+
const TEXTURE_BINDING = 0x4;
|
|
11
|
+
const STORAGE_BINDING = 0x8;
|
|
12
|
+
const BUFFER_MAP_READ = 0x1;
|
|
13
|
+
const BUFFER_COPY_DST = 0x8;
|
|
14
|
+
const BUFFER_UNIFORM = 0x40;
|
|
15
|
+
const BUFFER_STORAGE = 0x80;
|
|
16
|
+
|
|
17
|
+
type MotionBlurProbe = {
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly motionHalf: number;
|
|
20
|
+
readonly motionHalfY?: number;
|
|
21
|
+
readonly maxRadius: number;
|
|
22
|
+
readonly receiverX: number;
|
|
23
|
+
readonly receiverY?: number;
|
|
24
|
+
readonly width: number;
|
|
25
|
+
readonly height: number;
|
|
26
|
+
readonly moverStart: number;
|
|
27
|
+
readonly moverEnd: number;
|
|
28
|
+
readonly moverYStart?: number;
|
|
29
|
+
readonly moverYEnd?: number;
|
|
30
|
+
readonly expectNonZero?: boolean;
|
|
31
|
+
readonly sampleCount?: number;
|
|
32
|
+
readonly expectedRowEnergy?: number;
|
|
33
|
+
readonly expectedTotalEnergy?: number;
|
|
34
|
+
readonly energyTolerance?: number;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const PROBES: readonly MotionBlurProbe[] = [
|
|
38
|
+
{
|
|
39
|
+
name: 'short vector reaches a static receiver beside the mover',
|
|
40
|
+
motionHalf: 0x3400,
|
|
41
|
+
maxRadius: 32,
|
|
42
|
+
receiverX: 30,
|
|
43
|
+
width: 65,
|
|
44
|
+
height: 16,
|
|
45
|
+
moverStart: 32,
|
|
46
|
+
moverEnd: 35,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'long vector reaches a static receiver through an adjacent tile',
|
|
50
|
+
motionHalf: 0x3c00,
|
|
51
|
+
maxRadius: 64,
|
|
52
|
+
receiverX: 30,
|
|
53
|
+
width: 64,
|
|
54
|
+
height: 16,
|
|
55
|
+
moverStart: 32,
|
|
56
|
+
moverEnd: 35,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'long vector reaches a static receiver at the support boundary tile',
|
|
60
|
+
motionHalf: 0x4000,
|
|
61
|
+
maxRadius: 64,
|
|
62
|
+
receiverX: 30,
|
|
63
|
+
width: 128,
|
|
64
|
+
height: 16,
|
|
65
|
+
moverStart: 86,
|
|
66
|
+
moverEnd: 89,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'cap32 derives the positive offset-plus-two tile',
|
|
70
|
+
motionHalf: 0x4400,
|
|
71
|
+
maxRadius: 32,
|
|
72
|
+
receiverX: 30,
|
|
73
|
+
width: 64,
|
|
74
|
+
height: 16,
|
|
75
|
+
// The seven support taps reserve one receiver slot. For radius32 the
|
|
76
|
+
// +18.3 pixel tap lands in this tile-3 strip, exercising the +2 tile
|
|
77
|
+
// summary walk without relying on a hand-picked unreachable pixel.
|
|
78
|
+
moverStart: 48,
|
|
79
|
+
moverEnd: 51,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'cap64 derives the positive offset-plus-two tile',
|
|
83
|
+
motionHalf: 0x4400,
|
|
84
|
+
maxRadius: 64,
|
|
85
|
+
receiverX: 30,
|
|
86
|
+
width: 64,
|
|
87
|
+
height: 16,
|
|
88
|
+
// For radius64 the bounded +18.3 pixel tap also lands in tile 3.
|
|
89
|
+
moverStart: 48,
|
|
90
|
+
moverEnd: 51,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'cap32 derives the positive diagonal offset-plus-two tile',
|
|
94
|
+
motionHalf: 0x4400,
|
|
95
|
+
motionHalfY: 0x4400,
|
|
96
|
+
maxRadius: 32,
|
|
97
|
+
receiverX: 14,
|
|
98
|
+
receiverY: 14,
|
|
99
|
+
width: 64,
|
|
100
|
+
height: 64,
|
|
101
|
+
// The capped +45 degree support tap lands at (32,32), in tile (2,2), which is
|
|
102
|
+
// the diagonal +2 candidate from receiver tile (0,0).
|
|
103
|
+
moverStart: 32,
|
|
104
|
+
moverEnd: 35,
|
|
105
|
+
moverYStart: 32,
|
|
106
|
+
moverYEnd: 35,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'diagonal card conserves total energy at 4 taps',
|
|
110
|
+
motionHalf: 0x4000,
|
|
111
|
+
motionHalfY: 0x4000,
|
|
112
|
+
maxRadius: 32,
|
|
113
|
+
receiverX: 0,
|
|
114
|
+
receiverY: 0,
|
|
115
|
+
width: 64,
|
|
116
|
+
height: 64,
|
|
117
|
+
moverStart: 30,
|
|
118
|
+
moverEnd: 33,
|
|
119
|
+
moverYStart: 30,
|
|
120
|
+
moverYEnd: 33,
|
|
121
|
+
expectNonZero: false,
|
|
122
|
+
sampleCount: 4,
|
|
123
|
+
expectedTotalEnergy: 16,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'diagonal card conserves total energy at 8 taps',
|
|
127
|
+
motionHalf: 0x4000,
|
|
128
|
+
motionHalfY: 0x4000,
|
|
129
|
+
maxRadius: 32,
|
|
130
|
+
receiverX: 0,
|
|
131
|
+
receiverY: 0,
|
|
132
|
+
width: 64,
|
|
133
|
+
height: 64,
|
|
134
|
+
moverStart: 30,
|
|
135
|
+
moverEnd: 33,
|
|
136
|
+
moverYStart: 30,
|
|
137
|
+
moverYEnd: 33,
|
|
138
|
+
expectNonZero: false,
|
|
139
|
+
sampleCount: 8,
|
|
140
|
+
expectedTotalEnergy: 16,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: 'diagonal card conserves total energy at 16 taps',
|
|
144
|
+
motionHalf: 0x4000,
|
|
145
|
+
motionHalfY: 0x4000,
|
|
146
|
+
maxRadius: 32,
|
|
147
|
+
receiverX: 0,
|
|
148
|
+
receiverY: 0,
|
|
149
|
+
width: 64,
|
|
150
|
+
height: 64,
|
|
151
|
+
moverStart: 30,
|
|
152
|
+
moverEnd: 33,
|
|
153
|
+
moverYStart: 30,
|
|
154
|
+
moverYEnd: 33,
|
|
155
|
+
expectNonZero: false,
|
|
156
|
+
sampleCount: 16,
|
|
157
|
+
expectedTotalEnergy: 16,
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'horizontal card conserves total energy on a square canvas',
|
|
161
|
+
motionHalf: 0x4000,
|
|
162
|
+
maxRadius: 32,
|
|
163
|
+
receiverX: 0,
|
|
164
|
+
receiverY: 0,
|
|
165
|
+
width: 128,
|
|
166
|
+
height: 128,
|
|
167
|
+
moverStart: 62,
|
|
168
|
+
moverEnd: 65,
|
|
169
|
+
moverYStart: 62,
|
|
170
|
+
moverYEnd: 65,
|
|
171
|
+
expectNonZero: false,
|
|
172
|
+
sampleCount: 8,
|
|
173
|
+
expectedTotalEnergy: 16,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'vertical card conserves total energy on a square canvas',
|
|
177
|
+
motionHalf: 0,
|
|
178
|
+
motionHalfY: 0x4000,
|
|
179
|
+
maxRadius: 32,
|
|
180
|
+
receiverX: 0,
|
|
181
|
+
receiverY: 0,
|
|
182
|
+
width: 128,
|
|
183
|
+
height: 128,
|
|
184
|
+
moverStart: 62,
|
|
185
|
+
moverEnd: 65,
|
|
186
|
+
moverYStart: 62,
|
|
187
|
+
moverYEnd: 65,
|
|
188
|
+
expectNonZero: false,
|
|
189
|
+
sampleCount: 8,
|
|
190
|
+
expectedTotalEnergy: 16,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: 'cap64 derives the negative offset-plus-one tile',
|
|
194
|
+
motionHalf: 0xc000,
|
|
195
|
+
maxRadius: 64,
|
|
196
|
+
receiverX: 110,
|
|
197
|
+
width: 128,
|
|
198
|
+
height: 16,
|
|
199
|
+
moverStart: 91,
|
|
200
|
+
moverEnd: 94,
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: 'cap32 rejects a tile outside the support boundary',
|
|
204
|
+
motionHalf: 0x4000,
|
|
205
|
+
maxRadius: 32,
|
|
206
|
+
receiverX: 30,
|
|
207
|
+
width: 128,
|
|
208
|
+
height: 16,
|
|
209
|
+
moverStart: 102,
|
|
210
|
+
moverEnd: 105,
|
|
211
|
+
expectNonZero: false,
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: 'long vector preserves energy at half-cell translation 0',
|
|
215
|
+
motionHalf: 0x4000,
|
|
216
|
+
maxRadius: 32,
|
|
217
|
+
receiverX: 30,
|
|
218
|
+
width: 128,
|
|
219
|
+
height: 16,
|
|
220
|
+
moverStart: 62,
|
|
221
|
+
moverEnd: 65,
|
|
222
|
+
expectNonZero: false,
|
|
223
|
+
expectedRowEnergy: 4,
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: 'long vector preserves energy at half-cell translation 1',
|
|
227
|
+
motionHalf: 0x4000,
|
|
228
|
+
maxRadius: 32,
|
|
229
|
+
receiverX: 30,
|
|
230
|
+
width: 128,
|
|
231
|
+
height: 16,
|
|
232
|
+
moverStart: 63,
|
|
233
|
+
moverEnd: 66,
|
|
234
|
+
expectNonZero: false,
|
|
235
|
+
expectedRowEnergy: 4,
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: 'long vector preserves energy at half-cell translation 2',
|
|
239
|
+
motionHalf: 0x4000,
|
|
240
|
+
maxRadius: 32,
|
|
241
|
+
receiverX: 30,
|
|
242
|
+
width: 128,
|
|
243
|
+
height: 16,
|
|
244
|
+
moverStart: 64,
|
|
245
|
+
moverEnd: 67,
|
|
246
|
+
expectNonZero: false,
|
|
247
|
+
expectedRowEnergy: 4,
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: 'long vector preserves energy at half-cell translation 3',
|
|
251
|
+
motionHalf: 0x4000,
|
|
252
|
+
maxRadius: 32,
|
|
253
|
+
receiverX: 30,
|
|
254
|
+
width: 128,
|
|
255
|
+
height: 16,
|
|
256
|
+
moverStart: 65,
|
|
257
|
+
moverEnd: 68,
|
|
258
|
+
expectNonZero: false,
|
|
259
|
+
expectedRowEnergy: 4,
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: 'long vector preserves energy at half-cell translation 4',
|
|
263
|
+
motionHalf: 0x4000,
|
|
264
|
+
maxRadius: 32,
|
|
265
|
+
receiverX: 30,
|
|
266
|
+
width: 128,
|
|
267
|
+
height: 16,
|
|
268
|
+
moverStart: 66,
|
|
269
|
+
moverEnd: 69,
|
|
270
|
+
expectNonZero: false,
|
|
271
|
+
expectedRowEnergy: 4,
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: 'cap64 sparse source closes the bounded midpoint gap at 4 taps',
|
|
275
|
+
motionHalf: 0x4000,
|
|
276
|
+
maxRadius: 64,
|
|
277
|
+
receiverX: 30,
|
|
278
|
+
width: 128,
|
|
279
|
+
height: 16,
|
|
280
|
+
moverStart: 54,
|
|
281
|
+
moverEnd: 57,
|
|
282
|
+
sampleCount: 4,
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: 'cap64 sparse source preserves row energy at 8 taps',
|
|
286
|
+
motionHalf: 0x4000,
|
|
287
|
+
maxRadius: 64,
|
|
288
|
+
receiverX: 30,
|
|
289
|
+
width: 128,
|
|
290
|
+
height: 16,
|
|
291
|
+
moverStart: 54,
|
|
292
|
+
moverEnd: 57,
|
|
293
|
+
sampleCount: 8,
|
|
294
|
+
expectedRowEnergy: 4,
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
name: 'cap64 sparse source remains reachable at 16 taps',
|
|
298
|
+
motionHalf: 0x4000,
|
|
299
|
+
maxRadius: 64,
|
|
300
|
+
receiverX: 30,
|
|
301
|
+
width: 128,
|
|
302
|
+
height: 16,
|
|
303
|
+
moverStart: 54,
|
|
304
|
+
moverEnd: 57,
|
|
305
|
+
sampleCount: 16,
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: 'cap64 full support conserves energy at 4 taps',
|
|
309
|
+
motionHalf: 0x4000,
|
|
310
|
+
maxRadius: 64,
|
|
311
|
+
receiverX: 30,
|
|
312
|
+
width: 256,
|
|
313
|
+
height: 16,
|
|
314
|
+
moverStart: 126,
|
|
315
|
+
moverEnd: 129,
|
|
316
|
+
expectNonZero: false,
|
|
317
|
+
sampleCount: 4,
|
|
318
|
+
expectedRowEnergy: 4,
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: 'cap64 full support conserves energy at 8 taps',
|
|
322
|
+
motionHalf: 0x4000,
|
|
323
|
+
maxRadius: 64,
|
|
324
|
+
receiverX: 30,
|
|
325
|
+
width: 256,
|
|
326
|
+
height: 16,
|
|
327
|
+
moverStart: 126,
|
|
328
|
+
moverEnd: 129,
|
|
329
|
+
expectNonZero: false,
|
|
330
|
+
sampleCount: 8,
|
|
331
|
+
expectedRowEnergy: 4,
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
name: 'cap64 full support conserves energy at 16 taps',
|
|
335
|
+
motionHalf: 0x4000,
|
|
336
|
+
maxRadius: 64,
|
|
337
|
+
receiverX: 30,
|
|
338
|
+
width: 256,
|
|
339
|
+
height: 16,
|
|
340
|
+
moverStart: 126,
|
|
341
|
+
moverEnd: 129,
|
|
342
|
+
expectNonZero: false,
|
|
343
|
+
sampleCount: 16,
|
|
344
|
+
expectedRowEnergy: 4,
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: 'cap64 full support keeps translated phase energy',
|
|
348
|
+
motionHalf: 0x4000,
|
|
349
|
+
maxRadius: 64,
|
|
350
|
+
receiverX: 30,
|
|
351
|
+
width: 256,
|
|
352
|
+
height: 16,
|
|
353
|
+
moverStart: 127,
|
|
354
|
+
moverEnd: 130,
|
|
355
|
+
expectNonZero: false,
|
|
356
|
+
sampleCount: 8,
|
|
357
|
+
expectedRowEnergy: 4,
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
name: 'cap64 full support keeps reverse motion energy',
|
|
361
|
+
motionHalf: 0xc000,
|
|
362
|
+
maxRadius: 64,
|
|
363
|
+
receiverX: 94,
|
|
364
|
+
width: 256,
|
|
365
|
+
height: 16,
|
|
366
|
+
moverStart: 126,
|
|
367
|
+
moverEnd: 129,
|
|
368
|
+
sampleCount: 8,
|
|
369
|
+
expectedRowEnergy: 4,
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
name: 'cap64 translated sparse source stays reachable in view',
|
|
373
|
+
motionHalf: 0x4000,
|
|
374
|
+
maxRadius: 64,
|
|
375
|
+
receiverX: 94,
|
|
376
|
+
width: 256,
|
|
377
|
+
height: 16,
|
|
378
|
+
moverStart: 118,
|
|
379
|
+
moverEnd: 121,
|
|
380
|
+
sampleCount: 8,
|
|
381
|
+
expectedRowEnergy: 4,
|
|
382
|
+
},
|
|
383
|
+
];
|
|
384
|
+
|
|
385
|
+
const COPY_BYTES_PER_ROW_ALIGNMENT = 256;
|
|
386
|
+
|
|
387
|
+
it.each(PROBES)('production compute lane: $name', async ({
|
|
388
|
+
name,
|
|
389
|
+
motionHalf,
|
|
390
|
+
maxRadius,
|
|
391
|
+
receiverX,
|
|
392
|
+
receiverY = 8,
|
|
393
|
+
width,
|
|
394
|
+
height,
|
|
395
|
+
moverStart,
|
|
396
|
+
moverEnd,
|
|
397
|
+
moverYStart = 0,
|
|
398
|
+
moverYEnd = height - 1,
|
|
399
|
+
motionHalfY = 0,
|
|
400
|
+
expectNonZero = true,
|
|
401
|
+
sampleCount = 8,
|
|
402
|
+
expectedRowEnergy,
|
|
403
|
+
expectedTotalEnergy,
|
|
404
|
+
energyTolerance = 0.03,
|
|
405
|
+
}) => {
|
|
406
|
+
const adapter = await globalThis.navigator.gpu.requestAdapter();
|
|
407
|
+
if (adapter === null)
|
|
408
|
+
throw new Error('Dawn adapter unavailable for Motion Blur production probe');
|
|
409
|
+
const device = await adapter.requestDevice();
|
|
410
|
+
device.pushErrorScope('validation');
|
|
411
|
+
const module = device.createShaderModule({ code: MOTION_BLUR_COMPUTE_WGSL });
|
|
412
|
+
const compilation = await module.getCompilationInfo();
|
|
413
|
+
const errors = compilation.messages.filter((message) => message.type === 'error');
|
|
414
|
+
expect(errors, errors.map((message) => message.message).join('\n')).toHaveLength(0);
|
|
415
|
+
|
|
416
|
+
const layout = device.createBindGroupLayout({
|
|
417
|
+
entries: [
|
|
418
|
+
{ binding: 0, visibility: COMPUTE_STAGE, texture: { sampleType: 'float' } },
|
|
419
|
+
{ binding: 1, visibility: COMPUTE_STAGE, texture: { sampleType: 'float' } },
|
|
420
|
+
{ binding: 2, visibility: COMPUTE_STAGE, buffer: { type: 'storage' } },
|
|
421
|
+
{
|
|
422
|
+
binding: 3,
|
|
423
|
+
visibility: COMPUTE_STAGE,
|
|
424
|
+
storageTexture: { access: 'write-only', format: 'rgba16float' },
|
|
425
|
+
},
|
|
426
|
+
{ binding: 4, visibility: COMPUTE_STAGE, buffer: { type: 'uniform' } },
|
|
427
|
+
],
|
|
428
|
+
});
|
|
429
|
+
const pipelineLayout = device.createPipelineLayout({ bindGroupLayouts: [layout] });
|
|
430
|
+
const summary = device.createComputePipeline({
|
|
431
|
+
layout: pipelineLayout,
|
|
432
|
+
compute: { module, entryPoint: 'tile_summary' },
|
|
433
|
+
});
|
|
434
|
+
const reconstruct = device.createComputePipeline({
|
|
435
|
+
layout: pipelineLayout,
|
|
436
|
+
compute: { module, entryPoint: 'reconstruct' },
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
const texture = (usage: number) =>
|
|
440
|
+
device.createTexture({
|
|
441
|
+
size: { width, height, depthOrArrayLayers: 1 },
|
|
442
|
+
format: 'rgba16float',
|
|
443
|
+
usage,
|
|
444
|
+
});
|
|
445
|
+
const color = texture(TEXTURE_BINDING | TEXTURE_COPY_DST);
|
|
446
|
+
const temporal = texture(TEXTURE_BINDING | TEXTURE_COPY_DST);
|
|
447
|
+
const output = texture(STORAGE_BINDING | TEXTURE_COPY_SRC);
|
|
448
|
+
const colorData = new Uint16Array(width * height * 4);
|
|
449
|
+
const temporalData = new Uint16Array(width * height * 4);
|
|
450
|
+
for (let y = 0; y < height; y += 1) {
|
|
451
|
+
for (let x = 0; x < width; x += 1) {
|
|
452
|
+
const index = (y * width + x) * 4;
|
|
453
|
+
const mover = x >= moverStart && x <= moverEnd && y >= moverYStart && y <= moverYEnd;
|
|
454
|
+
colorData[index] = mover ? 0x3c00 : 0;
|
|
455
|
+
colorData[index + 1] = mover ? 0x3c00 : 0;
|
|
456
|
+
colorData[index + 2] = mover ? 0x3c00 : 0;
|
|
457
|
+
colorData[index + 3] = 0x3c00;
|
|
458
|
+
temporalData[index] = mover ? motionHalf : 0;
|
|
459
|
+
temporalData[index + 1] = mover ? motionHalfY : 0;
|
|
460
|
+
temporalData[index + 2] = mover ? 0x4000 : 0x4400;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
device.queue.writeTexture(
|
|
464
|
+
{ texture: color },
|
|
465
|
+
colorData,
|
|
466
|
+
{ bytesPerRow: width * 8, rowsPerImage: height },
|
|
467
|
+
{ width, height, depthOrArrayLayers: 1 },
|
|
468
|
+
);
|
|
469
|
+
device.queue.writeTexture(
|
|
470
|
+
{ texture: temporal },
|
|
471
|
+
temporalData,
|
|
472
|
+
{ bytesPerRow: width * 8, rowsPerImage: height },
|
|
473
|
+
{ width, height, depthOrArrayLayers: 1 },
|
|
474
|
+
);
|
|
475
|
+
const tileSummary = device.createBuffer({
|
|
476
|
+
size: Math.ceil(width / 16) * Math.ceil(height / 16) * 32,
|
|
477
|
+
usage: BUFFER_STORAGE,
|
|
478
|
+
});
|
|
479
|
+
const params = device.createBuffer({
|
|
480
|
+
size: 32,
|
|
481
|
+
usage: BUFFER_UNIFORM | BUFFER_COPY_DST,
|
|
482
|
+
});
|
|
483
|
+
const paramsData = new ArrayBuffer(32);
|
|
484
|
+
const paramsView = new DataView(paramsData);
|
|
485
|
+
paramsView.setFloat32(0, 180, true);
|
|
486
|
+
paramsView.setFloat32(4, maxRadius, true);
|
|
487
|
+
paramsView.setUint32(8, sampleCount, true);
|
|
488
|
+
paramsView.setFloat32(16, 60, true);
|
|
489
|
+
paramsView.setFloat32(20, 1, true);
|
|
490
|
+
paramsView.setFloat32(24, 1 / 60, true);
|
|
491
|
+
device.queue.writeBuffer(params, 0, paramsData);
|
|
492
|
+
const bindGroup = device.createBindGroup({
|
|
493
|
+
layout,
|
|
494
|
+
entries: [
|
|
495
|
+
{ binding: 0, resource: color.createView() },
|
|
496
|
+
{ binding: 1, resource: temporal.createView() },
|
|
497
|
+
{ binding: 2, resource: { buffer: tileSummary } },
|
|
498
|
+
{ binding: 3, resource: output.createView() },
|
|
499
|
+
{ binding: 4, resource: { buffer: params } },
|
|
500
|
+
],
|
|
501
|
+
});
|
|
502
|
+
const readback = device.createBuffer({
|
|
503
|
+
size:
|
|
504
|
+
Math.ceil((width * 8) / COPY_BYTES_PER_ROW_ALIGNMENT) * COPY_BYTES_PER_ROW_ALIGNMENT * height,
|
|
505
|
+
usage: BUFFER_COPY_DST | BUFFER_MAP_READ,
|
|
506
|
+
});
|
|
507
|
+
const readbackBytesPerRow =
|
|
508
|
+
Math.ceil((width * 8) / COPY_BYTES_PER_ROW_ALIGNMENT) * COPY_BYTES_PER_ROW_ALIGNMENT;
|
|
509
|
+
try {
|
|
510
|
+
const encoder = device.createCommandEncoder();
|
|
511
|
+
const summaryPass = encoder.beginComputePass();
|
|
512
|
+
summaryPass.setPipeline(summary);
|
|
513
|
+
summaryPass.setBindGroup(0, bindGroup);
|
|
514
|
+
summaryPass.dispatchWorkgroups(Math.ceil(width / 16), Math.ceil(height / 16));
|
|
515
|
+
summaryPass.end();
|
|
516
|
+
const reconstructPass = encoder.beginComputePass();
|
|
517
|
+
reconstructPass.setPipeline(reconstruct);
|
|
518
|
+
reconstructPass.setBindGroup(0, bindGroup);
|
|
519
|
+
reconstructPass.dispatchWorkgroups(Math.ceil(width / 8), Math.ceil(height / 8));
|
|
520
|
+
reconstructPass.end();
|
|
521
|
+
encoder.copyTextureToBuffer(
|
|
522
|
+
{ texture: output },
|
|
523
|
+
{ buffer: readback, bytesPerRow: readbackBytesPerRow, rowsPerImage: height },
|
|
524
|
+
{ width, height, depthOrArrayLayers: 1 },
|
|
525
|
+
);
|
|
526
|
+
device.queue.submit([encoder.finish()]);
|
|
527
|
+
await device.queue.onSubmittedWorkDone();
|
|
528
|
+
const validationError = await device.popErrorScope();
|
|
529
|
+
expect(validationError, `${name} emitted a Dawn validation error`).toBeNull();
|
|
530
|
+
await readback.mapAsync(BUFFER_MAP_READ);
|
|
531
|
+
const result = new Uint16Array(readback.getMappedRange());
|
|
532
|
+
const receiver = result[receiverY * (readbackBytesPerRow / 2) + receiverX * 4];
|
|
533
|
+
if (expectNonZero) {
|
|
534
|
+
expect(
|
|
535
|
+
receiver,
|
|
536
|
+
`${name} output was black at receiver (${receiverX},${receiverY})`,
|
|
537
|
+
).toBeGreaterThan(0);
|
|
538
|
+
} else {
|
|
539
|
+
expect(receiver, `${name} outside-support receiver unexpectedly received motion`).toBe(0);
|
|
540
|
+
}
|
|
541
|
+
const decodeFloat16 = (bits: number | undefined): number => {
|
|
542
|
+
if (bits === undefined) throw new Error('Readback omitted a required pixel');
|
|
543
|
+
const sign = (bits & 0x8000) === 0 ? 1 : -1;
|
|
544
|
+
const exponent = (bits >>> 10) & 0x1f;
|
|
545
|
+
const mantissa = bits & 0x03ff;
|
|
546
|
+
if (exponent === 0) return sign * 2 ** -14 * (mantissa / 1024);
|
|
547
|
+
if (exponent === 0x1f) return Number.POSITIVE_INFINITY;
|
|
548
|
+
return sign * 2 ** (exponent - 15) * (1 + mantissa / 1024);
|
|
549
|
+
};
|
|
550
|
+
if (expectedRowEnergy !== undefined) {
|
|
551
|
+
const rowEnergy = Array.from({ length: width }, (_, x) => {
|
|
552
|
+
const bits = result[receiverY * (readbackBytesPerRow / 2) + x * 4];
|
|
553
|
+
if (bits === undefined) throw new Error(`${name} row readback is truncated at x=${x}`);
|
|
554
|
+
return decodeFloat16(bits);
|
|
555
|
+
}).reduce((sum, value) => sum + value, 0);
|
|
556
|
+
const relativeError =
|
|
557
|
+
Math.abs(rowEnergy - expectedRowEnergy) / Math.max(expectedRowEnergy, 1);
|
|
558
|
+
expect(
|
|
559
|
+
relativeError,
|
|
560
|
+
`${name} row energy ${rowEnergy} differs from ${expectedRowEnergy}`,
|
|
561
|
+
).toBeLessThanOrEqual(energyTolerance);
|
|
562
|
+
}
|
|
563
|
+
if (expectedTotalEnergy !== undefined) {
|
|
564
|
+
const totalEnergy = Array.from({ length: height }, (_, y) =>
|
|
565
|
+
Array.from({ length: width }, (_, x) => {
|
|
566
|
+
const bits = result[y * (readbackBytesPerRow / 2) + x * 4];
|
|
567
|
+
if (bits === undefined)
|
|
568
|
+
throw new Error(`${name} total readback is truncated at y=${y}, x=${x}`);
|
|
569
|
+
return decodeFloat16(bits);
|
|
570
|
+
}).reduce((sum, value) => sum + value, 0),
|
|
571
|
+
).reduce((sum, value) => sum + value, 0);
|
|
572
|
+
const relativeError =
|
|
573
|
+
Math.abs(totalEnergy - expectedTotalEnergy) / Math.max(expectedTotalEnergy, 1);
|
|
574
|
+
expect(
|
|
575
|
+
relativeError,
|
|
576
|
+
`${name} total energy ${totalEnergy} differs from ${expectedTotalEnergy}`,
|
|
577
|
+
).toBeLessThanOrEqual(energyTolerance);
|
|
578
|
+
}
|
|
579
|
+
readback.unmap();
|
|
580
|
+
} finally {
|
|
581
|
+
readback.destroy();
|
|
582
|
+
tileSummary.destroy();
|
|
583
|
+
params.destroy();
|
|
584
|
+
color.destroy();
|
|
585
|
+
temporal.destroy();
|
|
586
|
+
output.destroy();
|
|
587
|
+
device.destroy();
|
|
588
|
+
}
|
|
589
|
+
});
|
|
@@ -84,8 +84,8 @@ describe('motion blur visual evidence contract', () => {
|
|
|
84
84
|
expect(entry.falsifier.provenance.length).toBeGreaterThan(0);
|
|
85
85
|
expect(entry.positive.confidence).toBeGreaterThanOrEqual(0);
|
|
86
86
|
expect(entry.falsifier.confidence).toBeGreaterThanOrEqual(0);
|
|
87
|
-
expect(entry.positive.coverage.dawnFrames).toBeGreaterThanOrEqual(
|
|
88
|
-
expect(entry.positive.coverage.browserFrames).toBeGreaterThanOrEqual(
|
|
87
|
+
expect(entry.positive.coverage.dawnFrames).toBeGreaterThanOrEqual(60);
|
|
88
|
+
expect(entry.positive.coverage.browserFrames).toBeGreaterThanOrEqual(60);
|
|
89
89
|
expect(entry.positive.coverage.frames).toBe(entry.positive.coverage.dawnFrames);
|
|
90
90
|
expect(entry.positive.coverage).toEqual({
|
|
91
91
|
frames: entry.positive.coverage.frames,
|
|
@@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
|
|
3
3
|
import { describe, expect, it } from 'vitest';
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const foldSource = readFileSync(new URL('../record/fold-buckets.ts', import.meta.url), 'utf8');
|
|
6
6
|
const materialSource = readFileSync(
|
|
7
7
|
new URL('../record/main-pass-material.ts', import.meta.url),
|
|
8
8
|
'utf8',
|
|
@@ -10,9 +10,9 @@ const materialSource = readFileSync(
|
|
|
10
10
|
|
|
11
11
|
describe('9-slice handle ownership', () => {
|
|
12
12
|
it('derives the lookup key from the canonical asset-runtime handle', () => {
|
|
13
|
-
expect(
|
|
14
|
-
expect(
|
|
15
|
-
expect(
|
|
13
|
+
expect(foldSource).toContain('handleSlot(HANDLE_NINESLICE_QUAD)');
|
|
14
|
+
expect(foldSource).toContain('r.assetHandle > handleSlot(HANDLE_NINESLICE_QUAD)');
|
|
15
|
+
expect(foldSource).not.toMatch(/BUILTIN_MESH_ID_MAX/);
|
|
16
16
|
expect(materialSource).not.toMatch(/NINESLICE_QUAD_RAW_ID\s*=/);
|
|
17
17
|
expect(materialSource).not.toMatch(/BUILTIN_MESH_ID_MAX\s*=/);
|
|
18
18
|
});
|
|
@@ -13,4 +13,13 @@ describe('PBR view bind-group layout', () => {
|
|
|
13
13
|
.map((entry) => entry.binding),
|
|
14
14
|
).toEqual([0, 10]);
|
|
15
15
|
});
|
|
16
|
+
|
|
17
|
+
it('omits cloud shadow bindings on the minimum sampled-texture profile', () => {
|
|
18
|
+
const entries = buildPbrViewBglEntries({
|
|
19
|
+
storageBuffer: true,
|
|
20
|
+
extendedLighting: false,
|
|
21
|
+
projectorAvailable: false,
|
|
22
|
+
});
|
|
23
|
+
expect(entries.some((entry) => entry.binding === 16 || entry.binding === 17)).toBe(false);
|
|
24
|
+
});
|
|
16
25
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
1
3
|
import { STANDARD_PIPELINE_PARAM_SCHEMA } from '@forgeax/engine-shader';
|
|
2
4
|
import { describe, expect, it } from 'vitest';
|
|
3
5
|
import { GPU_SHADER_STAGE_FRAGMENT, GPU_SHADER_STAGE_VERTEX } from '../gpu-stage.js';
|
|
@@ -125,4 +127,60 @@ describe('Standard clearcoat root contract', () => {
|
|
|
125
127
|
47,
|
|
126
128
|
]);
|
|
127
129
|
});
|
|
130
|
+
|
|
131
|
+
it('derives the single-layer medium depth and nearest inputs at the shader bindings', () => {
|
|
132
|
+
const descriptor = buildBindGroupLayoutDescriptor(
|
|
133
|
+
{
|
|
134
|
+
shader: {
|
|
135
|
+
id: 'forgeax::single-layer-medium',
|
|
136
|
+
passKind: 'forward',
|
|
137
|
+
variantSet: undefined,
|
|
138
|
+
},
|
|
139
|
+
attachments: { colorFormats: [], depthFormat: undefined, sampleCount: 1 },
|
|
140
|
+
geometry: { topology: 'triangle-list', vertexLayout: {} },
|
|
141
|
+
renderState: undefined,
|
|
142
|
+
},
|
|
143
|
+
{ kind: 'pbr-material-merged', materialParamSchema: [] },
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
expect(descriptor.entries.map((entry) => entry.binding)).toEqual([
|
|
147
|
+
...Array.from({ length: 16 }, (_, binding) => binding),
|
|
148
|
+
46,
|
|
149
|
+
]);
|
|
150
|
+
expect(descriptor.entries[10]).toMatchObject({
|
|
151
|
+
sampler: { type: 'non-filtering' },
|
|
152
|
+
});
|
|
153
|
+
expect(descriptor.entries[11]).toMatchObject({
|
|
154
|
+
texture: { sampleType: 'unfilterable-float', viewDimension: '2d' },
|
|
155
|
+
});
|
|
156
|
+
expect(descriptor.entries[12]).toMatchObject({
|
|
157
|
+
sampler: { type: 'filtering' },
|
|
158
|
+
});
|
|
159
|
+
expect(descriptor.entries[13]).toMatchObject({
|
|
160
|
+
texture: { sampleType: 'float', viewDimension: '2d' },
|
|
161
|
+
});
|
|
162
|
+
expect(descriptor.entries[14]).toMatchObject({
|
|
163
|
+
sampler: { type: 'non-filtering' },
|
|
164
|
+
});
|
|
165
|
+
expect(descriptor.entries[15]).toMatchObject({
|
|
166
|
+
texture: { sampleType: 'unfilterable-float', viewDimension: '2d' },
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// The medium is a project material artifact with an explicit empty
|
|
170
|
+
// paramSchema. Its per-shader user region is therefore the reserved UBO
|
|
171
|
+
// at binding 0, followed by IBL 1..7, transmission 8..9, and Surface
|
|
172
|
+
// resources 10..15. Keep this source assertion next to the descriptor
|
|
173
|
+
// assertion so a future injection-order change cannot leave a compiled
|
|
174
|
+
// WGSL binding map out of sync with the runtime BGL.
|
|
175
|
+
const source = readFileSync(
|
|
176
|
+
resolve(import.meta.dirname, '../../../shader/src/single-layer-medium.wgsl'),
|
|
177
|
+
'utf8',
|
|
178
|
+
);
|
|
179
|
+
expect(source).toContain('@group(1) @binding(10) var surfaceRawDepthSampler');
|
|
180
|
+
expect(source).toContain('@group(1) @binding(11) var surfaceRawDepthTexture');
|
|
181
|
+
expect(source).toContain('@group(1) @binding(12) var surfaceNearestLayerSampler');
|
|
182
|
+
expect(source).toContain('@group(1) @binding(13) var surfaceNearestLayerTexture');
|
|
183
|
+
expect(source).toContain('@group(1) @binding(14) var surfaceNearestDepthSampler');
|
|
184
|
+
expect(source).toContain('@group(1) @binding(15) var surfaceNearestDepthTexture');
|
|
185
|
+
});
|
|
128
186
|
});
|