@forgeax/engine-render 0.1.33 → 0.1.35
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 +1062 -127
- 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/device-feature-admission.d.ts +2 -2
- 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/host-contract.d.ts +6 -5
- package/dist/assembly/host-contract.d.ts.map +1 -1
- 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/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/render-target-host.d.ts +5 -0
- package/dist/assembly/render-target-host.d.ts.map +1 -1
- 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/webgpu-pbr-ready.d.ts +1 -0
- package/dist/assembly/webgpu-pbr-ready.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 +1 -1
- 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 +2 -1
- package/dist/assembly/webgpu-renderer.d.ts.map +1 -1
- package/dist/authoring.mjs +2 -4
- package/dist/authoring.mjs.map +1 -1
- package/dist/barrel-distortion.d.ts +47 -0
- package/dist/barrel-distortion.d.ts.map +1 -0
- package/dist/chunk-3XUBWRY2.mjs +1842 -0
- package/dist/chunk-3XUBWRY2.mjs.map +1 -0
- package/dist/{chunk-OO3DRYK7.mjs → chunk-G6HDNGY7.mjs} +2400 -1767
- package/dist/chunk-G6HDNGY7.mjs.map +1 -0
- package/dist/{chunk-ZDQWGQW7.mjs → chunk-LM5IE7GF.mjs} +4 -4
- package/dist/{chunk-ZDQWGQW7.mjs.map → chunk-LM5IE7GF.mjs.map} +1 -1
- package/dist/{chunk-VOZWDM3L.mjs → chunk-LNIUIKQ7.mjs} +1514 -498
- package/dist/chunk-LNIUIKQ7.mjs.map +1 -0
- package/dist/chunk-MXTWKZO4.mjs +3268 -0
- package/dist/chunk-MXTWKZO4.mjs.map +1 -0
- package/dist/chunk-MZ4C7EHF.mjs +6942 -0
- package/dist/chunk-MZ4C7EHF.mjs.map +1 -0
- package/dist/chunk-RIPAEGI6.mjs +48 -0
- package/dist/chunk-RIPAEGI6.mjs.map +1 -0
- package/dist/{chunk-LEAXOMYJ.mjs → chunk-SGPUJW3F.mjs} +117 -5
- package/dist/chunk-SGPUJW3F.mjs.map +1 -0
- package/dist/{chunk-PA5DRJNI.mjs → chunk-X2KA6WHM.mjs} +29 -4
- package/dist/chunk-X2KA6WHM.mjs.map +1 -0
- package/dist/{chunk-BLXGONR2.mjs → chunk-XSFB7XXQ.mjs} +51 -4
- package/dist/chunk-XSFB7XXQ.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/barrel-distortion.d.ts +13 -0
- package/dist/components/barrel-distortion.d.ts.map +1 -0
- 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/construct-renderer.d.ts +1 -1
- package/dist/construct-renderer.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +8406 -5785
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/gpu-residency.d.ts +19 -19
- 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/errors/cloud.d.ts +59 -0
- package/dist/errors/cloud.d.ts.map +1 -0
- package/dist/errors/render.d.ts +20 -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 +5 -1
- package/dist/extract/contracts.d.ts.map +1 -1
- package/dist/extract/material-context.d.ts +7 -0
- package/dist/extract/material-context.d.ts.map +1 -0
- 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 +6 -2
- package/dist/features/error-reporting.d.ts.map +1 -1
- package/dist/features/host.d.ts +15 -0
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/plan.d.ts +10 -0
- package/dist/features/plan.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 +48 -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/glyph-text-layout-system.d.ts +1 -1
- package/dist/glyph-text-layout-system.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.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 +47 -3
- 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 +26 -2
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +5 -0
- 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/frame-resources.d.ts.map +1 -1
- package/dist/ibl/skylight-bind-group.d.ts +14 -5
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -1
- package/dist/index.d.ts +30 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +780 -9
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +135 -1
- 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 +47 -100
- package/dist/instances.d.ts.map +1 -1
- package/dist/internal.mjs +7 -8
- package/dist/internal.mjs.map +1 -1
- package/dist/pbr-pipeline.d.ts +22 -4
- 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/lut-gpu.d.ts +2 -2
- package/dist/pipeline/standard-output/lut-gpu.d.ts.map +1 -1
- package/dist/pipeline/standard-output/resources.d.ts +2 -2
- package/dist/pipeline/standard-output/resources.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.map +1 -1
- package/dist/pipeline-builder.d.ts +1 -1
- package/dist/pipeline-builder.d.ts.map +1 -1
- 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/publication/contract.d.ts +77 -0
- package/dist/publication/contract.d.ts.map +1 -0
- package/dist/publication/dependencies.d.ts +7 -0
- package/dist/publication/dependencies.d.ts.map +1 -0
- package/dist/publication/prepare-geometry.d.ts +9 -0
- package/dist/publication/prepare-geometry.d.ts.map +1 -0
- package/dist/publication/programs.d.ts +5 -0
- package/dist/publication/programs.d.ts.map +1 -0
- package/dist/publication/publisher.d.ts +33 -0
- package/dist/publication/publisher.d.ts.map +1 -0
- package/dist/publication/receiver.d.ts +29 -0
- package/dist/publication/receiver.d.ts.map +1 -0
- package/dist/publication/resource-scope.d.ts +18 -0
- package/dist/publication/resource-scope.d.ts.map +1 -0
- package/dist/publication/targets.d.ts +33 -0
- package/dist/publication/targets.d.ts.map +1 -0
- package/dist/publication/video.d.ts +5 -0
- package/dist/publication/video.d.ts.map +1 -0
- 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 +43 -9
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame.d.ts +15 -65
- 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/helpers.d.ts +2 -2
- package/dist/record/helpers.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +22 -6
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +14 -10
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass-sprite-draws.d.ts +3 -16
- 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/motion-blur-receipt.d.ts +11 -0
- package/dist/record/motion-blur-receipt.d.ts.map +1 -0
- package/dist/record/prepared-material-bindings.d.ts +3 -3
- package/dist/record/prepared-material-bindings.d.ts.map +1 -1
- 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 +24 -5
- 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 +1 -1
- package/dist/record/skybox-post-pass.d.ts.map +1 -1
- package/dist/record/sprite-instance-buffer.d.ts +31 -0
- package/dist/record/sprite-instance-buffer.d.ts.map +1 -0
- package/dist/record/target-capture-graph.d.ts +19 -0
- package/dist/record/target-capture-graph.d.ts.map +1 -0
- package/dist/record/typed-frame-graph.d.ts +24 -15
- 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 +14 -4
- 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 +46 -5
- 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 +103 -2
- 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 +18 -9
- 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-projections.d.ts +3 -2
- package/dist/render-system-projections.d.ts.map +1 -1
- 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 +22 -21
- 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 +18 -7
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/scene/render-source.d.ts +42 -0
- package/dist/scene/render-source.d.ts.map +1 -0
- package/dist/scene/source-systems.d.ts +6 -0
- package/dist/scene/source-systems.d.ts.map +1 -0
- 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/systems/skin-palette-types.d.ts +10 -0
- package/dist/systems/skin-palette-types.d.ts.map +1 -1
- package/dist/systems/transparent-dispatch.d.ts +2 -2
- package/dist/systems/transparent-dispatch.d.ts.map +1 -1
- package/dist/systems/transparent-sort-config.d.ts +2 -1
- package/dist/systems/transparent-sort-config.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 +6 -7
- 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/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 +14 -2
- package/dist/typed-render-graph-primitives.d.ts.map +1 -1
- package/dist/volume/component.d.ts +9 -4
- 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/package.json +22 -21
- package/src/__tests__/atmosphere-daylight.dawn.test.ts +72 -0
- package/src/__tests__/auto-exposure-transaction.integration.test.ts +4 -9
- 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__/construct-renderer-identity.unit.test.ts +49 -0
- package/src/__tests__/detached-recovery-graph.unit.test.ts +277 -0
- package/src/__tests__/device-feature-admission.unit.test.ts +3 -2
- 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__/factory-contract.integration.test.ts +295 -45
- package/src/__tests__/feature-depth-input.dawn.test.ts +129 -2
- 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-material-artifacts.unit.test.ts +143 -0
- package/src/__tests__/gpu-driven-pbr.dawn.test.ts +5 -6
- package/src/__tests__/gpu-driven-production.integration.test.ts +482 -3
- package/src/__tests__/gpu-driven-shadow-views.dawn.test.ts +6 -5
- package/src/__tests__/gpu-driven-view-gpu-evidence.ts +94 -6
- 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-scene.unit.test.ts +119 -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 +97 -305
- package/src/__tests__/instances-world-ownership.integration.test.ts +62 -0
- package/src/__tests__/ktx2-basis-gpu-consumer.dawn.test.ts +4 -1
- package/src/__tests__/main-pass-material-medium-selection.unit.test.ts +145 -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__/materials-standard-contract.unit.test.ts +0 -1
- 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 +13 -7
- 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 +66 -8
- package/src/__tests__/physical-material-budget.unit.test.ts +40 -0
- package/src/__tests__/prepared-graphics-capability.unit.test.ts +66 -2
- package/src/__tests__/probe-bindings.unit.test.ts +582 -1
- package/src/__tests__/probe-scene-dirty.integration.test.ts +28 -1
- 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 +8 -0
- package/src/__tests__/render-feature-diagnostics.unit.test.ts +15 -2
- package/src/__tests__/render-feature-error-reporting.unit.test.ts +21 -1
- 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-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 +20 -20
- 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 +42 -8
- package/src/__tests__/renderer-frame-generation-fence.integration.test.ts +16 -0
- package/src/__tests__/renderer-frame-transaction.integration.test.ts +26 -10
- package/src/__tests__/resource-allocation.unit.test.ts +123 -0
- 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 +15 -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-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.integration.test.ts +182 -1
- 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__/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 +4 -2
- package/src/__tests__/volumetric-fog-budget-recovery.integration.test.ts +30 -20
- 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 +113 -9
- package/src/__tests__/volumetric-fog-topology.unit.test.ts +5 -3
- 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/device-feature-admission.ts +2 -2
- 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/host-contract.ts +8 -5
- 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/recovery/device-loss-fanout.ts +13 -0
- package/src/assembly/recovery/renderer-recover.ts +50 -18
- package/src/assembly/render-feature-post-processes.ts +54 -0
- package/src/assembly/render-target-host.ts +57 -47
- package/src/assembly/renderer-facade.ts +7 -2
- 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 +3 -3
- package/src/assembly/webgpu-pbr-ready.ts +9 -1
- package/src/assembly/webgpu-ready-per-pass.ts +104 -0
- package/src/assembly/webgpu-ready.ts +116 -62
- 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 +303 -313
- package/src/assembly/webgpu-vertex-layouts.ts +1 -1
- package/src/barrel-distortion.ts +247 -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/barrel-distortion.ts +46 -0
- 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/sprite-instances.ts +1 -1
- package/src/construct-renderer.ts +1 -1
- package/src/device/gpu-residency.ts +26 -25
- package/src/dynamic-geometry.ts +12 -1
- package/src/errors/cloud.ts +103 -0
- package/src/errors/render.ts +47 -8
- package/src/examples/single-layer-medium-surface.ts +59 -0
- package/src/extract/camera.ts +15 -1
- package/src/extract/contracts.ts +5 -0
- package/src/extract/material-context.ts +21 -0
- package/src/features/barrel-distortion.ts +172 -0
- package/src/features/error-reporting.ts +26 -6
- package/src/features/host.ts +128 -19
- package/src/features/plan.ts +10 -0
- package/src/features/render-graph-contribution.ts +9 -0
- package/src/features/render-graph-raster.ts +45 -3
- package/src/features/targets.ts +66 -0
- package/src/features/types.ts +51 -0
- package/src/fullscreen-post-process-pass.ts +41 -9
- package/src/glyph-text-layout-system.ts +2 -2
- package/src/gpu-dirty-ranges.ts +48 -0
- package/src/gpu-driven/batch-topology.ts +53 -0
- package/src/gpu-driven/material-artifacts.ts +33 -25
- package/src/gpu-driven/prepared-draw.ts +12 -4
- package/src/gpu-driven/production-raster-material.ts +1894 -0
- package/src/gpu-driven/production-raster.ts +825 -784
- 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 +164 -10
- package/src/gpu-scene.ts +75 -84
- package/src/hdrp-buffers.ts +4 -3
- package/src/ibl/frame-resources.ts +0 -1
- package/src/ibl/skylight-bind-group.ts +62 -32
- package/src/index.ts +205 -9
- package/src/inspection-types.ts +162 -0
- package/src/instance-buffer-cache.ts +4 -4
- package/src/instances.ts +152 -569
- package/src/pbr-pipeline.ts +230 -30
- 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/lut-gpu.ts +3 -3
- package/src/pipeline/standard-output/resources.ts +2 -2
- package/src/pipeline/standard-output/types.ts +12 -1
- package/src/pipeline/standard-pipeline.ts +291 -18
- package/src/pipeline/standard-post.ts +90 -24
- package/src/pipeline-builder.ts +1 -1
- package/src/plugin.ts +4 -0
- package/src/points-lines/__tests__/points-lines.bench.ts +17 -8
- package/src/prepare/prepared-graphics-resolver.ts +2 -0
- package/src/publication/__tests__/derived-geometry.integration.test.ts +177 -0
- package/src/publication/__tests__/features.integration.test.ts +122 -0
- package/src/publication/__tests__/programs.unit.test.ts +25 -0
- package/src/publication/__tests__/publication.integration.test.ts +370 -0
- package/src/publication/__tests__/targets.integration.test.ts +120 -0
- package/src/publication/__tests__/video.browser.test.ts +50 -0
- package/src/publication/contract.ts +104 -0
- package/src/publication/dependencies.ts +54 -0
- package/src/publication/prepare-geometry.ts +94 -0
- package/src/publication/programs.ts +45 -0
- package/src/publication/publisher.ts +618 -0
- package/src/publication/receiver.ts +297 -0
- package/src/publication/resource-scope.ts +31 -0
- package/src/publication/targets.ts +182 -0
- package/src/publication/video.ts +33 -0
- package/src/record/__tests__/main-pass-geometry.unit.test.ts +30 -0
- package/src/record/__tests__/material-bg-cache.unit.test.ts +15 -1
- package/src/record/__tests__/sprite-material-abi.unit.test.ts +9 -11
- package/src/record/__tests__/temporal-payload.unit.test.ts +1 -1
- 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__/video-texture-view.unit.test.ts +9 -9
- 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 +855 -0
- package/src/record/fold-instance-buffer.ts +51 -0
- package/src/record/frame-lighting.ts +36 -2
- package/src/record/frame-snapshot.ts +45 -9
- package/src/record/frame.ts +258 -1105
- package/src/record/gpu-draw-receipts.ts +38 -0
- package/src/record/gpu-timing.ts +48 -5
- package/src/record/helpers.ts +2 -2
- package/src/record/main-pass-geometry.ts +272 -84
- package/src/record/main-pass-material.ts +102 -36
- package/src/record/main-pass-sprite-draws.ts +13 -217
- package/src/record/main-pass.ts +164 -27
- package/src/record/motion-blur-receipt.ts +91 -0
- package/src/record/prepared-material-bindings.ts +11 -6
- package/src/record/probe-blend-buffer.ts +180 -0
- package/src/record/recovery-pipeline.ts +35 -3
- package/src/record/render-context.ts +41 -5
- package/src/record/shadow-pass.ts +30 -4
- package/src/record/skybox-post-pass.ts +28 -4
- package/src/record/sprite-instance-buffer.ts +155 -0
- package/src/record/target-capture-graph.ts +258 -0
- package/src/record/typed-frame-graph.ts +776 -340
- package/src/record/view-ubo.ts +27 -4
- package/src/record/volume-params.ts +225 -0
- package/src/recovery/render-system-candidate.ts +243 -50
- package/src/reflection/record-owner.ts +7 -3
- package/src/render-contract.ts +54 -5
- package/src/render-graph-primitives.ts +7 -1
- package/src/render-pipeline.ts +130 -0
- package/src/render-system-extract-tail.ts +90 -78
- package/src/render-system-extract.ts +76 -76
- package/src/render-system-presentation.ts +56 -0
- package/src/render-system-producer-roots.ts +96 -0
- package/src/render-system-projections.ts +3 -2
- package/src/render-system-residency.ts +159 -0
- package/src/render-system.ts +421 -408
- package/src/scene/probe-blend.ts +96 -4
- package/src/scene/render-scene.ts +416 -337
- package/src/scene/render-source.ts +90 -0
- package/src/scene/source-systems.ts +33 -0
- 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 +5 -1
- package/src/systems/skin-palette-types.ts +11 -0
- package/src/systems/transparent-dispatch.ts +2 -2
- package/src/systems/transparent-sort-config.ts +3 -1
- 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/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 +70 -2
- package/src/volume/component.ts +10 -9
- package/src/volume/extract.ts +11 -5
- package/src/volume/inspection.ts +3 -0
- package/src/volume/passes.ts +87 -4
- package/src/volume/resources.ts +2 -1
- package/dist/chunk-3RTCJTH4.mjs +0 -1610
- package/dist/chunk-3RTCJTH4.mjs.map +0 -1
- package/dist/chunk-BLXGONR2.mjs.map +0 -1
- package/dist/chunk-ILQ5MEZF.mjs +0 -32
- package/dist/chunk-ILQ5MEZF.mjs.map +0 -1
- package/dist/chunk-LEAXOMYJ.mjs.map +0 -1
- package/dist/chunk-NB2S7ZRX.mjs +0 -1783
- package/dist/chunk-NB2S7ZRX.mjs.map +0 -1
- package/dist/chunk-NNQL7CB3.mjs +0 -1713
- package/dist/chunk-NNQL7CB3.mjs.map +0 -1
- package/dist/chunk-OO3DRYK7.mjs.map +0 -1
- package/dist/chunk-PA5DRJNI.mjs.map +0 -1
- package/dist/chunk-PLAXOOX5.mjs +0 -1907
- package/dist/chunk-PLAXOOX5.mjs.map +0 -1
- package/dist/chunk-RXZ3RGOU.mjs +0 -53
- package/dist/chunk-RXZ3RGOU.mjs.map +0 -1
- package/dist/chunk-VOZWDM3L.mjs.map +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/** Closed errors produced by the CloudLayer authoring and resource route. */
|
|
2
|
+
|
|
3
|
+
export interface CloudLayerInvalidParameterDetail {
|
|
4
|
+
readonly field: string;
|
|
5
|
+
readonly value: unknown;
|
|
6
|
+
readonly expected: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export class CloudLayerInvalidParameterError extends Error {
|
|
10
|
+
readonly code = 'cloud-layer-invalid-parameter' as const;
|
|
11
|
+
readonly expected: string;
|
|
12
|
+
readonly hint: string;
|
|
13
|
+
readonly detail: CloudLayerInvalidParameterDetail;
|
|
14
|
+
|
|
15
|
+
constructor(field: string, value: unknown, expected: string) {
|
|
16
|
+
super(`CloudLayer.${field} is invalid`);
|
|
17
|
+
this.name = 'CloudLayerInvalidParameterError';
|
|
18
|
+
this.expected = `CloudLayer.${field} must be ${expected}`;
|
|
19
|
+
this.hint = `set CloudLayer.${field} to ${expected}`;
|
|
20
|
+
this.detail = { field, value, expected };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface CloudLayerOwnerConflictDetail {
|
|
25
|
+
readonly count: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class CloudLayerOwnerConflictError extends Error {
|
|
29
|
+
readonly code = 'cloud-layer-owner-conflict' as const;
|
|
30
|
+
readonly expected = 'at most one CloudLayer owns a World frame';
|
|
31
|
+
readonly hint = 'remove additional CloudLayer owners before extraction';
|
|
32
|
+
readonly detail: CloudLayerOwnerConflictDetail;
|
|
33
|
+
|
|
34
|
+
constructor(count: number) {
|
|
35
|
+
super(`CloudLayer owner cardinality is ${count}`);
|
|
36
|
+
this.name = 'CloudLayerOwnerConflictError';
|
|
37
|
+
this.detail = { count };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface CloudLayerCacheInvalidDetail {
|
|
42
|
+
readonly sourceKey: string;
|
|
43
|
+
readonly reason: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export class CloudLayerCacheInvalidError extends Error {
|
|
47
|
+
readonly code = 'cloud-layer-cache-invalid' as const;
|
|
48
|
+
readonly expected = 'the density cache payload matches its reconstructible source';
|
|
49
|
+
readonly hint = 'discard the derived cache and rebuild it from CloudLayer source facts';
|
|
50
|
+
readonly detail: CloudLayerCacheInvalidDetail;
|
|
51
|
+
|
|
52
|
+
constructor(sourceKey: string, reason: string) {
|
|
53
|
+
super(`CloudLayer cache is invalid: ${reason}`);
|
|
54
|
+
this.name = 'CloudLayerCacheInvalidError';
|
|
55
|
+
this.detail = { sourceKey, reason };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface CloudLayerCapabilityMissingDetail {
|
|
60
|
+
readonly capability: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export class CloudLayerCapabilityMissingError extends Error {
|
|
64
|
+
readonly code = 'cloud-layer-capability-missing' as const;
|
|
65
|
+
readonly expected = 'the selected backend exposes the capability required by the cloud lane';
|
|
66
|
+
readonly hint =
|
|
67
|
+
'inspect the capability report, disable the cloud lane on this backend, or retry on a backend with the required capability';
|
|
68
|
+
readonly detail: CloudLayerCapabilityMissingDetail;
|
|
69
|
+
|
|
70
|
+
constructor(capability: string) {
|
|
71
|
+
super(`CloudLayer capability is unavailable: ${capability}`);
|
|
72
|
+
this.name = 'CloudLayerCapabilityMissingError';
|
|
73
|
+
this.detail = { capability };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface CloudLayerResourceFailureDetail {
|
|
78
|
+
readonly stage: 'cache' | 'shadow' | 'view' | 'history' | 'retire';
|
|
79
|
+
readonly generation: number;
|
|
80
|
+
readonly cause?: unknown;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export class CloudLayerResourceFailureError extends Error {
|
|
84
|
+
readonly code = 'cloud-layer-resource-failed' as const;
|
|
85
|
+
readonly expected = 'cloud resources are created, submitted and retired as one generation';
|
|
86
|
+
readonly hint = 'keep the last-known-good cloud generation and retry after recovery';
|
|
87
|
+
readonly detail: CloudLayerResourceFailureDetail;
|
|
88
|
+
|
|
89
|
+
constructor(detail: CloudLayerResourceFailureDetail) {
|
|
90
|
+
super(`CloudLayer ${detail.stage} resource failed at generation ${detail.generation}`);
|
|
91
|
+
this.name = 'CloudLayerResourceFailureError';
|
|
92
|
+
this.detail = detail;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type CloudLayerError =
|
|
97
|
+
| CloudLayerInvalidParameterError
|
|
98
|
+
| CloudLayerOwnerConflictError
|
|
99
|
+
| CloudLayerCacheInvalidError
|
|
100
|
+
| CloudLayerCapabilityMissingError
|
|
101
|
+
| CloudLayerResourceFailureError;
|
|
102
|
+
|
|
103
|
+
export type CloudLayerErrorCode = CloudLayerError['code'];
|
package/src/errors/render.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RenderPublicationError } from '../publication/contract';
|
|
1
2
|
// @forgeax/engine-render -- render cluster error classes.
|
|
2
3
|
//
|
|
3
4
|
// feat-20260704-runtime-tier1-decomposition M2 / w8 (D-3): the monolithic
|
|
@@ -30,6 +31,7 @@ import type {
|
|
|
30
31
|
import type { AutoExposureError } from '../pipeline/standard-output/auto-exposure/inspection';
|
|
31
32
|
import type { SceneDataLane, SceneDataSchemaId } from '../temporal/scene-data';
|
|
32
33
|
import type { TransmissionCapabilityFact } from '../transmission/backdrop';
|
|
34
|
+
import type { CloudLayerError } from './cloud';
|
|
33
35
|
import type { RecoveryOutcome, RecoveryPhase } from './recover';
|
|
34
36
|
|
|
35
37
|
// Public render errors keep one machine-readable order: closed `code`,
|
|
@@ -561,7 +563,7 @@ export class PointShadowAtlasBoundsViolationError extends Error {
|
|
|
561
563
|
* Fired by the per-frame record stage (`videoTextureView`) when a VideoPlayer
|
|
562
564
|
* entity can reach neither video upload path this frame: the general
|
|
563
565
|
* `copyExternalImageToTexture` path (no host HTMLVideoElement resolved via
|
|
564
|
-
* `
|
|
566
|
+
* `VideoSourceProvider`) AND the high-perf `GPUExternalTexture` path
|
|
565
567
|
* (capability absent). The engine surfaces this explicit failure rather than
|
|
566
568
|
* silently rendering a stale/garbage texture (charter P3, plan-strategy D-6).
|
|
567
569
|
* - `.code = 'video-upload-unsupported'`
|
|
@@ -1392,6 +1394,27 @@ export type DynamicResolutionError =
|
|
|
1392
1394
|
| DynamicResolutionRequiresTaaError
|
|
1393
1395
|
| DynamicResolutionTimingUnavailableError;
|
|
1394
1396
|
|
|
1397
|
+
export interface BarrelDistortionInvalidParameterDetail {
|
|
1398
|
+
readonly field: 'width' | 'height' | 'strength' | 'centerX' | 'centerY';
|
|
1399
|
+
readonly value: number;
|
|
1400
|
+
readonly expected: string;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
export class BarrelDistortionInvalidParameterError extends Error {
|
|
1404
|
+
readonly code = 'barrel-distortion-invalid-parameter' as const;
|
|
1405
|
+
readonly expected: string;
|
|
1406
|
+
readonly hint: string;
|
|
1407
|
+
readonly detail: BarrelDistortionInvalidParameterDetail;
|
|
1408
|
+
|
|
1409
|
+
constructor(detail: BarrelDistortionInvalidParameterDetail) {
|
|
1410
|
+
super(`BarrelDistortion.${detail.field} is invalid`);
|
|
1411
|
+
this.name = 'BarrelDistortionInvalidParameterError';
|
|
1412
|
+
this.expected = `BarrelDistortion.${detail.field} must be ${detail.expected}`;
|
|
1413
|
+
this.hint = `set BarrelDistortion.${detail.field} to a value that is ${detail.expected}`;
|
|
1414
|
+
this.detail = detail;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1395
1418
|
export interface OwnerStageFailedDetail {
|
|
1396
1419
|
readonly owner: 'environment' | 'temporal' | 'fog' | 'renderer';
|
|
1397
1420
|
readonly stage: 'extract' | 'prepare' | 'record' | 'finish' | 'submit';
|
|
@@ -1839,8 +1862,8 @@ export interface VolumeOwnerConflictDetail {
|
|
|
1839
1862
|
|
|
1840
1863
|
export class VolumeOwnerConflictError extends Error {
|
|
1841
1864
|
readonly code = 'volume-owner-conflict' as const;
|
|
1842
|
-
readonly expected = '
|
|
1843
|
-
readonly hint = '
|
|
1865
|
+
readonly expected = 'at most eight local VolumetricFog owners per rendered World';
|
|
1866
|
+
readonly hint = 'reduce simultaneously visible volume owners and retry extraction';
|
|
1844
1867
|
readonly detail: VolumeOwnerConflictDetail;
|
|
1845
1868
|
|
|
1846
1869
|
constructor(ownerCount: number) {
|
|
@@ -1894,13 +1917,26 @@ export interface VolumeInvalidParametersDetail {
|
|
|
1894
1917
|
export class VolumeInvalidParametersError extends Error {
|
|
1895
1918
|
readonly code = 'volume-invalid-parameters' as const;
|
|
1896
1919
|
readonly expected = 'volume parameters remain finite and inside their closed ranges';
|
|
1897
|
-
readonly hint = 'repair extinction, albedo, emission, anisotropy, or
|
|
1920
|
+
readonly hint = 'repair extinction, albedo, emission, anisotropy, maxDistance, or sampling';
|
|
1898
1921
|
readonly detail: VolumeInvalidParametersDetail;
|
|
1899
1922
|
|
|
1900
|
-
constructor(input: {
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1923
|
+
constructor(input: {
|
|
1924
|
+
readonly maxDistance?: number;
|
|
1925
|
+
readonly anisotropy?: number;
|
|
1926
|
+
readonly sampling?: string;
|
|
1927
|
+
}) {
|
|
1928
|
+
const invalidSampling =
|
|
1929
|
+
input.sampling !== undefined && input.sampling !== 'noise' && input.sampling !== 'density';
|
|
1930
|
+
const field = invalidSampling
|
|
1931
|
+
? 'sampling'
|
|
1932
|
+
: input.maxDistance !== undefined && input.maxDistance <= 0
|
|
1933
|
+
? 'maxDistance'
|
|
1934
|
+
: 'parameters';
|
|
1935
|
+
const value = invalidSampling
|
|
1936
|
+
? input.sampling
|
|
1937
|
+
: field === 'maxDistance'
|
|
1938
|
+
? input.maxDistance
|
|
1939
|
+
: input.anisotropy;
|
|
1904
1940
|
super(`volume-invalid-parameters: ${field} is outside the authored range`);
|
|
1905
1941
|
this.name = 'VolumeInvalidParametersError';
|
|
1906
1942
|
this.detail = { field, value };
|
|
@@ -1945,6 +1981,7 @@ export type RenderErrorCode = RenderError['code'];
|
|
|
1945
1981
|
* `RenderErrorCode` discriminant on `.code`.
|
|
1946
1982
|
*/
|
|
1947
1983
|
export type RenderError =
|
|
1984
|
+
| RenderPublicationError
|
|
1948
1985
|
| LifecycleConstructionError
|
|
1949
1986
|
| AutoExposureError
|
|
1950
1987
|
| RendererExpectedOperationError
|
|
@@ -1981,6 +2018,8 @@ export type RenderError =
|
|
|
1981
2018
|
| TaaCapsInsufficientError
|
|
1982
2019
|
| EnvironmentGenerationFailedError
|
|
1983
2020
|
| AtmosphereInvalidParameterError
|
|
2021
|
+
| BarrelDistortionInvalidParameterError
|
|
2022
|
+
| CloudLayerError
|
|
1984
2023
|
| DynamicResolutionInvalidParameterError
|
|
1985
2024
|
| DynamicResolutionRequiresTaaError
|
|
1986
2025
|
| DynamicResolutionTimingUnavailableError
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { MaterialRootAsset } from '@forgeax/engine-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A public root asset showing the model declaration and its bounded input.
|
|
5
|
+
* The page is shared by every material instance; Render supplies the page
|
|
6
|
+
* bytes and each instance publishes its own range.
|
|
7
|
+
*/
|
|
8
|
+
export const SINGLE_LAYER_MEDIUM_SURFACE_EXAMPLE = {
|
|
9
|
+
kind: 'material',
|
|
10
|
+
surface: {
|
|
11
|
+
model: 'single-layer-medium',
|
|
12
|
+
module: 'game::water_surface_a',
|
|
13
|
+
dynamicInput: {
|
|
14
|
+
name: 'waterEvents',
|
|
15
|
+
fields: [
|
|
16
|
+
{ name: 'position', type: 'vec3<f32>' },
|
|
17
|
+
{ name: 'time', type: 'f32' },
|
|
18
|
+
{ name: 'eventId', type: 'u32' },
|
|
19
|
+
],
|
|
20
|
+
maxRecords: 64,
|
|
21
|
+
maxDomains: 8,
|
|
22
|
+
maxPageBytes: 2048,
|
|
23
|
+
maxBindings: 1,
|
|
24
|
+
maxEventsPerSample: 8,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
passes: [
|
|
28
|
+
{
|
|
29
|
+
name: 'color',
|
|
30
|
+
program: { module: 'forgeax::single-layer-medium' },
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
parameters: [],
|
|
34
|
+
values: {},
|
|
35
|
+
} as const satisfies MaterialRootAsset;
|
|
36
|
+
|
|
37
|
+
/** Two different imported Surface implementations consuming one model ABI. */
|
|
38
|
+
export const SINGLE_LAYER_MEDIUM_SURFACE_EXAMPLES = [
|
|
39
|
+
{
|
|
40
|
+
module: 'game::water_surface_a',
|
|
41
|
+
source: `#define_import_path game::water_surface_a
|
|
42
|
+
#import forgeax_material::single_layer_medium_surface_v1::{SingleLayerMediumSurfaceInput, SingleLayerMediumSurfaceData}
|
|
43
|
+
fn evaluate_surface(input : SingleLayerMediumSurfaceInput) -> SingleLayerMediumSurfaceData {
|
|
44
|
+
let event = read_waterEvents(input.eventRangeStart);
|
|
45
|
+
let normal = normalize(input.geometricNormalWS + vec3<f32>(0.0, 0.0, event.time * 0.02));
|
|
46
|
+
return SingleLayerMediumSurfaceData(normal, 0.18, 1.0, 0.0, vec3<f32>(0.18, 0.06, 0.02), vec3<f32>(0.02, 0.04, 0.08), 1.333, 0.2, 1000.0);
|
|
47
|
+
}`,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
module: 'game::water_surface_b',
|
|
51
|
+
source: `#define_import_path game::water_surface_b
|
|
52
|
+
#import forgeax_material::single_layer_medium_surface_v1::{SingleLayerMediumSurfaceInput, SingleLayerMediumSurfaceData}
|
|
53
|
+
fn evaluate_surface(input : SingleLayerMediumSurfaceInput) -> SingleLayerMediumSurfaceData {
|
|
54
|
+
let event = read_waterEvents(input.eventRangeStart);
|
|
55
|
+
let normal = normalize(input.geometricNormalWS + vec3<f32>(event.position.xy * 0.01, 0.0));
|
|
56
|
+
return SingleLayerMediumSurfaceData(normal, 0.32, 1.0, clamp(event.time * 0.1, 0.0, 1.0), vec3<f32>(0.04, 0.02, 0.01), vec3<f32>(0.08, 0.05, 0.02), 1.333, -0.1, 800.0);
|
|
57
|
+
}`,
|
|
58
|
+
},
|
|
59
|
+
] as const;
|
package/src/extract/camera.ts
CHANGED
|
@@ -2,6 +2,10 @@ import type { EntityHandle, World } from '@forgeax/engine-ecs';
|
|
|
2
2
|
import { readRenderArrayView } from '@forgeax/engine-ecs/projection';
|
|
3
3
|
import { mat4, vec3 } from '@forgeax/engine-math';
|
|
4
4
|
import { GlobalTransform } from '@forgeax/engine-scene';
|
|
5
|
+
import {
|
|
6
|
+
BarrelDistortion,
|
|
7
|
+
validateBarrelDistortionParameters,
|
|
8
|
+
} from '../components/barrel-distortion';
|
|
5
9
|
import {
|
|
6
10
|
antialiasFromF32,
|
|
7
11
|
Camera,
|
|
@@ -38,13 +42,20 @@ export function extractCameraSnapshots(world: World): CameraSnapshot[] {
|
|
|
38
42
|
const cameraQuery = world
|
|
39
43
|
.query({
|
|
40
44
|
read: [Camera],
|
|
41
|
-
optional: [
|
|
45
|
+
optional: [
|
|
46
|
+
MotionBlur,
|
|
47
|
+
DynamicResolution,
|
|
48
|
+
ScreenSpaceReflection,
|
|
49
|
+
DepthOfField,
|
|
50
|
+
BarrelDistortion,
|
|
51
|
+
],
|
|
42
52
|
with: [GlobalTransform],
|
|
43
53
|
})
|
|
44
54
|
.unwrap();
|
|
45
55
|
for (const row of cameraQuery) {
|
|
46
56
|
const cam = row.get(Camera);
|
|
47
57
|
const motionBlur = row.get(MotionBlur);
|
|
58
|
+
const barrelDistortion = row.get(BarrelDistortion);
|
|
48
59
|
const motionBlurResult = resolveMotionBlurParams(motionBlur);
|
|
49
60
|
if (!motionBlurResult.ok) throw motionBlurResult.error;
|
|
50
61
|
const motionBlurParams = motionBlurResult.value;
|
|
@@ -75,6 +86,8 @@ export function extractCameraSnapshots(world: World): CameraSnapshot[] {
|
|
|
75
86
|
const antialias = antialiasFromF32(cam.antialias);
|
|
76
87
|
const dynamicResolutionResult = validateDynamicResolutionCamera(dynamicResolution, antialias);
|
|
77
88
|
if (!dynamicResolutionResult.ok) throw dynamicResolutionResult.error;
|
|
89
|
+
const barrelDistortionResult = validateBarrelDistortionParameters(barrelDistortion);
|
|
90
|
+
if (!barrelDistortionResult.ok) throw barrelDistortionResult.error;
|
|
78
91
|
cameras.push({
|
|
79
92
|
entityKey: entity as number,
|
|
80
93
|
historyVersion: cam.historyVersion,
|
|
@@ -128,6 +141,7 @@ export function extractCameraSnapshots(world: World): CameraSnapshot[] {
|
|
|
128
141
|
targetFps: motionBlurParams.targetFps,
|
|
129
142
|
},
|
|
130
143
|
}),
|
|
144
|
+
...(barrelDistortion === undefined ? {} : { barrelDistortion: barrelDistortionResult.value }),
|
|
131
145
|
...(screenSpaceReflection === undefined
|
|
132
146
|
? {}
|
|
133
147
|
: {
|
package/src/extract/contracts.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type {
|
|
|
13
13
|
MaterialAsset,
|
|
14
14
|
MaterialPass,
|
|
15
15
|
MaterialRenderState,
|
|
16
|
+
MaterialSurfaceModel,
|
|
16
17
|
MaterialTextureCoordinates,
|
|
17
18
|
MeshLodLevel,
|
|
18
19
|
ParamSchemaEntry,
|
|
@@ -652,6 +653,10 @@ export interface MaterialSnapshot {
|
|
|
652
653
|
readonly baseColor: Vec3;
|
|
653
654
|
readonly metallic: number;
|
|
654
655
|
readonly roughness: number;
|
|
656
|
+
/** Root-owned Surface model used only for typed pass routing. */
|
|
657
|
+
readonly surfaceModel?: MaterialSurfaceModel | undefined;
|
|
658
|
+
/** Whether this material publishes a Deferred pass consumed before the forward-only lane. */
|
|
659
|
+
readonly deferredPass?: boolean | undefined;
|
|
655
660
|
readonly clearcoat?: number | undefined;
|
|
656
661
|
readonly clearcoatRoughness?: number | undefined;
|
|
657
662
|
/** Authored Standard PBR specular tint in linear runtime color space. */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { MaterialCookProgramContext } from '@forgeax/engine-pack/material-cook';
|
|
2
|
+
import type { RhiCaps } from '@forgeax/engine-rhi';
|
|
3
|
+
|
|
4
|
+
/** The receiving device selects the immutable material program domain. */
|
|
5
|
+
export function renderMaterialContext(caps: Pick<RhiCaps, 'backendKind' | 'storageBuffer'>): {
|
|
6
|
+
readonly materialContext?: MaterialCookProgramContext;
|
|
7
|
+
} {
|
|
8
|
+
if (caps.backendKind === 'null') return {};
|
|
9
|
+
return {
|
|
10
|
+
materialContext: {
|
|
11
|
+
backend: caps.backendKind === 'wgpu-webgl2' ? 'webgl2' : caps.backendKind,
|
|
12
|
+
capability: caps.storageBuffer ? 'storage-buffer' : 'uniform-fallback',
|
|
13
|
+
pipeline: 'forward',
|
|
14
|
+
geometry: 'mesh',
|
|
15
|
+
pass: 'forward',
|
|
16
|
+
profile: 'forgeax-material-wgsl-v1',
|
|
17
|
+
toolchain: 'naga-oil',
|
|
18
|
+
instrumentation: 'none',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/** One graph-valid identity for the barrel stage, feature and shader prewarm. */
|
|
2
|
+
export const BARREL_DISTORTION_POST_PROCESS_ID = 'fullscreen.forgeax.barrel-distortion';
|
|
3
|
+
export const BARREL_DISTORTION_FEATURE_IDENTITY = BARREL_DISTORTION_POST_PROCESS_ID;
|
|
4
|
+
|
|
5
|
+
import { ok, type Result } from '@forgeax/engine-types';
|
|
6
|
+
import type { RenderError } from '../errors/render';
|
|
7
|
+
import type { RenderFeaturePlan } from './plan';
|
|
8
|
+
import type { RenderFeature, RenderFeatureExtractContext, RenderFeaturePlanContext } from './types';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The coordinate function is exported beside the production shader so a real
|
|
12
|
+
* f32 device probe can compile exactly the same implementation. Keeping the
|
|
13
|
+
* probe source here avoids a second test-only equation that could drift from
|
|
14
|
+
* the Standard pass.
|
|
15
|
+
*/
|
|
16
|
+
export const BARREL_DISTORTION_WGSL_COORDINATE = /* wgsl */ `
|
|
17
|
+
struct BarrelDistortionParams {
|
|
18
|
+
strength : f32,
|
|
19
|
+
centerX : f32,
|
|
20
|
+
centerY : f32,
|
|
21
|
+
radiusSquared : f32,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
fn barrel_distortion_display_to_scene_uv(
|
|
25
|
+
inputUv : vec2<f32>,
|
|
26
|
+
params : BarrelDistortionParams,
|
|
27
|
+
dimensions : vec2<f32>,
|
|
28
|
+
) -> vec2<f32> {
|
|
29
|
+
let aspect = dimensions.x / max(dimensions.y, 1.0);
|
|
30
|
+
let p = vec2<f32>(
|
|
31
|
+
2.0 * aspect * (inputUv.x - params.centerX),
|
|
32
|
+
2.0 * (inputUv.y - params.centerY),
|
|
33
|
+
);
|
|
34
|
+
let t = dot(p, p) / max(params.radiusSquared, 1e-6);
|
|
35
|
+
let scale = (1.0 - params.strength) / (1.0 - params.strength * t);
|
|
36
|
+
return clamp(
|
|
37
|
+
vec2<f32>(
|
|
38
|
+
params.centerX + (inputUv.x - params.centerX) * scale,
|
|
39
|
+
params.centerY + (inputUv.y - params.centerY) * scale,
|
|
40
|
+
),
|
|
41
|
+
vec2<f32>(0.0),
|
|
42
|
+
vec2<f32>(1.0),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Manifest-equivalent WGSL for the bounded analytic model. The Standard
|
|
49
|
+
* owner registers this source once and keeps the graph, encoder, and submit
|
|
50
|
+
* lifecycle shared with every other fullscreen stage.
|
|
51
|
+
*/
|
|
52
|
+
export const BARREL_DISTORTION_WGSL = /* wgsl */ `${BARREL_DISTORTION_WGSL_COORDINATE}
|
|
53
|
+
struct FullscreenOutput {
|
|
54
|
+
@builtin(position) position : vec4<f32>,
|
|
55
|
+
@location(0) uv : vec2<f32>,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
fn fullscreen_triangle(vertex_index : u32) -> FullscreenOutput {
|
|
59
|
+
var x : f32 = -1.0;
|
|
60
|
+
var y : f32 = -1.0;
|
|
61
|
+
if (vertex_index == 1u) { x = 3.0; }
|
|
62
|
+
if (vertex_index == 2u) { y = 3.0; }
|
|
63
|
+
let u : f32 = (x + 1.0) * 0.5;
|
|
64
|
+
let v : f32 = 1.0 - (y + 1.0) * 0.5;
|
|
65
|
+
var out : FullscreenOutput;
|
|
66
|
+
out.position = vec4<f32>(x, y, 0.0, 1.0);
|
|
67
|
+
out.uv = vec2<f32>(u, v);
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@group(1) @binding(0) var sceneColor : texture_2d<f32>;
|
|
72
|
+
@group(1) @binding(1) var sceneSampler : sampler;
|
|
73
|
+
|
|
74
|
+
@group(1) @binding(2) var<uniform> params : BarrelDistortionParams;
|
|
75
|
+
|
|
76
|
+
@vertex
|
|
77
|
+
fn vs_main(@builtin(vertex_index) vertex_index : u32) -> FullscreenOutput {
|
|
78
|
+
return fullscreen_triangle(vertex_index);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@fragment
|
|
82
|
+
fn fs_main(input : FullscreenOutput) -> @location(0) vec4<f32> {
|
|
83
|
+
let dimensions = vec2<f32>(textureDimensions(sceneColor));
|
|
84
|
+
let sampleUv = barrel_distortion_display_to_scene_uv(input.uv, params, dimensions);
|
|
85
|
+
return textureSampleLevel(sceneColor, sceneSampler, sampleUv, 0.0);
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Ordinary feature registration for the Standard linear-LDR stage.
|
|
91
|
+
* Standard still allocates the stage targets and chooses its position in the
|
|
92
|
+
* post chain; this feature owns the executable fullscreen declaration that is
|
|
93
|
+
* projected into that slot by the existing graph/encoder/submit path.
|
|
94
|
+
*/
|
|
95
|
+
export interface BarrelDistortionFeatureFrame {
|
|
96
|
+
/** True only when the extracted camera requires a spatial warp this frame. */
|
|
97
|
+
readonly active: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function createBarrelDistortionRenderFeature(): RenderFeature<BarrelDistortionFeatureFrame> {
|
|
101
|
+
return Object.freeze({
|
|
102
|
+
identity: BARREL_DISTORTION_FEATURE_IDENTITY,
|
|
103
|
+
requiredCapabilities: ['rgba16floatRenderable'] as const,
|
|
104
|
+
requiredFullscreenPostProcesses: [
|
|
105
|
+
{ identity: BARREL_DISTORTION_POST_PROCESS_ID, source: BARREL_DISTORTION_WGSL },
|
|
106
|
+
],
|
|
107
|
+
extract: (
|
|
108
|
+
context: RenderFeatureExtractContext,
|
|
109
|
+
): Result<BarrelDistortionFeatureFrame, RenderError> =>
|
|
110
|
+
ok({ active: (context.selectedCamera?.barrelDistortion?.strength ?? 0) > 0 }),
|
|
111
|
+
plan: (
|
|
112
|
+
data: BarrelDistortionFeatureFrame,
|
|
113
|
+
_context: RenderFeaturePlanContext,
|
|
114
|
+
): Result<RenderFeaturePlan, RenderError> =>
|
|
115
|
+
ok({
|
|
116
|
+
resources: data.active
|
|
117
|
+
? [
|
|
118
|
+
{
|
|
119
|
+
kind: 'fullscreen-program' as const,
|
|
120
|
+
name: BARREL_DISTORTION_POST_PROCESS_ID,
|
|
121
|
+
source: BARREL_DISTORTION_WGSL,
|
|
122
|
+
reads: ['ldrColor'],
|
|
123
|
+
params: { byteSize: 16, defaultValue: new Uint8Array(16) },
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
kind: 'graphics-program' as const,
|
|
127
|
+
name: 'barrel-distortion-pipeline',
|
|
128
|
+
program: {
|
|
129
|
+
shader: BARREL_DISTORTION_POST_PROCESS_ID,
|
|
130
|
+
vertexLayout: 'none',
|
|
131
|
+
colorFormats: ['rgba16float'],
|
|
132
|
+
sampleCount: 1,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
kind: 'graphics-bindings' as const,
|
|
137
|
+
name: 'barrel-distortion-bindings',
|
|
138
|
+
program: 'barrel-distortion-pipeline',
|
|
139
|
+
values: {
|
|
140
|
+
group: 1,
|
|
141
|
+
fullscreen: true,
|
|
142
|
+
shader: BARREL_DISTORTION_POST_PROCESS_ID,
|
|
143
|
+
input: 'barrel-input',
|
|
144
|
+
},
|
|
145
|
+
logicalTargets: { input: 'barrel-input' },
|
|
146
|
+
},
|
|
147
|
+
]
|
|
148
|
+
: [],
|
|
149
|
+
passes: data.active
|
|
150
|
+
? [
|
|
151
|
+
{
|
|
152
|
+
kind: 'raster' as const,
|
|
153
|
+
name: 'barrel-distortion',
|
|
154
|
+
colorAttachments: [
|
|
155
|
+
{ target: 'barrel-output', loadOp: 'clear' as const, storeOp: 'store' as const },
|
|
156
|
+
],
|
|
157
|
+
sampledTargets: ['barrel-input'],
|
|
158
|
+
draws: [
|
|
159
|
+
{
|
|
160
|
+
program: 'barrel-distortion-pipeline',
|
|
161
|
+
bindings: ['barrel-distortion-bindings'],
|
|
162
|
+
vertexData: [],
|
|
163
|
+
vertexLayout: 'none' as const,
|
|
164
|
+
draw: { kind: 'draw' as const, vertexCount: 3, instanceCount: 1 },
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
]
|
|
169
|
+
: [],
|
|
170
|
+
}),
|
|
171
|
+
});
|
|
172
|
+
}
|
|
@@ -8,22 +8,33 @@ import type { RenderError } from '../errors/render';
|
|
|
8
8
|
*/
|
|
9
9
|
export const PENDING_RENDER_FEATURE_ERROR_REPORT_INTERVAL_FRAMES = 60;
|
|
10
10
|
|
|
11
|
+
export interface PendingRenderFeatureErrorReport {
|
|
12
|
+
readonly frame: number;
|
|
13
|
+
readonly fingerprint: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
11
16
|
export function shouldReportPendingRenderFeatureError(
|
|
12
|
-
lastReportedFrame: Map<string,
|
|
17
|
+
lastReportedFrame: Map<string, PendingRenderFeatureErrorReport>,
|
|
13
18
|
key: string,
|
|
14
19
|
frameNumber: number,
|
|
20
|
+
fingerprint = '',
|
|
15
21
|
intervalFrames = PENDING_RENDER_FEATURE_ERROR_REPORT_INTERVAL_FRAMES,
|
|
16
22
|
): boolean {
|
|
17
23
|
const lastReported = lastReportedFrame.get(key);
|
|
18
|
-
if (
|
|
19
|
-
|
|
24
|
+
if (
|
|
25
|
+
lastReported !== undefined &&
|
|
26
|
+
lastReported.fingerprint === fingerprint &&
|
|
27
|
+
frameNumber - lastReported.frame < intervalFrames
|
|
28
|
+
)
|
|
29
|
+
return false;
|
|
30
|
+
lastReportedFrame.set(key, { frame: frameNumber, fingerprint });
|
|
20
31
|
return true;
|
|
21
32
|
}
|
|
22
33
|
|
|
23
34
|
export function reportPendingRenderFeatureErrors(
|
|
24
35
|
errors: readonly RenderError[],
|
|
25
36
|
frameNumber: number,
|
|
26
|
-
lastReportedFrame: Map<string,
|
|
37
|
+
lastReportedFrame: Map<string, PendingRenderFeatureErrorReport>,
|
|
27
38
|
errorRegistry: { fire(error: RenderError): void },
|
|
28
39
|
): void {
|
|
29
40
|
for (const error of errors) {
|
|
@@ -36,7 +47,16 @@ export function reportPendingRenderFeatureErrors(
|
|
|
36
47
|
// failures still receive first/periodic reporting.
|
|
37
48
|
if (isSilentRenderFeatureWarmup(error)) continue;
|
|
38
49
|
const key = pendingRenderFeatureErrorKey(error);
|
|
39
|
-
|
|
50
|
+
const cause = error.code === 'render-feature-stage-failed' ? error.detail.cause : undefined;
|
|
51
|
+
const causeText =
|
|
52
|
+
cause instanceof Error
|
|
53
|
+
? `${cause.name}\0${cause.message}`
|
|
54
|
+
: typeof cause === 'string'
|
|
55
|
+
? cause
|
|
56
|
+
: '';
|
|
57
|
+
const fingerprint = `${error.expected}\0${error.hint}\0${causeText}`;
|
|
58
|
+
// Retain one record per owner, not one record per changing cause string.
|
|
59
|
+
if (shouldReportPendingRenderFeatureError(lastReportedFrame, key, frameNumber, fingerprint)) {
|
|
40
60
|
errorRegistry.fire(error);
|
|
41
61
|
}
|
|
42
62
|
}
|
|
@@ -74,5 +94,5 @@ function pendingRenderFeatureErrorKey(error: RenderError): string {
|
|
|
74
94
|
detail !== undefined && 'order' in detail && typeof detail.order === 'number'
|
|
75
95
|
? detail.order
|
|
76
96
|
: -1;
|
|
77
|
-
return `${error.code}\0${featureIdentity}\0${order}
|
|
97
|
+
return `${error.code}\0${featureIdentity}\0${order}`;
|
|
78
98
|
}
|