@forgeax/engine-render 0.1.28 → 0.1.30
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 +856 -126
- package/dist/assembly/atmosphere-shader-prewarm.d.ts +6 -0
- package/dist/assembly/atmosphere-shader-prewarm.d.ts.map +1 -0
- package/dist/assembly/device-feature-admission.d.ts +4 -3
- package/dist/assembly/device-feature-admission.d.ts.map +1 -1
- package/dist/assembly/dynamic-geometry-host.d.ts +27 -0
- package/dist/assembly/dynamic-geometry-host.d.ts.map +1 -1
- package/dist/assembly/dynamic-geometry-runtime.d.ts +20 -0
- package/dist/assembly/dynamic-geometry-runtime.d.ts.map +1 -0
- package/dist/assembly/factory.d.ts +3 -1
- package/dist/assembly/factory.d.ts.map +1 -1
- package/dist/assembly/gpu-driven-owner.d.ts +10 -0
- package/dist/assembly/gpu-driven-owner.d.ts.map +1 -0
- package/dist/assembly/host-contract.d.ts +14 -0
- package/dist/assembly/host-contract.d.ts.map +1 -1
- package/dist/assembly/material/assembly.d.ts +31 -1
- package/dist/assembly/material/assembly.d.ts.map +1 -1
- package/dist/assembly/material/pipeline-helpers.d.ts +24 -0
- package/dist/assembly/material/pipeline-helpers.d.ts.map +1 -0
- package/dist/assembly/material-shader-policy.d.ts +3 -1
- package/dist/assembly/material-shader-policy.d.ts.map +1 -1
- package/dist/assembly/recovery/device-loss-fanout.d.ts.map +1 -1
- package/dist/assembly/recovery/failure-location.d.ts +12 -0
- package/dist/assembly/recovery/failure-location.d.ts.map +1 -0
- package/dist/assembly/recovery/recovery-attempt.d.ts +1 -6
- package/dist/assembly/recovery/recovery-attempt.d.ts.map +1 -1
- package/dist/assembly/recovery/renderer-recover.d.ts +7 -4
- package/dist/assembly/recovery/renderer-recover.d.ts.map +1 -1
- package/dist/assembly/renderer-facade.d.ts.map +1 -1
- package/dist/assembly/renderer-feature-inspection.d.ts +5 -0
- package/dist/assembly/renderer-feature-inspection.d.ts.map +1 -0
- package/dist/assembly/renderer-frame-transaction.d.ts +19 -0
- package/dist/assembly/renderer-frame-transaction.d.ts.map +1 -1
- package/dist/assembly/renderer-helpers.d.ts +3 -0
- package/dist/assembly/renderer-helpers.d.ts.map +1 -1
- package/dist/assembly/renderer-inspection.d.ts +4 -0
- package/dist/assembly/renderer-inspection.d.ts.map +1 -1
- package/dist/assembly/shader-prewarm-policy.d.ts +7 -1
- package/dist/assembly/shader-prewarm-policy.d.ts.map +1 -1
- package/dist/assembly/skin-palette-owner.d.ts +8 -0
- package/dist/assembly/skin-palette-owner.d.ts.map +1 -0
- package/dist/assembly/ssr-shader-prewarm.d.ts +6 -0
- package/dist/assembly/ssr-shader-prewarm.d.ts.map +1 -0
- package/dist/assembly/webgpu-device-loss.d.ts +15 -0
- package/dist/assembly/webgpu-device-loss.d.ts.map +1 -0
- package/dist/assembly/webgpu-pbr-ready.d.ts +38 -0
- package/dist/assembly/webgpu-pbr-ready.d.ts.map +1 -0
- package/dist/assembly/webgpu-ready-mipmap.d.ts +11 -0
- package/dist/assembly/webgpu-ready-mipmap.d.ts.map +1 -0
- package/dist/assembly/webgpu-ready.d.ts +7 -3
- package/dist/assembly/webgpu-ready.d.ts.map +1 -1
- package/dist/assembly/webgpu-renderer-bootstrap.d.ts +10 -0
- package/dist/assembly/webgpu-renderer-bootstrap.d.ts.map +1 -0
- package/dist/assembly/webgpu-renderer-contract.d.ts +62 -0
- package/dist/assembly/webgpu-renderer-contract.d.ts.map +1 -0
- package/dist/assembly/webgpu-renderer-guards.d.ts +9 -0
- package/dist/assembly/webgpu-renderer-guards.d.ts.map +1 -0
- package/dist/assembly/webgpu-renderer-observation.d.ts +6 -0
- package/dist/assembly/webgpu-renderer-observation.d.ts.map +1 -0
- package/dist/assembly/webgpu-renderer-recovery-failure.d.ts +12 -0
- package/dist/assembly/webgpu-renderer-recovery-failure.d.ts.map +1 -0
- package/dist/assembly/webgpu-renderer.d.ts +7 -141
- package/dist/assembly/webgpu-renderer.d.ts.map +1 -1
- package/dist/assembly/webgpu-vertex-layouts.d.ts +28 -84
- package/dist/assembly/webgpu-vertex-layouts.d.ts.map +1 -1
- package/dist/authoring.mjs +2 -2
- package/dist/capture/scene-projection.d.ts +41 -0
- package/dist/capture/scene-projection.d.ts.map +1 -0
- package/dist/{chunk-J52NMQKR.mjs → chunk-7MQ3XBSP.mjs} +1098 -844
- package/dist/chunk-7MQ3XBSP.mjs.map +1 -0
- package/dist/{chunk-GF523LHF.mjs → chunk-BLXGONR2.mjs} +30 -12
- package/dist/chunk-BLXGONR2.mjs.map +1 -0
- package/dist/{chunk-VSL23LZE.mjs → chunk-C3DDSXYK.mjs} +1188 -463
- package/dist/chunk-C3DDSXYK.mjs.map +1 -0
- package/dist/{chunk-IQMKJLNU.mjs → chunk-FUUO4UND.mjs} +443 -30
- package/dist/chunk-FUUO4UND.mjs.map +1 -0
- package/dist/{chunk-J6KACNOH.mjs → chunk-JRBDO2KB.mjs} +617 -7
- package/dist/chunk-JRBDO2KB.mjs.map +1 -0
- package/dist/{chunk-GE3SDD72.mjs → chunk-MDQJPY3T.mjs} +20 -40
- package/dist/chunk-MDQJPY3T.mjs.map +1 -0
- package/dist/{chunk-MYJ5RPJO.mjs → chunk-NO4WZCAH.mjs} +3 -3
- package/dist/chunk-NO4WZCAH.mjs.map +1 -0
- package/dist/{chunk-RBDBZ5R7.mjs → chunk-PA5DRJNI.mjs} +2 -2
- package/dist/chunk-PA5DRJNI.mjs.map +1 -0
- package/dist/{chunk-MBU4ZVE7.mjs → chunk-PSEQ6QPH.mjs} +4655 -892
- package/dist/chunk-PSEQ6QPH.mjs.map +1 -0
- package/dist/{chunk-JAASCMXA.mjs → chunk-S5UE2T5P.mjs} +289 -41
- package/dist/chunk-S5UE2T5P.mjs.map +1 -0
- package/dist/components/camera.d.ts +62 -2
- package/dist/components/camera.d.ts.map +1 -1
- package/dist/components/directional-light.d.ts +2 -2
- package/dist/components/dynamic-resolution.d.ts +15 -0
- package/dist/components/dynamic-resolution.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 +6 -20
- package/dist/components/instances.d.ts.map +1 -1
- package/dist/components/light-helpers.d.ts.map +1 -1
- package/dist/components/reflection-probe.d.ts +1 -0
- package/dist/components/reflection-probe.d.ts.map +1 -1
- package/dist/components/scene-instance.d.ts +2 -1
- package/dist/components/scene-instance.d.ts.map +1 -1
- package/dist/components/screen-space-reflection.d.ts +14 -0
- package/dist/components/screen-space-reflection.d.ts.map +1 -0
- package/dist/components/skylight.d.ts +4 -1
- package/dist/components/skylight.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +14809 -7570
- 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 +3 -14
- package/dist/device/gpu-residency.d.ts.map +1 -1
- package/dist/dynamic-geometry.d.ts.map +1 -1
- package/dist/environment/background.d.ts +7 -0
- package/dist/environment/background.d.ts.map +1 -0
- package/dist/environment/ibl.d.ts +11 -0
- package/dist/environment/ibl.d.ts.map +1 -0
- package/dist/environment/storage.d.ts +14 -0
- package/dist/environment/storage.d.ts.map +1 -0
- package/dist/errors/gpu-driven.d.ts +6 -3
- package/dist/errors/gpu-driven.d.ts.map +1 -1
- package/dist/errors/render.d.ts +41 -4
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/extract/camera.d.ts.map +1 -1
- package/dist/extract/contracts.d.ts +7 -0
- package/dist/extract/contracts.d.ts.map +1 -1
- package/dist/extract/gpu-driven.d.ts +50 -3
- package/dist/extract/gpu-driven.d.ts.map +1 -1
- package/dist/features/host.d.ts +23 -1
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/noise-texture.d.ts +17 -0
- package/dist/features/noise-texture.d.ts.map +1 -0
- package/dist/features/plan.d.ts +83 -2
- package/dist/features/plan.d.ts.map +1 -1
- package/dist/features/prepared-gpu-work.d.ts +37 -4
- package/dist/features/prepared-gpu-work.d.ts.map +1 -1
- package/dist/features/prepared-graphics-store.d.ts.map +1 -1
- package/dist/features/prepared-graphics.d.ts +5 -0
- package/dist/features/prepared-graphics.d.ts.map +1 -1
- package/dist/features/render-graph-compute.d.ts +5 -3
- package/dist/features/render-graph-compute.d.ts.map +1 -1
- package/dist/features/render-graph-contribution.d.ts +11 -3
- package/dist/features/render-graph-contribution.d.ts.map +1 -1
- package/dist/features/render-graph-raster.d.ts +19 -3
- package/dist/features/render-graph-raster.d.ts.map +1 -1
- package/dist/features/types.d.ts +11 -0
- package/dist/features/types.d.ts.map +1 -1
- package/dist/fullscreen-post-process-pass.d.ts +2 -0
- package/dist/fullscreen-post-process-pass.d.ts.map +1 -1
- package/dist/gpu-driven/batch-topology.d.ts +34 -1
- package/dist/gpu-driven/batch-topology.d.ts.map +1 -1
- package/dist/gpu-driven/material-artifacts.d.ts +24 -0
- package/dist/gpu-driven/material-artifacts.d.ts.map +1 -0
- package/dist/gpu-driven/material-bindings.d.ts +7 -0
- package/dist/gpu-driven/material-bindings.d.ts.map +1 -0
- package/dist/gpu-driven/pbr-program.d.ts +10 -0
- package/dist/gpu-driven/pbr-program.d.ts.map +1 -0
- package/dist/gpu-driven/prepared-draw.d.ts +2 -0
- package/dist/gpu-driven/prepared-draw.d.ts.map +1 -1
- package/dist/gpu-driven/production-raster.d.ts +169 -27
- package/dist/gpu-driven/production-raster.d.ts.map +1 -1
- package/dist/gpu-driven/shadow-views.d.ts +126 -0
- package/dist/gpu-driven/shadow-views.d.ts.map +1 -0
- package/dist/gpu-driven/view-gpu.d.ts +18 -2
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
- package/dist/gpu-resource.d.ts +5 -2
- package/dist/gpu-resource.d.ts.map +1 -1
- package/dist/gpu-scene-schema.d.ts +2 -8
- package/dist/gpu-scene-schema.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +14 -0
- package/dist/gpu-scene.d.ts.map +1 -1
- package/dist/gpu-texture-usage.d.ts +1 -0
- package/dist/gpu-texture-usage.d.ts.map +1 -1
- package/dist/hdrp-buffers.d.ts +9 -0
- package/dist/hdrp-buffers.d.ts.map +1 -1
- package/dist/ibl/IblPipelineCache.d.ts +2 -0
- package/dist/ibl/IblPipelineCache.d.ts.map +1 -1
- package/dist/ibl/frame-resources.d.ts +8 -0
- package/dist/ibl/frame-resources.d.ts.map +1 -0
- package/dist/ibl/skylight-bind-group.d.ts +3 -1
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -1
- package/dist/index.d.ts +87 -75
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +10 -8
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +180 -1
- package/dist/inspection-types.d.ts.map +1 -1
- package/dist/instances-derived-bounds.d.ts +11 -0
- package/dist/instances-derived-bounds.d.ts.map +1 -1
- package/dist/instances.d.ts +89 -44
- package/dist/instances.d.ts.map +1 -1
- package/dist/internal.d.ts +3 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.mjs +117 -9
- package/dist/internal.mjs.map +1 -1
- package/dist/lifecycle.d.ts +2 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/material-row.d.ts +15 -0
- package/dist/material-row.d.ts.map +1 -0
- package/dist/materials.d.ts +15 -0
- package/dist/materials.d.ts.map +1 -1
- package/dist/pbr-pipeline.d.ts +23 -5
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/pipeline/render-extent.d.ts +51 -0
- package/dist/pipeline/render-extent.d.ts.map +1 -0
- package/dist/pipeline/standard-build-context.d.ts +7 -0
- package/dist/pipeline/standard-build-context.d.ts.map +1 -0
- package/dist/pipeline/standard-forward-lane.d.ts +3 -2
- package/dist/pipeline/standard-forward-lane.d.ts.map +1 -1
- package/dist/pipeline/standard-output/auto-exposure/capability.d.ts +12 -0
- package/dist/pipeline/standard-output/auto-exposure/capability.d.ts.map +1 -0
- package/dist/pipeline/standard-output/auto-exposure/gpu.d.ts +70 -0
- package/dist/pipeline/standard-output/auto-exposure/gpu.d.ts.map +1 -0
- package/dist/pipeline/standard-output/auto-exposure/graph.d.ts +75 -0
- package/dist/pipeline/standard-output/auto-exposure/graph.d.ts.map +1 -0
- package/dist/pipeline/standard-output/auto-exposure/inspection.d.ts +111 -0
- package/dist/pipeline/standard-output/auto-exposure/inspection.d.ts.map +1 -0
- package/dist/pipeline/standard-output/auto-exposure/oracle.d.ts +16 -0
- package/dist/pipeline/standard-output/auto-exposure/oracle.d.ts.map +1 -0
- package/dist/pipeline/standard-output/auto-exposure/preset.d.ts +14 -0
- package/dist/pipeline/standard-output/auto-exposure/preset.d.ts.map +1 -0
- package/dist/pipeline/standard-output/auto-exposure/state.d.ts +46 -0
- package/dist/pipeline/standard-output/auto-exposure/state.d.ts.map +1 -0
- package/dist/pipeline/standard-output/color-transform.d.ts +27 -0
- package/dist/pipeline/standard-output/color-transform.d.ts.map +1 -0
- package/dist/pipeline/standard-output/graph.d.ts +15 -0
- package/dist/pipeline/standard-output/graph.d.ts.map +1 -0
- package/dist/pipeline/standard-output/lut-admission.d.ts +29 -0
- package/dist/pipeline/standard-output/lut-admission.d.ts.map +1 -0
- package/dist/pipeline/standard-output/lut-gpu.d.ts +48 -0
- package/dist/pipeline/standard-output/lut-gpu.d.ts.map +1 -0
- package/dist/pipeline/standard-output/lut-state.d.ts +68 -0
- package/dist/pipeline/standard-output/lut-state.d.ts.map +1 -0
- package/dist/pipeline/standard-output/resources.d.ts +10 -0
- package/dist/pipeline/standard-output/resources.d.ts.map +1 -0
- package/dist/pipeline/standard-output/types.d.ts +39 -0
- package/dist/pipeline/standard-output/types.d.ts.map +1 -0
- package/dist/pipeline/standard-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-post.d.ts +2 -2
- package/dist/pipeline/standard-post.d.ts.map +1 -1
- package/dist/pipeline/standard-profile.d.ts +2 -1
- package/dist/pipeline/standard-profile.d.ts.map +1 -1
- package/dist/pipeline-builder.d.ts +5 -2
- package/dist/pipeline-builder.d.ts.map +1 -1
- package/dist/pipeline-spec-types.d.ts +4 -0
- package/dist/pipeline-spec-types.d.ts.map +1 -1
- package/dist/pipeline-spec.d.ts +1 -9
- package/dist/pipeline-spec.d.ts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/points-lines/standard-owner.d.ts +1 -1
- package/dist/points-lines/standard-owner.d.ts.map +1 -1
- package/dist/post-process-errors.d.ts +9 -2
- package/dist/post-process-errors.d.ts.map +1 -1
- package/dist/prepare/extended-lighting/resources.d.ts +3 -3
- package/dist/prepare/prepared-graphics-resolver.d.ts +6 -1
- package/dist/prepare/prepared-graphics-resolver.d.ts.map +1 -1
- package/dist/record/dynamic-geometry-consumption.d.ts +15 -0
- package/dist/record/dynamic-geometry-consumption.d.ts.map +1 -0
- package/dist/record/frame-lighting.d.ts +3 -3
- package/dist/record/frame-lighting.d.ts.map +1 -1
- package/dist/record/frame-snapshot.d.ts +109 -13
- 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 +41 -5
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +13 -9
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +43 -3
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass-sprite-draws.d.ts +2 -10
- package/dist/record/main-pass-sprite-draws.d.ts.map +1 -1
- package/dist/record/main-pass.d.ts +14 -2
- package/dist/record/main-pass.d.ts.map +1 -1
- package/dist/record/mesh-ssbo.d.ts +15 -6
- package/dist/record/mesh-ssbo.d.ts.map +1 -1
- package/dist/record/prepared-material-bindings.d.ts +19 -0
- package/dist/record/prepared-material-bindings.d.ts.map +1 -0
- package/dist/record/recovery-pipeline.d.ts +1 -0
- package/dist/record/recovery-pipeline.d.ts.map +1 -1
- package/dist/record/render-context.d.ts +101 -22
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/shadow-pass.d.ts +62 -7
- 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 +39 -8
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/record/view-ubo.d.ts +1 -0
- package/dist/record/view-ubo.d.ts.map +1 -1
- package/dist/recovery/render-system-candidate.d.ts +10 -2
- package/dist/recovery/render-system-candidate.d.ts.map +1 -1
- package/dist/recovery/render-system-roots.d.ts +11 -0
- package/dist/recovery/render-system-roots.d.ts.map +1 -0
- package/dist/recovery/types.d.ts +76 -0
- package/dist/recovery/types.d.ts.map +1 -0
- package/dist/reflection/background.d.ts +14 -0
- package/dist/reflection/background.d.ts.map +1 -0
- package/dist/reflection/filter.d.ts.map +1 -1
- package/dist/reflection/projection.d.ts +1 -0
- package/dist/reflection/projection.d.ts.map +1 -1
- package/dist/reflection/record-owner.d.ts +4 -4
- package/dist/reflection/record-owner.d.ts.map +1 -1
- package/dist/render-contract.d.ts +211 -53
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-graph-primitives.d.ts +1 -0
- package/dist/render-graph-primitives.d.ts.map +1 -1
- package/dist/render-pipeline.d.ts +81 -6
- package/dist/render-pipeline.d.ts.map +1 -1
- package/dist/render-system-extract-tail.d.ts +15 -6
- package/dist/render-system-extract-tail.d.ts.map +1 -1
- package/dist/render-system-extract.d.ts +128 -41
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system-projections.d.ts +22 -0
- package/dist/render-system-projections.d.ts.map +1 -0
- package/dist/render-system.d.ts +27 -77
- package/dist/render-system.d.ts.map +1 -1
- package/dist/scene/render-scene-types.d.ts +14 -7
- package/dist/scene/render-scene-types.d.ts.map +1 -1
- package/dist/scene/render-scene.d.ts +31 -11
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/scene/shadow-visibility.d.ts +5 -0
- package/dist/scene/shadow-visibility.d.ts.map +1 -0
- package/dist/ssao-config.d.ts +8 -6
- package/dist/ssao-config.d.ts.map +1 -1
- package/dist/ssr/admission.d.ts +70 -1
- package/dist/ssr/admission.d.ts.map +1 -1
- package/dist/ssr/compose.d.ts +13 -0
- package/dist/ssr/compose.d.ts.map +1 -0
- package/dist/ssr/errors.d.ts +35 -0
- package/dist/ssr/errors.d.ts.map +1 -1
- package/dist/ssr/graph.d.ts +60 -0
- package/dist/ssr/graph.d.ts.map +1 -0
- package/dist/ssr/history.d.ts +97 -0
- package/dist/ssr/history.d.ts.map +1 -0
- package/dist/ssr/hiz.d.ts +37 -0
- package/dist/ssr/hiz.d.ts.map +1 -0
- package/dist/ssr/inspection.d.ts +42 -0
- package/dist/ssr/inspection.d.ts.map +1 -0
- package/dist/ssr/resources.d.ts +58 -0
- package/dist/ssr/resources.d.ts.map +1 -0
- package/dist/ssr/temporal.d.ts +38 -0
- package/dist/ssr/temporal.d.ts.map +1 -0
- package/dist/systems/skin-palette-allocator.d.ts +32 -10
- package/dist/systems/skin-palette-allocator.d.ts.map +1 -1
- package/dist/systems/skin-palette-types.d.ts +15 -0
- package/dist/systems/skin-palette-types.d.ts.map +1 -1
- package/dist/systems/transparent-dispatch.d.ts +9 -0
- package/dist/systems/transparent-dispatch.d.ts.map +1 -0
- package/dist/targets/material-source.d.ts +7 -0
- package/dist/targets/material-source.d.ts.map +1 -1
- package/dist/temporal/frame-coordinator.d.ts +7 -0
- package/dist/temporal/frame-coordinator.d.ts.map +1 -1
- package/dist/temporal/gpu.d.ts +8 -0
- package/dist/temporal/gpu.d.ts.map +1 -1
- package/dist/temporal/history.d.ts.map +1 -1
- package/dist/temporal/index.mjs +6 -6
- package/dist/temporal/inspection.d.ts.map +1 -1
- package/dist/temporal/standard-scene-data.d.ts +4 -2
- package/dist/temporal/standard-scene-data.d.ts.map +1 -1
- package/dist/temporal/target-coverage-attachment.d.ts +15 -0
- package/dist/temporal/target-coverage-attachment.d.ts.map +1 -0
- package/dist/temporal/temporal-view.d.ts +6 -0
- package/dist/temporal/temporal-view.d.ts.map +1 -1
- package/dist/temporal/view.d.ts +6 -0
- package/dist/temporal/view.d.ts.map +1 -1
- package/dist/typed-render-graph-primitives.d.ts +41 -1
- package/dist/typed-render-graph-primitives.d.ts.map +1 -1
- package/dist/typed-shadow-passes.d.ts +3 -1
- package/dist/typed-shadow-passes.d.ts.map +1 -1
- package/dist/volume/component.d.ts +1 -0
- package/dist/volume/component.d.ts.map +1 -1
- package/dist/volume/temporal.d.ts +6 -0
- package/dist/volume/temporal.d.ts.map +1 -1
- package/package.json +21 -20
- package/src/__tests__/auto-exposure-gpu-evidence.ts +291 -0
- package/src/__tests__/auto-exposure-inspection.unit.test.ts +80 -0
- package/src/__tests__/auto-exposure-transaction.integration.test.ts +99 -0
- package/src/__tests__/auto-exposure.browser.test.ts +33 -0
- package/src/__tests__/auto-exposure.dawn.test.ts +33 -0
- package/src/__tests__/capture-scene-projection.unit.test.ts +24 -0
- package/src/__tests__/detached-inspection.integration.test.ts +5 -0
- package/src/__tests__/device-feature-admission.unit.test.ts +15 -24
- package/src/__tests__/device-loss-fanout.unit.test.ts +43 -0
- package/src/__tests__/device-scope-lifecycle.unit.test.ts +18 -0
- package/src/__tests__/device-scope-stale-matrix.unit.test.ts +18 -0
- package/src/__tests__/docs-gate-green.unit.test.ts +3 -3
- package/src/__tests__/dynamic-geometry-batch.unit.test.ts +157 -0
- package/src/__tests__/dynamic-geometry.unit.test.ts +36 -0
- package/src/__tests__/dynamic-resolution-plugin.integration.test.ts +81 -0
- package/src/__tests__/factory-contract.integration.test.ts +231 -9
- package/src/__tests__/fallback-row-stride-surface.unit.test.ts +19 -0
- package/src/__tests__/feature-depth-input.dawn.test.ts +121 -0
- package/src/__tests__/feature-noise.unit.test.ts +38 -0
- package/src/__tests__/fixtures/taa-resolve-pinned-baseline.wgsl +301 -0
- package/src/__tests__/frame-camera-selection.unit.test.ts +131 -0
- package/src/__tests__/frame-observation.contract.test.ts +21 -0
- package/src/__tests__/frame-plan-contract.unit.test.ts +24 -0
- package/src/__tests__/frame-targets.unit.test.ts +24 -0
- package/src/__tests__/fullscreen-feature-plan.unit.test.ts +3 -0
- package/src/__tests__/gpu-driven-baseline.characterization.test.ts +79 -0
- package/src/__tests__/gpu-driven-batch-topology-pbr.unit.test.ts +307 -7
- package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +122 -142
- package/src/__tests__/gpu-driven-indirect-raster.browser.test.ts +10 -1
- package/src/__tests__/gpu-driven-lod-cache.unit.test.ts +261 -0
- package/src/__tests__/gpu-driven-mesh-world-identity.unit.test.ts +346 -0
- package/src/__tests__/gpu-driven-pbr.dawn.test.ts +1422 -0
- package/src/__tests__/gpu-driven-pbr.integration.test.ts +21 -0
- package/src/__tests__/gpu-driven-production-fixture.ts +96 -0
- package/src/__tests__/gpu-driven-production.integration.test.ts +1076 -106
- package/src/__tests__/gpu-driven-scaling.unit.test.ts +1 -3
- package/src/__tests__/gpu-driven-shadow-views.browser.test.ts +63 -0
- package/src/__tests__/gpu-driven-shadow-views.dawn.test.ts +294 -0
- package/src/__tests__/gpu-driven-shadow-views.integration.test.ts +97 -0
- package/src/__tests__/gpu-driven-shadow-views.unit.test.ts +168 -0
- package/src/__tests__/gpu-driven-skin-contract.test-d.ts +11 -0
- package/src/__tests__/gpu-driven-view-gpu-evidence.ts +72 -20
- package/src/__tests__/gpu-driven-view-graph.integration.test.ts +30 -9
- package/src/__tests__/gpu-driven-view.unit.test.ts +160 -52
- package/src/__tests__/gpu-pass-timing-browser-runner.ts +15 -0
- package/src/__tests__/gpu-pass-timing.browser.test.ts +20 -2
- package/src/__tests__/gpu-resource-scope.unit.test.ts +71 -0
- package/src/__tests__/gpu-resource-store-stride.unit.test.ts +42 -0
- package/src/__tests__/gpu-scene-render-graph-gpu.ts +19 -5
- package/src/__tests__/gpu-scene.dawn.test.ts +40 -13
- package/src/__tests__/gpu-scene.unit.test.ts +613 -33
- package/src/__tests__/instances-culling.integration.test.ts +36 -10
- package/src/__tests__/instances-derived-bounds.unit.test.ts +54 -0
- package/src/__tests__/instances-store.unit.test.ts +242 -39
- package/src/__tests__/ktx2-basis-gpu-consumer.dawn.test.ts +6 -0
- package/src/__tests__/lighting-scene-roundtrip.integration.test.ts +13 -16
- package/src/__tests__/lut-lkg-transaction.integration.test.ts +122 -0
- package/src/__tests__/material-contract-inventory.unit.test.ts +5 -6
- package/src/__tests__/material-dispatch-shader-id.unit.test.ts +51 -0
- package/src/__tests__/material-lane-selection.unit.test.ts +60 -0
- package/src/__tests__/material-numeric-upload.unit.test.ts +53 -0
- package/src/__tests__/material-texture-handles.unit.test.ts +18 -0
- package/src/__tests__/material-texture-source.unit.test.ts +87 -0
- package/src/__tests__/materials-authoring-validation.unit.test.ts +41 -0
- package/src/__tests__/materials-standard-contract.unit.test.ts +57 -3
- package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +4 -0
- package/src/__tests__/mesh-submission-lifetime.unit.test.ts +8 -0
- package/src/__tests__/morph-neutral-admission.unit.test.ts +19 -0
- package/src/__tests__/normal-fallback.dawn.test.ts +122 -0
- package/src/__tests__/particle-material-input-layout.unit.test.ts +104 -0
- package/src/__tests__/physical-clearcoat.integration.test.ts +42 -3
- package/src/__tests__/pipeline-texture-specialization.unit.test.ts +138 -0
- package/src/__tests__/point-shadow-inspection.unit.test.ts +2 -0
- package/src/__tests__/post-process-error-policy-owner.unit.test.ts +6 -5
- package/src/__tests__/prepared-gpu-driven-pbr-contract.test-d.ts +31 -0
- package/src/__tests__/prepared-gpu-driven-pbr-contract.unit.test.ts +39 -0
- package/src/__tests__/prepared-gpu-driven-pbr.integration.test.ts +251 -9
- package/src/__tests__/prepared-graphics-capability.unit.test.ts +21 -0
- package/src/__tests__/prepared-graphics-pipeline-warmup.unit.test.ts +6 -2
- package/src/__tests__/profiler-phase-catalog.test.ts +5 -0
- package/src/__tests__/public-surface.test-d.ts +3 -0
- package/src/__tests__/recovery-candidate-prepare.contract.test.ts +30 -12
- package/src/__tests__/reflection-fallback-async-publication.unit.test.ts +171 -0
- package/src/__tests__/reflection-probe-authoring.unit.test.ts +12 -10
- package/src/__tests__/reflection-probe-box.dawn.test.ts +71 -0
- package/src/__tests__/reflection-probe-filter.unit.test.ts +9 -0
- package/src/__tests__/reflection-probe-orientation.dawn.test.ts +294 -0
- package/src/__tests__/reflection-probe-record-owner.characterization.unit.test.ts +5 -14
- package/src/__tests__/reflection-probe-updates.unit.test.ts +129 -0
- package/src/__tests__/render-error-code-owner.test-d.ts +7 -0
- package/src/__tests__/render-error-detail-ssot.test-d.ts +27 -1
- package/src/__tests__/render-error-exhaustive.test-d.ts +15 -0
- package/src/__tests__/render-extent.unit.test.ts +63 -0
- package/src/__tests__/render-feature-gpu-work.integration.test.ts +285 -2
- package/src/__tests__/render-feature-plan.unit.test.ts +245 -0
- package/src/__tests__/render-feature-shadow-order.unit.test.ts +228 -0
- package/src/__tests__/render-feature-zero-work.unit.test.ts +35 -1
- package/src/__tests__/render-graph-fallback.integration.test.ts +2 -2
- package/src/__tests__/render-owner-cohesion.unit.test.ts +55 -0
- package/src/__tests__/render-scene-mixed-updates.integration.test.ts +426 -0
- package/src/__tests__/render-scene-projection.unit.test.ts +915 -23
- package/src/__tests__/render-scene-resource-updates.integration.test.ts +214 -0
- package/src/__tests__/render-scene-skin-lifecycle.integration.test.ts +173 -0
- package/src/__tests__/render-scene-temporal-retry.unit.test.ts +133 -0
- package/src/__tests__/render-target-material-source.test-d.ts +27 -3
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +233 -9
- package/src/__tests__/renderer-frame-transaction.integration.test.ts +923 -5
- package/src/__tests__/shader-manifest-fixture.ts +45 -0
- package/src/__tests__/skin-motion-regression.unit.test.ts +0 -33
- package/src/__tests__/skin-palette-persistent.integration.test.ts +28 -0
- package/src/__tests__/skin-palette-persistent.unit.test.ts +247 -0
- package/src/__tests__/skinned-shadow-caster.test.ts +125 -14
- package/src/__tests__/specular-environment-scale.dawn.test.ts +158 -0
- package/src/__tests__/ssao-config.unit.test.ts +7 -0
- package/src/__tests__/ssao-surface.dawn.test.ts +252 -0
- package/src/__tests__/ssr-admission-matrix.integration.test.ts +7 -1
- package/src/__tests__/ssr-confidence-compose.unit.test.ts +84 -0
- package/src/__tests__/ssr-coordinate-oracle.unit.test.ts +28 -0
- package/src/__tests__/ssr-cube-silhouette.dawn.test.ts +270 -0
- package/src/__tests__/ssr-format-probe-gating.integration.test.ts +82 -0
- package/src/__tests__/ssr-gpu-dispatch.browser.test.ts +99 -0
- package/src/__tests__/ssr-gpu-dispatch.dawn.test.ts +116 -0
- package/src/__tests__/ssr-gpu-dispatch.ts +951 -0
- package/src/__tests__/ssr-graph-topology.unit.test.ts +104 -0
- package/src/__tests__/ssr-history-filter.dawn.test.ts +198 -0
- package/src/__tests__/ssr-hit-color.dawn.test.ts +273 -0
- package/src/__tests__/ssr-hiz-odd-reduction.dawn.test.ts +569 -0
- package/src/__tests__/ssr-hiz-rescue.dawn.test.ts +279 -0
- package/src/__tests__/ssr-hiz.browser.test.ts +150 -0
- package/src/__tests__/ssr-hiz.dawn.test.ts +150 -0
- package/src/__tests__/ssr-hiz.unit.test.ts +56 -0
- package/src/__tests__/ssr-inspection.unit.test.ts +105 -0
- package/src/__tests__/ssr-memory-budget.unit.test.ts +45 -0
- package/src/__tests__/ssr-performance-sequence-aggregation.unit.test.ts +15 -0
- package/src/__tests__/ssr-public-surface.test-d.ts +37 -0
- package/src/__tests__/ssr-receiver-coverage.dawn.test.ts +387 -0
- package/src/__tests__/ssr-reflection-mip-reducer.dawn.test.ts +309 -0
- package/src/__tests__/ssr-reprojection-probe.ts +90 -0
- package/src/__tests__/ssr-roughness-mip.dawn.test.ts +163 -0
- package/src/__tests__/ssr-shader-prewarm.unit.test.ts +59 -0
- package/src/__tests__/ssr-spatial.integration.test.ts +141 -0
- package/src/__tests__/ssr-stable-lattice.dawn.test.ts +475 -0
- package/src/__tests__/ssr-temporal-history.unit.test.ts +202 -0
- package/src/__tests__/ssr-texel-crossing.dawn.test.ts +448 -0
- package/src/__tests__/ssr-zero-work.integration.test.ts +87 -0
- package/src/__tests__/standard-cluster-variant-resolution.unit.test.ts +84 -12
- package/src/__tests__/standard-clustered-pipeline.unit.test.ts +29 -0
- package/src/__tests__/standard-output-chain-contract.unit.test.ts +99 -0
- package/src/__tests__/standard-output-chain.integration.test.ts +73 -0
- package/src/__tests__/standard-output-gpu-evidence.ts +205 -0
- package/src/__tests__/standard-output.browser.test.ts +15 -0
- package/src/__tests__/standard-output.dawn.test.ts +15 -0
- package/src/__tests__/standard-pbr-artifact-assembly.unit.test.ts +275 -0
- package/src/__tests__/standard-pipeline.integration.test.ts +320 -3
- package/src/__tests__/standard-profile-oracle.unit.test.ts +49 -0
- package/src/__tests__/standard-surface-lighting.unit.test.ts +41 -0
- package/src/__tests__/standard-texture-specialization.dawn.test.ts +141 -0
- package/src/__tests__/surface-adjacent-regressions.integration.test.ts +6 -3
- package/src/__tests__/taa-coverage-edge.dawn.test.ts +199 -0
- package/src/__tests__/taa-history-clipping.dawn.test.ts +328 -0
- package/src/__tests__/taa-neighborhood-equivalence.dawn.test.ts +782 -0
- package/src/__tests__/taa-stability-feedback.browser.test.ts +23 -0
- package/src/__tests__/taa-stability-feedback.dawn.test.ts +68 -0
- package/src/__tests__/taa-stability-feedback.ts +342 -0
- package/src/__tests__/temporal-history-lifecycle.unit.test.ts +49 -7
- package/src/__tests__/temporal-reset-matrix.unit.test.ts +9 -0
- package/src/__tests__/temporal-transaction.integration.test.ts +28 -0
- package/src/__tests__/temporal-view.unit.test.ts +17 -0
- package/src/__tests__/texture-usage-surface.unit.test.ts +4 -2
- package/src/__tests__/transmission-prewarm.unit.test.ts +57 -0
- package/src/__tests__/typed-pipeline-topology.unit.test.ts +109 -4
- package/src/__tests__/typed-scene-pass-material-cache.integration.test.ts +126 -0
- package/src/__tests__/vertex-layouts-ssot.unit.test.ts +47 -0
- package/src/__tests__/visibility-extract.perf.test.ts +20 -8
- package/src/__tests__/visibility-instances.integration.test.ts +19 -7
- package/src/__tests__/visibility-producer-matrix.integration.test.ts +20 -9
- package/src/__tests__/volumetric-fog-stage-readback.dawn.test.ts +62 -13
- package/src/__tests__/volumetric-fog-topology.unit.test.ts +7 -7
- package/src/assembly/atmosphere-shader-prewarm.ts +39 -0
- package/src/assembly/device-feature-admission.ts +9 -4
- package/src/assembly/dynamic-geometry-host.ts +284 -163
- package/src/assembly/dynamic-geometry-runtime.ts +71 -0
- package/src/assembly/factory.ts +4 -0
- package/src/assembly/gpu-driven-owner.ts +29 -0
- package/src/assembly/host-contract.ts +19 -0
- package/src/assembly/material/assembly.ts +383 -1
- package/src/assembly/material/pipeline-helpers.ts +100 -0
- package/src/assembly/material-shader-policy.ts +110 -46
- package/src/assembly/recovery/device-loss-fanout.ts +5 -0
- package/src/assembly/recovery/failure-location.ts +62 -0
- package/src/assembly/recovery/recovery-attempt.ts +2 -29
- package/src/assembly/recovery/renderer-recover.ts +16 -17
- package/src/assembly/renderer-facade.ts +34 -1
- package/src/assembly/renderer-feature-inspection.ts +13 -0
- package/src/assembly/renderer-frame-transaction.ts +63 -0
- package/src/assembly/renderer-helpers.ts +26 -0
- package/src/assembly/renderer-inspection.ts +6 -0
- package/src/assembly/shader-prewarm-policy.ts +46 -1
- package/src/assembly/skin-palette-owner.ts +21 -0
- package/src/assembly/ssr-shader-prewarm.ts +41 -0
- package/src/assembly/webgpu-device-loss.ts +75 -0
- package/src/assembly/webgpu-pbr-ready.ts +232 -0
- package/src/assembly/webgpu-ready-mipmap.ts +26 -0
- package/src/assembly/webgpu-ready.ts +161 -131
- package/src/assembly/webgpu-renderer-bootstrap.ts +85 -0
- package/src/assembly/webgpu-renderer-contract.ts +69 -0
- package/src/assembly/webgpu-renderer-guards.ts +32 -0
- package/src/assembly/webgpu-renderer-observation.ts +43 -0
- package/src/assembly/webgpu-renderer-recovery-failure.ts +62 -0
- package/src/assembly/webgpu-renderer.ts +744 -730
- package/src/assembly/webgpu-vertex-layouts.ts +233 -87
- package/src/capture/scene-projection.ts +37 -0
- package/src/components/__tests__/camera-exposure.contract.unit.test.ts +153 -0
- package/src/components/__tests__/dynamic-resolution-schema.unit.test.ts +65 -0
- package/src/components/__tests__/light-radius.integration.test.ts +59 -0
- package/src/components/camera.ts +287 -7
- package/src/components/directional-light.ts +3 -3
- package/src/components/dynamic-resolution.ts +67 -0
- package/src/components/index.ts +2 -0
- package/src/components/instances.ts +45 -18
- package/src/components/light-helpers.ts +6 -1
- package/src/components/reflection-probe.ts +1 -0
- package/src/components/scene-instance.ts +2 -1
- package/src/components/screen-space-reflection.ts +21 -0
- package/src/components/skylight.ts +4 -1
- package/src/components/sprite-animation.ts +2 -2
- package/src/components/sprite-instances.ts +1 -1
- package/src/device/device-scope.ts +13 -7
- package/src/device/gpu-residency.ts +45 -42
- package/src/dynamic-geometry.ts +13 -8
- package/src/environment/background.ts +281 -0
- package/src/environment/ibl.ts +211 -0
- package/src/environment/storage.ts +63 -0
- package/src/errors/gpu-driven.ts +49 -8
- package/src/errors/render.ts +91 -3
- package/src/extract/camera.ts +37 -1
- package/src/extract/contracts.ts +10 -0
- package/src/extract/gpu-driven.ts +240 -10
- package/src/features/host.ts +237 -19
- package/src/features/noise-texture.ts +91 -0
- package/src/features/plan.ts +553 -24
- package/src/features/prepared-gpu-work.ts +631 -49
- package/src/features/prepared-graphics-store.ts +31 -0
- package/src/features/prepared-graphics.ts +5 -0
- package/src/features/render-graph-compute.ts +41 -8
- package/src/features/render-graph-contribution.ts +141 -3
- package/src/features/render-graph-raster.ts +143 -30
- package/src/features/types.ts +11 -0
- package/src/fullscreen-post-process-pass.ts +3 -0
- package/src/gpu-driven/batch-topology.ts +452 -108
- package/src/gpu-driven/material-artifacts.ts +179 -0
- package/src/gpu-driven/material-bindings.ts +41 -0
- package/src/gpu-driven/pbr-program.ts +31 -0
- package/src/gpu-driven/prepared-draw.ts +42 -6
- package/src/gpu-driven/production-raster.ts +2806 -716
- package/src/gpu-driven/shadow-views.ts +539 -0
- package/src/gpu-driven/view-gpu.ts +188 -41
- package/src/gpu-resource.ts +21 -2
- package/src/gpu-scene-schema.ts +61 -11
- package/src/gpu-scene.ts +197 -99
- package/src/gpu-texture-usage.ts +1 -0
- package/src/hdrp-buffers.ts +141 -36
- package/src/ibl/IblPipelineCache.ts +5 -0
- package/src/ibl/frame-resources.ts +38 -0
- package/src/ibl/skylight-bind-group.ts +32 -21
- package/src/index.ts +194 -75
- package/src/inspection-types.ts +207 -1
- package/src/instances-derived-bounds.ts +258 -34
- package/src/instances.ts +459 -150
- package/src/internal.ts +22 -0
- package/src/lifecycle.ts +2 -0
- package/src/material-row.ts +194 -0
- package/src/materials.ts +44 -8
- package/src/pbr-pipeline.ts +172 -19
- package/src/pipeline/render-extent.ts +111 -0
- package/src/pipeline/standard-build-context.ts +7 -0
- package/src/pipeline/standard-forward-lane.ts +74 -29
- package/src/pipeline/standard-output/__tests__/lut-admission.unit.test.ts +103 -0
- package/src/pipeline/standard-output/auto-exposure/__tests__/capability.unit.test.ts +40 -0
- package/src/pipeline/standard-output/auto-exposure/__tests__/gpu.contract.unit.test.ts +125 -0
- package/src/pipeline/standard-output/auto-exposure/__tests__/graph.contract.unit.test.ts +94 -0
- package/src/pipeline/standard-output/auto-exposure/__tests__/oracle.test.ts +108 -0
- package/src/pipeline/standard-output/auto-exposure/__tests__/preset.test.ts +26 -0
- package/src/pipeline/standard-output/auto-exposure/capability.ts +38 -0
- package/src/pipeline/standard-output/auto-exposure/gpu.ts +567 -0
- package/src/pipeline/standard-output/auto-exposure/graph.ts +221 -0
- package/src/pipeline/standard-output/auto-exposure/inspection.ts +231 -0
- package/src/pipeline/standard-output/auto-exposure/oracle.ts +291 -0
- package/src/pipeline/standard-output/auto-exposure/preset.ts +28 -0
- package/src/pipeline/standard-output/auto-exposure/state.ts +156 -0
- package/src/pipeline/standard-output/color-transform.ts +124 -0
- package/src/pipeline/standard-output/graph.ts +139 -0
- package/src/pipeline/standard-output/lut-admission.ts +121 -0
- package/src/pipeline/standard-output/lut-gpu.ts +399 -0
- package/src/pipeline/standard-output/lut-state.ts +176 -0
- package/src/pipeline/standard-output/resources.ts +121 -0
- package/src/pipeline/standard-output/types.ts +58 -0
- package/src/pipeline/standard-pipeline.ts +232 -70
- package/src/pipeline/standard-post.ts +190 -27
- package/src/pipeline/standard-profile.ts +2 -1
- package/src/pipeline-builder.ts +28 -9
- package/src/pipeline-spec-types.ts +4 -0
- package/src/pipeline-spec.ts +37 -29
- package/src/plugin.ts +4 -0
- package/src/points-lines/standard-owner.ts +6 -14
- package/src/post-process-errors.ts +26 -18
- package/src/prepare/__tests__/extended-lighting-capability.unit.test.ts +2 -2
- package/src/prepare/extended-lighting/resources.ts +3 -3
- package/src/prepare/prepared-graphics-resolver.ts +9 -2
- package/src/record/__tests__/main-pass-geometry.unit.test.ts +68 -0
- package/src/record/__tests__/material-bg-cache.unit.test.ts +45 -0
- package/src/record/__tests__/material-slot-plan.unit.test.ts +57 -0
- package/src/record/__tests__/mesh-ssbo.unit.test.ts +40 -1
- package/src/record/__tests__/recovery-pipeline.unit.test.ts +20 -1
- package/src/record/__tests__/sprite-material-abi.unit.test.ts +41 -6
- package/src/record/__tests__/temporal-payload.unit.test.ts +2 -0
- package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +45 -0
- package/src/record/__tests__/view-ubo-layout.unit.test.ts +5 -0
- package/src/record/dynamic-geometry-consumption.ts +59 -0
- package/src/record/frame-lighting.ts +15 -12
- package/src/record/frame-snapshot.ts +146 -34
- package/src/record/frame-targets.ts +9 -0
- package/src/record/frame.ts +838 -170
- package/src/record/main-pass-geometry.ts +209 -103
- package/src/record/main-pass-material.ts +157 -40
- package/src/record/main-pass-sprite-draws.ts +16 -107
- package/src/record/main-pass.ts +141 -12
- package/src/record/material-uniforms.ts +1 -1
- package/src/record/mesh-ssbo.ts +59 -15
- package/src/record/prepared-material-bindings.ts +238 -0
- package/src/record/recovery-pipeline.ts +69 -90
- package/src/record/render-context.ts +123 -24
- package/src/record/shadow-pass.ts +1389 -230
- package/src/record/skybox-post-pass.ts +14 -3
- package/src/record/typed-frame-graph.ts +1064 -47
- package/src/record/view-ubo.ts +12 -1
- package/src/recovery/render-system-candidate.ts +135 -68
- package/src/recovery/render-system-roots.ts +113 -0
- package/src/recovery/types.ts +77 -0
- package/src/reflection/background.ts +151 -0
- package/src/reflection/filter.ts +3 -0
- package/src/reflection/projection.ts +16 -6
- package/src/reflection/record-owner.ts +308 -140
- package/src/render-contract.ts +237 -49
- package/src/render-graph-primitives.ts +34 -5
- package/src/render-pipeline.ts +90 -2
- package/src/render-system-extract-tail.ts +431 -162
- package/src/render-system-extract.ts +478 -119
- package/src/render-system-projections.ts +241 -0
- package/src/render-system.ts +715 -828
- package/src/scene/render-scene-types.ts +13 -4
- package/src/scene/render-scene.ts +577 -355
- package/src/scene/shadow-visibility.ts +21 -0
- package/src/ssao-config.ts +25 -8
- package/src/ssr/admission.ts +380 -14
- package/src/ssr/compose.ts +144 -0
- package/src/ssr/errors.ts +48 -0
- package/src/ssr/graph.ts +797 -0
- package/src/ssr/history.ts +436 -0
- package/src/ssr/hiz.ts +124 -0
- package/src/ssr/inspection.ts +124 -0
- package/src/ssr/resources.ts +202 -0
- package/src/ssr/temporal.ts +164 -0
- package/src/systems/skin-palette-allocator.ts +495 -148
- package/src/systems/skin-palette-types.ts +17 -0
- package/src/systems/transparent-dispatch.ts +90 -0
- package/src/targets/material-source.ts +34 -0
- package/src/temporal/coverage.ts +1 -1
- package/src/temporal/frame-coordinator.ts +23 -2
- package/src/temporal/gpu.ts +79 -12
- package/src/temporal/history.ts +3 -1
- package/src/temporal/inspection.ts +2 -1
- package/src/temporal/standard-scene-data.ts +10 -2
- package/src/temporal/target-coverage-attachment.ts +72 -0
- package/src/temporal/temporal-view.ts +11 -2
- package/src/temporal/view.ts +12 -2
- package/src/transmission/__tests__/standard-transmission.dawn.test.ts +219 -139
- package/src/typed-render-graph-primitives.ts +304 -74
- package/src/typed-shadow-passes.ts +122 -12
- package/src/volume/component.ts +1 -0
- package/src/volume/passes.ts +3 -3
- package/src/volume/temporal.ts +10 -0
- package/dist/chunk-GE3SDD72.mjs.map +0 -1
- package/dist/chunk-GF523LHF.mjs.map +0 -1
- package/dist/chunk-IQMKJLNU.mjs.map +0 -1
- package/dist/chunk-J52NMQKR.mjs.map +0 -1
- package/dist/chunk-J6KACNOH.mjs.map +0 -1
- package/dist/chunk-JAASCMXA.mjs.map +0 -1
- package/dist/chunk-MBU4ZVE7.mjs.map +0 -1
- package/dist/chunk-MYJ5RPJO.mjs.map +0 -1
- package/dist/chunk-RBDBZ5R7.mjs.map +0 -1
- package/dist/chunk-VSL23LZE.mjs.map +0 -1
- package/src/__tests__/instances-world-ownership.integration.test.ts +0 -62
- package/src/scene/__tests__/changed-block-summary.candidate.test.ts +0 -36
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { createShaderModuleImmediate, rhi } from '@forgeax/engine-rhi-webgpu';
|
|
4
|
+
import { expect, it } from 'vitest';
|
|
5
|
+
import { GPU_SHADER_STAGE_COMPUTE } from '../gpu-stage';
|
|
6
|
+
import {
|
|
7
|
+
GPU_TEXTURE_USAGE_COPY_DST,
|
|
8
|
+
GPU_TEXTURE_USAGE_COPY_SRC,
|
|
9
|
+
GPU_TEXTURE_USAGE_STORAGE_BINDING,
|
|
10
|
+
GPU_TEXTURE_USAGE_TEXTURE_BINDING,
|
|
11
|
+
} from '../gpu-texture-usage';
|
|
12
|
+
import { GPU_BUFFER_USAGE_COPY_DST, GPU_BUFFER_USAGE_MAP_READ } from '../gpu-usage';
|
|
13
|
+
|
|
14
|
+
type Pixel = readonly [number, number, number, number];
|
|
15
|
+
|
|
16
|
+
const BYTES_PER_PIXEL = 8;
|
|
17
|
+
const READBACK_BYTES_PER_ROW = 256;
|
|
18
|
+
|
|
19
|
+
function readShader(name: string): string {
|
|
20
|
+
return readFileSync(resolve(process.cwd(), `packages/shader/src/${name}.wgsl`), 'utf8');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function halfToFloat(bits: number): number {
|
|
24
|
+
const sign = (bits & 0x8000) === 0 ? 1 : -1;
|
|
25
|
+
const exponent = (bits >>> 10) & 0x1f;
|
|
26
|
+
const fraction = bits & 0x3ff;
|
|
27
|
+
if (exponent === 0) return sign * 2 ** -14 * (fraction / 1024);
|
|
28
|
+
if (exponent === 0x1f) return fraction === 0 ? sign * Infinity : Number.NaN;
|
|
29
|
+
return sign * 2 ** (exponent - 15) * (1 + fraction / 1024);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function floatToHalf(value: number): number {
|
|
33
|
+
if (!Number.isFinite(value)) return value < 0 ? 0xfc00 : 0x7c00;
|
|
34
|
+
const sign = value < 0 ? 0x8000 : 0;
|
|
35
|
+
const absolute = Math.abs(value);
|
|
36
|
+
if (absolute === 0) return sign;
|
|
37
|
+
if (absolute >= 65504) return sign | 0x7bff;
|
|
38
|
+
const exponent = Math.floor(Math.log2(absolute));
|
|
39
|
+
if (exponent < -14) return sign | Math.round(absolute / 2 ** -24);
|
|
40
|
+
const mantissa = absolute / 2 ** exponent - 1;
|
|
41
|
+
return sign | ((exponent + 15) << 10) | Math.round(mantissa * 1024);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function createDevice() {
|
|
45
|
+
return (await (await rhi.requestAdapter()).unwrap().requestDevice()).unwrap();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function compileTemporalShader(): Promise<string> {
|
|
49
|
+
const compiler = (await import(
|
|
50
|
+
/* @vite-ignore */ new URL('../../../shader-compiler/dist/index.mjs', import.meta.url).href
|
|
51
|
+
)) as {
|
|
52
|
+
compileShader(
|
|
53
|
+
source: string,
|
|
54
|
+
options: { id: string; imports: Record<string, string> },
|
|
55
|
+
): Promise<{ ok: boolean; value?: { wgsl: string }; error?: unknown }>;
|
|
56
|
+
};
|
|
57
|
+
const result = await compiler.compileShader(readShader('ssr-temporal'), {
|
|
58
|
+
id: 'forgeax_ssr::temporal',
|
|
59
|
+
imports: { 'forgeax_view::common': readShader('common') },
|
|
60
|
+
});
|
|
61
|
+
if (!result.ok || result.value === undefined) throw new Error(JSON.stringify(result.error));
|
|
62
|
+
return result.value.wgsl;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function runReducer(
|
|
66
|
+
shader: string,
|
|
67
|
+
sourceWidth: number,
|
|
68
|
+
sourceHeight: number,
|
|
69
|
+
targetWidth: number,
|
|
70
|
+
targetHeight: number,
|
|
71
|
+
sourcePixels: readonly Pixel[],
|
|
72
|
+
): Promise<number[]> {
|
|
73
|
+
const device = await createDevice();
|
|
74
|
+
const source = device
|
|
75
|
+
.createTexture({
|
|
76
|
+
size: { width: sourceWidth, height: sourceHeight, depthOrArrayLayers: 1 },
|
|
77
|
+
format: 'rgba16float',
|
|
78
|
+
textureBindingViewDimension: '2d',
|
|
79
|
+
usage: GPU_TEXTURE_USAGE_COPY_DST | GPU_TEXTURE_USAGE_TEXTURE_BINDING,
|
|
80
|
+
})
|
|
81
|
+
.unwrap();
|
|
82
|
+
const target = device
|
|
83
|
+
.createTexture({
|
|
84
|
+
size: { width: targetWidth, height: targetHeight, depthOrArrayLayers: 1 },
|
|
85
|
+
format: 'rgba16float',
|
|
86
|
+
textureBindingViewDimension: '2d',
|
|
87
|
+
usage: GPU_TEXTURE_USAGE_STORAGE_BINDING | GPU_TEXTURE_USAGE_COPY_SRC,
|
|
88
|
+
})
|
|
89
|
+
.unwrap();
|
|
90
|
+
const readback = device
|
|
91
|
+
.createBuffer({
|
|
92
|
+
size: READBACK_BYTES_PER_ROW * targetHeight,
|
|
93
|
+
usage: GPU_BUFFER_USAGE_MAP_READ | GPU_BUFFER_USAGE_COPY_DST,
|
|
94
|
+
})
|
|
95
|
+
.unwrap();
|
|
96
|
+
try {
|
|
97
|
+
const packed = new Uint16Array(sourceWidth * sourceHeight * 4);
|
|
98
|
+
for (let i = 0; i < sourcePixels.length; i++) {
|
|
99
|
+
const pixel = sourcePixels[i];
|
|
100
|
+
if (pixel === undefined) throw new Error(`missing source pixel ${i}`);
|
|
101
|
+
for (const channel of [0, 1, 2, 3] as const) {
|
|
102
|
+
packed[i * 4 + channel] = floatToHalf(pixel[channel]);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
device.queue
|
|
106
|
+
.writeTexture(
|
|
107
|
+
{ texture: source },
|
|
108
|
+
packed,
|
|
109
|
+
{
|
|
110
|
+
bytesPerRow: sourceWidth * BYTES_PER_PIXEL,
|
|
111
|
+
rowsPerImage: sourceHeight,
|
|
112
|
+
},
|
|
113
|
+
{ width: sourceWidth, height: sourceHeight, depthOrArrayLayers: 1 },
|
|
114
|
+
)
|
|
115
|
+
.unwrap();
|
|
116
|
+
|
|
117
|
+
const module = createShaderModuleImmediate(device, { code: shader }).unwrap();
|
|
118
|
+
const layout = device
|
|
119
|
+
.createBindGroupLayout({
|
|
120
|
+
entries: [
|
|
121
|
+
{
|
|
122
|
+
binding: 0,
|
|
123
|
+
visibility: GPU_SHADER_STAGE_COMPUTE,
|
|
124
|
+
texture: { sampleType: 'unfilterable-float', viewDimension: '2d' },
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
binding: 7,
|
|
128
|
+
visibility: GPU_SHADER_STAGE_COMPUTE,
|
|
129
|
+
storageTexture: { access: 'write-only', format: 'rgba16float', viewDimension: '2d' },
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
})
|
|
133
|
+
.unwrap();
|
|
134
|
+
const pipeline = device
|
|
135
|
+
.createComputePipeline({
|
|
136
|
+
layout: device.createPipelineLayout({ bindGroupLayouts: [layout] }).unwrap(),
|
|
137
|
+
compute: { module, entryPoint: 'ssr_reflection_mip' },
|
|
138
|
+
})
|
|
139
|
+
.unwrap();
|
|
140
|
+
const sourceView = device.createTextureView(source, { dimension: '2d' }).unwrap();
|
|
141
|
+
const targetView = device.createTextureView(target, { dimension: '2d' }).unwrap();
|
|
142
|
+
const group = device
|
|
143
|
+
.createBindGroup({
|
|
144
|
+
layout,
|
|
145
|
+
entries: [
|
|
146
|
+
{ binding: 0, resource: { kind: 'textureView', value: sourceView } },
|
|
147
|
+
{ binding: 7, resource: { kind: 'textureView', value: targetView } },
|
|
148
|
+
],
|
|
149
|
+
})
|
|
150
|
+
.unwrap();
|
|
151
|
+
const encoder = device.createCommandEncoder().unwrap();
|
|
152
|
+
const pass = encoder.beginComputePass();
|
|
153
|
+
pass.setPipeline(pipeline);
|
|
154
|
+
pass.setBindGroup(0, group);
|
|
155
|
+
pass.dispatchWorkgroups(Math.ceil(targetWidth / 8), Math.ceil(targetHeight / 8), 1);
|
|
156
|
+
pass.end();
|
|
157
|
+
encoder.copyTextureToBuffer(
|
|
158
|
+
{ texture: target },
|
|
159
|
+
{ buffer: readback, bytesPerRow: READBACK_BYTES_PER_ROW, rowsPerImage: targetHeight },
|
|
160
|
+
{ width: targetWidth, height: targetHeight, depthOrArrayLayers: 1 },
|
|
161
|
+
);
|
|
162
|
+
device.queue.submit([encoder.finish().unwrap()]).unwrap();
|
|
163
|
+
await device.queue.onSubmittedWorkDone();
|
|
164
|
+
const mapped = (await readback.mapAsync(GPU_BUFFER_USAGE_MAP_READ)).unwrap();
|
|
165
|
+
const bytes = new DataView(mapped.getMappedRange().unwrap().slice(0));
|
|
166
|
+
const values: number[] = [];
|
|
167
|
+
for (let y = 0; y < targetHeight; y++) {
|
|
168
|
+
for (let x = 0; x < targetWidth; x++) {
|
|
169
|
+
const offset = y * READBACK_BYTES_PER_ROW + x * BYTES_PER_PIXEL;
|
|
170
|
+
for (let channel = 0; channel < 4; channel++) {
|
|
171
|
+
values.push(halfToFloat(bytes.getUint16(offset + channel * 2, true)));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
mapped.unmap();
|
|
176
|
+
return values;
|
|
177
|
+
} finally {
|
|
178
|
+
device.destroyTexture(source).unwrap();
|
|
179
|
+
device.destroyTexture(target).unwrap();
|
|
180
|
+
device.destroyBuffer(readback).unwrap();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function averageFootprint(
|
|
185
|
+
pixels: readonly Pixel[],
|
|
186
|
+
sourceWidth: number,
|
|
187
|
+
sourceHeight: number,
|
|
188
|
+
targetX: number,
|
|
189
|
+
targetY: number,
|
|
190
|
+
targetWidth: number,
|
|
191
|
+
targetHeight: number,
|
|
192
|
+
): Pixel {
|
|
193
|
+
const firstX = Math.floor((targetX * sourceWidth) / targetWidth);
|
|
194
|
+
const endX = Math.floor(((targetX + 1) * sourceWidth) / targetWidth);
|
|
195
|
+
const firstY = Math.floor((targetY * sourceHeight) / targetHeight);
|
|
196
|
+
const endY = Math.floor(((targetY + 1) * sourceHeight) / targetHeight);
|
|
197
|
+
const sum: [number, number, number, number] = [0, 0, 0, 0];
|
|
198
|
+
let count = 0;
|
|
199
|
+
for (let y = firstY; y < endY; y++) {
|
|
200
|
+
for (let x = firstX; x < endX; x++) {
|
|
201
|
+
const pixel = pixels[y * sourceWidth + x];
|
|
202
|
+
if (pixel === undefined) throw new Error(`missing footprint pixel ${x},${y}`);
|
|
203
|
+
for (const channel of [0, 1, 2, 3] as const) sum[channel] += pixel[channel];
|
|
204
|
+
count += 1;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (count === 0) throw new Error(`empty footprint at ${targetX},${targetY}`);
|
|
208
|
+
return [sum[0] / count, sum[1] / count, sum[2] / count, sum[3] / count];
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
it('uses the production four-load 2x2 reducer for even extents', async () => {
|
|
212
|
+
const sourceWidth = 6;
|
|
213
|
+
const sourceHeight = 4;
|
|
214
|
+
const targetWidth = 3;
|
|
215
|
+
const targetHeight = 2;
|
|
216
|
+
const pixels = Array.from({ length: sourceWidth * sourceHeight }, (_, index): Pixel => {
|
|
217
|
+
const x = index % sourceWidth;
|
|
218
|
+
const y = Math.floor(index / sourceWidth);
|
|
219
|
+
return [1 + x + y * sourceWidth, 0.25 + x * 0.5, 0.5 + y * 0.75, 0.25 + ((x + y) % 4) * 0.25];
|
|
220
|
+
});
|
|
221
|
+
const values = await runReducer(
|
|
222
|
+
await compileTemporalShader(),
|
|
223
|
+
sourceWidth,
|
|
224
|
+
sourceHeight,
|
|
225
|
+
targetWidth,
|
|
226
|
+
targetHeight,
|
|
227
|
+
pixels,
|
|
228
|
+
);
|
|
229
|
+
for (let y = 0; y < targetHeight; y++) {
|
|
230
|
+
for (let x = 0; x < targetWidth; x++) {
|
|
231
|
+
const expected = averageFootprint(
|
|
232
|
+
pixels,
|
|
233
|
+
sourceWidth,
|
|
234
|
+
sourceHeight,
|
|
235
|
+
x,
|
|
236
|
+
y,
|
|
237
|
+
targetWidth,
|
|
238
|
+
targetHeight,
|
|
239
|
+
);
|
|
240
|
+
const offset = (y * targetWidth + x) * 4;
|
|
241
|
+
for (const channel of [0, 1, 2, 3] as const) {
|
|
242
|
+
expect(values[offset + channel]).toBeCloseTo(expected[channel], 2);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
it('keeps the explicit footprint reducer for odd extents and bounded confidence', async () => {
|
|
249
|
+
const sourceWidth = 5;
|
|
250
|
+
const sourceHeight = 3;
|
|
251
|
+
const targetWidth = 2;
|
|
252
|
+
const targetHeight = 1;
|
|
253
|
+
const pixels = Array.from({ length: sourceWidth * sourceHeight }, (_, index): Pixel => {
|
|
254
|
+
const x = index % sourceWidth;
|
|
255
|
+
const y = Math.floor(index / sourceWidth);
|
|
256
|
+
return [0.5 + x * 0.25, 2 + y, 0.125 + (x + y) * 0.0625, ((x + y) % 5) * 0.25];
|
|
257
|
+
});
|
|
258
|
+
const values = await runReducer(
|
|
259
|
+
await compileTemporalShader(),
|
|
260
|
+
sourceWidth,
|
|
261
|
+
sourceHeight,
|
|
262
|
+
targetWidth,
|
|
263
|
+
targetHeight,
|
|
264
|
+
pixels,
|
|
265
|
+
);
|
|
266
|
+
for (let x = 0; x < targetWidth; x++) {
|
|
267
|
+
const expected = averageFootprint(
|
|
268
|
+
pixels,
|
|
269
|
+
sourceWidth,
|
|
270
|
+
sourceHeight,
|
|
271
|
+
x,
|
|
272
|
+
0,
|
|
273
|
+
targetWidth,
|
|
274
|
+
targetHeight,
|
|
275
|
+
);
|
|
276
|
+
const offset = x * 4;
|
|
277
|
+
for (const channel of [0, 1, 2, 3] as const) {
|
|
278
|
+
expect(values[offset + channel]).toBeCloseTo(expected[channel], 2);
|
|
279
|
+
}
|
|
280
|
+
expect(values[offset + 3]).toBeGreaterThanOrEqual(0);
|
|
281
|
+
expect(values[offset + 3]).toBeLessThanOrEqual(1);
|
|
282
|
+
expect(values.slice(offset, offset + 4).every(Number.isFinite)).toBe(true);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
it('keeps premultiplied radiance through hit and miss footprints', async () => {
|
|
287
|
+
const pixels: readonly Pixel[] = [
|
|
288
|
+
[4, 2, 1, 1],
|
|
289
|
+
[0, 0, 0, 0],
|
|
290
|
+
[0, 0, 0, 0],
|
|
291
|
+
[2, 1, 0.5, 0.5],
|
|
292
|
+
];
|
|
293
|
+
const values = await runReducer(await compileTemporalShader(), 2, 2, 1, 1, pixels);
|
|
294
|
+
// The input is the presentation representation (a * L, a). A miss carries
|
|
295
|
+
// no RGB mass, so the reduced value remains premultiplied rather than
|
|
296
|
+
// turning into a black radiance sample.
|
|
297
|
+
expect(values[0]).toBeCloseTo(1.5, 2);
|
|
298
|
+
expect(values[1]).toBeCloseTo(0.75, 2);
|
|
299
|
+
expect(values[2]).toBeCloseTo(0.375, 2);
|
|
300
|
+
expect(values[3]).toBeCloseTo(0.375, 2);
|
|
301
|
+
expect(values[3]).toBeGreaterThan(0);
|
|
302
|
+
const [red, green, blue, alpha] = values;
|
|
303
|
+
if (red === undefined || green === undefined || blue === undefined || alpha === undefined) {
|
|
304
|
+
throw new Error('the reducer must return one complete RGBA pixel');
|
|
305
|
+
}
|
|
306
|
+
expect(red / alpha).toBeCloseTo(4, 2);
|
|
307
|
+
expect(green / alpha).toBeCloseTo(2, 2);
|
|
308
|
+
expect(blue / alpha).toBeCloseTo(1, 2);
|
|
309
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { RhiDevice } from '@forgeax/engine-rhi';
|
|
2
|
+
import { createShaderModuleImmediate } from '@forgeax/engine-rhi-webgpu';
|
|
3
|
+
import { GPU_SHADER_STAGE_COMPUTE } from '../gpu-stage';
|
|
4
|
+
import {
|
|
5
|
+
GPU_BUFFER_USAGE_COPY_DST,
|
|
6
|
+
GPU_BUFFER_USAGE_COPY_SRC,
|
|
7
|
+
GPU_BUFFER_USAGE_MAP_READ,
|
|
8
|
+
GPU_BUFFER_USAGE_STORAGE,
|
|
9
|
+
GPU_BUFFER_USAGE_UNIFORM,
|
|
10
|
+
} from '../gpu-usage';
|
|
11
|
+
|
|
12
|
+
/** Runs the cooked production reprojection function, not a CPU translation. */
|
|
13
|
+
export async function runSsrReprojectionProbe(device: RhiDevice, source: string) {
|
|
14
|
+
const module = createShaderModuleImmediate(device, {
|
|
15
|
+
code: `${source}
|
|
16
|
+
@group(1) @binding(0) var<storage, read_write> reprojectionProbe: array<vec4<f32>>;
|
|
17
|
+
@compute @workgroup_size(1) fn probe_ssr_reprojection() {
|
|
18
|
+
reprojectionProbe[0] = vec4<f32>(reprojectUv(vec2<f32>(0.5), vec2<f32>(0.0)),
|
|
19
|
+
reprojectUv(vec2<f32>(0.5), vec2<f32>(0.125, -0.0625)));
|
|
20
|
+
}`,
|
|
21
|
+
}).unwrap();
|
|
22
|
+
const paramsLayout = device
|
|
23
|
+
.createBindGroupLayout({
|
|
24
|
+
entries: [{ binding: 6, visibility: GPU_SHADER_STAGE_COMPUTE, buffer: { type: 'uniform' } }],
|
|
25
|
+
})
|
|
26
|
+
.unwrap();
|
|
27
|
+
const outputLayout = device
|
|
28
|
+
.createBindGroupLayout({
|
|
29
|
+
entries: [{ binding: 0, visibility: GPU_SHADER_STAGE_COMPUTE, buffer: { type: 'storage' } }],
|
|
30
|
+
})
|
|
31
|
+
.unwrap();
|
|
32
|
+
const layout = device
|
|
33
|
+
.createPipelineLayout({ bindGroupLayouts: [paramsLayout, outputLayout] })
|
|
34
|
+
.unwrap();
|
|
35
|
+
const pipeline = device
|
|
36
|
+
.createComputePipeline({ layout, compute: { module, entryPoint: 'probe_ssr_reprojection' } })
|
|
37
|
+
.unwrap();
|
|
38
|
+
const params = device
|
|
39
|
+
.createBuffer({ size: 32, usage: GPU_BUFFER_USAGE_UNIFORM | GPU_BUFFER_USAGE_COPY_DST })
|
|
40
|
+
.unwrap();
|
|
41
|
+
const output = device
|
|
42
|
+
.createBuffer({ size: 16, usage: GPU_BUFFER_USAGE_STORAGE | GPU_BUFFER_USAGE_COPY_SRC })
|
|
43
|
+
.unwrap();
|
|
44
|
+
const readback = device
|
|
45
|
+
.createBuffer({ size: 16, usage: GPU_BUFFER_USAGE_MAP_READ | GPU_BUFFER_USAGE_COPY_DST })
|
|
46
|
+
.unwrap();
|
|
47
|
+
try {
|
|
48
|
+
const paramsGroup = device
|
|
49
|
+
.createBindGroup({
|
|
50
|
+
layout: paramsLayout,
|
|
51
|
+
entries: [{ binding: 6, resource: { kind: 'buffer', value: { buffer: params } } }],
|
|
52
|
+
})
|
|
53
|
+
.unwrap();
|
|
54
|
+
const outputGroup = device
|
|
55
|
+
.createBindGroup({
|
|
56
|
+
layout: outputLayout,
|
|
57
|
+
entries: [{ binding: 0, resource: { kind: 'buffer', value: { buffer: output } } }],
|
|
58
|
+
})
|
|
59
|
+
.unwrap();
|
|
60
|
+
const samples = [];
|
|
61
|
+
// No jitter, alternating subpixel jitter, and the reverse transition.
|
|
62
|
+
// Fixed unjittered history must return the same motion-only coordinates.
|
|
63
|
+
for (const jitter of [
|
|
64
|
+
[0, 0, 0, 0],
|
|
65
|
+
[0.25 / 64, -0.25 / 32, -0.25 / 64, 0.25 / 32],
|
|
66
|
+
[-0.25 / 64, 0.25 / 32, 0.25 / 64, -0.25 / 32],
|
|
67
|
+
]) {
|
|
68
|
+
const payload = new Float32Array(8);
|
|
69
|
+
payload.set(jitter, 4);
|
|
70
|
+
device.queue.writeBuffer(params, 0, payload).unwrap();
|
|
71
|
+
const encoder = device.createCommandEncoder().unwrap();
|
|
72
|
+
const pass = encoder.beginComputePass();
|
|
73
|
+
pass.setPipeline(pipeline);
|
|
74
|
+
pass.setBindGroup(0, paramsGroup);
|
|
75
|
+
pass.setBindGroup(1, outputGroup);
|
|
76
|
+
pass.dispatchWorkgroups(1);
|
|
77
|
+
pass.end();
|
|
78
|
+
encoder.copyBufferToBuffer(output, 0, readback, 0, 16);
|
|
79
|
+
device.queue.submit([encoder.finish().unwrap()]).unwrap();
|
|
80
|
+
const mapped = (await readback.mapAsync(GPU_BUFFER_USAGE_MAP_READ)).unwrap();
|
|
81
|
+
samples.push([...new Float32Array(mapped.getMappedRange().unwrap().slice(0))]);
|
|
82
|
+
mapped.unmap();
|
|
83
|
+
}
|
|
84
|
+
return samples;
|
|
85
|
+
} finally {
|
|
86
|
+
device.destroyBuffer(params).unwrap();
|
|
87
|
+
device.destroyBuffer(output).unwrap();
|
|
88
|
+
device.destroyBuffer(readback).unwrap();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { createShaderModuleImmediate, rhi } from '@forgeax/engine-rhi-webgpu';
|
|
4
|
+
import { expect, it } from 'vitest';
|
|
5
|
+
import { GPU_SHADER_STAGE_COMPUTE } from '../gpu-stage';
|
|
6
|
+
import {
|
|
7
|
+
GPU_TEXTURE_USAGE_COPY_DST,
|
|
8
|
+
GPU_TEXTURE_USAGE_TEXTURE_BINDING,
|
|
9
|
+
} from '../gpu-texture-usage';
|
|
10
|
+
import {
|
|
11
|
+
GPU_BUFFER_USAGE_COPY_DST,
|
|
12
|
+
GPU_BUFFER_USAGE_COPY_SRC,
|
|
13
|
+
GPU_BUFFER_USAGE_MAP_READ,
|
|
14
|
+
GPU_BUFFER_USAGE_STORAGE,
|
|
15
|
+
} from '../gpu-usage';
|
|
16
|
+
|
|
17
|
+
it('samples the production reflection pyramid at roughness squared LOD with confidence weighting', async () => {
|
|
18
|
+
const source = readFileSync(
|
|
19
|
+
resolve(process.cwd(), 'packages/shader/src/ssr-compose.wgsl'),
|
|
20
|
+
'utf8',
|
|
21
|
+
);
|
|
22
|
+
const start = source.indexOf('fn ssrReflectionLod(');
|
|
23
|
+
const end = source.indexOf('@fragment\nfn fs_ssr_compose', start);
|
|
24
|
+
expect(start).toBeGreaterThan(0);
|
|
25
|
+
expect(end).toBeGreaterThan(start);
|
|
26
|
+
const temporalSource = readFileSync(
|
|
27
|
+
resolve(process.cwd(), 'packages/shader/src/ssr-temporal.wgsl'),
|
|
28
|
+
'utf8',
|
|
29
|
+
);
|
|
30
|
+
const temporalStart = temporalSource.indexOf('fn resolveSsrTemporal(');
|
|
31
|
+
const temporalEnd = temporalSource.indexOf('\n}\n', temporalStart) + 3;
|
|
32
|
+
expect(temporalStart).toBeGreaterThan(0);
|
|
33
|
+
expect(temporalEnd).toBeGreaterThan(temporalStart);
|
|
34
|
+
const temporalHelpers = temporalSource.slice(
|
|
35
|
+
temporalSource.indexOf('fn isFinite('),
|
|
36
|
+
temporalSource.indexOf('fn finitePositive('),
|
|
37
|
+
);
|
|
38
|
+
const device = (await (await rhi.requestAdapter()).unwrap().requestDevice()).unwrap();
|
|
39
|
+
const texture = device
|
|
40
|
+
.createTexture({
|
|
41
|
+
size: { width: 4, height: 4, depthOrArrayLayers: 1 },
|
|
42
|
+
mipLevelCount: 3,
|
|
43
|
+
// Match the production HDR pyramid, including the filtering precision.
|
|
44
|
+
format: 'rgba16float',
|
|
45
|
+
textureBindingViewDimension: '2d',
|
|
46
|
+
usage: GPU_TEXTURE_USAGE_COPY_DST | GPU_TEXTURE_USAGE_TEXTURE_BINDING,
|
|
47
|
+
})
|
|
48
|
+
.unwrap();
|
|
49
|
+
const output = device
|
|
50
|
+
.createBuffer({ size: 128, usage: GPU_BUFFER_USAGE_STORAGE | GPU_BUFFER_USAGE_COPY_SRC })
|
|
51
|
+
.unwrap();
|
|
52
|
+
const readback = device
|
|
53
|
+
.createBuffer({ size: 128, usage: GPU_BUFFER_USAGE_MAP_READ | GPU_BUFFER_USAGE_COPY_DST })
|
|
54
|
+
.unwrap();
|
|
55
|
+
try {
|
|
56
|
+
// Distinct levels falsify accidental mip-zero-only sampling. The middle
|
|
57
|
+
// level has zero confidence and must not introduce its green radiance.
|
|
58
|
+
for (let level = 0; level < 3; level++) {
|
|
59
|
+
const size = 4 >> level;
|
|
60
|
+
const color = [
|
|
61
|
+
[0x3c00, 0, 0, 0x3c00],
|
|
62
|
+
// Zero-confidence presentation texels carry no RGB payload.
|
|
63
|
+
[0, 0, 0, 0],
|
|
64
|
+
[0, 0, 0x3c00, 0x3c00],
|
|
65
|
+
][level];
|
|
66
|
+
if (color === undefined) throw new Error('Missing mip fixture color');
|
|
67
|
+
const data = new Uint16Array(size * size * 4);
|
|
68
|
+
for (let pixel = 0; pixel < size * size; pixel++) data.set(color, pixel * 4);
|
|
69
|
+
device.queue
|
|
70
|
+
.writeTexture(
|
|
71
|
+
{ texture, mipLevel: level, origin: [0, 0, 0] },
|
|
72
|
+
data,
|
|
73
|
+
{ offset: 0, bytesPerRow: size * 8, rowsPerImage: size },
|
|
74
|
+
{ width: size, height: size, depthOrArrayLayers: 1 },
|
|
75
|
+
)
|
|
76
|
+
.unwrap();
|
|
77
|
+
}
|
|
78
|
+
const module = createShaderModuleImmediate(device, {
|
|
79
|
+
code: `
|
|
80
|
+
@group(0) @binding(0) var radiance: texture_2d<f32>;
|
|
81
|
+
@group(0) @binding(1) var radianceSampler: sampler;
|
|
82
|
+
@group(0) @binding(2) var<storage, read_write> result: array<vec4<f32>>;
|
|
83
|
+
${source.slice(start, end)}
|
|
84
|
+
struct ProbeParams { historyValid: u32, maxHistoryWeight: f32 };
|
|
85
|
+
const params = ProbeParams(1u, 0.9);
|
|
86
|
+
${temporalHelpers}
|
|
87
|
+
${temporalSource.slice(temporalStart, temporalEnd)}
|
|
88
|
+
@compute @workgroup_size(1) fn probe() {
|
|
89
|
+
result[0] = sampleRoughSsr(vec2<f32>(0.5), 0.0);
|
|
90
|
+
result[1] = sampleRoughSsr(vec2<f32>(0.5), 0.5);
|
|
91
|
+
result[2] = sampleRoughSsr(vec2<f32>(0.5), 1.0);
|
|
92
|
+
result[3] = sampleRoughSsr(vec2<f32>(0.5), sqrt(0.75));
|
|
93
|
+
// Miss -> hit must not mix black history; hit -> miss decays confidence
|
|
94
|
+
// without darkening radiance; disocclusion rejects that carry immediately.
|
|
95
|
+
let red = vec4<f32>(1.0, 0.0, 0.0, 1.0);
|
|
96
|
+
let empty = vec4<f32>(0.0);
|
|
97
|
+
result[4] = resolveSsrTemporal(red, empty, 0.0, vec3<f32>(0), vec3<f32>(1), true, true, true, empty);
|
|
98
|
+
result[5] = resolveSsrTemporal(empty, red, 1.0, vec3<f32>(0), vec3<f32>(0), true, true, true, empty);
|
|
99
|
+
result[6] = resolveSsrTemporal(empty, red, 1.0, vec3<f32>(0), vec3<f32>(0), true, false, true, empty);
|
|
100
|
+
result[7] = resolveSsrTemporal(red, empty, 1.0, vec3<f32>(0), vec3<f32>(1), true, true, true, empty);
|
|
101
|
+
}`,
|
|
102
|
+
}).unwrap();
|
|
103
|
+
const groupLayout = device
|
|
104
|
+
.createBindGroupLayout({
|
|
105
|
+
entries: [
|
|
106
|
+
{
|
|
107
|
+
binding: 0,
|
|
108
|
+
visibility: GPU_SHADER_STAGE_COMPUTE,
|
|
109
|
+
texture: { sampleType: 'float', viewDimension: '2d' },
|
|
110
|
+
},
|
|
111
|
+
{ binding: 1, visibility: GPU_SHADER_STAGE_COMPUTE, sampler: { type: 'filtering' } },
|
|
112
|
+
{ binding: 2, visibility: GPU_SHADER_STAGE_COMPUTE, buffer: { type: 'storage' } },
|
|
113
|
+
],
|
|
114
|
+
})
|
|
115
|
+
.unwrap();
|
|
116
|
+
const layout = device.createPipelineLayout({ bindGroupLayouts: [groupLayout] }).unwrap();
|
|
117
|
+
const pipeline = device
|
|
118
|
+
.createComputePipeline({ layout, compute: { module, entryPoint: 'probe' } })
|
|
119
|
+
.unwrap();
|
|
120
|
+
const view = device.createTextureView(texture, { baseMipLevel: 0, mipLevelCount: 3 }).unwrap();
|
|
121
|
+
const sampler = device
|
|
122
|
+
.createSampler({
|
|
123
|
+
addressModeU: 'clamp-to-edge',
|
|
124
|
+
addressModeV: 'clamp-to-edge',
|
|
125
|
+
minFilter: 'linear',
|
|
126
|
+
magFilter: 'linear',
|
|
127
|
+
mipmapFilter: 'linear',
|
|
128
|
+
})
|
|
129
|
+
.unwrap();
|
|
130
|
+
const group = device
|
|
131
|
+
.createBindGroup({
|
|
132
|
+
layout: groupLayout,
|
|
133
|
+
entries: [
|
|
134
|
+
{ binding: 0, resource: { kind: 'textureView', value: view } },
|
|
135
|
+
{ binding: 1, resource: { kind: 'sampler', value: sampler } },
|
|
136
|
+
{ binding: 2, resource: { kind: 'buffer', value: { buffer: output } } },
|
|
137
|
+
],
|
|
138
|
+
})
|
|
139
|
+
.unwrap();
|
|
140
|
+
const encoder = device.createCommandEncoder().unwrap();
|
|
141
|
+
const pass = encoder.beginComputePass();
|
|
142
|
+
pass.setPipeline(pipeline);
|
|
143
|
+
pass.setBindGroup(0, group);
|
|
144
|
+
pass.dispatchWorkgroups(1);
|
|
145
|
+
pass.end();
|
|
146
|
+
encoder.copyBufferToBuffer(output, 0, readback, 0, 128);
|
|
147
|
+
device.queue.submit([encoder.finish().unwrap()]).unwrap();
|
|
148
|
+
const mapped = (await readback.mapAsync(GPU_BUFFER_USAGE_MAP_READ)).unwrap();
|
|
149
|
+
const values = [...new Float32Array(mapped.getMappedRange().unwrap().slice(0))];
|
|
150
|
+
mapped.unmap();
|
|
151
|
+
const expected = [
|
|
152
|
+
// sampleRoughSsr exposes the premultiplied presentation value; the
|
|
153
|
+
// production fragment unpremultiplies once before material blending.
|
|
154
|
+
1, 0, 0, 1, 0.5, 0, 0, 0.5, 0, 0, 1, 1, 0, 0, 0.5, 0.5, 1, 0, 0, 1, 1, 0, 0, 0.9, 0, 0, 0, 0,
|
|
155
|
+
0.1, 0, 0, 1,
|
|
156
|
+
];
|
|
157
|
+
for (const [i, value] of expected.entries()) expect(values[i]).toBeCloseTo(value, 5);
|
|
158
|
+
} finally {
|
|
159
|
+
device.destroyTexture(texture).unwrap();
|
|
160
|
+
device.destroyBuffer(output).unwrap();
|
|
161
|
+
device.destroyBuffer(readback).unwrap();
|
|
162
|
+
}
|
|
163
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ShaderModule } from '@forgeax/engine-rhi';
|
|
2
|
+
import type { ManifestEntry } from '@forgeax/engine-types';
|
|
3
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { prewarmSsrShaders } from '../assembly/ssr-shader-prewarm';
|
|
5
|
+
|
|
6
|
+
const entries = [
|
|
7
|
+
'ssr_hiz_seed',
|
|
8
|
+
'ssr_hiz_reduce',
|
|
9
|
+
'ssr_trace',
|
|
10
|
+
'ssr_temporal',
|
|
11
|
+
'vs_ssr_compose',
|
|
12
|
+
].map((entry) => ({ wgsl: `fn ${entry}() {}` }) as ManifestEntry);
|
|
13
|
+
|
|
14
|
+
describe('SSR bundle preparation', () => {
|
|
15
|
+
it('does no compile or publication for an absent optional bundle', async () => {
|
|
16
|
+
const compile = vi.fn(),
|
|
17
|
+
seed = vi.fn();
|
|
18
|
+
expect(await prewarmSsrShaders([], compile, seed)).toBeUndefined();
|
|
19
|
+
expect(compile).not.toHaveBeenCalled();
|
|
20
|
+
expect(seed).not.toHaveBeenCalled();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('rejects an incomplete bundle before compilation', async () => {
|
|
24
|
+
const compile = vi.fn(),
|
|
25
|
+
seed = vi.fn();
|
|
26
|
+
await expect(prewarmSsrShaders(entries.slice(0, 4), compile, seed)).rejects.toMatchObject({
|
|
27
|
+
code: 'shader-compile-failed',
|
|
28
|
+
});
|
|
29
|
+
expect(compile).not.toHaveBeenCalled();
|
|
30
|
+
expect(seed).not.toHaveBeenCalled();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('never seeds a partial generation when a later module fails', async () => {
|
|
34
|
+
const seed = vi.fn();
|
|
35
|
+
const compile = vi.fn(async (label: string) => {
|
|
36
|
+
if (label === 'ssr_temporal') throw new Error('compile failed');
|
|
37
|
+
return {} as ShaderModule;
|
|
38
|
+
});
|
|
39
|
+
await expect(prewarmSsrShaders(entries, compile, seed)).rejects.toThrow('compile failed');
|
|
40
|
+
expect(seed).not.toHaveBeenCalled();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('returns and seeds all five stages only after the final compile', async () => {
|
|
44
|
+
const seed = vi.fn();
|
|
45
|
+
const compile = vi.fn(async () => {
|
|
46
|
+
expect(seed).not.toHaveBeenCalled();
|
|
47
|
+
return {} as ShaderModule;
|
|
48
|
+
});
|
|
49
|
+
const sources = await prewarmSsrShaders(entries, compile, seed);
|
|
50
|
+
expect(seed).toHaveBeenCalledTimes(5);
|
|
51
|
+
expect(sources).toEqual({
|
|
52
|
+
hiz: 'fn ssr_hiz_seed() {}',
|
|
53
|
+
hizReduce: 'fn ssr_hiz_reduce() {}',
|
|
54
|
+
trace: 'fn ssr_trace() {}',
|
|
55
|
+
temporal: 'fn ssr_temporal() {}',
|
|
56
|
+
compose: 'fn vs_ssr_compose() {}',
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|