@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
package/src/gpu-scene-schema.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GPU_DRIVEN_MATERIAL_ROW_BYTES,
|
|
3
|
+
STANDARD_PIPELINE_PARAM_SCHEMA,
|
|
4
|
+
} from '@forgeax/engine-shader';
|
|
5
|
+
import { derive, type NumericParamType } from '@forgeax/engine-types';
|
|
6
|
+
|
|
1
7
|
export type GpuSceneScalar = 'u32' | 'i32' | 'f32';
|
|
2
|
-
export type GpuSceneFieldType = GpuSceneScalar | 'vec4<f32>' | 'mat4x4<f32>';
|
|
8
|
+
export type GpuSceneFieldType = GpuSceneScalar | 'vec3<f32>' | 'vec4<f32>' | 'mat4x4<f32>';
|
|
3
9
|
|
|
4
10
|
export interface GpuSceneField {
|
|
5
11
|
readonly name: string;
|
|
@@ -29,6 +35,7 @@ const TYPE_LAYOUT: Readonly<
|
|
|
29
35
|
u32: { size: 4, alignment: 4 },
|
|
30
36
|
i32: { size: 4, alignment: 4 },
|
|
31
37
|
f32: { size: 4, alignment: 4 },
|
|
38
|
+
'vec3<f32>': { size: 12, alignment: 16 },
|
|
32
39
|
'vec4<f32>': { size: 16, alignment: 16 },
|
|
33
40
|
'mat4x4<f32>': { size: 64, alignment: 16 },
|
|
34
41
|
};
|
|
@@ -62,6 +69,58 @@ export function gpuSceneWgsl(layout: GpuSceneTableLayout): string {
|
|
|
62
69
|
return `struct ${layout.name} {\n${fields}\n};`;
|
|
63
70
|
}
|
|
64
71
|
|
|
72
|
+
function gpuSceneTypeForNumeric(type: NumericParamType): GpuSceneFieldType {
|
|
73
|
+
switch (type) {
|
|
74
|
+
case 'f32':
|
|
75
|
+
return 'f32';
|
|
76
|
+
case 'i32':
|
|
77
|
+
return 'i32';
|
|
78
|
+
case 'u32':
|
|
79
|
+
return 'u32';
|
|
80
|
+
case 'vec3':
|
|
81
|
+
return 'vec3<f32>';
|
|
82
|
+
case 'vec4':
|
|
83
|
+
case 'color':
|
|
84
|
+
return 'vec4<f32>';
|
|
85
|
+
case 'vec2':
|
|
86
|
+
throw new Error('Standard PBR GPU Scene material ABI does not admit vec2 fields');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Project the canonical Standard material UBO into the GPU Scene storage row.
|
|
92
|
+
* The compiler-generated `MaterialParameters` struct, the row packer, and the
|
|
93
|
+
* shadow alpha-mask reader all consume this projection, so a new root numeric
|
|
94
|
+
* field or coordinate pair cannot silently create a second hand-written ABI.
|
|
95
|
+
*/
|
|
96
|
+
function deriveStandardMaterialFields(): readonly GpuSceneField[] {
|
|
97
|
+
const derived = derive(STANDARD_PIPELINE_PARAM_SCHEMA);
|
|
98
|
+
const fields = [
|
|
99
|
+
...derived.numericMembers.map((member) => ({
|
|
100
|
+
offset: member.offset,
|
|
101
|
+
field: { name: member.name, type: gpuSceneTypeForNumeric(member.type) },
|
|
102
|
+
})),
|
|
103
|
+
...derived.coordinateRecords.flatMap((record) => [
|
|
104
|
+
{
|
|
105
|
+
offset: record.offset,
|
|
106
|
+
field: { name: record.transformMember, type: 'vec4<f32>' as const },
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
offset: record.offset + 16,
|
|
110
|
+
field: { name: record.metadataMember, type: 'vec4<f32>' as const },
|
|
111
|
+
},
|
|
112
|
+
]),
|
|
113
|
+
];
|
|
114
|
+
fields.sort((left, right) => left.offset - right.offset);
|
|
115
|
+
return [
|
|
116
|
+
...fields.map(({ field }) => field),
|
|
117
|
+
...Array.from(
|
|
118
|
+
{ length: (GPU_DRIVEN_MATERIAL_ROW_BYTES - derived.totalBytes) / 16 },
|
|
119
|
+
(_, index) => ({ name: `_gpuDrivenPadding${index}`, type: 'vec4<f32>' as const }),
|
|
120
|
+
),
|
|
121
|
+
];
|
|
122
|
+
}
|
|
123
|
+
|
|
65
124
|
export const GPU_SCENE_SCHEMAS = Object.freeze({
|
|
66
125
|
lod: {
|
|
67
126
|
name: 'GpuSceneLod',
|
|
@@ -122,16 +181,7 @@ export const GPU_SCENE_SCHEMAS = Object.freeze({
|
|
|
122
181
|
},
|
|
123
182
|
material: {
|
|
124
183
|
name: 'GpuSceneMaterial',
|
|
125
|
-
fields:
|
|
126
|
-
{ name: 'params0', type: 'vec4<f32>' },
|
|
127
|
-
{ name: 'params1', type: 'vec4<f32>' },
|
|
128
|
-
{ name: 'params2', type: 'vec4<f32>' },
|
|
129
|
-
{ name: 'params3', type: 'vec4<f32>' },
|
|
130
|
-
{ name: 'resource0', type: 'u32' },
|
|
131
|
-
{ name: 'resource1', type: 'u32' },
|
|
132
|
-
{ name: 'resource2', type: 'u32' },
|
|
133
|
-
{ name: 'resource3', type: 'u32' },
|
|
134
|
-
],
|
|
184
|
+
fields: deriveStandardMaterialFields(),
|
|
135
185
|
},
|
|
136
186
|
} satisfies Readonly<Record<string, GpuSceneTableSchema>>);
|
|
137
187
|
|
package/src/gpu-scene.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Buffer, Result, RhiDevice } from '@forgeax/engine-rhi';
|
|
2
2
|
import { err, ok, RhiError } from '@forgeax/engine-rhi';
|
|
3
|
+
import { createStandardPbrArtifactReceipt } from '@forgeax/engine-shader';
|
|
3
4
|
import {
|
|
4
5
|
GPU_SCENE_LAYOUTS,
|
|
5
6
|
type GpuSceneTableLayout,
|
|
@@ -11,6 +12,7 @@ import {
|
|
|
11
12
|
GPU_BUFFER_USAGE_STORAGE,
|
|
12
13
|
} from './gpu-usage';
|
|
13
14
|
import type { GpuSceneInspection } from './inspection-types';
|
|
15
|
+
import { packMaterialProgramRow, packStandardPbrMaterialRow } from './material-row';
|
|
14
16
|
import type { RenderSceneApplyResult, RenderSceneSlot } from './scene/render-scene-types';
|
|
15
17
|
|
|
16
18
|
export type { GpuSceneInspection } from './inspection-types';
|
|
@@ -20,6 +22,7 @@ const INSTANCE = GPU_SCENE_LAYOUTS.instance;
|
|
|
20
22
|
const TRANSFORM = GPU_SCENE_LAYOUTS.transform;
|
|
21
23
|
const DRAW_TEMPLATE = GPU_SCENE_LAYOUTS.drawTemplate;
|
|
22
24
|
const MATERIAL = GPU_SCENE_LAYOUTS.material;
|
|
25
|
+
const STANDARD_PBR_RECEIPT = createStandardPbrArtifactReceipt();
|
|
23
26
|
const PRIMITIVE_ACTIVE = 1;
|
|
24
27
|
const PRIMITIVE_HAS_BOUNDS = 2;
|
|
25
28
|
const PRIMITIVE_GPU_DRIVEN = 4;
|
|
@@ -50,6 +53,7 @@ class StableRangeAllocator {
|
|
|
50
53
|
private readonly free: Array<{ start: number; count: number }> = [];
|
|
51
54
|
|
|
52
55
|
allocate(count: number): number {
|
|
56
|
+
if (count <= 0) return 0;
|
|
53
57
|
const freeIndex = this.free.findIndex((range) => range.count >= count);
|
|
54
58
|
if (freeIndex >= 0) {
|
|
55
59
|
const range = this.free[freeIndex];
|
|
@@ -157,6 +161,29 @@ function writeMat4(view: DataView, byteOffset: number, value: Float32Array): voi
|
|
|
157
161
|
}
|
|
158
162
|
}
|
|
159
163
|
|
|
164
|
+
function writeChangedMat4(
|
|
165
|
+
view: DataView,
|
|
166
|
+
byteOffset: number,
|
|
167
|
+
matrix: Float32Array,
|
|
168
|
+
sourceOffset = 0,
|
|
169
|
+
): boolean {
|
|
170
|
+
let changed = false;
|
|
171
|
+
for (let lane = 0; lane < 16; lane += 1) {
|
|
172
|
+
const at = byteOffset + lane * 4;
|
|
173
|
+
const value = matrix[sourceOffset + lane] ?? 0;
|
|
174
|
+
if (Object.is(view.getFloat32(at, true), value)) continue;
|
|
175
|
+
view.setFloat32(at, value, true);
|
|
176
|
+
changed = true;
|
|
177
|
+
}
|
|
178
|
+
return changed;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function writeChangedU32(view: DataView, byteOffset: number, value: number): boolean {
|
|
182
|
+
if (view.getUint32(byteOffset, true) === value) return false;
|
|
183
|
+
view.setUint32(byteOffset, value, true);
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
|
|
160
187
|
function writeVec4(view: DataView, byteOffset: number, values: readonly number[]): void {
|
|
161
188
|
for (let lane = 0; lane < 4; lane += 1) {
|
|
162
189
|
view.setFloat32(byteOffset + lane * 4, values[lane] ?? 0, true);
|
|
@@ -179,14 +206,7 @@ function stableU32(value: string): number {
|
|
|
179
206
|
function coalesceSlots(
|
|
180
207
|
slots: readonly number[],
|
|
181
208
|
): readonly { readonly start: number; readonly end: number }[] {
|
|
182
|
-
|
|
183
|
-
for (let index = 1; index < slots.length; index += 1) {
|
|
184
|
-
if ((slots[index] ?? 0) <= (slots[index - 1] ?? 0)) {
|
|
185
|
-
alreadyOrdered = false;
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
const ordered = alreadyOrdered ? slots : [...new Set(slots)].sort((a, b) => a - b);
|
|
209
|
+
const ordered = [...new Set(slots)].sort((a, b) => a - b);
|
|
190
210
|
const ranges: Array<{ start: number; end: number }> = [];
|
|
191
211
|
for (const slot of ordered) {
|
|
192
212
|
const previous = ranges.at(-1);
|
|
@@ -206,14 +226,18 @@ export class GpuScene {
|
|
|
206
226
|
private transformBytes: Uint8Array;
|
|
207
227
|
private transformView: DataView;
|
|
208
228
|
private buffers: GpuSceneBuffers;
|
|
229
|
+
/** Table buffers replaced by capacity growth stay alive until the scene is retired. */
|
|
230
|
+
private readonly retiredBuffers: Buffer[] = [];
|
|
209
231
|
private uploadRanges = 0;
|
|
210
232
|
private uploadBytes = 0;
|
|
211
233
|
private capacityGrows = 0;
|
|
212
234
|
private fullRebuilds = 0;
|
|
213
235
|
private clearedSlots = 0;
|
|
214
236
|
private noChangeFrames = 0;
|
|
237
|
+
/** Monotonic content identity consumed by shadow-cache invalidation. */
|
|
238
|
+
private sceneContentRevision = 0;
|
|
215
239
|
private identityUploaded = false;
|
|
216
|
-
private readonly allocations
|
|
240
|
+
private readonly allocations = new Map<number, PrimitiveAllocation>();
|
|
217
241
|
private readonly instances = new StableRangeAllocator();
|
|
218
242
|
private readonly transforms = new StableRangeAllocator();
|
|
219
243
|
private readonly draws = new StableRangeAllocator();
|
|
@@ -276,16 +300,42 @@ export class GpuScene {
|
|
|
276
300
|
return this.buffers.material;
|
|
277
301
|
}
|
|
278
302
|
|
|
303
|
+
get contentRevision(): number {
|
|
304
|
+
return this.sceneContentRevision;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Resolve the stable scene-material row for one retained render slot. The
|
|
309
|
+
* GPU-driven shadow projection uses this producer-owned index instead of
|
|
310
|
+
* reconstructing material identity from a batch position.
|
|
311
|
+
*/
|
|
312
|
+
materialIndexForSlot(slot: number, materialSlot: number): number | undefined {
|
|
313
|
+
const allocation = this.allocations.get(slot);
|
|
314
|
+
if (
|
|
315
|
+
allocation === undefined ||
|
|
316
|
+
!Number.isInteger(materialSlot) ||
|
|
317
|
+
materialSlot < 0 ||
|
|
318
|
+
materialSlot >= allocation.materialCount
|
|
319
|
+
) {
|
|
320
|
+
return undefined;
|
|
321
|
+
}
|
|
322
|
+
return allocation.materialStart + materialSlot;
|
|
323
|
+
}
|
|
324
|
+
|
|
279
325
|
sync(delta: RenderSceneApplyResult): Result<GpuSceneSyncResult, RhiError> {
|
|
280
326
|
for (const transformIndex of this.pendingTemporalUploads) {
|
|
281
327
|
this.writesByTable.transform.push(transformIndex);
|
|
282
328
|
}
|
|
283
329
|
const pendingWrites = TABLE_NAMES.some((name) => this.writesByTable[name].length > 0);
|
|
330
|
+
const contentUpdatedSlots = delta.contentUpdatedSlots;
|
|
331
|
+
const instanceUpdatedSlots = delta.instanceUpdatedSlots;
|
|
284
332
|
if (
|
|
285
333
|
delta.createdSlots.length === 0 &&
|
|
286
334
|
delta.updatedSlots.length === 0 &&
|
|
287
335
|
delta.recreatedSlots.length === 0 &&
|
|
288
336
|
delta.removedSlots.length === 0 &&
|
|
337
|
+
contentUpdatedSlots.length === 0 &&
|
|
338
|
+
instanceUpdatedSlots.length === 0 &&
|
|
289
339
|
!pendingWrites
|
|
290
340
|
) {
|
|
291
341
|
this.noChangeFrames += 1;
|
|
@@ -296,8 +346,8 @@ export class GpuScene {
|
|
|
296
346
|
writesByTable.transform.push(0);
|
|
297
347
|
}
|
|
298
348
|
let highestChangedSlot = -1;
|
|
299
|
-
const contentUpdatedSlots = delta.contentUpdatedSlots ?? [];
|
|
300
349
|
const contentUpdatedSlotIds = new Set(contentUpdatedSlots.map((record) => record.slot));
|
|
350
|
+
const instanceUpdatedSlotIds = new Set(instanceUpdatedSlots.map((record) => record.slot));
|
|
301
351
|
const allocationResets = new Set<number>();
|
|
302
352
|
// RenderScene may recycle a released CPU slot for a different identity in
|
|
303
353
|
// the same delta. Clear the old GPU allocation before ensuring the new
|
|
@@ -307,11 +357,16 @@ export class GpuScene {
|
|
|
307
357
|
if (record.slot > highestChangedSlot) highestChangedSlot = record.slot;
|
|
308
358
|
this.clearSlot(record.slot, writesByTable);
|
|
309
359
|
}
|
|
310
|
-
for (const records of [
|
|
360
|
+
for (const records of [
|
|
361
|
+
delta.createdSlots,
|
|
362
|
+
contentUpdatedSlots,
|
|
363
|
+
instanceUpdatedSlots,
|
|
364
|
+
delta.recreatedSlots,
|
|
365
|
+
]) {
|
|
311
366
|
for (const record of records) {
|
|
312
|
-
const previous = this.allocations
|
|
367
|
+
const previous = this.allocations.get(record.slot);
|
|
313
368
|
this.ensureAllocation(record, writesByTable);
|
|
314
|
-
if (previous !== this.allocations
|
|
369
|
+
if (previous !== this.allocations.get(record.slot)) allocationResets.add(record.slot);
|
|
315
370
|
if (record.slot > highestChangedSlot) highestChangedSlot = record.slot;
|
|
316
371
|
}
|
|
317
372
|
}
|
|
@@ -331,21 +386,27 @@ export class GpuScene {
|
|
|
331
386
|
if (!grown.ok) return grown;
|
|
332
387
|
}
|
|
333
388
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
for (const record of
|
|
339
|
-
|
|
389
|
+
const publications = [...delta.createdSlots, ...delta.updatedSlots, ...delta.recreatedSlots];
|
|
390
|
+
const newSlots = new Set(
|
|
391
|
+
[...delta.createdSlots, ...delta.recreatedSlots].map((record) => record.slot),
|
|
392
|
+
);
|
|
393
|
+
for (const record of publications) {
|
|
394
|
+
const reset = newSlots.has(record.slot) || allocationResets.has(record.slot);
|
|
395
|
+
if (reset || contentUpdatedSlotIds.has(record.slot)) {
|
|
396
|
+
this.writeSlot(record, reset, writesByTable);
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
if (instanceUpdatedSlotIds.has(record.slot))
|
|
400
|
+
this.writeInstanceTransforms(record, writesByTable);
|
|
340
401
|
this.writeRootTransform(record, false, writesByTable);
|
|
341
402
|
}
|
|
342
|
-
for (const record of delta.recreatedSlots) this.writeSlot(record, true, writesByTable);
|
|
343
403
|
const uploaded = this.uploadRows(writesByTable);
|
|
344
404
|
if (!uploaded.ok) return uploaded;
|
|
345
405
|
this.pendingTemporalUploads.clear();
|
|
346
406
|
for (const name of TABLE_NAMES) writesByTable[name].length = 0;
|
|
347
407
|
this.identityUploaded = true;
|
|
348
408
|
this.clearedSlots += delta.removedSlots.length;
|
|
409
|
+
this.sceneContentRevision += 1;
|
|
349
410
|
return ok({
|
|
350
411
|
ranges: uploaded.value.ranges,
|
|
351
412
|
bytes: uploaded.value.bytes,
|
|
@@ -368,10 +429,6 @@ export class GpuScene {
|
|
|
368
429
|
for (const range of ranges) {
|
|
369
430
|
for (let index = range.start; index < range.end; index += 1) {
|
|
370
431
|
this.pendingTemporalUploads.add(index);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
for (const range of ranges) {
|
|
374
|
-
for (let index = range.start; index < range.end; index += 1) {
|
|
375
432
|
this.transformBytes.copyWithin(
|
|
376
433
|
index * TRANSFORM.stride + previousOffset,
|
|
377
434
|
index * TRANSFORM.stride + currentOffset,
|
|
@@ -401,7 +458,7 @@ export class GpuScene {
|
|
|
401
458
|
}
|
|
402
459
|
|
|
403
460
|
rebuild(slots: readonly RenderSceneSlot[]): Result<GpuSceneSyncResult, RhiError> {
|
|
404
|
-
this.allocations.
|
|
461
|
+
this.allocations.clear();
|
|
405
462
|
this.instances.reset();
|
|
406
463
|
this.transforms.reset(1);
|
|
407
464
|
this.draws.reset();
|
|
@@ -444,6 +501,7 @@ export class GpuScene {
|
|
|
444
501
|
this.uploadRanges += TABLE_NAMES.length;
|
|
445
502
|
this.uploadBytes += bytes;
|
|
446
503
|
this.fullRebuilds += 1;
|
|
504
|
+
this.sceneContentRevision += 1;
|
|
447
505
|
this.identityUploaded = true;
|
|
448
506
|
return ok({ ranges: TABLE_NAMES.length, bytes, grew, cleared: 0 });
|
|
449
507
|
}
|
|
@@ -485,6 +543,7 @@ export class GpuScene {
|
|
|
485
543
|
dispose(): void {
|
|
486
544
|
if (this.disposed) return;
|
|
487
545
|
this.disposed = true;
|
|
546
|
+
for (const buffer of this.retiredBuffers) this.device.destroyBuffer(buffer);
|
|
488
547
|
for (const buffer of Object.values(this.buffers)) this.device.destroyBuffer(buffer);
|
|
489
548
|
}
|
|
490
549
|
|
|
@@ -493,7 +552,7 @@ export class GpuScene {
|
|
|
493
552
|
resetPrevious: boolean,
|
|
494
553
|
writes: Record<GpuSceneTableName, number[]>,
|
|
495
554
|
): void {
|
|
496
|
-
const allocation = this.allocations
|
|
555
|
+
const allocation = this.allocations.get(record.slot);
|
|
497
556
|
if (allocation === undefined) throw new RangeError('GPU Scene allocation unavailable');
|
|
498
557
|
const primitiveOffset = record.slot * PRIMITIVE.stride;
|
|
499
558
|
const primitive = new DataView(this.tableBytes.primitive);
|
|
@@ -556,25 +615,49 @@ export class GpuScene {
|
|
|
556
615
|
const instanceOffset = instanceIndex * INSTANCE.stride;
|
|
557
616
|
const transformIndex =
|
|
558
617
|
allocation.instanceTransformCount === 0 ? 0 : allocation.instanceTransformStart + ordinal;
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
618
|
+
let metadataChanged = writeChangedU32(
|
|
619
|
+
instance,
|
|
620
|
+
instanceOffset + offset(INSTANCE, 'primitiveIndex'),
|
|
621
|
+
record.slot,
|
|
622
|
+
);
|
|
623
|
+
metadataChanged =
|
|
624
|
+
writeChangedU32(
|
|
625
|
+
instance,
|
|
626
|
+
instanceOffset + offset(INSTANCE, 'transformIndex'),
|
|
627
|
+
transformIndex,
|
|
628
|
+
) || metadataChanged;
|
|
629
|
+
metadataChanged =
|
|
630
|
+
writeChangedU32(
|
|
631
|
+
instance,
|
|
632
|
+
instanceOffset + offset(INSTANCE, 'customDataStart'),
|
|
633
|
+
record.snapshot.skin?.customDataStart ?? 0,
|
|
634
|
+
) || metadataChanged;
|
|
635
|
+
metadataChanged =
|
|
636
|
+
writeChangedU32(instance, instanceOffset + offset(INSTANCE, 'flags'), PRIMITIVE_ACTIVE) ||
|
|
637
|
+
metadataChanged;
|
|
563
638
|
if (allocation.instanceTransformCount > 0) {
|
|
564
|
-
const
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
const localWorld = local?.length === 16 ? local : IDENTITY_MATRIX;
|
|
639
|
+
const transforms = record.snapshot.instances?.transforms;
|
|
640
|
+
const hasLocal = transforms !== undefined && transforms.length >= (ordinal + 1) * 16;
|
|
641
|
+
const local = hasLocal ? transforms : IDENTITY_MATRIX;
|
|
642
|
+
const sourceOffset = hasLocal ? ordinal * 16 : 0;
|
|
569
643
|
const localOffset = transformIndex * TRANSFORM.stride;
|
|
570
|
-
const
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
644
|
+
const changed = writeChangedMat4(
|
|
645
|
+
transform,
|
|
646
|
+
localOffset + offset(TRANSFORM, 'currentWorld'),
|
|
647
|
+
local,
|
|
648
|
+
sourceOffset,
|
|
649
|
+
);
|
|
650
|
+
if (resetPrevious)
|
|
651
|
+
writeChangedMat4(
|
|
652
|
+
transform,
|
|
653
|
+
localOffset + offset(TRANSFORM, 'previousWorld'),
|
|
654
|
+
local,
|
|
655
|
+
sourceOffset,
|
|
656
|
+
);
|
|
657
|
+
else if (changed) this.pendingTemporalTransforms.add(transformIndex);
|
|
658
|
+
if (changed || resetPrevious) writes.transform.push(transformIndex);
|
|
576
659
|
}
|
|
577
|
-
writes.instance.push(instanceIndex);
|
|
660
|
+
if (metadataChanged || resetPrevious) writes.instance.push(instanceIndex);
|
|
578
661
|
}
|
|
579
662
|
|
|
580
663
|
this.writeRootTransform(record, resetPrevious, writes);
|
|
@@ -623,76 +706,85 @@ export class GpuScene {
|
|
|
623
706
|
writes.drawTemplate.push(drawIndex);
|
|
624
707
|
}
|
|
625
708
|
|
|
626
|
-
|
|
709
|
+
this.writeMaterialSlot(record, writes);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
private writeMaterialSlot(
|
|
713
|
+
record: RenderSceneSlot,
|
|
714
|
+
writes: Record<GpuSceneTableName, number[]>,
|
|
715
|
+
): void {
|
|
716
|
+
const allocation = this.allocations.get(record.slot);
|
|
717
|
+
if (allocation === undefined) throw new RangeError('GPU Scene allocation unavailable');
|
|
627
718
|
for (let ordinal = 0; ordinal < allocation.materialCount; ordinal += 1) {
|
|
628
719
|
const materialIndex = allocation.materialStart + ordinal;
|
|
629
720
|
const materialOffset = materialIndex * MATERIAL.stride;
|
|
630
721
|
const snapshot = record.snapshot.materials[ordinal] ?? record.snapshot.material;
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
snapshot.emissive?.[2] ?? 0,
|
|
645
|
-
snapshot.emissiveIntensity ?? 0,
|
|
646
|
-
]);
|
|
647
|
-
writeVec4(material, materialOffset + offset(MATERIAL, 'params3'), [
|
|
648
|
-
snapshot.normalScale ?? 1,
|
|
649
|
-
snapshot.occlusionStrength ?? 1,
|
|
650
|
-
0,
|
|
651
|
-
0,
|
|
652
|
-
]);
|
|
653
|
-
material.setUint32(
|
|
654
|
-
materialOffset + offset(MATERIAL, 'resource0'),
|
|
655
|
-
snapshot.baseColorTexture ?? 0,
|
|
656
|
-
true,
|
|
657
|
-
);
|
|
658
|
-
material.setUint32(
|
|
659
|
-
materialOffset + offset(MATERIAL, 'resource1'),
|
|
660
|
-
snapshot.metallicRoughnessTexture ?? 0,
|
|
661
|
-
true,
|
|
662
|
-
);
|
|
663
|
-
material.setUint32(
|
|
664
|
-
materialOffset + offset(MATERIAL, 'resource2'),
|
|
665
|
-
snapshot.normalTexture ?? 0,
|
|
666
|
-
true,
|
|
667
|
-
);
|
|
668
|
-
material.setUint32(
|
|
669
|
-
materialOffset + offset(MATERIAL, 'resource3'),
|
|
670
|
-
snapshot.emissiveTexture ?? 0,
|
|
671
|
-
true,
|
|
672
|
-
);
|
|
722
|
+
const shaderId = snapshot.materialShaderId;
|
|
723
|
+
const schema = snapshot.materialParamSchema;
|
|
724
|
+
const row =
|
|
725
|
+
shaderId !== undefined &&
|
|
726
|
+
shaderId !== 'forgeax::default-standard-pbr' &&
|
|
727
|
+
shaderId !== 'forgeax::pbr-skin' &&
|
|
728
|
+
shaderId !== 'forgeax::default-standard-pbr-skin' &&
|
|
729
|
+
schema !== undefined
|
|
730
|
+
? packMaterialProgramRow(schema, snapshot, MATERIAL.stride)
|
|
731
|
+
: packStandardPbrMaterialRow(STANDARD_PBR_RECEIPT, snapshot);
|
|
732
|
+
const destination = new Uint8Array(this.tableBytes.material, materialOffset, MATERIAL.stride);
|
|
733
|
+
destination.fill(0);
|
|
734
|
+
if (row !== undefined) destination.set(row.subarray(0, MATERIAL.stride));
|
|
673
735
|
writes.material.push(materialIndex);
|
|
674
736
|
}
|
|
675
737
|
}
|
|
676
738
|
|
|
739
|
+
/** Consume changed instance fields independently of root or material changes. */
|
|
740
|
+
private writeInstanceTransforms(
|
|
741
|
+
record: RenderSceneSlot,
|
|
742
|
+
writes: Record<GpuSceneTableName, number[]>,
|
|
743
|
+
): void {
|
|
744
|
+
const allocation = this.allocations.get(record.slot);
|
|
745
|
+
const instances = record.snapshot.instances;
|
|
746
|
+
if (allocation === undefined || instances === undefined) {
|
|
747
|
+
throw new RangeError('GPU Scene instance update has no explicit allocation');
|
|
748
|
+
}
|
|
749
|
+
if (allocation.instanceTransformCount !== instances.instanceCount) {
|
|
750
|
+
throw new RangeError('GPU Scene instance update changed instance count');
|
|
751
|
+
}
|
|
752
|
+
for (let ordinal = 0; ordinal < allocation.instanceTransformCount; ordinal += 1) {
|
|
753
|
+
const transformIndex = allocation.instanceTransformStart + ordinal;
|
|
754
|
+
const transformOffset = transformIndex * TRANSFORM.stride;
|
|
755
|
+
if (
|
|
756
|
+
writeChangedMat4(
|
|
757
|
+
this.transformView,
|
|
758
|
+
transformOffset + offset(TRANSFORM, 'currentWorld'),
|
|
759
|
+
instances.transforms,
|
|
760
|
+
ordinal * 16,
|
|
761
|
+
)
|
|
762
|
+
) {
|
|
763
|
+
this.pendingTemporalTransforms.add(transformIndex);
|
|
764
|
+
writes.transform.push(transformIndex);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
|
|
677
769
|
private writeRootTransform(
|
|
678
770
|
record: RenderSceneSlot,
|
|
679
771
|
resetPrevious: boolean,
|
|
680
772
|
writes: Record<GpuSceneTableName, number[]>,
|
|
681
773
|
): void {
|
|
682
|
-
const allocation = this.allocations
|
|
774
|
+
const allocation = this.allocations.get(record.slot);
|
|
683
775
|
if (allocation === undefined) throw new RangeError('GPU Scene allocation unavailable');
|
|
684
776
|
const transformOffset = allocation.transformStart * TRANSFORM.stride;
|
|
685
777
|
const previousOffset = transformOffset + offset(TRANSFORM, 'previousWorld');
|
|
686
778
|
if (resetPrevious) {
|
|
687
779
|
writeMat4(this.transformView, previousOffset, record.snapshot.transform.world);
|
|
688
780
|
}
|
|
689
|
-
|
|
781
|
+
const changed = writeChangedMat4(
|
|
690
782
|
this.transformView,
|
|
691
783
|
transformOffset + offset(TRANSFORM, 'currentWorld'),
|
|
692
784
|
record.snapshot.transform.world,
|
|
693
785
|
);
|
|
694
|
-
if (!resetPrevious) this.pendingTemporalTransforms.add(allocation.transformStart);
|
|
695
|
-
writes.transform.push(allocation.transformStart);
|
|
786
|
+
if (changed && !resetPrevious) this.pendingTemporalTransforms.add(allocation.transformStart);
|
|
787
|
+
if (changed || resetPrevious) writes.transform.push(allocation.transformStart);
|
|
696
788
|
}
|
|
697
789
|
|
|
698
790
|
private clearSlot(slot: number, writes: Record<GpuSceneTableName, number[]>): void {
|
|
@@ -701,10 +793,10 @@ export class GpuScene {
|
|
|
701
793
|
new Uint8Array(this.tableBytes[name], slot * layout.stride, layout.stride).fill(0);
|
|
702
794
|
writes[name].push(slot);
|
|
703
795
|
}
|
|
704
|
-
const allocation = this.allocations
|
|
796
|
+
const allocation = this.allocations.get(slot);
|
|
705
797
|
if (allocation === undefined) return;
|
|
706
798
|
this.clearAllocation(allocation, writes);
|
|
707
|
-
this.allocations
|
|
799
|
+
this.allocations.delete(slot);
|
|
708
800
|
}
|
|
709
801
|
|
|
710
802
|
private uploadRows(
|
|
@@ -749,7 +841,7 @@ export class GpuScene {
|
|
|
749
841
|
const instanceTransformCount = explicitInstances === undefined ? 0 : instanceCount;
|
|
750
842
|
const drawCount = Math.max(1, record.snapshot.gpuDrivenDraws?.length ?? 0);
|
|
751
843
|
const materialCount = Math.max(1, record.snapshot.materials.length);
|
|
752
|
-
const existing = this.allocations
|
|
844
|
+
const existing = this.allocations.get(record.slot);
|
|
753
845
|
if (
|
|
754
846
|
existing?.instanceCount === instanceCount &&
|
|
755
847
|
existing.instanceTransformCount === instanceTransformCount &&
|
|
@@ -771,7 +863,7 @@ export class GpuScene {
|
|
|
771
863
|
materialStart: this.materials.allocate(materialCount),
|
|
772
864
|
materialCount,
|
|
773
865
|
};
|
|
774
|
-
this.allocations
|
|
866
|
+
this.allocations.set(record.slot, allocation);
|
|
775
867
|
}
|
|
776
868
|
|
|
777
869
|
private clearAllocation(
|
|
@@ -787,17 +879,20 @@ export class GpuScene {
|
|
|
787
879
|
).fill(0);
|
|
788
880
|
writes.instance.push(instanceIndex);
|
|
789
881
|
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
882
|
+
new Uint8Array(
|
|
883
|
+
this.tableBytes.transform,
|
|
884
|
+
allocation.transformStart * TRANSFORM.stride,
|
|
885
|
+
TRANSFORM.stride,
|
|
886
|
+
).fill(0);
|
|
887
|
+
writes.transform.push(allocation.transformStart);
|
|
888
|
+
for (let ordinal = 0; ordinal < allocation.instanceTransformCount; ordinal += 1) {
|
|
889
|
+
const transformIndex = allocation.instanceTransformStart + ordinal;
|
|
793
890
|
new Uint8Array(
|
|
794
891
|
this.tableBytes.transform,
|
|
795
892
|
transformIndex * TRANSFORM.stride,
|
|
796
893
|
TRANSFORM.stride,
|
|
797
894
|
).fill(0);
|
|
798
895
|
writes.transform.push(transformIndex);
|
|
799
|
-
this.pendingTemporalTransforms.delete(transformIndex);
|
|
800
|
-
this.pendingTemporalUploads.delete(transformIndex);
|
|
801
896
|
}
|
|
802
897
|
for (let ordinal = 0; ordinal < allocation.drawCount; ordinal += 1) {
|
|
803
898
|
const drawIndex = allocation.drawStart + ordinal;
|
|
@@ -842,7 +937,10 @@ export class GpuScene {
|
|
|
842
937
|
return write;
|
|
843
938
|
}
|
|
844
939
|
}
|
|
845
|
-
|
|
940
|
+
// A submitted frame may still reference the previous table set. Keep it
|
|
941
|
+
// owned by this scene until the scene itself is retired after the queue
|
|
942
|
+
// fence; destroying it here causes validation errors during growth.
|
|
943
|
+
this.retiredBuffers.push(...Object.values(this.buffers));
|
|
846
944
|
this.buffers = nextBuffers.value;
|
|
847
945
|
this.tableBytes = nextTables;
|
|
848
946
|
this.refreshTransformViews();
|
package/src/gpu-texture-usage.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
export const GPU_TEXTURE_USAGE_COPY_SRC = 0x01;
|
|
8
8
|
export const GPU_TEXTURE_USAGE_COPY_DST = 0x02;
|
|
9
9
|
export const GPU_TEXTURE_USAGE_TEXTURE_BINDING = 0x04;
|
|
10
|
+
export const GPU_TEXTURE_USAGE_STORAGE_BINDING = 0x08;
|
|
10
11
|
export const GPU_TEXTURE_USAGE_RENDER_ATTACHMENT = 0x10;
|
|
11
12
|
export const GPU_TEXTURE_USAGE_RENDER_ATTACHMENT_AND_TEXTURE_BINDING =
|
|
12
13
|
GPU_TEXTURE_USAGE_RENDER_ATTACHMENT | GPU_TEXTURE_USAGE_TEXTURE_BINDING;
|