@forgeax/engine-render 0.1.21 → 0.1.24
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 +281 -38
- package/dist/assembly/backend-contract.d.ts +13 -0
- package/dist/assembly/backend-contract.d.ts.map +1 -1
- package/dist/assembly/bundler-contract.d.ts +9 -0
- package/dist/assembly/bundler-contract.d.ts.map +1 -0
- package/dist/assembly/device-feature-admission.d.ts +8 -0
- package/dist/assembly/device-feature-admission.d.ts.map +1 -1
- package/dist/assembly/extended-lighting-fallback.d.ts +13 -0
- package/dist/assembly/extended-lighting-fallback.d.ts.map +1 -0
- package/dist/assembly/factory.d.ts +7 -235
- package/dist/assembly/factory.d.ts.map +1 -1
- package/dist/assembly/host-contract.d.ts +10 -0
- package/dist/assembly/host-contract.d.ts.map +1 -1
- package/dist/assembly/material/assembly.d.ts +3 -2
- package/dist/assembly/material/assembly.d.ts.map +1 -1
- package/dist/assembly/material/standard-layer-projection.d.ts +10 -0
- package/dist/assembly/material/standard-layer-projection.d.ts.map +1 -0
- package/dist/assembly/material-shader-policy.d.ts +168 -0
- package/dist/assembly/material-shader-policy.d.ts.map +1 -0
- package/dist/assembly/material-shader-prewarm.d.ts +21 -0
- package/dist/assembly/material-shader-prewarm.d.ts.map +1 -0
- package/dist/assembly/mesh-ssbo-grow.d.ts +88 -0
- package/dist/assembly/mesh-ssbo-grow.d.ts.map +1 -0
- package/dist/assembly/recovery/device-loss-fanout.d.ts +14 -0
- package/dist/assembly/recovery/device-loss-fanout.d.ts.map +1 -0
- package/dist/assembly/recovery/generation.d.ts +46 -0
- package/dist/assembly/recovery/generation.d.ts.map +1 -0
- package/dist/assembly/recovery/recovery-attempt.d.ts +63 -0
- package/dist/assembly/recovery/recovery-attempt.d.ts.map +1 -0
- package/dist/assembly/recovery/renderer-recover.d.ts +115 -0
- package/dist/assembly/recovery/renderer-recover.d.ts.map +1 -0
- package/dist/assembly/renderer-facade.d.ts +10 -0
- package/dist/assembly/renderer-facade.d.ts.map +1 -0
- package/dist/assembly/renderer-frame-transaction.d.ts +17 -0
- package/dist/assembly/renderer-frame-transaction.d.ts.map +1 -1
- package/dist/assembly/renderer-helpers.d.ts +19 -0
- package/dist/assembly/renderer-helpers.d.ts.map +1 -0
- package/dist/assembly/renderer-lifecycle.d.ts +34 -0
- package/dist/assembly/renderer-lifecycle.d.ts.map +1 -1
- package/dist/assembly/shader-prewarm-policy.d.ts +15 -0
- package/dist/assembly/shader-prewarm-policy.d.ts.map +1 -0
- package/dist/assembly/webgpu-ready-contract.d.ts +9 -0
- package/dist/assembly/webgpu-ready-contract.d.ts.map +1 -0
- package/dist/assembly/webgpu-ready.d.ts +55 -0
- package/dist/assembly/webgpu-ready.d.ts.map +1 -0
- package/dist/assembly/webgpu-renderer.d.ts +152 -0
- package/dist/assembly/webgpu-renderer.d.ts.map +1 -0
- package/dist/authoring.mjs +1 -1
- package/dist/{chunk-PCHBPYML.mjs → chunk-GE3SDD72.mjs} +37 -5
- package/dist/chunk-GE3SDD72.mjs.map +1 -0
- package/dist/chunk-KZFTK6DO.mjs +1191 -0
- package/dist/chunk-KZFTK6DO.mjs.map +1 -0
- package/dist/{chunk-FS2KNUQH.mjs → chunk-Q752SHI5.mjs} +332 -568
- package/dist/chunk-Q752SHI5.mjs.map +1 -0
- package/dist/{chunk-6OPXDQ2E.mjs → chunk-RR5L4SRS.mjs} +33 -294
- package/dist/chunk-RR5L4SRS.mjs.map +1 -0
- package/dist/chunk-TFH5I7JJ.mjs +296 -0
- package/dist/chunk-TFH5I7JJ.mjs.map +1 -0
- package/dist/chunk-UQYS7FRM.mjs +1003 -0
- package/dist/chunk-UQYS7FRM.mjs.map +1 -0
- package/dist/chunk-YKB5DQV7.mjs +345 -0
- package/dist/chunk-YKB5DQV7.mjs.map +1 -0
- package/dist/{chunk-5YADUCA7.mjs → chunk-YRUYGA4A.mjs} +1189 -1217
- package/dist/chunk-YRUYGA4A.mjs.map +1 -0
- package/dist/chunk-Z3YYH2MB.mjs +5082 -0
- package/dist/chunk-Z3YYH2MB.mjs.map +1 -0
- package/dist/cluster-binner.d.ts +5 -0
- package/dist/cluster-binner.d.ts.map +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/light-helpers.d.ts +4 -0
- package/dist/components/light-helpers.d.ts.map +1 -1
- package/dist/components/light-probe.d.ts +9 -0
- package/dist/components/light-probe.d.ts.map +1 -0
- package/dist/components/rect-area-light.d.ts +12 -0
- package/dist/components/rect-area-light.d.ts.map +1 -0
- package/dist/components/scene-instance.d.ts +4 -0
- package/dist/components/scene-instance.d.ts.map +1 -1
- package/dist/components/spot-light.d.ts +3 -0
- package/dist/components/spot-light.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +27276 -23232
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/device-scope.d.ts +2 -0
- package/dist/device/device-scope.d.ts.map +1 -1
- package/dist/device/gpu-residency.d.ts +32 -5
- package/dist/device/gpu-residency.d.ts.map +1 -1
- package/dist/device/lifecycle-transaction.d.ts +2 -0
- package/dist/device/lifecycle-transaction.d.ts.map +1 -0
- package/dist/environment/frame.d.ts +5 -0
- package/dist/environment/frame.d.ts.map +1 -1
- package/dist/environment/inspection.d.ts +7 -0
- package/dist/environment/inspection.d.ts.map +1 -1
- package/dist/environment/lifecycle.d.ts +20 -2
- package/dist/environment/lifecycle.d.ts.map +1 -1
- package/dist/errors/gpu-driven.d.ts +26 -0
- package/dist/errors/gpu-driven.d.ts.map +1 -0
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/recover.d.ts +67 -3
- package/dist/errors/recover.d.ts.map +1 -1
- package/dist/errors/render.d.ts +39 -1
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/extract/contracts.d.ts +899 -0
- package/dist/extract/contracts.d.ts.map +1 -0
- package/dist/extract/gpu-driven.d.ts +50 -0
- package/dist/extract/gpu-driven.d.ts.map +1 -0
- package/dist/extract/visibility.d.ts.map +1 -1
- package/dist/features/host.d.ts +2 -0
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/prepared-gpu-work.d.ts +3 -0
- package/dist/features/prepared-gpu-work.d.ts.map +1 -1
- package/dist/features/prepared-graphics-store.d.ts +2 -0
- package/dist/features/prepared-graphics-store.d.ts.map +1 -1
- package/dist/gpu-driven/batch-topology.d.ts +34 -0
- package/dist/gpu-driven/batch-topology.d.ts.map +1 -1
- package/dist/gpu-driven/prepared-draw.d.ts +63 -0
- package/dist/gpu-driven/prepared-draw.d.ts.map +1 -0
- package/dist/gpu-driven/production-raster.d.ts +126 -2
- package/dist/gpu-driven/production-raster.d.ts.map +1 -1
- package/dist/gpu-driven/view-gpu.d.ts +64 -1
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
- package/dist/gpu-scene-schema.d.ts +14 -0
- package/dist/gpu-scene-schema.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +9 -1
- package/dist/gpu-scene.d.ts.map +1 -1
- package/dist/gpu-usage.d.ts +0 -1
- package/dist/gpu-usage.d.ts.map +1 -1
- package/dist/hdrp-buffers.d.ts +3 -3
- package/dist/hdrp-buffers.d.ts.map +1 -1
- package/dist/ibl/IblPipelineCache.d.ts +7 -6
- package/dist/ibl/IblPipelineCache.d.ts.map +1 -1
- package/dist/ibl/skylight-bind-group.d.ts +7 -1
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +90 -5
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +163 -1
- package/dist/inspection-types.d.ts.map +1 -1
- package/dist/internal.d.ts +9 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.mjs +23 -2
- package/dist/internal.mjs.map +1 -1
- package/dist/light-buffer-layout.d.ts +60 -148
- package/dist/light-buffer-layout.d.ts.map +1 -1
- package/dist/materials.d.ts +34 -10
- package/dist/materials.d.ts.map +1 -1
- package/dist/mesh-material-bindings.d.ts +56 -0
- package/dist/mesh-material-bindings.d.ts.map +1 -1
- package/dist/occlusion-proxy.d.ts +4 -0
- package/dist/occlusion-proxy.d.ts.map +1 -0
- package/dist/pbr-pipeline.d.ts +58 -21
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-forward-lane.d.ts.map +1 -1
- package/dist/pipeline/standard-lighting/graph.d.ts.map +1 -1
- package/dist/pipeline/standard-lighting/light-frame.d.ts +3 -3
- package/dist/pipeline/standard-lighting/light-frame.d.ts.map +1 -1
- package/dist/pipeline/standard-lighting/topology.d.ts +1 -1
- package/dist/pipeline/standard-lighting/topology.d.ts.map +1 -1
- package/dist/pipeline/standard-lighting/transport.d.ts.map +1 -1
- package/dist/pipeline/standard-pipeline.d.ts.map +1 -1
- package/dist/pipeline-builder.d.ts +2 -0
- package/dist/pipeline-builder.d.ts.map +1 -1
- package/dist/pipeline-spec.d.ts +1 -1
- package/dist/pipeline-spec.d.ts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/points-lines/prepare.d.ts +3 -0
- package/dist/points-lines/prepare.d.ts.map +1 -1
- package/dist/points-lines/standard-owner.d.ts +33 -0
- package/dist/points-lines/standard-owner.d.ts.map +1 -0
- package/dist/prepare/extended-lighting/ltc-resources.d.ts +31 -0
- package/dist/prepare/extended-lighting/ltc-resources.d.ts.map +1 -0
- package/dist/prepare/extended-lighting/resources.d.ts +72 -0
- package/dist/prepare/extended-lighting/resources.d.ts.map +1 -0
- package/dist/prepare/extended-lighting/spot-modifiers.d.ts +42 -0
- package/dist/prepare/extended-lighting/spot-modifiers.d.ts.map +1 -0
- package/dist/prepare/extended-lighting/state.d.ts +24 -0
- package/dist/prepare/extended-lighting/state.d.ts.map +1 -0
- package/dist/record/frame-lighting.d.ts +8 -6
- package/dist/record/frame-lighting.d.ts.map +1 -1
- package/dist/record/frame-snapshot.d.ts +55 -10
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame-targets.d.ts.map +1 -1
- package/dist/record/frame.d.ts +21 -5
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/gpu-timing.d.ts +19 -7
- package/dist/record/gpu-timing.d.ts.map +1 -1
- package/dist/record/helpers.d.ts +0 -20
- package/dist/record/helpers.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +20 -2
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +10 -18
- 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.map +1 -1
- package/dist/record/mesh-ssbo.d.ts +11 -3
- package/dist/record/mesh-ssbo.d.ts.map +1 -1
- package/dist/record/recovery-pipeline.d.ts +30 -0
- package/dist/record/recovery-pipeline.d.ts.map +1 -0
- package/dist/record/render-context.d.ts +82 -9
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/shadow-pass.d.ts.map +1 -1
- package/dist/record/typed-frame-graph.d.ts +49 -2
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/record/view-ubo.d.ts +1 -2
- package/dist/record/view-ubo.d.ts.map +1 -1
- package/dist/recovery/render-system-candidate.d.ts +65 -0
- package/dist/recovery/render-system-candidate.d.ts.map +1 -0
- package/dist/reflection/inspection.d.ts +10 -0
- package/dist/reflection/inspection.d.ts.map +1 -0
- package/dist/reflection/projection.d.ts +49 -0
- package/dist/reflection/projection.d.ts.map +1 -1
- package/dist/reflection/record-owner.d.ts +60 -0
- package/dist/reflection/record-owner.d.ts.map +1 -0
- package/dist/render-contract.d.ts +78 -15
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-pipeline.d.ts +7 -0
- package/dist/render-pipeline.d.ts.map +1 -1
- package/dist/render-system-extract-tail.d.ts +12 -0
- package/dist/render-system-extract-tail.d.ts.map +1 -0
- package/dist/render-system-extract.d.ts +252 -30
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system.d.ts +140 -5
- package/dist/render-system.d.ts.map +1 -1
- package/dist/scene/probe-blend-record.d.ts +22 -0
- package/dist/scene/probe-blend-record.d.ts.map +1 -0
- package/dist/scene/probe-blend.d.ts +142 -0
- package/dist/scene/probe-blend.d.ts.map +1 -0
- package/dist/scene/render-scene-types.d.ts +0 -6
- package/dist/scene/render-scene-types.d.ts.map +1 -1
- package/dist/scene/render-scene.d.ts +122 -9
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/scene/visibility/bounds.d.ts +20 -0
- package/dist/scene/visibility/bounds.d.ts.map +1 -0
- package/dist/scene/visibility/budget.d.ts +16 -0
- package/dist/scene/visibility/budget.d.ts.map +1 -0
- package/dist/scene/visibility/facet.d.ts +73 -0
- package/dist/scene/visibility/facet.d.ts.map +1 -0
- package/dist/scene/visibility/gpu-frame-timing.d.ts +41 -0
- package/dist/scene/visibility/gpu-frame-timing.d.ts.map +1 -0
- package/dist/scene/visibility/gpu-lod.d.ts +46 -0
- package/dist/scene/visibility/gpu-lod.d.ts.map +1 -0
- package/dist/scene/visibility/inspection.d.ts +132 -0
- package/dist/scene/visibility/inspection.d.ts.map +1 -0
- package/dist/scene/visibility/lod-selector.d.ts +25 -0
- package/dist/scene/visibility/lod-selector.d.ts.map +1 -0
- package/dist/scene/visibility/occlusion-confidence.d.ts +81 -0
- package/dist/scene/visibility/occlusion-confidence.d.ts.map +1 -0
- package/dist/scene/visibility/occlusion-pass.d.ts +57 -0
- package/dist/scene/visibility/occlusion-pass.d.ts.map +1 -0
- package/dist/scene/visibility/occlusion-query-pool.d.ts +57 -0
- package/dist/scene/visibility/occlusion-query-pool.d.ts.map +1 -0
- package/dist/scene/visibility/occlusion-runtime.d.ts +96 -0
- package/dist/scene/visibility/occlusion-runtime.d.ts.map +1 -0
- package/dist/scene/visibility/types.d.ts +34 -0
- package/dist/scene/visibility/types.d.ts.map +1 -0
- package/dist/ssr/admission.d.ts +122 -0
- package/dist/ssr/admission.d.ts.map +1 -0
- package/dist/ssr/composition.d.ts +32 -0
- package/dist/ssr/composition.d.ts.map +1 -0
- package/dist/ssr/errors.d.ts +39 -0
- package/dist/ssr/errors.d.ts.map +1 -0
- package/dist/ssr/identity.d.ts +13 -0
- package/dist/ssr/identity.d.ts.map +1 -0
- package/dist/systems/skin-palette-allocator.d.ts +1 -1
- package/dist/temporal/frame-coordinator.d.ts +13 -0
- package/dist/temporal/frame-coordinator.d.ts.map +1 -1
- package/dist/temporal/frame.d.ts +2 -0
- package/dist/temporal/frame.d.ts.map +1 -1
- package/dist/temporal/index.mjs +6 -5
- package/dist/temporal/taa-history-store.d.ts +15 -1
- package/dist/temporal/taa-history-store.d.ts.map +1 -1
- package/dist/temporal/transaction.d.ts +5 -0
- package/dist/temporal/transaction.d.ts.map +1 -1
- package/dist/temporal/view.d.ts +7 -0
- package/dist/temporal/view.d.ts.map +1 -1
- package/dist/tilemap-chunk-extract-system.d.ts +1 -1
- package/dist/typed-render-graph-primitives.d.ts +4 -0
- package/dist/typed-render-graph-primitives.d.ts.map +1 -1
- package/dist/volume/passes.d.ts +8 -4
- package/dist/volume/passes.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/__tests__/cluster-grid-default-surface.unit.test.ts +5 -0
- package/src/__tests__/detached-inspection.integration.test.ts +6 -0
- package/src/__tests__/device-feature-admission.unit.test.ts +19 -1
- package/src/__tests__/device-loss-fanout.unit.test.ts +107 -0
- package/src/__tests__/device-scope-lifecycle.unit.test.ts +21 -0
- package/src/__tests__/direct-light-snapshot.unit.test.ts +59 -3
- package/src/__tests__/environment-generation.integration.test.ts +39 -0
- package/src/__tests__/evidence-identity.ts +13 -0
- package/src/__tests__/evidence-identity.unit.test.ts +24 -0
- package/src/__tests__/expose-renderer-errors.unit.test.ts +34 -0
- package/src/__tests__/extended-lighting-recovery.browser.test.ts +14 -0
- package/src/__tests__/extended-lighting-recovery.dawn.test.ts +14 -0
- package/src/__tests__/extended-lighting-recovery.integration.test.ts +81 -0
- package/src/__tests__/extended-lighting-resources.unit.test.ts +51 -0
- package/src/__tests__/extended-lighting-zero-feature.integration.test.ts +52 -0
- package/src/__tests__/factory-contract.integration.test.ts +154 -6
- package/src/__tests__/fallback-row-stride-surface.unit.test.ts +4 -1
- package/src/__tests__/frame-observation.contract.test.ts +15 -0
- package/src/__tests__/gpu-driven-batch-topology-pbr.unit.test.ts +146 -0
- package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +1 -0
- package/src/__tests__/gpu-driven-indirect-raster.dawn.test.ts +1 -0
- package/src/__tests__/gpu-driven-production.integration.test.ts +572 -9
- package/src/__tests__/gpu-driven-scaling.unit.test.ts +66 -2
- package/src/__tests__/gpu-driven-view-gpu-evidence.ts +26 -1
- package/src/__tests__/gpu-driven-view-graph.integration.test.ts +89 -2
- package/src/__tests__/gpu-driven-view.browser.test.ts +3 -3
- package/src/__tests__/gpu-driven-view.dawn.test.ts +3 -3
- package/src/__tests__/gpu-driven-view.unit.test.ts +50 -0
- package/src/__tests__/gpu-lod-evidence.ts +188 -0
- package/src/__tests__/gpu-lod-fallback.integration.test.ts +10 -0
- package/src/__tests__/gpu-lod-indirect.integration.test.ts +40 -0
- package/src/__tests__/gpu-lod-parity.dawn.test.ts +29 -0
- package/src/__tests__/gpu-lod-readiness.integration.test.ts +52 -0
- package/src/__tests__/gpu-lod-schema.unit.test.ts +66 -0
- package/src/__tests__/gpu-lod-selector.unit.test.ts +28 -0
- package/src/__tests__/gpu-lod-silhouette.browser.test.ts +13 -0
- package/src/__tests__/gpu-resource-store-stride.unit.test.ts +66 -1
- package/src/__tests__/gpu-scene.dawn.test.ts +8 -1
- package/src/__tests__/gpu-scene.unit.test.ts +49 -3
- package/src/__tests__/ibl/face-uniforms.unit.test.ts +2 -0
- package/src/__tests__/ibl-residency-publication.unit.test.ts +113 -0
- package/src/__tests__/light-buffer-layout.unit.test.ts +113 -3
- package/src/__tests__/light-inspection.unit.test.ts +55 -0
- package/src/__tests__/light-resource-error.unit.test.ts +43 -0
- package/src/__tests__/lighting-scene-roundtrip.integration.test.ts +109 -0
- package/src/__tests__/lod-bounds.unit.test.ts +42 -0
- package/src/__tests__/lod-cpu-lane.integration.test.ts +55 -0
- package/src/__tests__/lod-cpu-no-change.perf.test.ts +19 -0
- package/src/__tests__/lod-gpu-frame-timing.unit.test.ts +49 -0
- package/src/__tests__/lod-multi-view.integration.test.ts +63 -0
- package/src/__tests__/lod-occlusion-device-loss.integration.test.ts +27 -0
- package/src/__tests__/lod-occlusion-final-decision.integration.test.ts +47 -0
- package/src/__tests__/lod-occlusion-inspection.integration.test.ts +217 -0
- package/src/__tests__/lod-occlusion-inspection.schema.test-d.ts +14 -0
- package/src/__tests__/lod-occlusion-inspection.unit.test.ts +72 -0
- package/src/__tests__/lod-occlusion-visual-evidence.ts +91 -0
- package/src/__tests__/lod-occlusion.browser.test.ts +15 -0
- package/src/__tests__/lod-occlusion.dawn.test.ts +20 -0
- package/src/__tests__/lod-selector.profile.test.ts +35 -0
- package/src/__tests__/lod-selector.unit.test.ts +68 -0
- package/src/__tests__/lod-visibility-identity.unit.test.ts +198 -0
- package/src/__tests__/lod-visibility-lifecycle.integration.test.ts +132 -0
- package/src/__tests__/ltc-resources.unit.test.ts +32 -0
- package/src/__tests__/material-contract-inventory.unit.test.ts +41 -9
- package/src/__tests__/material-cooked-projection.unit.test.ts +19 -1
- package/src/__tests__/material-static-dynamic-route.unit.test.ts +29 -0
- package/src/__tests__/material-stride-surface.unit.test.ts +7 -3
- package/src/__tests__/materials-standard-contract.unit.test.ts +104 -0
- package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +1 -1
- package/src/__tests__/occlusion-confidence.unit.test.ts +168 -0
- package/src/__tests__/occlusion-invalidation.integration.test.ts +37 -0
- package/src/__tests__/occlusion-pass-routing.unit.test.ts +16 -0
- package/src/__tests__/occlusion-pass.dawn.test.ts +20 -0
- package/src/__tests__/occlusion-pass.integration.test.ts +43 -0
- package/src/__tests__/occlusion-pass.rhi-null.test.ts +22 -0
- package/src/__tests__/occlusion-query-pool.rhi-null.test.ts +21 -0
- package/src/__tests__/occlusion-query-pool.unit.test.ts +95 -0
- package/src/__tests__/occlusion-query-ticket.integration.test.ts +47 -0
- package/src/__tests__/occlusion-query.dawn.test.ts +16 -0
- package/src/__tests__/occlusion-query.evidence.ts +178 -0
- package/src/__tests__/occlusion-query.rhi-null.test.ts +31 -0
- package/src/__tests__/occlusion-runtime.unit.test.ts +120 -0
- package/src/__tests__/physical-clearcoat.integration.test.ts +89 -0
- package/src/__tests__/prepared-gpu-driven-pbr.integration.test.ts +196 -0
- package/src/__tests__/prepared-graphics-pipeline-warmup.unit.test.ts +1 -1
- package/src/__tests__/probe-bindings.unit.test.ts +200 -0
- package/src/__tests__/probe-blend-numeric.unit.test.ts +67 -0
- package/src/__tests__/probe-blend-oracle.unit.test.ts +136 -0
- package/src/__tests__/probe-capacity.integration.test.ts +97 -0
- package/src/__tests__/probe-recovery.integration.test.ts +104 -0
- package/src/__tests__/probe-scene-dirty.integration.test.ts +211 -0
- package/src/__tests__/profiler-phase-catalog.test.ts +4 -1
- package/src/__tests__/profiler-phase-token.test.ts +1 -0
- package/src/__tests__/recover-error-policy-owner.unit.test.ts +6 -3
- package/src/__tests__/recovery-candidate-prepare.contract.test.ts +140 -0
- package/src/__tests__/rect-area-boundary.unit.test.ts +24 -0
- package/src/__tests__/reflection-fallback-graph.unit.test.ts +67 -0
- package/src/__tests__/reflection-fallback-inspection.unit.test.ts +77 -0
- package/src/__tests__/reflection-fallback-lifecycle.integration.test.ts +21 -0
- package/src/__tests__/reflection-fallback-projection.unit.test.ts +90 -0
- package/src/__tests__/reflection-fallback-source.unit.test.ts +32 -0
- package/src/__tests__/reflection-probe-owner-placement.unit.test.ts +39 -0
- package/src/__tests__/reflection-probe-record-owner.characterization.unit.test.ts +120 -0
- package/src/__tests__/render-error-code-owner.test-d.ts +1 -0
- package/src/__tests__/render-feature-docs.unit.test.ts +12 -7
- package/src/__tests__/render-graph-fallback.integration.test.ts +24 -0
- package/src/__tests__/render-perf/extended-lighting.bench.test.ts +66 -0
- package/src/__tests__/render-scene-projection.unit.test.ts +447 -18
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +160 -17
- package/src/__tests__/renderer-frame-generation-fence.integration.test.ts +47 -0
- package/src/__tests__/renderer-generation-assembly.unit.test.ts +77 -0
- package/src/__tests__/renderer-generation-failure.unit.test.ts +108 -0
- package/src/__tests__/renderer-producer-root-matrix.integration.test.ts +33 -0
- package/src/__tests__/renderer-recovery-capability-matrix.unit.test.ts +59 -0
- package/src/__tests__/renderer-recovery-contract.unit.test.ts +73 -0
- package/src/__tests__/renderer-recovery-lifecycle.unit.test.ts +216 -0
- package/src/__tests__/renderer-target-history-recovery.integration.test.ts +80 -0
- package/src/__tests__/shader-manifest-fixture.ts +13 -16
- package/src/__tests__/shader-stage-surface.unit.test.ts +1 -1
- package/src/__tests__/skin-motion-regression.unit.test.ts +22 -0
- package/src/__tests__/skinned-shadow-caster.test.ts +2 -2
- package/src/__tests__/spot-modifier-projection.unit.test.ts +70 -0
- package/src/__tests__/ssr-admission-matrix.integration.test.ts +206 -0
- package/src/__tests__/ssr-composition.unit.test.ts +46 -0
- package/src/__tests__/ssr-fallback-zero-work.bench.test.ts +94 -0
- package/src/__tests__/ssr-recovery-errors.unit.test.ts +58 -0
- package/src/__tests__/standard-cluster-variant-resolution.unit.test.ts +67 -0
- package/src/__tests__/standard-clustered-pipeline.unit.test.ts +7 -0
- package/src/__tests__/standard-layer-projection.unit.test.ts +23 -0
- package/src/__tests__/standard-lighting-inspection.integration.test.ts +1 -1
- package/src/__tests__/standard-lighting-write.unit.test.ts +66 -2
- package/src/__tests__/temporal-fallback-generation.integration.test.ts +16 -0
- package/src/__tests__/temporal-view.unit.test.ts +3 -3
- package/src/__tests__/transmission-prewarm.unit.test.ts +111 -32
- package/src/__tests__/visibility-budget.integration.test.ts +140 -0
- package/src/__tests__/visibility-budget.unit.test.ts +70 -0
- package/src/__tests__/visibility-extract.integration.test.ts +11 -6
- package/src/__tests__/volumetric-fog-point-spot-accumulation.integration.test.ts +6 -3
- package/src/__tests__/volumetric-fog-stage-readback.dawn.test.ts +31 -28
- package/src/__tests__/volumetric-fog-topology.unit.test.ts +3 -1
- package/src/assembly/backend-contract.ts +13 -0
- package/src/assembly/bundler-contract.ts +9 -0
- package/src/assembly/device-feature-admission.ts +26 -9
- package/src/assembly/extended-lighting-fallback.ts +216 -0
- package/src/assembly/factory.ts +81 -9634
- package/src/assembly/host-contract.ts +10 -0
- package/src/assembly/material/assembly.ts +18 -2
- package/src/assembly/material/standard-layer-projection.ts +16 -0
- package/src/assembly/material-shader-policy.ts +854 -0
- package/src/assembly/material-shader-prewarm.ts +88 -0
- package/src/assembly/mesh-ssbo-grow.ts +270 -0
- package/src/assembly/recovery/device-loss-fanout.ts +89 -0
- package/src/assembly/recovery/generation.ts +141 -0
- package/src/assembly/recovery/recovery-attempt.ts +800 -0
- package/src/assembly/recovery/renderer-recover.ts +906 -0
- package/src/assembly/renderer-facade.ts +342 -0
- package/src/assembly/renderer-frame-transaction.ts +45 -0
- package/src/assembly/renderer-helpers.ts +99 -0
- package/src/assembly/renderer-lifecycle.ts +159 -0
- package/src/assembly/shader-prewarm-policy.ts +157 -0
- package/src/assembly/webgpu-ready-contract.ts +14 -0
- package/src/assembly/webgpu-ready.ts +4079 -0
- package/src/assembly/webgpu-renderer.ts +4095 -0
- package/src/cluster-binner.ts +31 -0
- package/src/components/__tests__/lighting-authoring.unit.test.ts +39 -0
- package/src/components/__tests__/rect-area-light.unit.test.ts +33 -0
- package/src/components/camera.ts +1 -1
- package/src/components/index.ts +3 -0
- package/src/components/light-helpers.ts +52 -1
- package/src/components/light-probe.ts +13 -0
- package/src/components/rect-area-light.ts +15 -0
- package/src/components/scene-instance.ts +6 -0
- package/src/components/spot-light.ts +3 -0
- package/src/debug-draw-glue.ts +1 -1
- package/src/device/__tests__/extended-lighting-recovery.unit.test.ts +24 -0
- package/src/device/device-scope.ts +35 -6
- package/src/device/gpu-residency.ts +334 -35
- package/src/device/lifecycle-transaction.ts +12 -0
- package/src/environment/frame.ts +6 -0
- package/src/environment/inspection.ts +10 -0
- package/src/environment/lifecycle.ts +122 -9
- package/src/errors/gpu-driven.ts +92 -0
- package/src/errors/index.ts +1 -0
- package/src/errors/recover.ts +108 -5
- package/src/errors/render.ts +72 -1
- package/src/extract/camera.ts +3 -3
- package/src/extract/contracts.ts +974 -0
- package/src/extract/gpu-driven.ts +108 -0
- package/src/extract/visibility.ts +0 -23
- package/src/features/host.ts +16 -0
- package/src/features/prepared-gpu-work.ts +20 -2
- package/src/features/prepared-graphics-store.ts +17 -0
- package/src/gpu-driven/batch-topology.ts +206 -28
- package/src/gpu-driven/prepared-draw.ts +208 -0
- package/src/gpu-driven/production-raster.ts +1046 -39
- package/src/gpu-driven/view-gpu.ts +411 -29
- package/src/gpu-scene-schema.ts +13 -0
- package/src/gpu-scene.ts +137 -67
- package/src/gpu-usage.ts +0 -1
- package/src/hdrp-buffers.ts +6 -6
- package/src/ibl/IblPipelineCache.ts +134 -50
- package/src/ibl/skylight-bind-group.ts +26 -0
- package/src/index.ts +83 -1
- package/src/inspection-types.ts +220 -1
- package/src/internal.ts +38 -0
- package/src/light-buffer-layout.ts +157 -324
- package/src/materials.ts +278 -47
- package/src/mesh-material-bindings.ts +59 -0
- package/src/occlusion-proxy.ts +64 -0
- package/src/pbr-pipeline.ts +290 -60
- package/src/pipeline/standard-forward-lane.ts +47 -0
- package/src/pipeline/standard-lighting/graph.ts +2 -1
- package/src/pipeline/standard-lighting/light-frame.ts +3 -2
- package/src/pipeline/standard-lighting/topology.ts +1 -1
- package/src/pipeline/standard-lighting/transport.ts +2 -1
- package/src/pipeline/standard-pipeline.ts +2 -0
- package/src/pipeline-builder.ts +5 -2
- package/src/pipeline-spec.ts +12 -1
- package/src/plugin.ts +4 -0
- package/src/points-lines/__tests__/cache-recovery.unit.test.ts +22 -0
- package/src/points-lines/prepare.ts +9 -0
- package/src/points-lines/standard-owner.ts +403 -0
- package/src/prepare/__tests__/extended-lighting-capability.unit.test.ts +56 -0
- package/src/prepare/extended-lighting/ltc-resources.ts +136 -0
- package/src/prepare/extended-lighting/resources.ts +389 -0
- package/src/prepare/extended-lighting/spot-modifiers.ts +194 -0
- package/src/prepare/extended-lighting/state.ts +92 -0
- package/src/record/__tests__/frame-targets-recovery.unit.test.ts +60 -0
- package/src/record/__tests__/gpu-timing.unit.test.ts +177 -0
- package/src/record/__tests__/main-pass-geometry.unit.test.ts +26 -1
- package/src/record/__tests__/mesh-ssbo.unit.test.ts +38 -0
- package/src/record/__tests__/recovery-pipeline.unit.test.ts +124 -0
- package/src/record/__tests__/sprite-material-abi.unit.test.ts +28 -13
- package/src/record/__tests__/standard-pbr-ubo-layout.unit.test.ts +47 -4
- package/src/record/__tests__/temporal-payload.unit.test.ts +29 -28
- package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +21 -2
- package/src/record/frame-lighting.ts +252 -53
- package/src/record/frame-snapshot.ts +72 -12
- package/src/record/frame-targets.ts +11 -1
- package/src/record/frame.ts +416 -95
- package/src/record/gpu-timing.ts +108 -44
- package/src/record/helpers.ts +1 -59
- package/src/record/main-pass-geometry.ts +434 -44
- package/src/record/main-pass-material.ts +324 -210
- package/src/record/main-pass-sprite-draws.ts +58 -92
- package/src/record/main-pass.ts +94 -6
- package/src/record/mesh-ssbo.ts +79 -46
- package/src/record/recovery-pipeline.ts +695 -0
- package/src/record/render-context.ts +99 -7
- package/src/record/shadow-pass.ts +66 -40
- package/src/record/typed-frame-graph.ts +270 -84
- package/src/record/view-ubo.ts +17 -27
- package/src/recovery/render-system-candidate.ts +839 -0
- package/src/reflection/inspection.ts +67 -0
- package/src/reflection/projection.ts +196 -1
- package/src/reflection/record-owner.ts +1283 -0
- package/src/render-contract.ts +82 -12
- package/src/render-pipeline.ts +5 -0
- package/src/render-system-extract-tail.ts +2983 -0
- package/src/render-system-extract.ts +290 -2784
- package/src/render-system.ts +1597 -1192
- package/src/scene/__tests__/changed-block-summary.candidate.test.ts +36 -0
- package/src/scene/probe-blend-record.ts +54 -0
- package/src/scene/probe-blend.ts +813 -0
- package/src/scene/render-scene-types.ts +0 -7
- package/src/scene/render-scene.ts +972 -184
- package/src/scene/visibility/bounds.ts +57 -0
- package/src/scene/visibility/budget.ts +40 -0
- package/src/scene/visibility/facet.ts +400 -0
- package/src/scene/visibility/gpu-frame-timing.ts +101 -0
- package/src/scene/visibility/gpu-lod.ts +119 -0
- package/src/scene/visibility/inspection.ts +313 -0
- package/src/scene/visibility/lod-selector.ts +84 -0
- package/src/scene/visibility/occlusion-confidence.ts +478 -0
- package/src/scene/visibility/occlusion-pass.ts +165 -0
- package/src/scene/visibility/occlusion-query-pool.ts +178 -0
- package/src/scene/visibility/occlusion-runtime.ts +672 -0
- package/src/scene/visibility/types.ts +50 -0
- package/src/ssr/admission.ts +451 -0
- package/src/ssr/composition.ts +73 -0
- package/src/ssr/errors.ts +76 -0
- package/src/ssr/identity.ts +12 -0
- package/src/systems/skin-palette-allocator.ts +1 -1
- package/src/temporal/frame-coordinator.ts +30 -1
- package/src/temporal/frame.ts +14 -1
- package/src/temporal/taa-history-store.ts +46 -2
- package/src/temporal/temporal-view.ts +1 -1
- package/src/temporal/transaction.ts +9 -0
- package/src/temporal/view.ts +11 -0
- package/src/tilemap-chunk-extract-system.ts +5 -5
- package/src/transmission/__tests__/standard-transmission.dawn.test.ts +19 -12
- package/src/typed-render-graph-primitives.ts +48 -0
- package/src/volume/passes.ts +46 -49
- package/dist/.tsbuildinfo +0 -1
- package/dist/chunk-5YADUCA7.mjs.map +0 -1
- package/dist/chunk-6OPXDQ2E.mjs.map +0 -1
- package/dist/chunk-BXBQQKFQ.mjs +0 -67
- package/dist/chunk-BXBQQKFQ.mjs.map +0 -1
- package/dist/chunk-FS2KNUQH.mjs.map +0 -1
- package/dist/chunk-PCHBPYML.mjs.map +0 -1
- package/dist/chunk-VFPLTKCU.mjs +0 -192
- package/dist/chunk-VFPLTKCU.mjs.map +0 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { MeshSsboCapacityExceededError, MeshSsboCeilingReachedError } from '@forgeax/engine-assets-runtime';
|
|
2
|
+
import type { Buffer } from '@forgeax/engine-rhi';
|
|
3
|
+
export declare const INITIAL_MESH_SSBO_SLOT_COUNT = 1024;
|
|
4
|
+
/**
|
|
5
|
+
* Derive a usable storage-buffer ceiling from device limits.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors the `SKIN_PALETTE_MAX_BINDING_BYTES` 0/undefined floor pattern
|
|
8
|
+
* (createRenderer.ts:4070-4073): when `maxStorageBufferBindingSize` is 0 or
|
|
9
|
+
* undefined (WebKit `downlevel_webgl2_defaults`), climb the fallback chain —
|
|
10
|
+
* `maxBufferSize` → `maxUniformBufferBindingSize` → WebGPU spec floor
|
|
11
|
+
* 134217728 (128 MiB).
|
|
12
|
+
*
|
|
13
|
+
* Pure helper — no device dependency, directly testable in node.
|
|
14
|
+
*/
|
|
15
|
+
export declare function deriveStorageBufferCeiling(limits: Readonly<{
|
|
16
|
+
maxStorageBufferBindingSize?: number;
|
|
17
|
+
maxBufferSize?: number;
|
|
18
|
+
maxUniformBufferBindingSize?: number;
|
|
19
|
+
}>): number;
|
|
20
|
+
/**
|
|
21
|
+
* Mesh + material buffer wrapper carrying the inner `Buffer` handle plus
|
|
22
|
+
* the byte-size at the time of allocation. The wrapper-object identity is
|
|
23
|
+
* stable across grow events — only `.buffer` and `.sizeInBytes` are mutated
|
|
24
|
+
* in place — so `PipelineState.meshStorageBuffer` / `materialUniformBuffer`
|
|
25
|
+
* fields capture the wrapper once and survive grow events without a re-bind
|
|
26
|
+
* cycle through the public Renderer surface (research §F8 R1).
|
|
27
|
+
*/
|
|
28
|
+
export interface MeshSsboBufferWrapper {
|
|
29
|
+
buffer: Buffer | null;
|
|
30
|
+
sizeInBytes: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function requireMeshSsboBuffer(wrapper: MeshSsboBufferWrapper): asserts wrapper is MeshSsboBufferWrapper & {
|
|
33
|
+
buffer: Buffer;
|
|
34
|
+
};
|
|
35
|
+
/** Closure-local grow state surfaced for spy assertions in unit tests. */
|
|
36
|
+
export interface MeshSsboState {
|
|
37
|
+
slotCount: number;
|
|
38
|
+
mesh: MeshSsboBufferWrapper;
|
|
39
|
+
material: MeshSsboBufferWrapper;
|
|
40
|
+
}
|
|
41
|
+
/** `growMeshSsbo` return shape (D-5: Result-like, never throws). */
|
|
42
|
+
export type MeshSsboGrowResult = {
|
|
43
|
+
readonly ok: true;
|
|
44
|
+
} | {
|
|
45
|
+
readonly ok: false;
|
|
46
|
+
readonly code: 'mesh-ssbo-ceiling-reached' | 'mesh-ssbo-capacity-exceeded';
|
|
47
|
+
/** Pre-grow slotCount — the caller can render up to this many slots (degraded subset). */
|
|
48
|
+
readonly degradedToSlotCount: number;
|
|
49
|
+
};
|
|
50
|
+
/** Minimal device surface the grow controller needs (mocked in unit tests). */
|
|
51
|
+
export interface MeshSsboGrowDevice {
|
|
52
|
+
readonly limits: {
|
|
53
|
+
readonly maxStorageBufferBindingSize: number;
|
|
54
|
+
};
|
|
55
|
+
readonly createBuffer: (descriptor: {
|
|
56
|
+
readonly label?: string;
|
|
57
|
+
readonly size: number;
|
|
58
|
+
readonly usage: number;
|
|
59
|
+
readonly mappedAtCreation?: boolean;
|
|
60
|
+
}) => Buffer;
|
|
61
|
+
}
|
|
62
|
+
/** Minimal error-registry surface (just `fire` — `RhiErrorListenerRegistry` matches). */
|
|
63
|
+
export interface MeshSsboGrowErrorRegistry {
|
|
64
|
+
fire: (e: MeshSsboCeilingReachedError | MeshSsboCapacityExceededError) => void;
|
|
65
|
+
}
|
|
66
|
+
export interface MeshSsboGrowControllerInit {
|
|
67
|
+
readonly device: MeshSsboGrowDevice;
|
|
68
|
+
readonly errorRegistry: MeshSsboGrowErrorRegistry;
|
|
69
|
+
readonly initialSlotCount: number;
|
|
70
|
+
readonly perEntityStride: number;
|
|
71
|
+
readonly meshUsage: number;
|
|
72
|
+
readonly materialUsage: number;
|
|
73
|
+
}
|
|
74
|
+
export interface MeshSsboGrowController {
|
|
75
|
+
readonly state: MeshSsboState;
|
|
76
|
+
/** Allocate the initial mesh + material buffer pair at `initialSlotCount`. */
|
|
77
|
+
readonly initialBuild: () => void;
|
|
78
|
+
/** Grow to satisfy `neededSlots`; idempotent + ceiling-aware. */
|
|
79
|
+
readonly growMeshSsbo: (neededSlots: number) => MeshSsboGrowResult;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Build a closure-scoped mesh-SSBO grow controller. Module-scope so unit
|
|
83
|
+
* tests (`__tests__/mesh-ssbo-grow.test.ts`) can construct it with a fake
|
|
84
|
+
* device + spy errorRegistry without spinning up the full WebGPU renderer
|
|
85
|
+
* (charter F2 minimal surface — the controller is the testable seam).
|
|
86
|
+
*/
|
|
87
|
+
export declare function createMeshSsboGrowController(init: MeshSsboGrowControllerInit): MeshSsboGrowController;
|
|
88
|
+
//# sourceMappingURL=mesh-ssbo-grow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-ssbo-grow.d.ts","sourceRoot":"","sources":["../../src/assembly/mesh-ssbo-grow.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAUlD,eAAO,MAAM,4BAA4B,OAAO,CAAC;AA8CjD;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,QAAQ,CAAC;IACf,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC,CAAC,GACD,MAAM,CAsBR;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACp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AAQ,CAAC,aAAa,EAAE,yBAAyB,CAAC;IAClD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC;IAClC,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,kBAAkB,CAAC;CACpE;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,0BAA0B,GAC/B,sBAAsB,CAuFxB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RhiDevice } from '@forgeax/engine-rhi';
|
|
2
|
+
import type { HealthListenerRegistry, LostListenerRegistry, RhiErrorListenerRegistry } from '../../lifecycle';
|
|
3
|
+
import type { RhiBackendPack } from '../backend-contract';
|
|
4
|
+
/** Wire one device's loss promise into the Renderer-owned observability channels. */
|
|
5
|
+
export declare function attachDeviceLostFanout(device: RhiDevice, pack: RhiBackendPack, registries: {
|
|
6
|
+
lostRegistry: LostListenerRegistry;
|
|
7
|
+
errorRegistry: RhiErrorListenerRegistry;
|
|
8
|
+
healthRegistry: HealthListenerRegistry;
|
|
9
|
+
generation: number;
|
|
10
|
+
currentGeneration: () => number;
|
|
11
|
+
onStaleLoss?: () => void;
|
|
12
|
+
onDeviceLost?: (detail: string) => void;
|
|
13
|
+
}): void;
|
|
14
|
+
//# sourceMappingURL=device-loss-fanout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-loss-fanout.d.ts","sourceRoot":"","sources":["../../../src/assembly/recovery/device-loss-fanout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EACV,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,qFAAqF;AACrF,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,cAAc,EACpB,UAAU,EAAE;IACV,YAAY,EAAE,oBAAoB,CAAC;IACnC,aAAa,EAAE,wBAAwB,CAAC;IACxC,cAAc,EAAE,sBAAsB,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,GACA,IAAI,CAkEN"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type Result } from '@forgeax/engine-types';
|
|
2
|
+
import { type DeviceResourceKind, type DeviceScope, type LifecycleCleanupFailure, type LifecycleResourceSpec } from '../../device/device-scope';
|
|
3
|
+
/** The private value published by one complete renderer device generation. */
|
|
4
|
+
export interface GenerationAggregate<TDevice = unknown, TContext = unknown, TPipeline = unknown, TProducerBindings = unknown, TGraph = unknown> {
|
|
5
|
+
readonly generation: number;
|
|
6
|
+
readonly scope: DeviceScope;
|
|
7
|
+
readonly device: TDevice;
|
|
8
|
+
readonly context: TContext;
|
|
9
|
+
readonly pipeline: TPipeline;
|
|
10
|
+
readonly producerBindings: TProducerBindings;
|
|
11
|
+
readonly graph: TGraph | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface GenerationAssemblyInput<TAggregate extends GenerationAggregate = GenerationAggregate> {
|
|
14
|
+
readonly scope: TAggregate['scope'];
|
|
15
|
+
readonly device: TAggregate['device'];
|
|
16
|
+
readonly context: TAggregate['context'];
|
|
17
|
+
readonly pipeline: TAggregate['pipeline'];
|
|
18
|
+
readonly producerBindings: TAggregate['producerBindings'];
|
|
19
|
+
readonly graph?: TAggregate['graph'];
|
|
20
|
+
readonly roots: readonly LifecycleResourceSpec<unknown>[];
|
|
21
|
+
}
|
|
22
|
+
export interface GenerationAssemblyFailure {
|
|
23
|
+
readonly code: 'generation-assembly-failed';
|
|
24
|
+
readonly generation: number;
|
|
25
|
+
readonly resourceKind: DeviceResourceKind;
|
|
26
|
+
readonly cause: unknown;
|
|
27
|
+
readonly cleanupFailures: readonly LifecycleCleanupFailure[];
|
|
28
|
+
}
|
|
29
|
+
export interface GenerationPublication<TAggregate> {
|
|
30
|
+
current: TAggregate;
|
|
31
|
+
}
|
|
32
|
+
export interface GenerationAllocator {
|
|
33
|
+
readonly activeGeneration: number;
|
|
34
|
+
next(): number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Build all device-bound roots before exposing their generation aggregate.
|
|
38
|
+
* LifecycleTransaction owns creation failure rollback; this function only
|
|
39
|
+
* projects its failure into the generation assembly boundary.
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildGenerationAggregate<TAggregate extends GenerationAggregate = GenerationAggregate>(input: GenerationAssemblyInput<TAggregate>): Promise<Result<TAggregate, GenerationAssemblyFailure>>;
|
|
42
|
+
/** Replace the owner slot only after the complete candidate has been checked. */
|
|
43
|
+
export declare function publishGeneration<TAggregate>(publication: GenerationPublication<TAggregate | undefined>, candidate: TAggregate, isPublishable: (candidate: TAggregate) => boolean): void;
|
|
44
|
+
/** Allocate unique candidate generations while leaving the active value unchanged. */
|
|
45
|
+
export declare function createGenerationAllocator(activeGeneration: number): GenerationAllocator;
|
|
46
|
+
//# sourceMappingURL=generation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generation.d.ts","sourceRoot":"","sources":["../../../src/assembly/recovery/generation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK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AAC,IAAI,EAAE,4BAA4B,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,eAAe,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAC9D;AAED,MAAM,WAAW,qBAAqB,CAAC,UAAU;IAC/C,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,IAAI,IAAI,MAAM,CAAC;CAChB;AA4BD;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,SAAS,mBAAmB,GAAG,mBAAmB,EAE5D,KAAK,EAAE,uBAAuB,CAAC,UAAU,CAAC,GACzC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,yBAAyB,CAAC,CAAC,CA0BxD;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,UAAU,EAC1C,WAAW,EAAE,qBAAqB,CAAC,UAAU,GAAG,SAAS,CAAC,EAC1D,SAAS,EAAE,UAAU,EACrB,aAAa,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,OAAO,GAChD,IAAI,CAKN;AAED,sFAAsF;AACtF,wBAAgB,yBAAyB,CAAC,gBAAgB,EAAE,MAAM,GAAG,mBAAmB,CASvF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type RhiAdapter, type RhiCanvasContext, type RhiDevice, RhiError, type Texture, type TextureView } from '@forgeax/engine-rhi';
|
|
2
|
+
import { type Result } from '@forgeax/engine-types';
|
|
3
|
+
import type { RhiBackendPack } from '../backend-contract';
|
|
4
|
+
import { type RecoveryContinuation, type RecoveryDeadline, type RecoveryPhase } from '../renderer-lifecycle';
|
|
5
|
+
export declare const STANDARD_PBR_REQUIRED_SAMPLED_TEXTURES = 17;
|
|
6
|
+
type ProbeFormat = 'rgba16float' | 'rgba8unorm';
|
|
7
|
+
/**
|
|
8
|
+
* Prove that a freshly acquired candidate device can execute and expose one
|
|
9
|
+
* render attachment before recovery publishes it. Device creation and a
|
|
10
|
+
* successful queue.submit are not sufficient evidence: a replacement device
|
|
11
|
+
* can accept those operations while its first observable frame remains
|
|
12
|
+
* empty. This probe intentionally has no shader, asset, graph, or surface
|
|
13
|
+
* dependency, so its result cleanly separates backend readiness from renderer
|
|
14
|
+
* graph publication.
|
|
15
|
+
*
|
|
16
|
+
* The null backend is structural-only and deliberately has no CPU readback
|
|
17
|
+
* implementation; its contract is already exercised by command-shape tests.
|
|
18
|
+
*/
|
|
19
|
+
export declare function probeCandidateDeviceExecution(device: RhiDevice): Promise<import('@forgeax/engine-types').Result<void, RhiError>>;
|
|
20
|
+
/**
|
|
21
|
+
* Exercise the actual RenderGraphBuilder/CompiledRenderGraph execution path
|
|
22
|
+
* against the candidate graph's physical color target. The graph is tiny and
|
|
23
|
+
* imported-target-only: it isolates pass resolution/encoding from the full
|
|
24
|
+
* renderer topology while preserving the exact candidate texture and view.
|
|
25
|
+
*/
|
|
26
|
+
export declare function probeCandidateGraphExecution(device: RhiDevice, target: {
|
|
27
|
+
readonly texture: Texture;
|
|
28
|
+
readonly view: TextureView;
|
|
29
|
+
readonly format: ProbeFormat;
|
|
30
|
+
}): Promise<import('@forgeax/engine-types').Result<void, RhiError>>;
|
|
31
|
+
export declare function deviceOptionsForAdapter(adapter: Pick<RhiAdapter, 'features' | 'limits'>): {
|
|
32
|
+
requiredFeatures?: GPUFeatureName[];
|
|
33
|
+
requiredLimits?: GPUDeviceDescriptor['requiredLimits'];
|
|
34
|
+
} | undefined;
|
|
35
|
+
export interface AcquiredDeviceGeneration {
|
|
36
|
+
readonly adapter: RhiAdapter;
|
|
37
|
+
readonly device: RhiDevice;
|
|
38
|
+
readonly context: RhiCanvasContext;
|
|
39
|
+
}
|
|
40
|
+
export interface DeviceGenerationAcquisitionFailure {
|
|
41
|
+
readonly stage: 'adapter' | 'device' | 'context';
|
|
42
|
+
readonly error: RhiError;
|
|
43
|
+
}
|
|
44
|
+
export interface RecoveryStepTimeout {
|
|
45
|
+
readonly phase: RecoveryPhase;
|
|
46
|
+
readonly elapsedMs: number;
|
|
47
|
+
readonly cause: RhiError;
|
|
48
|
+
}
|
|
49
|
+
export type RecoveryStepOutcome<T, E> = {
|
|
50
|
+
readonly kind: 'value';
|
|
51
|
+
readonly value: T;
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: 'error';
|
|
54
|
+
readonly error: E;
|
|
55
|
+
} | {
|
|
56
|
+
readonly kind: 'timeout';
|
|
57
|
+
readonly timeout: RecoveryStepTimeout;
|
|
58
|
+
};
|
|
59
|
+
export declare function runRecoveryStep<T, E>(operation: (continuation?: RecoveryContinuation) => Promise<Result<T, E>>, phase: RecoveryPhase, deadline: RecoveryDeadline | undefined, now?: () => number, continuation?: RecoveryContinuation): Promise<RecoveryStepOutcome<T, E>>;
|
|
60
|
+
/** Acquire the same backend generation inputs for boot and recovery. */
|
|
61
|
+
export declare function acquireDeviceGeneration(pack: RhiBackendPack, canvas: HTMLCanvasElement | OffscreenCanvas, deadline?: RecoveryDeadline, continuation?: RecoveryContinuation, onPhase?: (phase: RecoveryPhase) => void): Promise<Result<AcquiredDeviceGeneration, DeviceGenerationAcquisitionFailure>>;
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=recovery-attempt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery-attempt.d.ts","sourceRoot":"","sources":["../../../src/assembly/recovery/recovery-attempt.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAM,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,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ssetRegistry, MipmapShaderModuleFactory } from '@forgeax/engine-assets-runtime';
|
|
2
|
+
import { DynamicTextureStore } from '@forgeax/engine-assets-runtime';
|
|
3
|
+
import type { BindGroupLayout, PipelineLayout, RenderPipeline, RhiCanvasContext, RhiDevice } from '@forgeax/engine-rhi';
|
|
4
|
+
import { type Result } from '@forgeax/engine-rhi';
|
|
5
|
+
import type { MaterialShaderManifestEntry, ShaderCatalog } from '@forgeax/engine-shader';
|
|
6
|
+
import type { ParamSchemaEntry } from '@forgeax/engine-types';
|
|
7
|
+
import { DeviceScope } from '../../device/device-scope';
|
|
8
|
+
import { GpuResidencyCache } from '../../device/gpu-residency';
|
|
9
|
+
import { type RecoverFailure } from '../../errors/recover';
|
|
10
|
+
import type { PipelineState, RecoveryColdWorkGuard, RenderSystemInternals } from '../../record/render-context';
|
|
11
|
+
import type { RecoveryGraphCandidate, RecoveryPostProcessResources, RecoveryRootBundle, RenderSystem } from '../../render-system';
|
|
12
|
+
import type { RhiBackendPack } from '../backend-contract';
|
|
13
|
+
import { type LayoutKind, type MaterialShaderBindingContract, type ShaderDeviceAdapterInternal } from '../material-shader-policy';
|
|
14
|
+
import type { MeshSsboGrowResult, MeshSsboState } from '../mesh-ssbo-grow';
|
|
15
|
+
import type { RecoveryContinuation, RecoveryDeadline, RecoveryPhase } from '../renderer-lifecycle';
|
|
16
|
+
import type { RecoveryFailureLocation, WebGPURendererInternals } from '../webgpu-renderer';
|
|
17
|
+
import { type GenerationAggregate } from './generation';
|
|
18
|
+
type RendererShaderState = {
|
|
19
|
+
readonly device: RhiDevice;
|
|
20
|
+
shaderInstance: ShaderCatalog | null;
|
|
21
|
+
sharedShaderModuleAdapter: ShaderDeviceAdapterInternal | null;
|
|
22
|
+
sharedImmediateShaderModuleAdapter: ShaderDeviceAdapterInternal | null;
|
|
23
|
+
};
|
|
24
|
+
type PerShaderMaterialLayoutCacheEntry = {
|
|
25
|
+
readonly source: string;
|
|
26
|
+
readonly paramSchema: readonly ParamSchemaEntry[];
|
|
27
|
+
readonly layoutKind: LayoutKind;
|
|
28
|
+
readonly layout: {
|
|
29
|
+
materialBgl: BindGroupLayout;
|
|
30
|
+
pipelineLayout: PipelineLayout;
|
|
31
|
+
} | null;
|
|
32
|
+
};
|
|
33
|
+
type RendererPipelineCacheState = {
|
|
34
|
+
materialShaderPipelineCache: Map<string, RenderPipeline>;
|
|
35
|
+
materialShaderManifestEntryCache: Map<string, MaterialShaderManifestEntry>;
|
|
36
|
+
materialShaderVariantResolutionCache: WeakMap<object, Map<string, string | undefined>>;
|
|
37
|
+
group0MaterialLayout: {
|
|
38
|
+
materialBgl: BindGroupLayout;
|
|
39
|
+
pipelineLayout: PipelineLayout;
|
|
40
|
+
} | null;
|
|
41
|
+
viewOnlyMaterialPipelineLayout: PipelineLayout | null;
|
|
42
|
+
viewAndSceneDepthMaterialPipelineLayout: PipelineLayout | null;
|
|
43
|
+
group0ResourceLayouts: Map<string, {
|
|
44
|
+
materialBgl: BindGroupLayout;
|
|
45
|
+
pipelineLayout: PipelineLayout;
|
|
46
|
+
}>;
|
|
47
|
+
preparedMaterialPipelineLayoutCache: Map<string, PipelineLayout>;
|
|
48
|
+
perShaderMaterialLayoutCache: Map<string, PerShaderMaterialLayoutCacheEntry>;
|
|
49
|
+
materialShaderBindingContractCache: Map<string, {
|
|
50
|
+
source: string;
|
|
51
|
+
contract: MaterialShaderBindingContract;
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
type RendererCandidateState = {
|
|
55
|
+
readonly device: RhiDevice;
|
|
56
|
+
readonly context: RhiCanvasContext;
|
|
57
|
+
readonly scope: DeviceScope;
|
|
58
|
+
readonly gpuStore: GpuResidencyCache;
|
|
59
|
+
readonly dynamicTextureStore: DynamicTextureStore;
|
|
60
|
+
readonly shaderState: RendererShaderState;
|
|
61
|
+
readonly pipelineCacheState: RendererPipelineCacheState;
|
|
62
|
+
readonly materialShaderUvSetCounts: Map<string, number>;
|
|
63
|
+
pipelineState: PipelineState | null;
|
|
64
|
+
emptyPostProcessBgl: BindGroupLayout | null;
|
|
65
|
+
growMeshSsbo: ((neededSlots: number) => MeshSsboGrowResult) | undefined;
|
|
66
|
+
meshSsboState: MeshSsboState | undefined;
|
|
67
|
+
};
|
|
68
|
+
type RendererGenerationBindings = {
|
|
69
|
+
readonly gpuStore: GpuResidencyCache;
|
|
70
|
+
readonly dynamicTextureStore: DynamicTextureStore;
|
|
71
|
+
readonly shaderState: RendererShaderState;
|
|
72
|
+
readonly pipelineCacheState: RendererPipelineCacheState;
|
|
73
|
+
readonly materialShaderUvSetCounts: Map<string, number>;
|
|
74
|
+
readonly emptyPostProcessBgl: BindGroupLayout | null;
|
|
75
|
+
readonly growMeshSsbo: ((neededSlots: number) => MeshSsboGrowResult) | undefined;
|
|
76
|
+
readonly meshSsboState: MeshSsboState | undefined;
|
|
77
|
+
};
|
|
78
|
+
type RendererGeneration = GenerationAggregate<RhiDevice, RhiCanvasContext, PipelineState, RendererGenerationBindings, undefined>;
|
|
79
|
+
export interface RendererRecoveryDependencies {
|
|
80
|
+
readonly isDisposed: () => boolean;
|
|
81
|
+
readonly internals: WebGPURendererInternals;
|
|
82
|
+
readonly getActiveDeviceScope: () => DeviceScope;
|
|
83
|
+
readonly getActiveShaderState: () => RendererShaderState;
|
|
84
|
+
readonly getMaterialShaderUvSetCounts: () => Map<string, number>;
|
|
85
|
+
readonly createRendererPipelineCacheState: () => RendererPipelineCacheState;
|
|
86
|
+
readonly getCandidateBuildState: () => RendererCandidateState | undefined;
|
|
87
|
+
readonly setCandidateBuildState: (state: RendererCandidateState | undefined) => void;
|
|
88
|
+
readonly getCandidateShaderState: () => RendererShaderState | undefined;
|
|
89
|
+
readonly setCandidateShaderState: (state: RendererShaderState | undefined) => void;
|
|
90
|
+
readonly getCandidatePipelineCacheState: () => RendererPipelineCacheState | undefined;
|
|
91
|
+
readonly setCandidatePipelineCacheState: (state: RendererPipelineCacheState | undefined) => void;
|
|
92
|
+
readonly getCandidateMaterialShaderUvSetCounts: () => Map<string, number> | undefined;
|
|
93
|
+
readonly setCandidateMaterialShaderUvSetCounts: (state: Map<string, number> | undefined) => void;
|
|
94
|
+
readonly setCandidateEmptyPostProcessBgl: (layout: BindGroupLayout | null | undefined) => void;
|
|
95
|
+
readonly getShader: () => ShaderCatalog;
|
|
96
|
+
readonly assets: AssetRegistry;
|
|
97
|
+
readonly adaptMipmapShaderModuleFactory: (factory: RhiBackendPack['createShaderModule']) => MipmapShaderModuleFactory | undefined;
|
|
98
|
+
readonly buildPipeline: (scope?: DeviceScope, device?: RhiDevice, residencyStore?: GpuResidencyCache) => Promise<PipelineState>;
|
|
99
|
+
readonly getMaterialShaderPipeline: NonNullable<RenderSystemInternals['getMaterialShaderPipeline']>;
|
|
100
|
+
readonly getMaterialShaderPipelineEntry: NonNullable<RenderSystemInternals['getMaterialShaderPipelineEntry']>;
|
|
101
|
+
readonly getCachedMaterialShaderBindingContract: NonNullable<RenderSystemInternals['getMaterialShaderBindingContract']>;
|
|
102
|
+
readonly getParamSchema: NonNullable<RenderSystemInternals['getParamSchema']>;
|
|
103
|
+
readonly getMaterialBindGroupLayout: NonNullable<RenderSystemInternals['getMaterialBindGroupLayout']>;
|
|
104
|
+
readonly metrics: RenderSystemInternals['metrics'];
|
|
105
|
+
readonly buildPostProcessPipeline: NonNullable<RenderSystemInternals['buildPostProcessPipeline']>;
|
|
106
|
+
readonly renderSystem: RenderSystem;
|
|
107
|
+
readonly createRecoveryFailureLocation: (phase: RecoveryPhase, cause: unknown, overrides?: Partial<Omit<RecoveryFailureLocation, 'phase' | 'cause'>>) => RecoveryFailureLocation;
|
|
108
|
+
readonly publishAndRetireRendererGeneration: (candidate: RendererGeneration, candidatePostProcessResources: RecoveryPostProcessResources, recoveryRootBundle: RecoveryRootBundle, recoveryGraphCandidate: RecoveryGraphCandidate | undefined, recoveryColdWorkGuard: RecoveryColdWorkGuard) => void;
|
|
109
|
+
}
|
|
110
|
+
export interface RendererRecovery {
|
|
111
|
+
recoverOnce(deadline: RecoveryDeadline, deadlineExpired: (phase: RecoveryPhase) => boolean, setCandidateCleanup: (cleanup: () => void) => void, continuation: RecoveryContinuation, setRecoveryPhase: (phase: RecoveryPhase) => void, onRootsCommitted: (count: number) => void, onFailure: (failure: RecoveryFailureLocation) => void): Promise<Result<void, RecoverFailure>>;
|
|
112
|
+
}
|
|
113
|
+
export declare function createRendererRecovery(deps: RendererRecoveryDependencies): RendererRecovery;
|
|
114
|
+
export {};
|
|
115
|
+
//# sourceMappingURL=renderer-recover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-recover.d.ts","sourceRoot":"","sources":["../../../src/assembly/recovery/renderer-recover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC/F,OAAO,EAA6B,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAChG,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,SAAS,EACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAW,KAAK,MAAM,EAAY,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,KAAK,EAAU,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAQzE,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,sBAAsB,EACtB,4BAA4B,EAC5B,kBAAkB,EAClB,YAAY,EACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAA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-0,0 +1,10 @@
|
|
|
1
|
+
import { type RendererOperationCause } from '../errors/render';
|
|
2
|
+
import type { Renderer, RenderProfile } from '../render-contract';
|
|
3
|
+
import type { RendererHostImplementation } from './host-contract';
|
|
4
|
+
/** Narrow the concrete host to the lease/receipt-only public contract. */
|
|
5
|
+
export declare function exposeRenderer(renderer: RendererHostImplementation): Renderer;
|
|
6
|
+
export declare function toError(value: unknown): Error;
|
|
7
|
+
export declare function structuredRendererCause(cause: unknown, operation: string): RendererOperationCause;
|
|
8
|
+
export declare function validateRenderProfile(profile: RenderProfile): string | undefined;
|
|
9
|
+
export declare function freezeRenderProfile(profile: RenderProfile): RenderProfile;
|
|
10
|
+
//# sourceMappingURL=renderer-facade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-facade.d.ts","sourceRoot":"","sources":["../../src/assembly/renderer-facade.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,sBAAsB,EAE5B,MAAM,kBAAkB,CAAC;AAM1B,OAAO,KAAK,EACV,QAAQ,EAKR,aAAa,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAGlE,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,QAAQ,EAAE,0BAA0B,GAAG,QAAQ,CAoL7E;AAMD,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAG7C;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,sBAAsB,CA0BjG;AA2DD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CA4BhF;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAKzE"}
|
|
@@ -23,7 +23,24 @@ export interface RendererFrameTransactionSteps<T> {
|
|
|
23
23
|
readonly submit: (candidate: T) => RendererFrameStageResult<void>;
|
|
24
24
|
readonly commit: (candidate: T) => void;
|
|
25
25
|
readonly abort?: (failure: RendererFrameStageFailure) => void;
|
|
26
|
+
readonly generationFence?: RendererGenerationFence;
|
|
26
27
|
}
|
|
28
|
+
export interface RendererGenerationFence {
|
|
29
|
+
readonly capturedGeneration: number;
|
|
30
|
+
readonly currentGeneration: () => number;
|
|
31
|
+
}
|
|
32
|
+
export type ContinuationKind = 'readback' | 'query' | 'mapAsync' | 'queue-completion';
|
|
33
|
+
export interface ContinuationTerminationReason {
|
|
34
|
+
readonly code: 'device-lost' | 'disposed' | 'stale-generation';
|
|
35
|
+
readonly detail?: unknown;
|
|
36
|
+
}
|
|
37
|
+
export interface ContinuationTerminator {
|
|
38
|
+
terminate(reason: ContinuationTerminationReason): boolean;
|
|
39
|
+
promise(): Promise<ContinuationTerminationReason>;
|
|
40
|
+
isTerminated(): boolean;
|
|
41
|
+
guard(kind: ContinuationKind): boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare function createContinuationTerminator(): ContinuationTerminator;
|
|
27
44
|
/**
|
|
28
45
|
* Run the four renderer stages behind one commit barrier. A stage can expose
|
|
29
46
|
* only a structured failure; the candidate is never published until submit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-frame-transaction.d.ts","sourceRoot":"","sources":["../../src/assembly/renderer-frame-transaction.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,SAAS,EAAE,CAAC,EACZ,OAAO,GAAE,MAAM,IAAsB,GACpC,wBAAwB,CAAC,CAAC,CAAC,CAe7B;AAED,MAAM,MAAM,kBAAkB,GAAG,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AAE,MAAM,MAAM,CAAC;CAC1C;AAED,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,kBAAkB,CAAC;AAEtF,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,UAAU,GAAG,kBAAkB,CAAC;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC;IAC1D,OAAO,IAAI,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAClD,YAAY,IAAI,OAAO,CAAC;IACxB,KAAK,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC;CACxC;AAED,wBAAgB,4BAA4B,IAAI,sBAAsB,CAiBrE;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,CAAC,EAC/C,KAAK,EAAE,6BAA6B,CAAC,CAAC,CAAC,GAErC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACxC;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,yBAAyB,CAAA;CAAE,CAyBpE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Result, RhiCanvasContext, RhiDevice } from '@forgeax/engine-rhi';
|
|
2
|
+
import { RhiError } from '@forgeax/engine-rhi';
|
|
3
|
+
import type { RhiErrorListenerRegistry } from '../lifecycle';
|
|
4
|
+
import { type PipelineState } from '../render-system';
|
|
5
|
+
/** Minimum device-bound surface contract needed by lazy context configuration. */
|
|
6
|
+
export interface RendererSurfaceInternals {
|
|
7
|
+
readonly device: RhiDevice;
|
|
8
|
+
readonly context: RhiCanvasContext;
|
|
9
|
+
readonly pack: {
|
|
10
|
+
readonly instrumentation?: {
|
|
11
|
+
readonly resolveSurfaceDevice?: (device: RhiDevice) => Result<RhiDevice, RhiError>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare function wrapDisposeError(cause: unknown, step: string): RhiError;
|
|
16
|
+
export declare function ensureContextConfigured(internals: RendererSurfaceInternals, state: PipelineState, errorRegistry: RhiErrorListenerRegistry, context?: RhiCanvasContext, device?: RhiDevice): Result<void, RhiError>;
|
|
17
|
+
export declare function runShimSyncStep<T>(fn: () => Result<T, RhiError>, fallbackCode: 'shader-compile-failed' | 'webgpu-runtime-error' | 'queue-write-buffer-out-of-bounds', expected: string, hint: string): Result<T, RhiError>;
|
|
18
|
+
export declare function runShimStep<T>(fn: () => Promise<Result<T, RhiError>>, fallbackCode: 'shader-compile-failed' | 'webgpu-runtime-error', expected: string, hint: string): Promise<Result<T, RhiError>>;
|
|
19
|
+
//# sourceMappingURL=renderer-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-helpers.d.ts","sourceRoot":"","sources":["../../src/assembly/renderer-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAW,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAExE,kFAAkF;AAClF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,eAAe,CAAC,EAAE;YACzB,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;SACpF,CAAC;KACH,CAAC;CACH;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAQvE;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,wBAAwB,EACnC,KAAK,EAAE,aAAa,EACpB,aAAa,EAAE,wBAAwB,EACvC,OAAO,GAAE,gBAAoC,EAC7C,MAAM,GAAE,SAA4B,GACnC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAqBxB;AAED,wBAAgB,eAAe,CAAC,CAAC,EAC/B,EAAE,EAAE,MAAM,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,EAC7B,YAAY,EACR,uBAAuB,GACvB,sBAAsB,GACtB,kCAAkC,EACtC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAcrB;AAED,wBAAsB,WAAW,CAAC,CAAC,EACjC,EAAE,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EACtC,YAAY,EAAE,uBAAuB,GAAG,sBAAsB,EAC9D,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAc9B"}
|
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
import type { RendererState } from '../render-contract';
|
|
2
2
|
/** Lifecycle states that may accept a new frame operation. */
|
|
3
3
|
export declare function isRendererStateOperational(state: RendererState): boolean;
|
|
4
|
+
export declare const RECOVERY_TOTAL_DEADLINE_MS = 20000;
|
|
5
|
+
export declare const RECOVERY_ADAPTER_DEADLINE_MS = 10000;
|
|
6
|
+
export declare const RECOVERY_DEVICE_DEADLINE_MS = 10000;
|
|
7
|
+
export declare const RECOVERY_PHASES: readonly ["quiesce", "acquire-adapter", "acquire-device", "rehydrate", "compile-graph", "publish", "cleanup"];
|
|
8
|
+
export type RecoveryPhase = (typeof RECOVERY_PHASES)[number];
|
|
9
|
+
export type RecoveryGuidance = 'retry' | 'repair-owner' | 'rebuild-renderer';
|
|
10
|
+
export interface RendererLifecycle {
|
|
11
|
+
state(): RendererState;
|
|
12
|
+
transition(next: RendererState): boolean;
|
|
13
|
+
states(): readonly RendererState[];
|
|
14
|
+
}
|
|
15
|
+
export declare function createRendererLifecycle(initial?: RendererState): RendererLifecycle;
|
|
16
|
+
export interface RecoveryDeadline {
|
|
17
|
+
readonly startedAt: number;
|
|
18
|
+
readonly totalDeadlineMs: number;
|
|
19
|
+
readonly adapterDeadlineMs: number;
|
|
20
|
+
readonly deviceDeadlineMs: number;
|
|
21
|
+
readonly deadlineAt: number;
|
|
22
|
+
beginDeviceAcquisition(now: number): void;
|
|
23
|
+
isValid(phase: RecoveryPhase, now: number): boolean;
|
|
24
|
+
elapsed(now: number): number;
|
|
25
|
+
}
|
|
26
|
+
export declare function createRecoveryDeadline(startedAt: number): RecoveryDeadline;
|
|
27
|
+
export interface RecoveryContinuation {
|
|
28
|
+
isValid(phase: RecoveryPhase, now: number): boolean;
|
|
29
|
+
abandon(now: number): void;
|
|
30
|
+
cleanupOnce(): void;
|
|
31
|
+
}
|
|
32
|
+
export declare function createRecoveryContinuation(deadline: RecoveryDeadline, cleanup: () => void): RecoveryContinuation;
|
|
33
|
+
export interface SingleFlight<T> {
|
|
34
|
+
run(): Promise<T>;
|
|
35
|
+
inFlight(): Promise<T> | undefined;
|
|
36
|
+
}
|
|
37
|
+
export declare function createSingleFlight<T>(factory: () => Promise<T>): SingleFlight<T>;
|
|
4
38
|
//# sourceMappingURL=renderer-lifecycle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-lifecycle.d.ts","sourceRoot":"","sources":["../../src/assembly/renderer-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM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M,GAAG,OAAO,CAAC;IACpD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CA4B1E;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACpD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,IAAI,IAAI,CAAC;CACrB;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,MAAM,IAAI,GAClB,oBAAoB,CAqBtB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAClB,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACpC;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAwBhF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Result, RhiError, ShaderModule } from '@forgeax/engine-rhi';
|
|
2
|
+
import { type MaterialShaderManifestEntry } from '@forgeax/engine-shader';
|
|
3
|
+
/** Minimum sampled-texture limit needed by Standard transmission variants. */
|
|
4
|
+
export declare const STANDARD_PBR_REQUIRED_SAMPLED_TEXTURES = 17;
|
|
5
|
+
/** Select HDRP variants that must be seeded during ready-state construction. */
|
|
6
|
+
export declare function selectHdrpPbrPrewarmVariants(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean, extendedLightingShaderAvailableOrTransmissionCapable?: boolean, transmissionCapable?: boolean, directionalPcssAvailable?: boolean, projectorAvailable?: boolean): readonly MaterialShaderManifestEntry['variants'][number][];
|
|
7
|
+
/** Return every active-capability pbr-skin variant used by URP and HDRP draws. */
|
|
8
|
+
export declare function selectSkinPrewarmVariants(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean): readonly MaterialShaderManifestEntry['variants'][number][];
|
|
9
|
+
/** Select probe-enabled material modules for recovery candidate prewarming. */
|
|
10
|
+
export declare function selectProbePrewarmVariants(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean, extendedLightingShaderAvailable?: boolean, transmissionCapable?: boolean, directionalPcssAvailable?: boolean, projectorAvailable?: boolean, webgl2Downlevel?: boolean): readonly MaterialShaderManifestEntry['variants'][number][];
|
|
11
|
+
/** Compile and seed a selected material-shader variant set without duplicate modules. */
|
|
12
|
+
export declare function prewarmMaterialShaderVariants(variants: readonly MaterialShaderManifestEntry['variants'][number][], prewarmedModules: Map<string, ShaderModule>, compile: (variant: MaterialShaderManifestEntry['variants'][number], moduleLabel: string) => Promise<Result<ShaderModule, RhiError>>, seed: (moduleLabel: string, module: ShaderModule) => void): Promise<void>;
|
|
13
|
+
/** Select the declared Standard URP transmission variants for exact prewarm. */
|
|
14
|
+
export declare function selectStandardPbrTransmissionPrewarmVariants(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean, directionalPcssAvailable?: boolean, projectorAvailable?: boolean, extendedLightingShaderAvailable?: boolean): readonly MaterialShaderManifestEntry['variants'][number][];
|
|
15
|
+
//# sourceMappingURL=shader-prewarm-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader-prewarm-policy.d.ts","sourceRoot":"","sources":["../../src/assembly/shader-prewarm-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAoB,KAAK,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE5F,8EAA8E;AAC9E,eAAO,MAAM,sCAAsC,KAAK,CAAC;AAEzD,gFAAgF;AAChF,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D,oBAAoB,EAAE,OAAO,EAC7B,wBAAwB,UAAO,EAC/B,kBAAkB,GAAE,OAAc,EAClC,+BAA+B,UAAO,GACrC,SAAS,2BAA2B,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAE,CAkC5D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Generation-scoped buffer and attachment constants used by the ready builder. */
|
|
2
|
+
export declare const VIEW_UBO_BYTES: number;
|
|
3
|
+
export declare const MIPMAP_PREWARM_FORMATS: readonly GPUTextureFormat[];
|
|
4
|
+
export declare const BRIGHT_PARAMS_BYTES = 16;
|
|
5
|
+
export declare const BLUR_PARAMS_BYTES = 16;
|
|
6
|
+
export declare const COMPOSITE_PARAMS_BYTES = 16;
|
|
7
|
+
export declare const HDR_COLOR_ATTACHMENT_FORMAT: GPUTextureFormat;
|
|
8
|
+
export declare const DEPTH_TEXTURE_FORMAT: GPUTextureFormat;
|
|
9
|
+
//# sourceMappingURL=webgpu-ready-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgpu-ready-contract.d.ts","sourceRoot":"","sources":["../../src/assembly/webgpu-ready-contract.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,eAAO,MAAM,cAAc,QAA2B,CAAC;AACvD,eAAO,MAAM,sBAAsB,EAAE,SAAS,gBAAgB,EAI7D,CAAC;AACF,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,2BAA2B,EAAE,gBAAgC,CAAC;AAC3E,eAAO,MAAM,oBAAoB,EAAE,gBAAyC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { RenderPipeline, Result, RhiDevice, ShaderModule } from '@forgeax/engine-rhi';
|
|
2
|
+
import { RhiError } from '@forgeax/engine-rhi';
|
|
3
|
+
import { type ShaderCatalog } from '@forgeax/engine-shader';
|
|
4
|
+
export type { MaterialShaderManifestEntry } from '@forgeax/engine-shader';
|
|
5
|
+
import type { GpuResidencyCache } from '../device/gpu-residency';
|
|
6
|
+
import type { DeviceScope, RhiErrorListenerRegistry } from '../lifecycle';
|
|
7
|
+
import { type PipelineGroup2Contract } from '../pbr-pipeline';
|
|
8
|
+
import { type VolumetricFogShaderSources } from '../render-contract';
|
|
9
|
+
import { type PipelineState } from '../render-system';
|
|
10
|
+
import { type MeshSsboGrowResult, type MeshSsboState } from './mesh-ssbo-grow';
|
|
11
|
+
/**
|
|
12
|
+
* Build the `Renderer.initialization` Promise (D-S3 three-step strict-serial chain).
|
|
13
|
+
*
|
|
14
|
+
* Steps run in order; each rejection short-circuits the chain and the
|
|
15
|
+
* resulting Promise rejects with a structured `RhiError` / `ShaderError`.
|
|
16
|
+
* AI users `await renderer.initialization` once before the first `draw(world)` call;
|
|
17
|
+
* subsequent frames may skip the await (the Promise stays resolved).
|
|
18
|
+
*
|
|
19
|
+
* Step 1 (manifest load): `shader.loadManifest()` populates the runtime
|
|
20
|
+
* registry. Failure = `ShaderError 'manifest-malformed'` /
|
|
21
|
+
* `'shader-not-found'`.
|
|
22
|
+
*
|
|
23
|
+
* Step 2 (pipeline compile): synthesises the PBR pipeline (3 BindGroupLayout
|
|
24
|
+
* + 1 PipelineLayout + 1 ShaderModule + 1 RenderPipeline). Failure =
|
|
25
|
+
* `RhiError 'shader-compile-failed'` / `'feature-not-enabled'` /
|
|
26
|
+
* `'limit-exceeded'`.
|
|
27
|
+
*
|
|
28
|
+
* Step 3 (asset upload): allocates GPU buffers for the builtin cube and
|
|
29
|
+
* triangle meshes via `device.createBuffer` + `queue.writeBuffer`. Failure
|
|
30
|
+
* = `RhiError 'limit-exceeded'` / `'webgpu-runtime-error'` /
|
|
31
|
+
* `'queue-write-buffer-out-of-bounds'`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildReadyWebGPU(rhiDevice: RhiDevice, rendererScope: DeviceScope, getShader: () => ShaderCatalog, gpuStore: GpuResidencyCache, asyncCreateShaderModule: ((device: RhiDevice, desc: {
|
|
34
|
+
code: string;
|
|
35
|
+
label?: string | undefined;
|
|
36
|
+
}) => Promise<Result<ShaderModule, RhiError>>) | undefined, errorRegistry: RhiErrorListenerRegistry,
|
|
37
|
+
/**
|
|
38
|
+
* Material shader modules declared by producer features. These are compiled
|
|
39
|
+
* during Renderer.initialization so prepared graphics do not fail on their first
|
|
40
|
+
* frame while the shared async shader adapter is still warming up.
|
|
41
|
+
*/
|
|
42
|
+
requiredMaterialShaders: readonly string[],
|
|
43
|
+
/** Fullscreen feature modules compiled before the first synchronous frame. */
|
|
44
|
+
requiredFullscreenPostProcesses: readonly {
|
|
45
|
+
readonly identity: string;
|
|
46
|
+
readonly source: string;
|
|
47
|
+
}[], setGrowMeshSsboHook: (hook: (neededSlots: number) => MeshSsboGrowResult, state: MeshSsboState) => void, seedShaderModule: (label: string, module: ShaderModule) => void, seedMaterialShaderPipelineCache: (key: string, pso: RenderPipeline, group2Contract: PipelineGroup2Contract) => void, registerBuiltinTonemap: (source: string) => void,
|
|
48
|
+
/** Register the special FXAA pass' final-output policy params UBO. */
|
|
49
|
+
registerBuiltinFxaa: (source: string) => void, registerBuiltinTemporalPostProcesses: (entries: {
|
|
50
|
+
readonly motionBlur?: string;
|
|
51
|
+
readonly taaResolve?: string;
|
|
52
|
+
}) => void,
|
|
53
|
+
/** Install manifest-owned volume utility sources only after all four modules compile. */
|
|
54
|
+
setVolumetricFogShaderSources: (sources: VolumetricFogShaderSources) => void): Promise<PipelineState>;
|
|
55
|
+
//# sourceMappingURL=webgpu-ready.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgpu-ready.d.ts","sourceRoot":"","sources":["../../src/assembly/webgpu-ready.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAKV,cAAc,EACd,MAAM,EACN,SAAS,EAET,YAAY,EACb,MAAM,qBAAqB,CAAC;AAC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