@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
package/src/pbr-pipeline.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// material BGL grows from the derived user region by appending the 7
|
|
7
7
|
// Skylight resources via `mergeSkylightIntoMaterialBgl`. The
|
|
8
8
|
// unlit pipeline keeps its 7-entry material BGL (no Skylight binding
|
|
9
|
-
// 7..
|
|
9
|
+
// 7..12 contamination) so unlit demos don't carry IBL state.
|
|
10
10
|
// - charter P4: same pipeline layout shape drives Skylight present +
|
|
11
11
|
// absent paths -- AI users do not branch on Skylight existence.
|
|
12
12
|
// - feat-20260520-skylight-ibl-cubemap M4 / t59 (round-4): the
|
|
@@ -209,8 +209,8 @@ export function buildPbrMaterialUserRegionEntries(
|
|
|
209
209
|
// (group(0) bindings 3..7); this kind is the seam for
|
|
210
210
|
// each per-material shadow override surface a future feat
|
|
211
211
|
// wires onto group(1).
|
|
212
|
-
// - 'ibl' the
|
|
213
|
-
// cube + brdfLut 2d +
|
|
212
|
+
// - 'ibl' the 6 IBL / Skylight entries (irradiance / prefilter
|
|
213
|
+
// cube + brdfLut 2d + 2 samplers + intensity uniform).
|
|
214
214
|
// Used by `buildPbrPipelineLayouts` after the user-region
|
|
215
215
|
// user paramSchema entries are emitted.
|
|
216
216
|
// - 'lightmap' the 4 emissive + occlusion entries (sampler + texture
|
|
@@ -224,7 +224,7 @@ export function buildPbrMaterialUserRegionEntries(
|
|
|
224
224
|
// placeholders because their shaders do not read these slots.
|
|
225
225
|
export type InjectionKind = keyof typeof INJECTION_KIND_LENGTHS;
|
|
226
226
|
|
|
227
|
-
const IBL_INJECTION_LENGTH =
|
|
227
|
+
const IBL_INJECTION_LENGTH = 6;
|
|
228
228
|
const LIGHTMAP_INJECTION_LENGTH = 4;
|
|
229
229
|
const SHADOW_INJECTION_LENGTH = 2;
|
|
230
230
|
const TRANSMISSION_INJECTION_LENGTH = 2;
|
|
@@ -283,16 +283,10 @@ export function appendInjection(
|
|
|
283
283
|
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
284
284
|
texture: { sampleType: 'float', viewDimension: '2d' },
|
|
285
285
|
},
|
|
286
|
-
// binding start+5:
|
|
286
|
+
// binding start+5: uniform { intensity: f32 }
|
|
287
287
|
{
|
|
288
288
|
binding: start + 5,
|
|
289
289
|
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
290
|
-
sampler: { type: 'filtering' },
|
|
291
|
-
},
|
|
292
|
-
// binding start+6: uniform { intensity: f32 }
|
|
293
|
-
{
|
|
294
|
-
binding: start + 6,
|
|
295
|
-
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
296
290
|
buffer: { type: 'uniform' },
|
|
297
291
|
},
|
|
298
292
|
];
|
|
@@ -350,6 +344,51 @@ export function appendInjection(
|
|
|
350
344
|
}
|
|
351
345
|
}
|
|
352
346
|
|
|
347
|
+
/**
|
|
348
|
+
* Append the renderer-owned inputs required by the Engine single-layer
|
|
349
|
+
* medium template. They intentionally live after the normal IBL and
|
|
350
|
+
* transmission injections so authored parameter schemas remain the only
|
|
351
|
+
* source of the prefix. The raw-depth texture is an r32float producer
|
|
352
|
+
* resource and therefore uses the unfilterable-float/non-filtering pair.
|
|
353
|
+
*/
|
|
354
|
+
export function appendSingleLayerMediumInjection(
|
|
355
|
+
bgl: readonly GPUBindGroupLayoutEntry[],
|
|
356
|
+
): GPUBindGroupLayoutEntry[] {
|
|
357
|
+
const start = bgl.length;
|
|
358
|
+
return [
|
|
359
|
+
{
|
|
360
|
+
binding: start,
|
|
361
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
362
|
+
sampler: { type: 'non-filtering' },
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
binding: start + 1,
|
|
366
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
367
|
+
texture: { sampleType: 'unfilterable-float', viewDimension: '2d' },
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
binding: start + 2,
|
|
371
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
372
|
+
sampler: { type: 'filtering' },
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
binding: start + 3,
|
|
376
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
377
|
+
texture: { sampleType: 'float', viewDimension: '2d' },
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
binding: start + 4,
|
|
381
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
382
|
+
sampler: { type: 'non-filtering' },
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
binding: start + 5,
|
|
386
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
387
|
+
texture: { sampleType: 'unfilterable-float', viewDimension: '2d' },
|
|
388
|
+
},
|
|
389
|
+
];
|
|
390
|
+
}
|
|
391
|
+
|
|
353
392
|
// Closed-set length sentinels — the map is the membership owner.
|
|
354
393
|
export const INJECTION_KIND_LENGTHS = {
|
|
355
394
|
shadow: SHADOW_INJECTION_LENGTH,
|
|
@@ -581,6 +620,7 @@ export function buildPbrViewBglEntries(caps: PbrCaps): GPUBindGroupLayoutEntry[]
|
|
|
581
620
|
},
|
|
582
621
|
];
|
|
583
622
|
const extendedLighting = caps.extendedLighting ?? true;
|
|
623
|
+
const lowLimitCloudBindings = extendedLighting === false && caps.projectorAvailable === false;
|
|
584
624
|
if (extendedLighting) {
|
|
585
625
|
entries.push(
|
|
586
626
|
{
|
|
@@ -633,6 +673,23 @@ export function buildPbrViewBglEntries(caps: PbrCaps): GPUBindGroupLayoutEntry[]
|
|
|
633
673
|
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
634
674
|
buffer: { type: 'uniform', hasDynamicOffset: true },
|
|
635
675
|
});
|
|
676
|
+
// Cloud direct-solar transport is a renderer-owned view resource. The
|
|
677
|
+
// minimum 16-texture profile has no spare sampled texture lane; its shader
|
|
678
|
+
// variant returns the direct-sun fallback without declaring this pair.
|
|
679
|
+
if (!lowLimitCloudBindings) {
|
|
680
|
+
entries.push(
|
|
681
|
+
{
|
|
682
|
+
binding: 16,
|
|
683
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
684
|
+
texture: { sampleType: 'float', viewDimension: '2d' },
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
binding: 17,
|
|
688
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
689
|
+
sampler: { type: 'filtering' },
|
|
690
|
+
},
|
|
691
|
+
);
|
|
692
|
+
}
|
|
636
693
|
return entries;
|
|
637
694
|
}
|
|
638
695
|
|
|
@@ -959,6 +1016,32 @@ export function buildGpuDrivenPbrInstancesBindGroupLayout(
|
|
|
959
1016
|
return result.value;
|
|
960
1017
|
}
|
|
961
1018
|
|
|
1019
|
+
/**
|
|
1020
|
+
* Build the slot-3 layout used by direct single-layer-medium draws.
|
|
1021
|
+
*
|
|
1022
|
+
* Direct Surface draws retain their ordinary instance transforms at binding
|
|
1023
|
+
* zero, but consume the same producer-owned ProbeBlend, dynamic page, frame
|
|
1024
|
+
* rows, and shared time resources as the scene-index lane. Binding six is the
|
|
1025
|
+
* per-draw frame-row base; it keeps a local instance index independent from
|
|
1026
|
+
* the renderer's compact scene-index address.
|
|
1027
|
+
*/
|
|
1028
|
+
export function buildSurfaceDirectInstancesBindGroupLayout(
|
|
1029
|
+
device: PbrPipelineDevice,
|
|
1030
|
+
caps: PbrCaps,
|
|
1031
|
+
): BindGroupLayout {
|
|
1032
|
+
if (!caps.storageBuffer) {
|
|
1033
|
+
throw new Error('Direct Surface instances layout requires storage-buffer capability');
|
|
1034
|
+
}
|
|
1035
|
+
const result = device.createBindGroupLayout(
|
|
1036
|
+
buildBindGroupLayoutDescriptor(BGL_ONLY_SPEC_STUB, {
|
|
1037
|
+
kind: 'pbr-surface-direct-instances',
|
|
1038
|
+
caps,
|
|
1039
|
+
}),
|
|
1040
|
+
);
|
|
1041
|
+
if (!result.ok) throw result.error;
|
|
1042
|
+
return result.value;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
962
1045
|
/** Build the four-slot rigid scene-index pipeline layout. */
|
|
963
1046
|
export function buildGpuDrivenPbrPipelineLayout(
|
|
964
1047
|
device: PbrPipelineDevice,
|
|
@@ -1030,13 +1113,13 @@ export function pbrSkinMeshDynamicOffsets(
|
|
|
1030
1113
|
|
|
1031
1114
|
/**
|
|
1032
1115
|
* Build a stand-alone 7-entry unlit material BGL. Round-4 D-5 keeps unlit
|
|
1033
|
-
* material BG isolated from Skylight binding 7..
|
|
1116
|
+
* material BG isolated from Skylight binding 7..12 -- unlit demos do not
|
|
1034
1117
|
* pay for IBL state. The unlit pipeline still binds material at slot 1,
|
|
1035
1118
|
* just with a 7-entry layout.
|
|
1036
1119
|
*
|
|
1037
1120
|
* Note: at the moment the runtime still routes both unlit + standard
|
|
1038
1121
|
* through a single 14-entry pipeline layout; the unlit material BG
|
|
1039
|
-
* carries fallback identity resources at binding 7..
|
|
1122
|
+
* carries fallback identity resources at binding 7..12. This factory is
|
|
1040
1123
|
* exported as a future-proof seam for the moment when unlit demos own
|
|
1041
1124
|
* their own pipeline layout (t57 (e) test pins the contract today so the
|
|
1042
1125
|
* eventual split has a green target).
|
|
@@ -1152,7 +1235,7 @@ export const SPRITE_PASS_PER_INSTANCE_REGION_VARIANT_SET = '';
|
|
|
1152
1235
|
*
|
|
1153
1236
|
* Three groups by derivation source:
|
|
1154
1237
|
* 1. Shader-derived (paramSchema reflection + injection chain):
|
|
1155
|
-
* - `'pbr-material-merged'` — derived user region + Skylight
|
|
1238
|
+
* - `'pbr-material-merged'` — derived user region + Skylight 6 + transmission 2
|
|
1156
1239
|
* - `'unlit-material'` — 7 entries: base PBR material only (no inject)
|
|
1157
1240
|
* - `'hdrp-7-slot'` — 7 entries (binding 0 + 3..8): HDRP cluster + SSAO group(2) BGL
|
|
1158
1241
|
* 2. Caps-driven literal shapes (no shader):
|
|
@@ -1185,13 +1268,15 @@ export type BglKind =
|
|
|
1185
1268
|
| 'pbr-mesh-array'
|
|
1186
1269
|
| 'pbr-instances'
|
|
1187
1270
|
| 'pbr-gpu-driven-instances'
|
|
1271
|
+
| 'pbr-surface-direct-instances'
|
|
1188
1272
|
| 'pbr-skin-mesh-array'
|
|
1189
1273
|
| 'unlit-material'
|
|
1190
1274
|
| 'hdrp-7-slot'
|
|
1191
1275
|
| 'fullscreen-post'
|
|
1192
1276
|
| 'fullscreen-post-with-params'
|
|
1193
1277
|
| 'fullscreen-post-with-scene-depth'
|
|
1194
|
-
| 'fullscreen-post-with-scene-depth-msaa'
|
|
1278
|
+
| 'fullscreen-post-with-scene-depth-msaa'
|
|
1279
|
+
| 'fullscreen-post-with-paired-msaa';
|
|
1195
1280
|
|
|
1196
1281
|
/**
|
|
1197
1282
|
* Output shape of {@link buildBindGroupLayoutDescriptor}: matches the RHI
|
|
@@ -1434,7 +1519,7 @@ export function buildBindGroupLayoutDescriptor(
|
|
|
1434
1519
|
entries: [
|
|
1435
1520
|
{
|
|
1436
1521
|
binding: 0,
|
|
1437
|
-
visibility: GPU_SHADER_STAGE_VERTEX
|
|
1522
|
+
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
1438
1523
|
buffer: { type: meshBufType, hasDynamicOffset: false },
|
|
1439
1524
|
},
|
|
1440
1525
|
{
|
|
@@ -1443,7 +1528,7 @@ export function buildBindGroupLayoutDescriptor(
|
|
|
1443
1528
|
// the shared visible bind group can serve both the Standard PBR
|
|
1444
1529
|
// (binding(2)) and depth-only shadow (binding(1)) consumers.
|
|
1445
1530
|
binding: 1,
|
|
1446
|
-
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
1531
|
+
visibility: GPU_SHADER_STAGE_VERTEX | GPU_SHADER_STAGE_FRAGMENT,
|
|
1447
1532
|
buffer: { type: meshBufType, hasDynamicOffset: false },
|
|
1448
1533
|
},
|
|
1449
1534
|
{
|
|
@@ -1451,6 +1536,71 @@ export function buildBindGroupLayoutDescriptor(
|
|
|
1451
1536
|
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
1452
1537
|
buffer: { type: meshBufType, hasDynamicOffset: false },
|
|
1453
1538
|
},
|
|
1539
|
+
{
|
|
1540
|
+
// Generic Surface dynamic pages are read by authored Surface
|
|
1541
|
+
// accessors. The binding is present for every scene-index group
|
|
1542
|
+
// so Standard and custom Surface batches share one owner shape.
|
|
1543
|
+
binding: 3,
|
|
1544
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1545
|
+
buffer: { type: meshBufType, hasDynamicOffset: false },
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
// Frame time, explicit event ranges, and paired background/depth
|
|
1549
|
+
// facts use separate read-only pages. This keeps live state out
|
|
1550
|
+
// of the material row and leaves skin's address lane untouched.
|
|
1551
|
+
binding: 4,
|
|
1552
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1553
|
+
buffer: { type: meshBufType, hasDynamicOffset: false },
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
// Frame time is one frame-global fact. Keeping it outside the
|
|
1557
|
+
// member row prevents a stable frame from issuing one 4-byte
|
|
1558
|
+
// queue write for every visible Surface member.
|
|
1559
|
+
binding: 5,
|
|
1560
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1561
|
+
buffer: { type: 'uniform', hasDynamicOffset: false },
|
|
1562
|
+
},
|
|
1563
|
+
],
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
case 'pbr-surface-direct-instances': {
|
|
1567
|
+
return {
|
|
1568
|
+
label: 'pbr-surface-direct-instances-bgl',
|
|
1569
|
+
entries: [
|
|
1570
|
+
{
|
|
1571
|
+
binding: 0,
|
|
1572
|
+
// Direct instance transforms are consumed only by vs_main. Keep
|
|
1573
|
+
// them out of the fragment-stage storage budget; Surface already
|
|
1574
|
+
// needs the retained ProbeBlend/page/frame records there and the
|
|
1575
|
+
// portable WebGPU limit is eight storage buffers per stage.
|
|
1576
|
+
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
1577
|
+
buffer: { type: 'read-only-storage', hasDynamicOffset: false },
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
binding: 1,
|
|
1581
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1582
|
+
buffer: { type: 'read-only-storage', hasDynamicOffset: true },
|
|
1583
|
+
},
|
|
1584
|
+
{
|
|
1585
|
+
binding: 3,
|
|
1586
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1587
|
+
buffer: { type: 'read-only-storage', hasDynamicOffset: false },
|
|
1588
|
+
},
|
|
1589
|
+
{
|
|
1590
|
+
binding: 4,
|
|
1591
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1592
|
+
buffer: { type: 'read-only-storage', hasDynamicOffset: false },
|
|
1593
|
+
},
|
|
1594
|
+
{
|
|
1595
|
+
binding: 5,
|
|
1596
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1597
|
+
buffer: { type: 'uniform', hasDynamicOffset: false },
|
|
1598
|
+
},
|
|
1599
|
+
{
|
|
1600
|
+
binding: 6,
|
|
1601
|
+
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
1602
|
+
buffer: { type: 'uniform', hasDynamicOffset: false },
|
|
1603
|
+
},
|
|
1454
1604
|
],
|
|
1455
1605
|
};
|
|
1456
1606
|
}
|
|
@@ -1482,11 +1632,11 @@ export function buildBindGroupLayoutDescriptor(
|
|
|
1482
1632
|
}
|
|
1483
1633
|
case 'pbr-material-merged': {
|
|
1484
1634
|
// Material BGL: per-shader user-region (derive(paramSchema).bglEntries)
|
|
1485
|
-
// + IBL injection (
|
|
1635
|
+
// + IBL injection (6) + transmission injection (2). The user-region
|
|
1486
1636
|
// size is the only variable; injection start = userRegion.length so a
|
|
1487
1637
|
// custom schema shifts IBL/transmission by its sampler/texture pairs.
|
|
1488
|
-
// The built-in standard-PBR
|
|
1489
|
-
//
|
|
1638
|
+
// The built-in standard-PBR user region has 15 entries;
|
|
1639
|
+
// scene rows follow injection, and physical texture pairs follow the effective root schema.
|
|
1490
1640
|
//
|
|
1491
1641
|
// Schema source priority (D-1): explicit materialParamSchema option >
|
|
1492
1642
|
// registry lookup of spec.shader.id > built-in standard-PBR fallback.
|
|
@@ -1504,9 +1654,18 @@ export function buildBindGroupLayoutDescriptor(
|
|
|
1504
1654
|
const userRegion = buildPbrMaterialUserRegionEntries(userRegionSchema);
|
|
1505
1655
|
const afterIbl = [...userRegion, ...appendInjection(userRegion, 'ibl')];
|
|
1506
1656
|
const afterTransmission = [...afterIbl, ...appendInjection(afterIbl, 'transmission')];
|
|
1657
|
+
const engineRegion =
|
|
1658
|
+
options.caps?.transmissionBackdrop === false &&
|
|
1659
|
+
spec.shader.id !== 'forgeax::single-layer-medium'
|
|
1660
|
+
? afterIbl
|
|
1661
|
+
: afterTransmission;
|
|
1662
|
+
const afterSurfaceMedium =
|
|
1663
|
+
spec.shader.id === 'forgeax::single-layer-medium'
|
|
1664
|
+
? [...engineRegion, ...appendSingleLayerMediumInjection(engineRegion)]
|
|
1665
|
+
: engineRegion;
|
|
1507
1666
|
const merged = [
|
|
1508
|
-
...
|
|
1509
|
-
...appendTextureInjection(
|
|
1667
|
+
...afterSurfaceMedium,
|
|
1668
|
+
...appendTextureInjection(afterSurfaceMedium, physicalFields),
|
|
1510
1669
|
];
|
|
1511
1670
|
// Scene-index Standard variants consume one producer-owned material row
|
|
1512
1671
|
// after the complete fixed physical range. Keeping it at binding 46
|
|
@@ -1518,16 +1677,21 @@ export function buildBindGroupLayoutDescriptor(
|
|
|
1518
1677
|
buffer: { type: 'read-only-storage', hasDynamicOffset: false },
|
|
1519
1678
|
});
|
|
1520
1679
|
}
|
|
1680
|
+
const entries = [
|
|
1681
|
+
...merged,
|
|
1682
|
+
...(spec.shader.id === 'forgeax::single-layer-medium'
|
|
1683
|
+
? []
|
|
1684
|
+
: [
|
|
1685
|
+
{
|
|
1686
|
+
binding: 47,
|
|
1687
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1688
|
+
texture: { sampleType: 'float' as const, viewDimension: 'cube' as const },
|
|
1689
|
+
},
|
|
1690
|
+
]),
|
|
1691
|
+
];
|
|
1521
1692
|
return {
|
|
1522
1693
|
label: 'pbr-material-skylight-bgl',
|
|
1523
|
-
entries
|
|
1524
|
-
...merged,
|
|
1525
|
-
{
|
|
1526
|
-
binding: 47,
|
|
1527
|
-
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1528
|
-
texture: { sampleType: 'float', viewDimension: 'cube' },
|
|
1529
|
-
},
|
|
1530
|
-
],
|
|
1694
|
+
entries,
|
|
1531
1695
|
};
|
|
1532
1696
|
}
|
|
1533
1697
|
case 'unlit-material': {
|
|
@@ -1630,6 +1794,42 @@ export function buildBindGroupLayoutDescriptor(
|
|
|
1630
1794
|
],
|
|
1631
1795
|
};
|
|
1632
1796
|
}
|
|
1797
|
+
case 'fullscreen-post-with-paired-msaa': {
|
|
1798
|
+
return {
|
|
1799
|
+
label: 'fullscreen-post-with-paired-msaa-bgl',
|
|
1800
|
+
entries: [
|
|
1801
|
+
{
|
|
1802
|
+
binding: 0,
|
|
1803
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1804
|
+
texture: {
|
|
1805
|
+
sampleType: 'unfilterable-float',
|
|
1806
|
+
viewDimension: '2d',
|
|
1807
|
+
multisampled: true,
|
|
1808
|
+
},
|
|
1809
|
+
},
|
|
1810
|
+
{
|
|
1811
|
+
binding: 1,
|
|
1812
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1813
|
+
sampler: { type: 'filtering' },
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
binding: 2,
|
|
1817
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1818
|
+
buffer: { type: 'uniform' },
|
|
1819
|
+
},
|
|
1820
|
+
{
|
|
1821
|
+
binding: 3,
|
|
1822
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1823
|
+
texture: { sampleType: 'depth', viewDimension: '2d', multisampled: true },
|
|
1824
|
+
},
|
|
1825
|
+
{
|
|
1826
|
+
binding: 4,
|
|
1827
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1828
|
+
sampler: { type: 'non-filtering' },
|
|
1829
|
+
},
|
|
1830
|
+
],
|
|
1831
|
+
};
|
|
1832
|
+
}
|
|
1633
1833
|
}
|
|
1634
1834
|
}
|
|
1635
1835
|
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type GraphAccess,
|
|
3
|
+
type GraphTextureDescriptor,
|
|
4
|
+
type RenderGraphBuilder,
|
|
5
|
+
RenderGraphError,
|
|
6
|
+
} from '@forgeax/engine-render-graph';
|
|
7
|
+
import { err, ok, type Result } from '@forgeax/engine-types';
|
|
8
|
+
import type {
|
|
9
|
+
RenderPipelineFrame,
|
|
10
|
+
RenderPipelineGpuDrivenProjection,
|
|
11
|
+
RenderPipelineSurfaceMediumPair,
|
|
12
|
+
RenderPipelineTarget,
|
|
13
|
+
} from '../render-pipeline';
|
|
14
|
+
import { createRenderPipelineTarget } from '../render-pipeline';
|
|
15
|
+
import { addTypedFullscreenPass, addTypedScenePass } from '../typed-render-graph-primitives';
|
|
16
|
+
|
|
17
|
+
/** Stable renderer-owned post-process identity for the independent depth copy. */
|
|
18
|
+
export const SINGLE_LAYER_MEDIUM_RAW_DEPTH_POST_PROCESS_ID =
|
|
19
|
+
'forgeax.single-layer-medium-raw-depth' as const;
|
|
20
|
+
export const SINGLE_LAYER_MEDIUM_MSAA_PAIRED_COLOR_POST_PROCESS_ID =
|
|
21
|
+
'forgeax.single-layer-medium-msaa-paired-color' as const;
|
|
22
|
+
export const SINGLE_LAYER_MEDIUM_MSAA_RAW_DEPTH_POST_PROCESS_ID =
|
|
23
|
+
'forgeax.single-layer-medium-msaa-raw-depth' as const;
|
|
24
|
+
|
|
25
|
+
export interface SingleLayerMediumMsaaPair {
|
|
26
|
+
readonly color: RenderPipelineTarget;
|
|
27
|
+
readonly depth: RenderPipelineTarget;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface SingleLayerMediumRawDepthProducerInput {
|
|
31
|
+
readonly graph: RenderGraphBuilder<RenderPipelineFrame>;
|
|
32
|
+
/** Resource/pass prefix; defaults to the opaque scene producer identity. */
|
|
33
|
+
readonly label?: string | undefined;
|
|
34
|
+
/** The already-resolved opaque color keeps the fullscreen primitive's input ABI complete. */
|
|
35
|
+
readonly sourceColor: RenderPipelineTarget;
|
|
36
|
+
/** The opaque depth pass output. It is sampled only by the copy producer. */
|
|
37
|
+
readonly sourceDepth: RenderPipelineTarget;
|
|
38
|
+
/** Must match the Standard scene depth extent (surface or internal resolution). */
|
|
39
|
+
readonly size: GraphTextureDescriptor['size'];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Produce an independent, single-sample raw-depth texture for Surface media.
|
|
44
|
+
*
|
|
45
|
+
* The graph source is the completed opaque depth pass and the destination is
|
|
46
|
+
* an r32float color target. This intermediate is the only place that samples
|
|
47
|
+
* the hardware depth view; medium materials bind the independent result while
|
|
48
|
+
* writing the scene depth attachment. MSAA is rejected at the producer seam
|
|
49
|
+
* until the backend has an explicit depth resolve policy.
|
|
50
|
+
*/
|
|
51
|
+
export function addSingleLayerMediumRawDepthProducer(
|
|
52
|
+
input: SingleLayerMediumRawDepthProducerInput,
|
|
53
|
+
): Result<RenderPipelineTarget, RenderGraphError> {
|
|
54
|
+
const label = input.label ?? 'single-layer-medium-raw-depth';
|
|
55
|
+
if (input.sourceDepth.sampleCount !== 1) {
|
|
56
|
+
return err(
|
|
57
|
+
new RenderGraphError({
|
|
58
|
+
code: 'resource-descriptor-invalid',
|
|
59
|
+
expected: 'single-layer medium raw-depth producer has a single-sample source depth',
|
|
60
|
+
hint: 'select a resolved 1x depth producer; MSAA depth resolve is not admitted yet',
|
|
61
|
+
detail: {
|
|
62
|
+
resourceLabel: label,
|
|
63
|
+
field: 'sourceDepth.sampleCount',
|
|
64
|
+
expected: '1',
|
|
65
|
+
actual: String(input.sourceDepth.sampleCount),
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const rawDepth = createRenderPipelineTarget(input.graph, label, {
|
|
72
|
+
format: 'r32float',
|
|
73
|
+
size: input.size,
|
|
74
|
+
sampleCount: 1,
|
|
75
|
+
});
|
|
76
|
+
if (!rawDepth.ok) return rawDepth;
|
|
77
|
+
|
|
78
|
+
const producer = addTypedFullscreenPass(input.graph, {
|
|
79
|
+
name: `${label}-producer`,
|
|
80
|
+
shader: SINGLE_LAYER_MEDIUM_RAW_DEPTH_POST_PROCESS_ID,
|
|
81
|
+
input: input.sourceColor,
|
|
82
|
+
output: rawDepth.value,
|
|
83
|
+
depth: input.sourceDepth,
|
|
84
|
+
});
|
|
85
|
+
if (!producer.ok) return producer;
|
|
86
|
+
return ok(rawDepth.value);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Resolve a four-sample color/depth pair by selecting the nearest depth sample
|
|
91
|
+
* and the color at that exact sample index. This is deliberately separate
|
|
92
|
+
* from WebGPU's averaging color resolve, which cannot preserve the opaque or
|
|
93
|
+
* nearest-water sample associated with the selected depth.
|
|
94
|
+
*/
|
|
95
|
+
export function addSingleLayerMediumMsaaPairProducer(input: {
|
|
96
|
+
readonly graph: RenderGraphBuilder<RenderPipelineFrame>;
|
|
97
|
+
readonly label: string;
|
|
98
|
+
readonly sourceColor: RenderPipelineTarget;
|
|
99
|
+
readonly sourceDepth: RenderPipelineTarget;
|
|
100
|
+
readonly size: GraphTextureDescriptor['size'];
|
|
101
|
+
}): Result<SingleLayerMediumMsaaPair, RenderGraphError> {
|
|
102
|
+
if (input.sourceColor.sampleCount !== 4 || input.sourceDepth.sampleCount !== 4) {
|
|
103
|
+
return err(
|
|
104
|
+
new RenderGraphError({
|
|
105
|
+
code: 'resource-descriptor-invalid',
|
|
106
|
+
expected: 'single-layer medium paired MSAA producer has 4x color and depth inputs',
|
|
107
|
+
hint: 'route 1x inputs through the single-sample raw-depth producer',
|
|
108
|
+
detail: {
|
|
109
|
+
resourceLabel: input.label,
|
|
110
|
+
field: 'source.sampleCount',
|
|
111
|
+
expected: 'color=4,depth=4',
|
|
112
|
+
actual: `color=${input.sourceColor.sampleCount},depth=${input.sourceDepth.sampleCount}`,
|
|
113
|
+
},
|
|
114
|
+
}),
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
const color = createRenderPipelineTarget(input.graph, `${input.label}-color`, {
|
|
118
|
+
format: input.sourceColor.format,
|
|
119
|
+
size: input.size,
|
|
120
|
+
sampleCount: 1,
|
|
121
|
+
...(input.sourceColor.domain === undefined ? {} : { domain: input.sourceColor.domain }),
|
|
122
|
+
});
|
|
123
|
+
if (!color.ok) return color;
|
|
124
|
+
const depth = createRenderPipelineTarget(input.graph, `${input.label}-depth`, {
|
|
125
|
+
format: 'r32float',
|
|
126
|
+
size: input.size,
|
|
127
|
+
sampleCount: 1,
|
|
128
|
+
});
|
|
129
|
+
if (!depth.ok) return depth;
|
|
130
|
+
const colorProducer = addTypedFullscreenPass(input.graph, {
|
|
131
|
+
name: `${input.label}-color-producer`,
|
|
132
|
+
shader: SINGLE_LAYER_MEDIUM_MSAA_PAIRED_COLOR_POST_PROCESS_ID,
|
|
133
|
+
input: input.sourceColor,
|
|
134
|
+
output: color.value,
|
|
135
|
+
depth: input.sourceDepth,
|
|
136
|
+
});
|
|
137
|
+
if (!colorProducer.ok) return colorProducer;
|
|
138
|
+
const depthProducer = addTypedFullscreenPass(input.graph, {
|
|
139
|
+
name: `${input.label}-depth-producer`,
|
|
140
|
+
shader: SINGLE_LAYER_MEDIUM_MSAA_RAW_DEPTH_POST_PROCESS_ID,
|
|
141
|
+
input: input.sourceColor,
|
|
142
|
+
output: depth.value,
|
|
143
|
+
depth: input.sourceDepth,
|
|
144
|
+
});
|
|
145
|
+
if (!depthProducer.ok) return depthProducer;
|
|
146
|
+
return ok({ color: color.value, depth: depth.value });
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** Inputs shared by the two graph passes owned by the Surface model. */
|
|
150
|
+
export interface SingleLayerMediumPassInput {
|
|
151
|
+
readonly graph: RenderGraphBuilder<RenderPipelineFrame>;
|
|
152
|
+
readonly size: GraphTextureDescriptor['size'];
|
|
153
|
+
readonly nearestLayer: RenderPipelineTarget;
|
|
154
|
+
readonly nearestDepth: RenderPipelineTarget;
|
|
155
|
+
readonly color: RenderPipelineTarget;
|
|
156
|
+
readonly colorResolve?: RenderPipelineTarget | undefined;
|
|
157
|
+
readonly depth: RenderPipelineTarget;
|
|
158
|
+
readonly sampled?: readonly RenderPipelineTarget[] | undefined;
|
|
159
|
+
readonly directionalShadow?: RenderPipelineTarget | undefined;
|
|
160
|
+
readonly spotShadow?: RenderPipelineTarget | undefined;
|
|
161
|
+
/** Optional producer-owned cloud shadow bound through the Standard frame group. */
|
|
162
|
+
readonly cloudShadow?: RenderPipelineTarget | undefined;
|
|
163
|
+
readonly ssao?: RenderPipelineTarget | undefined;
|
|
164
|
+
readonly extraAccesses?: readonly GraphAccess[] | undefined;
|
|
165
|
+
/** Producer-owned pair of opaque color and sampled raw-depth facts. */
|
|
166
|
+
readonly surfacePair: RenderPipelineSurfaceMediumPair;
|
|
167
|
+
readonly gpuDriven?: RenderPipelineGpuDrivenProjection | undefined;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Admit the nearest-layer and color Surface submissions to the existing
|
|
172
|
+
* Standard graph only when the producer supplied a paired sampled raw depth.
|
|
173
|
+
* The pair is deliberately an input: this helper does not invent a backdrop,
|
|
174
|
+
* copy depth, or turn an unavailable fact into a graph resource.
|
|
175
|
+
*/
|
|
176
|
+
export function addSingleLayerMediumPasses(
|
|
177
|
+
input: SingleLayerMediumPassInput,
|
|
178
|
+
): Result<void, RenderGraphError> {
|
|
179
|
+
const pair = input.surfacePair;
|
|
180
|
+
if (pair.rawDepth.status === 'unavailable') {
|
|
181
|
+
return err(
|
|
182
|
+
new RenderGraphError({
|
|
183
|
+
code: 'resource-descriptor-invalid',
|
|
184
|
+
expected: 'single-layer medium consumes a graph-paired sampled raw depth',
|
|
185
|
+
hint: 'enable an owner-approved depth-copy producer before admitting the Surface passes',
|
|
186
|
+
detail: {
|
|
187
|
+
resourceLabel: 'single-layer-medium',
|
|
188
|
+
field: 'surfacePair.rawDepth',
|
|
189
|
+
expected: 'available sampled depth view',
|
|
190
|
+
actual: pair.rawDepth.reason,
|
|
191
|
+
},
|
|
192
|
+
}),
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
const sampled = input.sampled ?? [];
|
|
196
|
+
const nearest = addTypedScenePass(input.graph, {
|
|
197
|
+
name: 'single-layer-medium-nearest-layer',
|
|
198
|
+
color: input.nearestLayer,
|
|
199
|
+
depth: input.nearestDepth,
|
|
200
|
+
sampled,
|
|
201
|
+
...(input.directionalShadow === undefined
|
|
202
|
+
? {}
|
|
203
|
+
: { directionalShadow: input.directionalShadow }),
|
|
204
|
+
...(input.spotShadow === undefined ? {} : { spotShadow: input.spotShadow }),
|
|
205
|
+
...(input.cloudShadow === undefined ? {} : { cloudShadow: input.cloudShadow }),
|
|
206
|
+
...(input.ssao === undefined ? {} : { ssao: input.ssao }),
|
|
207
|
+
selector: { LightMode: ['Forward'] },
|
|
208
|
+
colorLoadOp: 'clear',
|
|
209
|
+
depthLoadOp: 'clear',
|
|
210
|
+
recordMode: 'single-layer-medium-nearest-layer',
|
|
211
|
+
transmissionBackdrop: pair.opaqueColor,
|
|
212
|
+
surfacePair: pair,
|
|
213
|
+
gpuDrivenFilter: 'single-layer-medium',
|
|
214
|
+
...(input.extraAccesses === undefined ? {} : { extraAccesses: input.extraAccesses }),
|
|
215
|
+
...(input.gpuDriven === undefined ? {} : { gpuDriven: input.gpuDriven }),
|
|
216
|
+
});
|
|
217
|
+
if (!nearest.ok) return nearest;
|
|
218
|
+
|
|
219
|
+
const nearestPair =
|
|
220
|
+
input.nearestLayer.sampleCount === 4
|
|
221
|
+
? addSingleLayerMediumMsaaPairProducer({
|
|
222
|
+
graph: input.graph,
|
|
223
|
+
label: 'single-layer-medium-nearest-resolve',
|
|
224
|
+
sourceColor: input.nearestLayer,
|
|
225
|
+
sourceDepth: input.nearestDepth,
|
|
226
|
+
size: input.size,
|
|
227
|
+
})
|
|
228
|
+
: (() => {
|
|
229
|
+
const depth = addSingleLayerMediumRawDepthProducer({
|
|
230
|
+
graph: input.graph,
|
|
231
|
+
label: 'single-layer-medium-nearest-depth-sampled',
|
|
232
|
+
sourceColor: input.nearestLayer,
|
|
233
|
+
sourceDepth: input.nearestDepth,
|
|
234
|
+
size: input.size,
|
|
235
|
+
});
|
|
236
|
+
return depth.ok ? ok({ color: input.nearestLayer, depth: depth.value }) : depth;
|
|
237
|
+
})();
|
|
238
|
+
if (!nearestPair.ok) return nearestPair;
|
|
239
|
+
|
|
240
|
+
const colorSampled = [...sampled, nearestPair.value.color];
|
|
241
|
+
const color = addTypedScenePass(input.graph, {
|
|
242
|
+
name: 'single-layer-medium-color',
|
|
243
|
+
color: input.color,
|
|
244
|
+
...(input.colorResolve === undefined ? {} : { resolve: input.colorResolve }),
|
|
245
|
+
depth: input.depth,
|
|
246
|
+
sampled: colorSampled,
|
|
247
|
+
...(input.directionalShadow === undefined
|
|
248
|
+
? {}
|
|
249
|
+
: { directionalShadow: input.directionalShadow }),
|
|
250
|
+
...(input.spotShadow === undefined ? {} : { spotShadow: input.spotShadow }),
|
|
251
|
+
...(input.cloudShadow === undefined ? {} : { cloudShadow: input.cloudShadow }),
|
|
252
|
+
...(input.ssao === undefined ? {} : { ssao: input.ssao }),
|
|
253
|
+
selector: { LightMode: ['Forward'] },
|
|
254
|
+
colorLoadOp: 'load',
|
|
255
|
+
depthLoadOp: 'load',
|
|
256
|
+
recordMode: 'single-layer-medium-color',
|
|
257
|
+
transmissionBackdrop: pair.opaqueColor,
|
|
258
|
+
surfacePair: pair,
|
|
259
|
+
surfaceNearestLayer: nearestPair.value.color.view,
|
|
260
|
+
surfaceNearestDepth: nearestPair.value.depth.view,
|
|
261
|
+
gpuDrivenFilter: 'single-layer-medium',
|
|
262
|
+
...(input.extraAccesses === undefined ? {} : { extraAccesses: input.extraAccesses }),
|
|
263
|
+
...(input.gpuDriven === undefined ? {} : { gpuDriven: input.gpuDriven }),
|
|
264
|
+
});
|
|
265
|
+
if (!color.ok) return color;
|
|
266
|
+
return ok(undefined);
|
|
267
|
+
}
|