@forgeax/engine-render 0.1.33 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1010 -124
- package/dist/assembly/backend-contract.d.ts +2 -0
- package/dist/assembly/backend-contract.d.ts.map +1 -1
- package/dist/assembly/barrel-distortion-inspection.d.ts +3 -0
- package/dist/assembly/barrel-distortion-inspection.d.ts.map +1 -0
- package/dist/assembly/canvas-draw-guard.d.ts +3 -0
- package/dist/assembly/canvas-draw-guard.d.ts.map +1 -0
- package/dist/assembly/cloud-shadow-entry.d.ts +4 -0
- package/dist/assembly/cloud-shadow-entry.d.ts.map +1 -0
- package/dist/assembly/dynamic-geometry-host.d.ts +4 -1
- package/dist/assembly/dynamic-geometry-host.d.ts.map +1 -1
- package/dist/assembly/dynamic-geometry-runtime.d.ts +1 -1
- package/dist/assembly/dynamic-geometry-runtime.d.ts.map +1 -1
- package/dist/assembly/factory.d.ts +1 -1
- package/dist/assembly/factory.d.ts.map +1 -1
- package/dist/assembly/host-contract.d.ts +3 -3
- 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/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 +1 -1
- package/dist/assembly/webgpu-renderer.d.ts.map +1 -1
- package/dist/authoring.mjs +1 -1
- package/dist/barrel-distortion.d.ts +47 -0
- package/dist/barrel-distortion.d.ts.map +1 -0
- package/dist/{chunk-PA5DRJNI.mjs → chunk-ELJFJ2BU.mjs} +2 -2
- package/dist/chunk-ELJFJ2BU.mjs.map +1 -0
- package/dist/{chunk-ZDQWGQW7.mjs → chunk-HEB564WF.mjs} +4 -4
- package/dist/{chunk-ZDQWGQW7.mjs.map → chunk-HEB564WF.mjs.map} +1 -1
- package/dist/{chunk-VOZWDM3L.mjs → chunk-MKDIT2EM.mjs} +1307 -188
- package/dist/chunk-MKDIT2EM.mjs.map +1 -0
- package/dist/{chunk-LEAXOMYJ.mjs → chunk-OCDLEI6I.mjs} +3 -3
- package/dist/{chunk-LEAXOMYJ.mjs.map → chunk-OCDLEI6I.mjs.map} +1 -1
- package/dist/chunk-ODZWR6JQ.mjs +4927 -0
- package/dist/chunk-ODZWR6JQ.mjs.map +1 -0
- package/dist/{chunk-3RTCJTH4.mjs → chunk-SHFUFJ5N.mjs} +184 -13
- package/dist/chunk-SHFUFJ5N.mjs.map +1 -0
- package/dist/{chunk-OO3DRYK7.mjs → chunk-UI5SFODX.mjs} +176 -96
- package/dist/chunk-UI5SFODX.mjs.map +1 -0
- package/dist/{chunk-PLAXOOX5.mjs → chunk-UINHLCZA.mjs} +561 -79
- package/dist/chunk-UINHLCZA.mjs.map +1 -0
- package/dist/{chunk-NB2S7ZRX.mjs → chunk-WEX45HKH.mjs} +127 -386
- package/dist/chunk-WEX45HKH.mjs.map +1 -0
- package/dist/cloud/density.d.ts +55 -0
- package/dist/cloud/density.d.ts.map +1 -0
- package/dist/cloud/extract.d.ts +25 -0
- package/dist/cloud/extract.d.ts.map +1 -0
- package/dist/cloud/feature.d.ts +57 -0
- package/dist/cloud/feature.d.ts.map +1 -0
- package/dist/cloud/frame-context.d.ts +8 -0
- package/dist/cloud/frame-context.d.ts.map +1 -0
- package/dist/cloud/inspection.d.ts +59 -0
- package/dist/cloud/inspection.d.ts.map +1 -0
- package/dist/cloud/optics.d.ts +56 -0
- package/dist/cloud/optics.d.ts.map +1 -0
- package/dist/cloud/parameters.d.ts +73 -0
- package/dist/cloud/parameters.d.ts.map +1 -0
- package/dist/cloud/resources.d.ts +60 -0
- package/dist/cloud/resources.d.ts.map +1 -0
- package/dist/cloud/shadow.d.ts +42 -0
- package/dist/cloud/shadow.d.ts.map +1 -0
- package/dist/cloud/temporal.d.ts +74 -0
- package/dist/cloud/temporal.d.ts.map +1 -0
- package/dist/components/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 +6759 -2875
- package/dist/construct-renderer.mjs.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 +18 -4
- 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/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 +10 -0
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/plan.d.ts +8 -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 +44 -0
- package/dist/features/types.d.ts.map +1 -1
- package/dist/fullscreen-post-process-pass.d.ts +15 -7
- package/dist/fullscreen-post-process-pass.d.ts.map +1 -1
- package/dist/gpu-dirty-ranges.d.ts +11 -0
- package/dist/gpu-dirty-ranges.d.ts.map +1 -0
- package/dist/gpu-driven/batch-topology.d.ts +17 -0
- package/dist/gpu-driven/batch-topology.d.ts.map +1 -1
- package/dist/gpu-driven/material-artifacts.d.ts +6 -0
- package/dist/gpu-driven/material-artifacts.d.ts.map +1 -1
- package/dist/gpu-driven/prepared-draw.d.ts.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/skylight-bind-group.d.ts +10 -1
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -1
- package/dist/index.d.ts +27 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +258 -8
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +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 +48 -100
- package/dist/instances.d.ts.map +1 -1
- package/dist/internal.mjs +7 -7
- package/dist/pbr-pipeline.d.ts +19 -1
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/pipeline/single-layer-medium-passes.d.ts +73 -0
- package/dist/pipeline/single-layer-medium-passes.d.ts.map +1 -0
- package/dist/pipeline/standard-forward-lane.d.ts.map +1 -1
- package/dist/pipeline/standard-output/graph.d.ts.map +1 -1
- package/dist/pipeline/standard-output/types.d.ts +4 -2
- package/dist/pipeline/standard-output/types.d.ts.map +1 -1
- package/dist/pipeline/standard-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-post.d.ts.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/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 +37 -3
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame.d.ts +10 -61
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/gpu-draw-receipts.d.ts +11 -0
- package/dist/record/gpu-draw-receipts.d.ts.map +1 -0
- package/dist/record/gpu-timing.d.ts +8 -0
- package/dist/record/gpu-timing.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +21 -5
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +7 -1
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass-sprite-draws.d.ts.map +1 -1
- package/dist/record/main-pass.d.ts +13 -2
- package/dist/record/main-pass.d.ts.map +1 -1
- package/dist/record/motion-blur-receipt.d.ts +11 -0
- package/dist/record/motion-blur-receipt.d.ts.map +1 -0
- package/dist/record/probe-blend-buffer.d.ts +16 -0
- package/dist/record/probe-blend-buffer.d.ts.map +1 -0
- package/dist/record/recovery-pipeline.d.ts.map +1 -1
- package/dist/record/render-context.d.ts +22 -3
- 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/typed-frame-graph.d.ts +22 -2
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/record/view-ubo.d.ts +11 -3
- package/dist/record/view-ubo.d.ts.map +1 -1
- package/dist/record/volume-params.d.ts +9 -0
- package/dist/record/volume-params.d.ts.map +1 -0
- package/dist/recovery/render-system-candidate.d.ts +10 -0
- package/dist/recovery/render-system-candidate.d.ts.map +1 -1
- package/dist/reflection/record-owner.d.ts.map +1 -1
- package/dist/render-contract.d.ts +42 -4
- 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 +16 -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-residency.d.ts +12 -0
- package/dist/render-system-residency.d.ts.map +1 -0
- package/dist/render-system.d.ts +19 -14
- 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 +12 -5
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/ssao-buffers.d.ts +9 -0
- package/dist/ssao-buffers.d.ts.map +1 -1
- package/dist/surface/dynamic-input.d.ts +133 -0
- package/dist/surface/dynamic-input.d.ts.map +1 -0
- package/dist/surface/gpu-driven.d.ts +41 -0
- package/dist/surface/gpu-driven.d.ts.map +1 -0
- package/dist/surface/submission-observation.d.ts +136 -0
- package/dist/surface/submission-observation.d.ts.map +1 -0
- package/dist/systems/skin-palette-allocator.d.ts.map +1 -1
- package/dist/temporal/gpu.d.ts +13 -1
- package/dist/temporal/gpu.d.ts.map +1 -1
- package/dist/temporal/index.mjs +5 -5
- package/dist/temporal/inspection.d.ts.map +1 -1
- package/dist/temporal/standard-scene-data.d.ts.map +1 -1
- package/dist/temporal/target-coverage-attachment.d.ts.map +1 -1
- package/dist/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__/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-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 +2 -2
- 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__/main-pass-material-medium-selection.unit.test.ts +146 -0
- package/src/__tests__/material-shader-prewarm.unit.test.ts +59 -0
- package/src/__tests__/material-snapshot-mutation.integration.test.ts +39 -1
- package/src/__tests__/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 +58 -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 +7 -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 +41 -7
- 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/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 +3 -3
- 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 +41 -18
- package/src/assembly/render-feature-post-processes.ts +54 -0
- package/src/assembly/renderer-facade.ts +4 -1
- package/src/assembly/renderer-feature-inspection.ts +8 -2
- package/src/assembly/renderer-frame-transaction.ts +23 -0
- package/src/assembly/renderer-inspection.ts +28 -0
- package/src/assembly/skin-palette-owner.ts +1 -1
- package/src/assembly/temporal-post-process-prewarm.ts +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 +115 -61
- 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 +214 -252
- 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/dynamic-geometry.ts +12 -1
- package/src/errors/cloud.ts +103 -0
- package/src/errors/render.ts +44 -7
- 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/features/barrel-distortion.ts +172 -0
- package/src/features/error-reporting.ts +26 -6
- package/src/features/host.ts +115 -14
- package/src/features/plan.ts +8 -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 +47 -0
- package/src/fullscreen-post-process-pass.ts +41 -9
- package/src/gpu-dirty-ranges.ts +48 -0
- package/src/gpu-driven/batch-topology.ts +53 -0
- package/src/gpu-driven/material-artifacts.ts +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/skylight-bind-group.ts +49 -7
- package/src/index.ts +196 -9
- package/src/inspection-types.ts +162 -0
- package/src/instance-buffer-cache.ts +4 -4
- package/src/instances.ts +149 -569
- package/src/pbr-pipeline.ts +219 -13
- package/src/pipeline/single-layer-medium-passes.ts +267 -0
- package/src/pipeline/standard-forward-lane.ts +313 -57
- package/src/pipeline/standard-output/graph.ts +8 -2
- package/src/pipeline/standard-output/types.ts +12 -1
- package/src/pipeline/standard-pipeline.ts +291 -18
- package/src/pipeline/standard-post.ts +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/record/__tests__/main-pass-geometry.unit.test.ts +30 -0
- package/src/record/__tests__/sprite-material-abi.unit.test.ts +1 -1
- package/src/record/__tests__/temporal-payload.unit.test.ts +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__/view-ubo-layout.unit.test.ts +4 -3
- package/src/record/barrel-distortion-frame.ts +110 -0
- package/src/record/dynamic-geometry-consumption.ts +39 -9
- package/src/record/fold-buckets.ts +852 -0
- package/src/record/fold-instance-buffer.ts +51 -0
- package/src/record/frame-lighting.ts +36 -2
- package/src/record/frame-snapshot.ts +39 -3
- package/src/record/frame.ts +217 -1084
- package/src/record/gpu-draw-receipts.ts +38 -0
- package/src/record/gpu-timing.ts +48 -5
- package/src/record/main-pass-geometry.ts +251 -82
- package/src/record/main-pass-material.ts +66 -4
- package/src/record/main-pass-sprite-draws.ts +7 -65
- package/src/record/main-pass.ts +156 -20
- package/src/record/motion-blur-receipt.ts +91 -0
- package/src/record/probe-blend-buffer.ts +180 -0
- package/src/record/recovery-pipeline.ts +35 -3
- package/src/record/render-context.ts +39 -3
- package/src/record/shadow-pass.ts +30 -1
- package/src/record/skybox-post-pass.ts +28 -4
- package/src/record/typed-frame-graph.ts +770 -134
- package/src/record/view-ubo.ts +26 -3
- package/src/record/volume-params.ts +225 -0
- package/src/recovery/render-system-candidate.ts +235 -42
- package/src/reflection/record-owner.ts +7 -3
- package/src/render-contract.ts +48 -4
- package/src/render-graph-primitives.ts +7 -1
- package/src/render-pipeline.ts +130 -0
- package/src/render-system-extract-tail.ts +57 -61
- package/src/render-system-extract.ts +74 -76
- package/src/render-system-presentation.ts +56 -0
- package/src/render-system-producer-roots.ts +96 -0
- package/src/render-system-residency.ts +159 -0
- package/src/render-system.ts +347 -363
- package/src/scene/probe-blend.ts +96 -4
- package/src/scene/render-scene.ts +349 -280
- package/src/ssao-buffers.ts +95 -2
- package/src/surface/__tests__/dynamic-input.unit.test.ts +374 -0
- package/src/surface/__tests__/gpu-driven.unit.test.ts +87 -0
- package/src/surface/dynamic-input.ts +658 -0
- package/src/surface/gpu-driven.ts +147 -0
- package/src/surface/submission-observation.ts +517 -0
- package/src/systems/skin-palette-allocator.ts +4 -1
- package/src/temporal/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.map +0 -1
- 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.map +0 -1
- package/dist/chunk-VOZWDM3L.mjs.map +0 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type { Buffer, RhiDevice } from '@forgeax/engine-rhi';
|
|
2
|
+
import { GpuBuffer } from '../gpu-resource';
|
|
3
|
+
import {
|
|
4
|
+
GPU_BUFFER_USAGE_COPY_DST,
|
|
5
|
+
GPU_BUFFER_USAGE_STORAGE,
|
|
6
|
+
GPU_BUFFER_USAGE_UNIFORM,
|
|
7
|
+
} from '../gpu-usage';
|
|
8
|
+
import type { ProbeBlendBufferProjection } from '../scene/probe-blend';
|
|
9
|
+
import {
|
|
10
|
+
PROBE_BLEND_RECORD_STRIDE,
|
|
11
|
+
type ProbeBlendRecord,
|
|
12
|
+
probeBlendRecordOffset,
|
|
13
|
+
} from '../scene/probe-blend-record';
|
|
14
|
+
import type { RenderFrameState } from './frame-snapshot';
|
|
15
|
+
|
|
16
|
+
export interface ProbeBlendBufferRecord {
|
|
17
|
+
readonly cacheKey: number;
|
|
18
|
+
readonly record: ProbeBlendRecord;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function isProbeBlendProjection(
|
|
22
|
+
input: ProbeBlendBufferProjection | readonly ProbeBlendBufferRecord[],
|
|
23
|
+
): input is ProbeBlendBufferProjection {
|
|
24
|
+
return !Array.isArray(input);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function retireProbeBlendRecordBuffer(buffer: GpuBuffer): void {
|
|
28
|
+
const destroy = (): void => {
|
|
29
|
+
if (!buffer.isDestroyed) void buffer.destroy();
|
|
30
|
+
};
|
|
31
|
+
void buffer.device.queue.onSubmittedWorkDone().then(destroy, destroy);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function createCompleteProbeBlendBuffer(
|
|
35
|
+
device: RhiDevice,
|
|
36
|
+
requiredCapacity: number,
|
|
37
|
+
records: readonly ProbeBlendBufferRecord[],
|
|
38
|
+
): {
|
|
39
|
+
readonly buffer: GpuBuffer;
|
|
40
|
+
readonly cache: ReadonlyMap<number, { readonly generation: number; readonly bytes: Uint8Array }>;
|
|
41
|
+
} {
|
|
42
|
+
const created = device.createBuffer({
|
|
43
|
+
label: 'probe-blend-records',
|
|
44
|
+
size: requiredCapacity * PROBE_BLEND_RECORD_STRIDE,
|
|
45
|
+
usage:
|
|
46
|
+
(device.caps.storageBuffer ? GPU_BUFFER_USAGE_STORAGE : GPU_BUFFER_USAGE_UNIFORM) |
|
|
47
|
+
GPU_BUFFER_USAGE_COPY_DST,
|
|
48
|
+
mappedAtCreation: false,
|
|
49
|
+
});
|
|
50
|
+
if (!created.ok) throw created.error;
|
|
51
|
+
const candidate = new GpuBuffer(device, created.value);
|
|
52
|
+
const cache = new Map<number, { readonly generation: number; readonly bytes: Uint8Array }>();
|
|
53
|
+
try {
|
|
54
|
+
for (const { cacheKey, record } of records) {
|
|
55
|
+
const uploaded = device.queue.writeBuffer(
|
|
56
|
+
candidate.handle,
|
|
57
|
+
probeBlendRecordOffset(record.objectKey),
|
|
58
|
+
record.bytes,
|
|
59
|
+
);
|
|
60
|
+
if (!uploaded.ok) throw uploaded.error;
|
|
61
|
+
cache.set(cacheKey, {
|
|
62
|
+
generation: record.generation,
|
|
63
|
+
bytes: new Uint8Array(record.bytes),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
} catch (cause) {
|
|
67
|
+
void candidate.destroy();
|
|
68
|
+
throw cause;
|
|
69
|
+
}
|
|
70
|
+
return { buffer: candidate, cache };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Retain one device buffer for direct and scene-index ProbeBlend consumers.
|
|
75
|
+
* Capacity is settled before any upload so a growth cannot erase records
|
|
76
|
+
* written earlier in the same frame. Slot zero remains the producer sentinel;
|
|
77
|
+
* RenderScene object slot N occupies aligned record N+1.
|
|
78
|
+
*/
|
|
79
|
+
export function ensureProbeBlendRecordBuffer(
|
|
80
|
+
device: RhiDevice,
|
|
81
|
+
frameState: Pick<
|
|
82
|
+
RenderFrameState,
|
|
83
|
+
| 'probeBlendRecordBuffer'
|
|
84
|
+
| 'probeBlendRecordBufferCapacity'
|
|
85
|
+
| 'probeBlendBuffers'
|
|
86
|
+
| 'probeBlendRecordProjection'
|
|
87
|
+
>,
|
|
88
|
+
input: ProbeBlendBufferProjection | readonly ProbeBlendBufferRecord[] | undefined,
|
|
89
|
+
): Buffer | undefined {
|
|
90
|
+
const projection = input !== undefined && isProbeBlendProjection(input) ? input : undefined;
|
|
91
|
+
const records: readonly ProbeBlendBufferRecord[] =
|
|
92
|
+
input === undefined
|
|
93
|
+
? []
|
|
94
|
+
: (projection?.records ?? (input as readonly ProbeBlendBufferRecord[]));
|
|
95
|
+
let buffer = frameState.probeBlendRecordBuffer;
|
|
96
|
+
const accepted = frameState.probeBlendRecordProjection;
|
|
97
|
+
if (
|
|
98
|
+
projection !== undefined &&
|
|
99
|
+
accepted?.projection === projection &&
|
|
100
|
+
accepted.device === device
|
|
101
|
+
) {
|
|
102
|
+
if (records.length === 0) return undefined;
|
|
103
|
+
if (accepted.buffer === buffer && buffer !== undefined && !buffer.isDestroyed) {
|
|
104
|
+
return buffer.handle;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (records.length === 0) {
|
|
108
|
+
if (projection !== undefined) {
|
|
109
|
+
frameState.probeBlendBuffers.clear();
|
|
110
|
+
frameState.probeBlendRecordProjection = {
|
|
111
|
+
projection,
|
|
112
|
+
device,
|
|
113
|
+
buffer: undefined,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
const requiredCapacity =
|
|
119
|
+
projection?.capacity ??
|
|
120
|
+
records.reduce((capacity, { record }) => Math.max(capacity, record.objectKey + 2), 1);
|
|
121
|
+
const grows =
|
|
122
|
+
buffer === undefined ||
|
|
123
|
+
buffer.isDestroyed ||
|
|
124
|
+
buffer.device !== device ||
|
|
125
|
+
frameState.probeBlendRecordBufferCapacity < requiredCapacity;
|
|
126
|
+
const hasAcceptedBaseline =
|
|
127
|
+
projection !== undefined &&
|
|
128
|
+
accepted !== undefined &&
|
|
129
|
+
accepted.device === device &&
|
|
130
|
+
accepted.buffer === buffer &&
|
|
131
|
+
buffer !== undefined &&
|
|
132
|
+
!buffer.isDestroyed &&
|
|
133
|
+
accepted.projection.sourceIdentity === projection.sourceIdentity &&
|
|
134
|
+
accepted.projection.revision === projection.baseRevision;
|
|
135
|
+
const requiresCompletePublish =
|
|
136
|
+
grows ||
|
|
137
|
+
(projection !== undefined && (!hasAcceptedBaseline || projection.dirtyRecords.length > 1));
|
|
138
|
+
if (requiresCompletePublish) {
|
|
139
|
+
const candidate = createCompleteProbeBlendBuffer(device, requiredCapacity, records);
|
|
140
|
+
const previous = buffer;
|
|
141
|
+
buffer = candidate.buffer;
|
|
142
|
+
frameState.probeBlendRecordBuffer = candidate.buffer;
|
|
143
|
+
frameState.probeBlendRecordBufferCapacity = requiredCapacity;
|
|
144
|
+
frameState.probeBlendBuffers.clear();
|
|
145
|
+
for (const [key, value] of candidate.cache) frameState.probeBlendBuffers.set(key, value);
|
|
146
|
+
if (projection === undefined) delete frameState.probeBlendRecordProjection;
|
|
147
|
+
else frameState.probeBlendRecordProjection = { projection, device, buffer: candidate.buffer };
|
|
148
|
+
if (previous !== undefined) retireProbeBlendRecordBuffer(previous);
|
|
149
|
+
return candidate.buffer.handle;
|
|
150
|
+
}
|
|
151
|
+
if (buffer === undefined) return undefined;
|
|
152
|
+
const changed = projection?.dirtyRecords ?? records;
|
|
153
|
+
const cacheUpdates: [number, { readonly generation: number; readonly bytes: Uint8Array }][] = [];
|
|
154
|
+
for (const { cacheKey, record } of changed) {
|
|
155
|
+
const cached = frameState.probeBlendBuffers.get(cacheKey);
|
|
156
|
+
const unchanged =
|
|
157
|
+
cached !== undefined &&
|
|
158
|
+
cached.generation === record.generation &&
|
|
159
|
+
cached.bytes.length === record.bytes.length &&
|
|
160
|
+
cached.bytes.every((value, index) => value === record.bytes[index]);
|
|
161
|
+
if (unchanged) continue;
|
|
162
|
+
const uploaded = device.queue.writeBuffer(
|
|
163
|
+
buffer.handle,
|
|
164
|
+
probeBlendRecordOffset(record.objectKey),
|
|
165
|
+
record.bytes,
|
|
166
|
+
);
|
|
167
|
+
if (!uploaded.ok) throw uploaded.error;
|
|
168
|
+
cacheUpdates.push([
|
|
169
|
+
cacheKey,
|
|
170
|
+
{ generation: record.generation, bytes: new Uint8Array(record.bytes) },
|
|
171
|
+
]);
|
|
172
|
+
}
|
|
173
|
+
for (const [cacheKey, value] of cacheUpdates) frameState.probeBlendBuffers.set(cacheKey, value);
|
|
174
|
+
for (const cacheKey of projection?.removedCacheKeys ?? []) {
|
|
175
|
+
frameState.probeBlendBuffers.delete(cacheKey);
|
|
176
|
+
}
|
|
177
|
+
if (projection === undefined) delete frameState.probeBlendRecordProjection;
|
|
178
|
+
else frameState.probeBlendRecordProjection = { projection, device, buffer };
|
|
179
|
+
return buffer.handle;
|
|
180
|
+
}
|
|
@@ -173,7 +173,11 @@ function addRequest(input: {
|
|
|
173
173
|
readonly vertexLayoutProjection?: VertexLayoutProjection;
|
|
174
174
|
readonly vertexEntry?: string;
|
|
175
175
|
readonly fragmentEntry?: string;
|
|
176
|
-
readonly layoutKindOverride?:
|
|
176
|
+
readonly layoutKindOverride?:
|
|
177
|
+
| 'pbr'
|
|
178
|
+
| 'pbr-skin'
|
|
179
|
+
| 'surface-direct-pbr'
|
|
180
|
+
| 'surface-direct-cluster-pbr';
|
|
177
181
|
readonly preserveUndefinedVariant?: boolean;
|
|
178
182
|
readonly variantAlreadyResolved?: boolean;
|
|
179
183
|
}): void {
|
|
@@ -244,7 +248,7 @@ function addRequest(input: {
|
|
|
244
248
|
undefined,
|
|
245
249
|
undefined,
|
|
246
250
|
projection,
|
|
247
|
-
|
|
251
|
+
'immediate',
|
|
248
252
|
input.layoutKindOverride,
|
|
249
253
|
undefined,
|
|
250
254
|
input.additionalColorFormats,
|
|
@@ -260,6 +264,7 @@ function addStandardMaterialRequests(input: {
|
|
|
260
264
|
readonly internals: RenderSystemInternals;
|
|
261
265
|
readonly pipelineState: PipelineState;
|
|
262
266
|
readonly validated: readonly ValidatedRenderable[];
|
|
267
|
+
readonly dispatch: readonly DispatchEntry[];
|
|
263
268
|
readonly standardLighting: StandardTopologyInputValue | undefined;
|
|
264
269
|
readonly sampleCount: number;
|
|
265
270
|
readonly isHdrTarget: boolean;
|
|
@@ -267,6 +272,13 @@ function addStandardMaterialRequests(input: {
|
|
|
267
272
|
readonly reflectionFallbackAvailable: boolean;
|
|
268
273
|
}): void {
|
|
269
274
|
const pointsLinesProjection = deriveVertexLayoutProjection(DEFAULT_VERTEX_ATTRIBUTE_MAP);
|
|
275
|
+
const forwardPrograms = new Map<string, DispatchEntry>();
|
|
276
|
+
for (const candidate of input.dispatch) {
|
|
277
|
+
if (candidate.tags.LightMode !== 'Forward' || candidate.materialShaderId === undefined)
|
|
278
|
+
continue;
|
|
279
|
+
const key = `${candidate.renderableIndex}:${candidate.materialHandle}`;
|
|
280
|
+
if (!forwardPrograms.has(key)) forwardPrograms.set(key, candidate);
|
|
281
|
+
}
|
|
270
282
|
for (const entry of input.validated) {
|
|
271
283
|
if (entry.source.pointsLines !== undefined) {
|
|
272
284
|
const pointsLinesMaterial = entry.source.material;
|
|
@@ -312,9 +324,14 @@ function addStandardMaterialRequests(input: {
|
|
|
312
324
|
const unlitHasColor = unlitProjection === 'VERTEX_COLOR_AVAILABLE=true';
|
|
313
325
|
for (const submesh of entry.mesh.submeshes) {
|
|
314
326
|
const material = entry.source.materials[submesh.materialSlot] ?? entry.source.material;
|
|
327
|
+
const forwardProgram = forwardPrograms.get(
|
|
328
|
+
`${entry.renderableIndex}:${material.materialHandle ?? -1}`,
|
|
329
|
+
);
|
|
315
330
|
const materialShaderId =
|
|
316
331
|
entry.source.skin === undefined
|
|
317
|
-
? (
|
|
332
|
+
? (forwardProgram?.materialShaderId ??
|
|
333
|
+
material.materialShaderId ??
|
|
334
|
+
'forgeax::default-unlit')
|
|
318
335
|
: SKIN_MATERIAL_SHADER_ID;
|
|
319
336
|
const renderState = geometryRenderStateForPass(
|
|
320
337
|
recoveryRenderState(materialShaderId, material, submesh.topology) as ReturnType<
|
|
@@ -370,6 +387,13 @@ function addStandardMaterialRequests(input: {
|
|
|
370
387
|
const materialCapabilityVariantSet = isStandardPbrMaterialShader(materialShaderId)
|
|
371
388
|
? standardPbrCapabilityVariantSet
|
|
372
389
|
: capabilityVariantSet;
|
|
390
|
+
const surfaceLayoutKind =
|
|
391
|
+
material.surfaceModel === 'single-layer-medium'
|
|
392
|
+
? input.standardLighting?.kind === 'clustered' &&
|
|
393
|
+
input.internals.device.caps.storageBuffer
|
|
394
|
+
? ('surface-direct-cluster-pbr' as const)
|
|
395
|
+
: ('surface-direct-pbr' as const)
|
|
396
|
+
: undefined;
|
|
373
397
|
const requestedVariant = isSprite
|
|
374
398
|
? materialShaderId === 'forgeax::sprite' && entry.source.spriteInstances !== undefined
|
|
375
399
|
? SPRITE_PASS_PER_INSTANCE_REGION_VARIANT_SET
|
|
@@ -398,6 +422,12 @@ function addStandardMaterialRequests(input: {
|
|
|
398
422
|
indexFormat: entry.mesh.indexFormat,
|
|
399
423
|
...optionalVariant(reflectionFallbackVariant),
|
|
400
424
|
passKind: 'forward',
|
|
425
|
+
...(forwardProgram?.vertexEntry === undefined
|
|
426
|
+
? {}
|
|
427
|
+
: { vertexEntry: forwardProgram.vertexEntry }),
|
|
428
|
+
...(forwardProgram?.fragmentEntry === undefined
|
|
429
|
+
? {}
|
|
430
|
+
: { fragmentEntry: forwardProgram.fragmentEntry }),
|
|
401
431
|
sampleCount: input.sampleCount,
|
|
402
432
|
...optionalColorFormat(input.colorFormatOverride),
|
|
403
433
|
...(input.reflectionFallbackAvailable &&
|
|
@@ -405,6 +435,7 @@ function addStandardMaterialRequests(input: {
|
|
|
405
435
|
? { additionalColorFormats: ['rgba16float'] as const }
|
|
406
436
|
: {}),
|
|
407
437
|
vertexLayoutProjection: meshProjection,
|
|
438
|
+
...(surfaceLayoutKind === undefined ? {} : { layoutKindOverride: surfaceLayoutKind }),
|
|
408
439
|
preserveUndefinedVariant: isSprite && requestedVariant === undefined,
|
|
409
440
|
variantAlreadyResolved:
|
|
410
441
|
isSprite ||
|
|
@@ -610,6 +641,7 @@ export function prepareRecoveryPipelineReadiness(input: {
|
|
|
610
641
|
internals: input.internals,
|
|
611
642
|
pipelineState: input.pipelineState,
|
|
612
643
|
validated: input.validated,
|
|
644
|
+
dispatch: input.dispatch,
|
|
613
645
|
standardLighting: input.standardLighting,
|
|
614
646
|
sampleCount,
|
|
615
647
|
isHdrTarget,
|
|
@@ -113,6 +113,11 @@ export interface ReflectionProbeRecordState {
|
|
|
113
113
|
export interface MaterialShaderPipelineEntry {
|
|
114
114
|
readonly pipeline: RhiRenderPipeline;
|
|
115
115
|
readonly group2Contract: PipelineGroup2Contract;
|
|
116
|
+
/** Producer receipt for the exact artifact selected with this pipeline. */
|
|
117
|
+
readonly receipt?: {
|
|
118
|
+
readonly identity: string;
|
|
119
|
+
readonly generation: number;
|
|
120
|
+
};
|
|
116
121
|
}
|
|
117
122
|
|
|
118
123
|
import type {
|
|
@@ -198,6 +203,7 @@ export interface RenderSystemRuntime {
|
|
|
198
203
|
| {
|
|
199
204
|
readonly vertexColorAvailable?: boolean;
|
|
200
205
|
readonly deformation?: 'rigid' | 'skin';
|
|
206
|
+
readonly variantSet?: string;
|
|
201
207
|
readonly clustered?: boolean;
|
|
202
208
|
readonly reflectionFallback?: boolean;
|
|
203
209
|
readonly pass?: 'forward' | 'shadow' | 'depth';
|
|
@@ -221,7 +227,15 @@ export interface RenderSystemRuntime {
|
|
|
221
227
|
vertexLayout?: string,
|
|
222
228
|
vertexLayoutProjection?: VertexLayoutProjection,
|
|
223
229
|
shaderModuleMode?: RenderFeatureShaderModuleMode,
|
|
224
|
-
layoutKindOverride?:
|
|
230
|
+
layoutKindOverride?:
|
|
231
|
+
| 'pbr'
|
|
232
|
+
| 'pbr-skin'
|
|
233
|
+
| 'gpu-driven-pbr'
|
|
234
|
+
| 'gpu-driven-skin'
|
|
235
|
+
| 'gpu-driven-cluster-pbr'
|
|
236
|
+
| 'gpu-driven-cluster-skin'
|
|
237
|
+
| 'surface-direct-pbr'
|
|
238
|
+
| 'surface-direct-cluster-pbr',
|
|
225
239
|
/** Optional vertex entry override for receipt-owned scene-index passes. */
|
|
226
240
|
vertexEntryPoint?: string,
|
|
227
241
|
additionalColorFormats?: readonly GPUTextureFormat[],
|
|
@@ -246,7 +260,15 @@ export interface RenderSystemRuntime {
|
|
|
246
260
|
vertexLayout?: string,
|
|
247
261
|
vertexLayoutProjection?: VertexLayoutProjection,
|
|
248
262
|
shaderModuleMode?: RenderFeatureShaderModuleMode,
|
|
249
|
-
layoutKindOverride?:
|
|
263
|
+
layoutKindOverride?:
|
|
264
|
+
| 'pbr'
|
|
265
|
+
| 'pbr-skin'
|
|
266
|
+
| 'gpu-driven-pbr'
|
|
267
|
+
| 'gpu-driven-skin'
|
|
268
|
+
| 'gpu-driven-cluster-pbr'
|
|
269
|
+
| 'gpu-driven-cluster-skin'
|
|
270
|
+
| 'surface-direct-pbr'
|
|
271
|
+
| 'surface-direct-cluster-pbr',
|
|
250
272
|
/** Optional vertex entry override for receipt-owned scene-index passes. */
|
|
251
273
|
vertexEntryPoint?: string,
|
|
252
274
|
additionalColorFormats?: readonly GPUTextureFormat[],
|
|
@@ -413,6 +435,8 @@ export interface PipelineState {
|
|
|
413
435
|
readonly probeInstancesBindGroupLayout?: BindGroupLayout;
|
|
414
436
|
readonly identityInstanceBuffer: Buffer;
|
|
415
437
|
readonly defaultSampler: Sampler;
|
|
438
|
+
/** Nearest/clamp sampler required by r32float Surface depth input. */
|
|
439
|
+
readonly surfaceMediumDepthSampler?: Sampler;
|
|
416
440
|
readonly fallbackTextureView: TextureView;
|
|
417
441
|
readonly unlitPipeline: RhiRenderPipeline | null;
|
|
418
442
|
readonly standardPipeline: RhiRenderPipeline | null;
|
|
@@ -427,10 +451,16 @@ export interface PipelineState {
|
|
|
427
451
|
readonly pbrPipelineLayout: PipelineLayout | null;
|
|
428
452
|
/** Dedicated slot-3 layout for scene-index GPU-driven Standard PBR draws. */
|
|
429
453
|
readonly gpuDrivenInstancesBindGroupLayout?: BindGroupLayout | null;
|
|
454
|
+
/** Direct Surface slot-3 ABI: instances + retained medium frame resources. */
|
|
455
|
+
readonly surfaceDirectInstancesBindGroupLayout?: BindGroupLayout | null;
|
|
430
456
|
readonly gpuDrivenPbrPipelineLayout?: PipelineLayout | null;
|
|
431
457
|
/** Device-owned shader modules paired with their exact Standard PBR receipts. */
|
|
432
458
|
readonly gpuDrivenPbrPrograms?: ReadonlyMap<string, GpuDrivenPbrProgram>;
|
|
433
459
|
readonly gpuDrivenPbrSkinPipelineLayout?: PipelineLayout | null;
|
|
460
|
+
/** Clustered group(2) layouts paired with the scene-index slot(3). */
|
|
461
|
+
readonly gpuDrivenClusterPbrPipelineLayout?: PipelineLayout | null;
|
|
462
|
+
readonly gpuDrivenClusterPbrSkinPipelineLayout?: PipelineLayout | null;
|
|
463
|
+
readonly gpuDrivenClusterMeshBindGroupLayout?: BindGroupLayout | null;
|
|
434
464
|
readonly pbrProbePipelineLayout?: PipelineLayout | null;
|
|
435
465
|
readonly hdrpPbrPipelineLayout: PipelineLayout | null;
|
|
436
466
|
readonly hdrpMeshBindGroupLayout?: BindGroupLayout | null;
|
|
@@ -579,6 +609,8 @@ export interface _StandardForwardSceneView {
|
|
|
579
609
|
readonly gpuDrivenSceneMaterialBuffer?: Buffer;
|
|
580
610
|
/** Concrete main-pass draw identities already claimed by the capable GPU lane. */
|
|
581
611
|
readonly gpuDrivenDrawKeys?: ReadonlySet<string>;
|
|
612
|
+
/** Stable world identities used to construct the claimed draw keys. */
|
|
613
|
+
readonly gpuDrivenWorldKeys?: readonly number[];
|
|
582
614
|
readonly gpuDrivenShadowViews?: ShadowViewStatePool;
|
|
583
615
|
readonly gpuDrivenShadowBatchProjections?: ReadonlyMap<
|
|
584
616
|
string,
|
|
@@ -601,7 +633,11 @@ export interface _StandardForwardSceneView {
|
|
|
601
633
|
readonly pointsLines: PointsLinesRecordOwner | undefined;
|
|
602
634
|
readonly materialBgAssemblyCache: Map<string, MaterialBgAssemblyCacheEntry>;
|
|
603
635
|
/** Record-stage proof callback; invoked only after a real draw command is encoded. */
|
|
604
|
-
readonly onRenderableDraw?: (
|
|
636
|
+
readonly onRenderableDraw?: (
|
|
637
|
+
entry: ValidatedRenderable,
|
|
638
|
+
submeshIndex?: number,
|
|
639
|
+
receipt?: { readonly lane: 'cpu' | 'gpu'; readonly ready: boolean },
|
|
640
|
+
) => void;
|
|
605
641
|
readonly reflectionProbes?: ReflectionProbeRecordState;
|
|
606
642
|
materialUboPayloadCache?: {
|
|
607
643
|
readonly materialSlots: readonly MaterialSnapshot[];
|
|
@@ -82,6 +82,8 @@ export interface GpuDrivenShadowBatch {
|
|
|
82
82
|
readonly deformation: 'rigid' | 'skin';
|
|
83
83
|
/** Complete binding for this batch, including opaque batches after custom casters. */
|
|
84
84
|
readonly materialGroup: BindGroup;
|
|
85
|
+
/** Receipt-derived material BG for alpha-mask batches; opaque uses the pass singleton. */
|
|
86
|
+
readonly alphaMaskMaterialGroup?: BindGroup | undefined;
|
|
85
87
|
readonly vertexBuffer: Buffer;
|
|
86
88
|
readonly indexBuffer?: Buffer | undefined;
|
|
87
89
|
readonly indexFormat?: 'uint16' | 'uint32' | undefined;
|
|
@@ -192,6 +194,7 @@ function ensureTypedShadowViewBg(
|
|
|
192
194
|
);
|
|
193
195
|
}
|
|
194
196
|
const projectorAvailable = pipelineState.projectorAvailable !== false;
|
|
197
|
+
const lowLimitCloudBindings = !extendedLighting && !projectorAvailable;
|
|
195
198
|
try {
|
|
196
199
|
return getOrCreateFromChain(
|
|
197
200
|
frameState.viewBindGroupCache,
|
|
@@ -209,6 +212,9 @@ function ensureTypedShadowViewBg(
|
|
|
209
212
|
? [pipelineState.defaultWhiteTextureView, pipelineState.defaultSampler]
|
|
210
213
|
: []),
|
|
211
214
|
pipelineState.pointsLinesViewBuffer ?? pipelineState.viewUniformBuffer,
|
|
215
|
+
...(lowLimitCloudBindings
|
|
216
|
+
? []
|
|
217
|
+
: [pipelineState.defaultWhiteTextureView, pipelineState.defaultSampler]),
|
|
212
218
|
],
|
|
213
219
|
variant,
|
|
214
220
|
() => {
|
|
@@ -287,6 +293,24 @@ function ensureTypedShadowViewBg(
|
|
|
287
293
|
},
|
|
288
294
|
]
|
|
289
295
|
: []),
|
|
296
|
+
...(lowLimitCloudBindings
|
|
297
|
+
? []
|
|
298
|
+
: [
|
|
299
|
+
{
|
|
300
|
+
binding: 16,
|
|
301
|
+
resource: {
|
|
302
|
+
kind: 'textureView' as const,
|
|
303
|
+
value: pipelineState.defaultWhiteTextureView,
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
binding: 17,
|
|
308
|
+
resource: {
|
|
309
|
+
kind: 'sampler' as const,
|
|
310
|
+
value: pipelineState.defaultSampler,
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
]),
|
|
290
314
|
],
|
|
291
315
|
});
|
|
292
316
|
if (!created.ok) throw created.error;
|
|
@@ -786,6 +810,7 @@ function recordGpuDrivenShadowIfPublished(
|
|
|
786
810
|
visibleBindGroup: projection.visibleBindGroup,
|
|
787
811
|
deformation: projection.deformation,
|
|
788
812
|
materialGroup,
|
|
813
|
+
...(batch.key.admission === 'alpha-mask' ? { alphaMaskMaterialGroup: materialGroup } : {}),
|
|
789
814
|
vertexBuffer: projection.mesh.vertexBuffer.handle,
|
|
790
815
|
...(batch.key.drawKind === 'indexed' && projection.mesh.indexBuffer !== null
|
|
791
816
|
? {
|
|
@@ -1970,7 +1995,11 @@ function ensureGpuDrivenCustomShadowMaterialBg(
|
|
|
1970
1995
|
c: _InternalRenderPipelineContext,
|
|
1971
1996
|
projection: GpuDrivenShadowBatchProjection,
|
|
1972
1997
|
): BindGroup {
|
|
1973
|
-
const shaderId =
|
|
1998
|
+
const shaderId =
|
|
1999
|
+
projection.shadowArtifact.specializationKey ?? projection.shadowArtifact.material;
|
|
2000
|
+
const materialKey = `shadow-material-custom:${shaderId}:${projection.materialEntityKey}:${projection.material.materialHandle ?? -1}:${c.store.materialResourceEpoch}`;
|
|
2001
|
+
const cached = c.materialBgAssemblyCache.get(materialKey);
|
|
2002
|
+
if (cached !== undefined) return cached.bindGroup;
|
|
1974
2003
|
const fallback = c.pipelineState.skylightFallback;
|
|
1975
2004
|
if (fallback === null) {
|
|
1976
2005
|
throw new RhiError({
|
|
@@ -498,6 +498,7 @@ export function recordFxaaPass(
|
|
|
498
498
|
resolve: ResolveContext,
|
|
499
499
|
graphPass?: RhiRenderPassEncoder,
|
|
500
500
|
paramsOverride?: Uint8Array,
|
|
501
|
+
graphOutputFormat?: GPUTextureFormat,
|
|
501
502
|
): void {
|
|
502
503
|
const { runtime, pipelineState, encoder, camera, currentTexture } = c;
|
|
503
504
|
// FXAA samples the graph-owned LDR target and writes the current surface.
|
|
@@ -570,9 +571,17 @@ export function recordFxaaPass(
|
|
|
570
571
|
c.bindGroupCounts,
|
|
571
572
|
);
|
|
572
573
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
574
|
+
// Typed graph passes own their attachment format. In particular, the
|
|
575
|
+
// barrel/LUT split keeps FXAA in the graph-owned rgba16float domain before
|
|
576
|
+
// the final output encoding; falling back to the swapchain format here
|
|
577
|
+
// builds a BGRA pipeline against an RGBA16F attachment and invalidates the
|
|
578
|
+
// command buffer on WebGPU.
|
|
579
|
+
const fxaaColorFormat =
|
|
580
|
+
graphPass !== undefined && graphOutputFormat !== undefined
|
|
581
|
+
? graphOutputFormat
|
|
582
|
+
: runtime.device.caps.storageBuffer
|
|
583
|
+
? pipelineState.format
|
|
584
|
+
: pipelineState.colorAttachmentFormat;
|
|
576
585
|
let fxaaPass = graphPass;
|
|
577
586
|
if (fxaaPass === undefined) {
|
|
578
587
|
const fxaaOutputView = runtime.device.createTextureView(currentTexture, {
|
|
@@ -594,7 +603,22 @@ export function recordFxaaPass(
|
|
|
594
603
|
) as never,
|
|
595
604
|
);
|
|
596
605
|
}
|
|
597
|
-
|
|
606
|
+
let fxaaPipeline = pipelineState.perPassResources.fxaaPipeline;
|
|
607
|
+
if (graphPass !== undefined && graphOutputFormat !== undefined) {
|
|
608
|
+
const entry = runtime.lookupPostProcess?.(FXAA_POST_PROCESS_ID);
|
|
609
|
+
const rebuilt =
|
|
610
|
+
entry === undefined || runtime.getPostProcessPipeline === undefined
|
|
611
|
+
? null
|
|
612
|
+
: runtime.getPostProcessPipeline(
|
|
613
|
+
FXAA_POST_PROCESS_ID,
|
|
614
|
+
fxaaBglLayout,
|
|
615
|
+
[graphOutputFormat],
|
|
616
|
+
entry,
|
|
617
|
+
);
|
|
618
|
+
if (rebuilt !== null) fxaaPipeline = rebuilt;
|
|
619
|
+
}
|
|
620
|
+
if (fxaaPipeline === null) return;
|
|
621
|
+
fxaaPass.setPipeline(fxaaPipeline);
|
|
598
622
|
fxaaPass.setBindGroup(0, fxaaBg);
|
|
599
623
|
fxaaPass.draw(3, 1, 0, 0);
|
|
600
624
|
if (graphPass === undefined) fxaaPass.end();
|