@forgeax/engine-render 0.1.4 → 0.1.6
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 +130 -641
- package/dist/.tsbuildinfo +1 -1
- package/dist/__tests__/device-scope-lifecycle.unit.test.d.ts +2 -0
- package/dist/__tests__/device-scope-lifecycle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/device-scope-stale-matrix.unit.test.d.ts +2 -0
- package/dist/__tests__/device-scope-stale-matrix.unit.test.d.ts.map +1 -0
- package/dist/__tests__/fullscreen-feature-plan.unit.test.d.ts +2 -0
- package/dist/__tests__/fullscreen-feature-plan.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-indirect-raster-evidence.d.ts.map +1 -1
- package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts +6 -0
- package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts.map +1 -1
- package/dist/{gpu-driven/view-reference.d.ts → __tests__/gpu-driven-view-reference.d.ts} +4 -4
- package/dist/__tests__/gpu-driven-view-reference.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene-render-graph-gpu.d.ts.map +1 -1
- package/dist/__tests__/ibl/face-uniforms.unit.test.d.ts +2 -0
- package/dist/__tests__/ibl/face-uniforms.unit.test.d.ts.map +1 -0
- package/dist/__tests__/morph-feature-plan.unit.test.d.ts +2 -0
- package/dist/__tests__/morph-feature-plan.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-plan.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-plan.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-plan.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-plan.unit.test.d.ts.map +1 -0
- package/dist/__tests__/ssao-config.unit.test.d.ts +2 -0
- package/dist/__tests__/ssao-config.unit.test.d.ts.map +1 -0
- package/dist/__tests__/standard-clustered-pipeline.unit.test.d.ts +2 -0
- package/dist/__tests__/standard-clustered-pipeline.unit.test.d.ts.map +1 -0
- package/dist/__tests__/standard-descriptors.test-d.d.ts +2 -0
- package/dist/__tests__/standard-descriptors.test-d.d.ts.map +1 -0
- package/dist/__tests__/standard-pipeline.dawn.test.d.ts +2 -0
- package/dist/__tests__/standard-pipeline.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/standard-pipeline.integration.test.d.ts +2 -0
- package/dist/__tests__/standard-pipeline.integration.test.d.ts.map +1 -0
- package/dist/__tests__/standard-profile-oracle.unit.test.d.ts +2 -0
- package/dist/__tests__/standard-profile-oracle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-resource-short-circuit.unit.test.d.ts +2 -0
- package/dist/__tests__/visibility-resource-short-circuit.unit.test.d.ts.map +1 -0
- package/dist/{renderer/backend-selection.d.ts → assembly/backend-contract.d.ts} +15 -4
- package/dist/assembly/backend-contract.d.ts.map +1 -0
- package/dist/assembly/factory.d.ts +207 -0
- package/dist/assembly/factory.d.ts.map +1 -0
- package/dist/assembly/host-contract.d.ts +84 -0
- package/dist/assembly/host-contract.d.ts.map +1 -0
- package/dist/{renderer → assembly}/material/assembly.d.ts +0 -1
- package/dist/{renderer → assembly}/material/assembly.d.ts.map +1 -1
- package/dist/assembly/material/pipeline-projection.d.ts +30 -0
- package/dist/assembly/material/pipeline-projection.d.ts.map +1 -0
- package/dist/authoring.d.ts +10 -11
- package/dist/authoring.d.ts.map +1 -1
- package/dist/authoring.mjs +25 -3
- package/dist/authoring.mjs.map +1 -1
- package/dist/chunk-CQXZC5XI.mjs +182 -0
- package/dist/chunk-CQXZC5XI.mjs.map +1 -0
- package/dist/chunk-QC4VW3XJ.mjs +79 -0
- package/dist/chunk-QC4VW3XJ.mjs.map +1 -0
- package/dist/chunk-SCRSAK5B.mjs +480 -0
- package/dist/chunk-SCRSAK5B.mjs.map +1 -0
- package/dist/components/__tests__/schema-contract.unit.test.d.ts +2 -0
- package/dist/components/__tests__/schema-contract.unit.test.d.ts.map +1 -0
- package/dist/components/glyph-text.d.ts +1 -1
- package/dist/components/glyph-text.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/instances.d.ts +1 -1
- package/dist/components/instances.d.ts.map +1 -1
- package/dist/components/light-helpers.d.ts +1 -1
- package/dist/components/light-helpers.d.ts.map +1 -1
- package/dist/components/mesh-filter.d.ts +7 -7
- package/dist/components/mesh-filter.d.ts.map +1 -1
- package/dist/components/scene-instance.d.ts +11 -11
- package/dist/components/skybox-background.d.ts +56 -0
- package/dist/components/skybox-background.d.ts.map +1 -0
- package/dist/components/skylight.d.ts +55 -0
- package/dist/components/skylight.d.ts.map +1 -0
- package/dist/components/sprite-animation.d.ts +2 -3
- package/dist/components/sprite-animation.d.ts.map +1 -1
- package/dist/components/sprite-instances.d.ts +1 -1
- package/dist/components/sprite-playback-mode.d.ts +6 -1
- package/dist/components/sprite-playback-mode.d.ts.map +1 -1
- package/dist/components/sprite-region-override.d.ts +2 -3
- package/dist/components/sprite-region-override.d.ts.map +1 -1
- package/dist/components/tile-layer.d.ts +5 -0
- package/dist/components/tile-layer.d.ts.map +1 -1
- package/dist/construct-renderer.d.ts +18 -1
- package/dist/construct-renderer.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +27008 -4
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/debug-draw-glue.d.ts +2 -53
- package/dist/debug-draw-glue.d.ts.map +1 -1
- package/dist/device/device-scope.d.ts +83 -0
- package/dist/device/device-scope.d.ts.map +1 -0
- package/dist/{gpu-resource-store.d.ts → device/gpu-residency.d.ts} +91 -48
- package/dist/device/gpu-residency.d.ts.map +1 -0
- package/dist/device/resource-types.d.ts +8 -0
- package/dist/device/resource-types.d.ts.map +1 -0
- package/dist/engine-metrics.d.ts +2 -2
- package/dist/engine-metrics.d.ts.map +1 -1
- package/dist/errors/recover.d.ts +28 -1
- package/dist/errors/recover.d.ts.map +1 -1
- package/dist/errors/render.d.ts +249 -258
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/features/fullscreen.d.ts +19 -0
- package/dist/features/fullscreen.d.ts.map +1 -0
- package/dist/features/host.d.ts +32 -26
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/morph/morph-feature.d.ts +39 -5
- package/dist/features/morph/morph-feature.d.ts.map +1 -1
- package/dist/features/plan.d.ts +182 -0
- package/dist/features/plan.d.ts.map +1 -0
- package/dist/features/prepared-gpu-work.d.ts +21 -17
- package/dist/features/prepared-gpu-work.d.ts.map +1 -1
- package/dist/features/prepared-graphics-store.d.ts +2 -1
- package/dist/features/prepared-graphics-store.d.ts.map +1 -1
- package/dist/features/prepared-graphics.d.ts +11 -21
- package/dist/features/prepared-graphics.d.ts.map +1 -1
- package/dist/features/render-graph-compute.d.ts +2 -2
- package/dist/features/render-graph-compute.d.ts.map +1 -1
- package/dist/features/render-graph-contribution.d.ts +4 -7
- package/dist/features/render-graph-contribution.d.ts.map +1 -1
- package/dist/features/render-graph-raster.d.ts +2 -2
- package/dist/features/render-graph-raster.d.ts.map +1 -1
- package/dist/features/render-graph-resources.d.ts +6 -6
- package/dist/features/render-graph-resources.d.ts.map +1 -1
- package/dist/features/targets.d.ts +5 -5
- package/dist/features/targets.d.ts.map +1 -1
- package/dist/features/types.d.ts +11 -190
- package/dist/features/types.d.ts.map +1 -1
- package/dist/features/vocabulary.d.ts +14 -0
- package/dist/features/vocabulary.d.ts.map +1 -0
- package/dist/fullscreen-post-process-pass.d.ts +4 -25
- package/dist/fullscreen-post-process-pass.d.ts.map +1 -1
- package/dist/glyph-text-layout-system.d.ts +3 -2
- package/dist/glyph-text-layout-system.d.ts.map +1 -1
- package/dist/gpu-driven/batch-topology.d.ts +6 -75
- package/dist/gpu-driven/batch-topology.d.ts.map +1 -1
- package/dist/gpu-driven/production-raster.d.ts +13 -112
- package/dist/gpu-driven/production-raster.d.ts.map +1 -1
- package/dist/gpu-driven/view-gpu.d.ts +10 -66
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
- package/dist/gpu-resource.d.ts +3 -3
- package/dist/gpu-scene-schema.d.ts +1 -94
- package/dist/gpu-scene-schema.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +7 -33
- package/dist/gpu-scene.d.ts.map +1 -1
- package/dist/hdrp-buffers.d.ts +3 -53
- package/dist/hdrp-buffers.d.ts.map +1 -1
- package/dist/ibl/IblPipelineCache.d.ts +74 -180
- package/dist/ibl/IblPipelineCache.d.ts.map +1 -1
- package/dist/ibl/skylight-bind-group.d.ts +1 -1
- package/dist/index.d.ts +13 -43
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +165 -3
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +69 -0
- package/dist/inspection-types.d.ts.map +1 -0
- package/dist/instance-buffer-cache.d.ts +1 -4
- package/dist/instance-buffer-cache.d.ts.map +1 -1
- package/dist/internal.d.ts +1 -73
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.mjs +1 -43
- package/dist/internal.mjs.map +1 -1
- package/dist/lifecycle.d.ts +36 -2
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/materials.d.ts +0 -3
- package/dist/materials.d.ts.map +1 -1
- package/dist/mesh-material-bindings.d.ts +0 -1
- package/dist/mesh-material-bindings.d.ts.map +1 -1
- package/dist/pbr-pipeline.d.ts +75 -29
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-forward-lane.d.ts +5 -0
- package/dist/pipeline/standard-forward-lane.d.ts.map +1 -0
- package/dist/pipeline/standard-pipeline.d.ts +31 -0
- package/dist/pipeline/standard-pipeline.d.ts.map +1 -0
- package/dist/pipeline/standard-profile.d.ts +40 -0
- package/dist/pipeline/standard-profile.d.ts.map +1 -0
- package/dist/pipeline-builder.d.ts +3 -3
- package/dist/pipeline-builder.d.ts.map +1 -1
- package/dist/pipeline-spec-types.d.ts +24 -0
- package/dist/pipeline-spec-types.d.ts.map +1 -0
- package/dist/pipeline-spec.d.ts +16 -155
- package/dist/pipeline-spec.d.ts.map +1 -1
- package/dist/plugin.d.ts +1 -14
- package/dist/plugin.d.ts.map +1 -1
- package/dist/post-process-errors.d.ts +18 -18
- package/dist/post-process-errors.d.ts.map +1 -1
- package/dist/prepare/prepared-graphics-resolver.d.ts +2 -5
- package/dist/prepare/prepared-graphics-resolver.d.ts.map +1 -1
- package/dist/record/__tests__/typed-frame-graph-plan.unit.test.d.ts +2 -0
- package/dist/record/__tests__/typed-frame-graph-plan.unit.test.d.ts.map +1 -0
- package/dist/record/frame-lighting.d.ts +7 -73
- package/dist/record/frame-lighting.d.ts.map +1 -1
- package/dist/record/frame-snapshot.d.ts +44 -44
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame-targets.d.ts +5 -38
- package/dist/record/frame-targets.d.ts.map +1 -1
- package/dist/record/frame.d.ts +64 -52
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/helpers.d.ts +3 -2
- package/dist/record/helpers.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +5 -4
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +90 -59
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass-sprite-draws.d.ts +28 -3
- package/dist/record/main-pass-sprite-draws.d.ts.map +1 -1
- package/dist/record/main-pass.d.ts +1 -1
- package/dist/record/main-pass.d.ts.map +1 -1
- package/dist/record/mesh-ssbo.d.ts +276 -3
- package/dist/record/mesh-ssbo.d.ts.map +1 -1
- package/dist/record/render-context.d.ts +235 -0
- package/dist/record/render-context.d.ts.map +1 -0
- package/dist/record/shadow-pass.d.ts +15 -88
- 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 +29 -7
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/record/view-ubo.d.ts +3 -3
- package/dist/record/view-ubo.d.ts.map +1 -1
- package/dist/render-contract.d.ts +416 -0
- package/dist/render-contract.d.ts.map +1 -0
- package/dist/render-data.d.ts.map +1 -1
- package/dist/render-graph-primitives.d.ts +14 -362
- package/dist/render-graph-primitives.d.ts.map +1 -1
- package/dist/render-pipeline.d.ts +25 -64
- package/dist/render-pipeline.d.ts.map +1 -1
- package/dist/render-system-extract.d.ts +107 -338
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system.d.ts +21 -713
- package/dist/render-system.d.ts.map +1 -1
- package/dist/scene/render-scene-types.d.ts +58 -0
- package/dist/scene/render-scene-types.d.ts.map +1 -0
- package/dist/scene/render-scene.d.ts +105 -0
- package/dist/scene/render-scene.d.ts.map +1 -0
- package/dist/scene-instances/post-spawn-resolve-joints.d.ts +2 -5
- package/dist/scene-instances/post-spawn-resolve-joints.d.ts.map +1 -1
- package/dist/ssao-buffers.d.ts +22 -3
- package/dist/ssao-buffers.d.ts.map +1 -1
- package/dist/systems/skin-palette-allocator.d.ts +2 -4
- package/dist/systems/skin-palette-allocator.d.ts.map +1 -1
- package/dist/systems/skin-palette-types.d.ts +14 -0
- package/dist/systems/skin-palette-types.d.ts.map +1 -0
- package/dist/systems/transparent-sort-config.d.ts +23 -2
- package/dist/systems/transparent-sort-config.d.ts.map +1 -1
- package/dist/tilemap-chunk-extract-system.d.ts +4 -3
- package/dist/tilemap-chunk-extract-system.d.ts.map +1 -1
- package/dist/typed-render-graph-primitives.d.ts +2 -4
- package/dist/typed-render-graph-primitives.d.ts.map +1 -1
- package/dist/typed-shadow-passes.d.ts +3 -3
- package/dist/typed-shadow-passes.d.ts.map +1 -1
- package/package.json +23 -23
- package/src/__tests__/backend-selection-rhi-capture.test-d.ts +1 -1
- package/src/__tests__/callback-inference.test-d.ts +6 -3
- package/src/__tests__/cluster-grid-default-surface.unit.test.ts +7 -4
- package/src/__tests__/construct-renderer-identity.unit.test.ts +15 -2
- package/src/__tests__/device-scope-lifecycle.unit.test.ts +151 -0
- package/src/__tests__/device-scope-stale-matrix.unit.test.ts +42 -0
- package/src/__tests__/direct-extract-consumer-contract.test-d.ts +8 -19
- package/src/__tests__/direct-light-snapshot.unit.test.ts +3 -13
- package/src/__tests__/factory-contract.integration.test.ts +158 -209
- package/src/__tests__/fallback-row-stride-surface.unit.test.ts +1 -4
- package/src/__tests__/frame-observation.contract.test.ts +17 -8
- package/src/__tests__/fullscreen-feature-plan.unit.test.ts +32 -0
- package/src/__tests__/glyph-text-layout-recovery.unit.test.ts +6 -11
- package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +9 -16
- package/src/__tests__/gpu-driven-production.integration.test.ts +32 -205
- package/src/__tests__/gpu-driven-scaling.unit.test.ts +4 -7
- package/src/__tests__/gpu-driven-view-gpu-evidence.ts +87 -8
- package/src/__tests__/gpu-driven-view-graph.integration.test.ts +170 -8
- package/src/{gpu-driven/view-reference.ts → __tests__/gpu-driven-view-reference.ts} +4 -3
- package/src/__tests__/gpu-driven-view.browser.test.ts +12 -1
- package/src/__tests__/gpu-driven-view.dawn.test.ts +12 -1
- package/src/__tests__/gpu-driven-view.unit.test.ts +11 -267
- package/src/__tests__/gpu-resource-store-stride.unit.test.ts +3 -3
- package/src/__tests__/gpu-scene-render-graph-gpu.ts +2 -3
- package/src/__tests__/gpu-scene.dawn.test.ts +2 -6
- package/src/__tests__/gpu-scene.unit.test.ts +10 -24
- package/src/__tests__/ibl/face-uniforms.unit.test.ts +46 -0
- package/src/__tests__/infinite-grid-no-vertex-probe.unit.test.ts +34 -66
- package/src/__tests__/ktx2-basis-gpu-consumer.dawn.test.ts +14 -5
- package/src/__tests__/light-buffer-layout.unit.test.ts +4 -49
- package/src/__tests__/material-cooked-projection.unit.test.ts +2 -51
- package/src/__tests__/material-snapshot-mutation.integration.test.ts +10 -15
- package/src/__tests__/material-static-dynamic-route.unit.test.ts +4 -23
- package/src/__tests__/material-stride-surface.unit.test.ts +2 -2
- package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +7 -8
- package/src/__tests__/morph-culling-reentry.dawn.test.ts +29 -38
- package/src/__tests__/morph-feature-gpu-work.integration.test.ts +45 -43
- package/src/__tests__/morph-feature-plan.unit.test.ts +53 -0
- package/src/__tests__/morph-visual-evidence.integration.test.ts +47 -33
- package/src/__tests__/nineslice-handle-surface.unit.test.ts +11 -6
- package/src/__tests__/post-process-error-policy-owner.unit.test.ts +6 -13
- package/src/__tests__/prepared-graphics-capability.unit.test.ts +6 -81
- package/src/__tests__/prepared-graphics-generation.unit.test.ts +3 -17
- package/src/__tests__/prepared-graphics-lifecycle.unit.test.ts +6 -74
- package/src/__tests__/prepared-graphics-resolver.unit.test.ts +1 -3
- package/src/__tests__/prepared-graphics-snapshot.unit.test.ts +2 -2
- package/src/__tests__/profiler-default-off.test.ts +1 -1
- package/src/__tests__/profiler-phase-catalog.test.ts +2 -2
- package/src/__tests__/profiler-phase-integration.test.ts +5 -13
- package/src/__tests__/profiler-phase-token.test.ts +3 -8
- package/src/__tests__/public-surface.test-d.ts +65 -3
- package/src/__tests__/recover-error-policy-owner.unit.test.ts +1 -21
- package/src/__tests__/render-error-code-owner.test-d.ts +18 -23
- package/src/__tests__/render-error-detail-ssot.test-d.ts +0 -95
- package/src/__tests__/render-error-exhaustive.test-d.ts +8 -1
- package/src/__tests__/render-feature-assembly.test-d.ts +8 -16
- package/src/__tests__/render-feature-context.test-d.ts +16 -40
- package/src/__tests__/render-feature-contract.test-d.ts +9 -18
- package/src/__tests__/render-feature-diagnostics.unit.test.ts +6 -8
- package/src/__tests__/render-feature-docs.unit.test.ts +8 -7
- package/src/__tests__/render-feature-gpu-work.integration.test.ts +14 -75
- package/src/__tests__/render-feature-plan.test-d.ts +161 -0
- package/src/__tests__/render-feature-plan.unit.test.ts +170 -0
- package/src/__tests__/render-feature-prepared-diagnostics.unit.test.ts +8 -19
- package/src/__tests__/render-feature-prepared-errors.test-d.ts +3 -6
- package/src/__tests__/render-feature-prepared-graphics-docs.unit.test.ts +10 -71
- package/src/__tests__/render-feature-prepared-graphics-isolation.unit.test.ts +11 -61
- package/src/__tests__/render-feature-prepared-graphics-negative.test-d.ts +20 -43
- package/src/__tests__/render-feature-prepared-graphics.test-d.ts +56 -78
- package/src/__tests__/render-feature-public-surface.test-d.ts +6 -24
- package/src/__tests__/render-feature-retry.unit.test.ts +7 -48
- package/src/__tests__/render-feature-scheduling.unit.test.ts +15 -27
- package/src/__tests__/render-feature-stage-failed-policy-owner.unit.test.ts +0 -9
- package/src/__tests__/render-feature-stage-fault-recovery.unit.test.ts +19 -109
- package/src/__tests__/render-feature-visibility-context.test-d.ts +1 -6
- package/src/__tests__/render-feature-visibility-context.unit.test.ts +1 -2
- package/src/__tests__/render-feature-zero-work.unit.test.ts +14 -20
- package/src/__tests__/render-scene-projection.unit.test.ts +73 -111
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +44 -95
- package/src/__tests__/renderer-lifecycle.integration.test.ts +49 -1
- package/src/__tests__/shader-stage-surface.unit.test.ts +14 -9
- package/src/__tests__/ssao-config.unit.test.ts +36 -0
- package/src/__tests__/ssao-kernel-surface.unit.test.ts +4 -5
- package/src/__tests__/standard-clustered-pipeline.unit.test.ts +28 -0
- package/src/__tests__/standard-descriptors.test-d.ts +22 -0
- package/src/__tests__/standard-pipeline.dawn.test.ts +61 -0
- package/src/__tests__/standard-pipeline.integration.test.ts +124 -0
- package/src/__tests__/standard-profile-oracle.unit.test.ts +62 -0
- package/src/__tests__/surface-configuration.unit.test.ts +1 -2
- package/src/__tests__/texture-usage-surface.unit.test.ts +3 -6
- package/src/__tests__/typed-pipeline-topology.unit.test.ts +40 -206
- package/src/__tests__/urp-pipeline-targets.unit.test.ts +1 -11
- package/src/__tests__/urp-pipeline.unit.test.ts +2 -2
- package/src/__tests__/vertex-color-pipeline.unit.test.ts +10 -2
- package/src/__tests__/vertex-layout-consumer.unit.test.ts +1 -1
- package/src/__tests__/visibility-diagnostics.integration.test.ts +7 -11
- package/src/__tests__/visibility-extract.integration.test.ts +20 -11
- package/src/__tests__/visibility-extract.perf.test.ts +66 -32
- package/src/__tests__/visibility-feature-dedup.integration.test.ts +2 -4
- package/src/__tests__/visibility-hidden-report.unit.test.ts +1 -2
- package/src/__tests__/visibility-instances.integration.test.ts +7 -11
- package/src/__tests__/visibility-multi-world.integration.test.ts +38 -6
- package/src/__tests__/visibility-producer-matrix.integration.test.ts +18 -41
- package/src/__tests__/visibility-public-surface.test-d.ts +10 -9
- package/src/__tests__/visibility-resolver.unit.test.ts +2 -1
- package/src/__tests__/visibility-resource-short-circuit.unit.test.ts +80 -0
- package/src/__tests__/visibility-snapshot-contract.unit.test.ts +2 -1
- package/src/__tests__/vocabulary.unit.test.ts +1 -1
- package/src/assembly/backend-contract.ts +57 -0
- package/src/{renderer/renderer-factory.ts → assembly/factory.ts} +1663 -2690
- package/src/assembly/host-contract.ts +101 -0
- package/src/{renderer → assembly}/material/assembly.ts +0 -2
- package/src/assembly/material/pipeline-projection.ts +63 -0
- package/src/authoring.ts +14 -22
- package/src/components/__tests__/schema-contract.unit.test.ts +10 -0
- package/src/components/glyph-text.ts +3 -2
- package/src/components/index.ts +7 -9
- package/src/components/instances.ts +4 -5
- package/src/components/light-helpers.ts +1 -1
- package/src/components/mesh-filter.ts +11 -10
- package/src/components/post-process-params.ts +3 -3
- package/src/components/scene-instance.ts +12 -12
- package/src/components/skybox-background.ts +103 -0
- package/src/components/{environment.ts → skylight.ts} +2 -110
- package/src/components/sprite-animation.ts +3 -4
- package/src/components/sprite-instances.ts +2 -2
- package/src/components/sprite-playback-mode.ts +7 -1
- package/src/components/sprite-region-override.ts +2 -3
- package/src/components/tile-layer.ts +8 -2
- package/src/construct-renderer.ts +67 -4
- package/src/debug-draw-glue.ts +8 -129
- package/src/device/device-scope.ts +306 -0
- package/src/{gpu-resource-store.ts → device/gpu-residency.ts} +540 -639
- package/src/device/resource-types.ts +20 -0
- package/src/engine-metrics.ts +12 -19
- package/src/errors/recover.ts +45 -3
- package/src/errors/render.ts +357 -460
- package/src/features/fullscreen.ts +46 -0
- package/src/features/host.ts +575 -309
- package/src/features/morph/morph-feature.ts +195 -105
- package/src/features/plan.ts +447 -0
- package/src/features/prepared-gpu-work.ts +72 -15
- package/src/features/prepared-graphics-store.ts +20 -6
- package/src/features/prepared-graphics.ts +12 -71
- package/src/features/render-graph-compute.ts +14 -5
- package/src/features/render-graph-contribution.ts +43 -63
- package/src/features/render-graph-raster.ts +11 -6
- package/src/features/render-graph-resources.ts +25 -23
- package/src/features/targets.ts +8 -21
- package/src/features/types.ts +39 -227
- package/src/features/vocabulary.ts +24 -0
- package/src/fullscreen-post-process-pass.ts +14 -57
- package/src/glyph-text-layout-system.ts +70 -96
- package/src/gpu-driven/batch-topology.ts +24 -202
- package/src/gpu-driven/production-raster.ts +93 -1108
- package/src/gpu-driven/view-gpu.ts +46 -192
- package/src/gpu-resource.ts +4 -4
- package/src/gpu-scene-schema.ts +11 -99
- package/src/gpu-scene.ts +231 -364
- package/src/hdrp-buffers.ts +12 -221
- package/src/ibl/IblPipelineCache.ts +471 -711
- package/src/ibl/skylight-bind-group.ts +4 -4
- package/src/index.ts +58 -217
- package/src/inspection-types.ts +76 -0
- package/src/instance-buffer-cache.ts +1 -29
- package/src/internal.ts +6 -85
- package/src/lifecycle.ts +64 -19
- package/src/materials.ts +7 -29
- package/src/mesh-material-bindings.ts +0 -1
- package/src/pbr-pipeline.ts +434 -53
- package/src/{urp-pipeline.ts → pipeline/standard-forward-lane.ts} +38 -149
- package/src/{hdrp-pipeline.ts → pipeline/standard-pipeline.ts} +221 -191
- package/src/pipeline/standard-profile.ts +65 -0
- package/src/pipeline-builder.ts +60 -64
- package/src/pipeline-spec-types.ts +28 -0
- package/src/pipeline-spec.ts +72 -609
- package/src/plugin.ts +3 -75
- package/src/post-process-errors.ts +31 -33
- package/src/prepare/prepared-graphics-resolver.ts +5 -4
- package/src/record/__tests__/material-slot-plan.unit.test.ts +1 -33
- package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +41 -0
- package/src/record/__tests__/video-texture-view.unit.test.ts +1 -1
- package/src/record/frame-lighting.ts +74 -195
- package/src/record/frame-snapshot.ts +45 -60
- package/src/record/frame-targets.ts +8 -243
- package/src/record/frame.ts +509 -796
- package/src/record/helpers.ts +6 -11
- package/src/record/main-pass-geometry.ts +106 -147
- package/src/record/main-pass-material.ts +517 -190
- package/src/record/main-pass-sprite-draws.ts +198 -117
- package/src/record/main-pass.ts +162 -143
- package/src/record/mesh-ssbo.ts +517 -38
- package/src/record/render-context.ts +364 -0
- package/src/record/shadow-pass.ts +138 -1838
- package/src/record/skybox-post-pass.ts +12 -14
- package/src/record/typed-frame-graph.ts +215 -254
- package/src/record/view-ubo.ts +6 -37
- package/src/render-contract.ts +571 -0
- package/src/render-data.ts +3 -3
- package/src/render-graph-primitives.ts +76 -851
- package/src/render-pipeline.ts +104 -188
- package/src/render-system-extract.ts +1048 -1729
- package/src/render-system.ts +330 -1957
- package/src/scene/render-scene-types.ts +64 -0
- package/src/scene/render-scene.ts +1032 -0
- package/src/scene-instances/post-spawn-resolve-joints.ts +4 -7
- package/src/ssao-buffers.ts +167 -8
- package/src/systems/skin-palette-allocator.ts +21 -64
- package/src/systems/skin-palette-types.ts +14 -0
- package/src/systems/transparent-sort-config.ts +25 -3
- package/src/tilemap-chunk-extract-system.ts +53 -70
- package/src/typed-render-graph-primitives.ts +35 -24
- package/src/typed-shadow-passes.ts +26 -56
- package/dist/__tests__/analytic-sky-contract.test.d.ts +0 -2
- package/dist/__tests__/analytic-sky-contract.test.d.ts.map +0 -1
- package/dist/__tests__/analytic-sky-falsify.test.d.ts +0 -2
- package/dist/__tests__/analytic-sky-falsify.test.d.ts.map +0 -1
- package/dist/__tests__/assets-runtime-handoff.integration.test.d.ts +0 -2
- package/dist/__tests__/assets-runtime-handoff.integration.test.d.ts.map +0 -1
- package/dist/__tests__/backend-selection.integration.test.d.ts +0 -2
- package/dist/__tests__/backend-selection.integration.test.d.ts.map +0 -1
- package/dist/__tests__/camera-temporal.test-d.d.ts +0 -2
- package/dist/__tests__/camera-temporal.test-d.d.ts.map +0 -1
- package/dist/__tests__/camera-temporal.test.d.ts +0 -2
- package/dist/__tests__/camera-temporal.test.d.ts.map +0 -1
- package/dist/__tests__/directional-shadow-probe-atlas-layout.unit.test.d.ts +0 -2
- package/dist/__tests__/directional-shadow-probe-atlas-layout.unit.test.d.ts.map +0 -1
- package/dist/__tests__/environment-inspection.test.d.ts +0 -2
- package/dist/__tests__/environment-inspection.test.d.ts.map +0 -1
- package/dist/__tests__/fog-ai-user.fixture.d.ts +0 -2
- package/dist/__tests__/fog-ai-user.fixture.d.ts.map +0 -1
- package/dist/__tests__/fog-custom-render-feature.fixture.d.ts +0 -16
- package/dist/__tests__/fog-custom-render-feature.fixture.d.ts.map +0 -1
- package/dist/__tests__/fog-custom-render-feature.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-custom-render-feature.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-inspection.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-inspection.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-owner-state.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-owner-state.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-pipeline-topology.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-pipeline-topology.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-public-surface.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-public-surface.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-ray-contract.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-ray-contract.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-source-absence.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-source-absence.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-temporal.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-temporal.integration.test.d.ts.map +0 -1
- package/dist/__tests__/frame-chain.unit.test.d.ts +0 -2
- package/dist/__tests__/frame-chain.unit.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-scene-field-type-owner.test-d.d.ts +0 -2
- package/dist/__tests__/gpu-scene-field-type-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/hdrp-pipeline.unit.test.d.ts +0 -2
- package/dist/__tests__/hdrp-pipeline.unit.test.d.ts.map +0 -1
- package/dist/__tests__/ibl/ibl-fallback.unit.test.d.ts +0 -2
- package/dist/__tests__/ibl/ibl-fallback.unit.test.d.ts.map +0 -1
- package/dist/__tests__/material-derived-error-stop-draw.integration.test.d.ts +0 -2
- package/dist/__tests__/material-derived-error-stop-draw.integration.test.d.ts.map +0 -1
- package/dist/__tests__/material-derived-payload.integration.test.d.ts +0 -2
- package/dist/__tests__/material-derived-payload.integration.test.d.ts.map +0 -1
- package/dist/__tests__/materials.unit.test.d.ts +0 -2
- package/dist/__tests__/materials.unit.test.d.ts.map +0 -1
- package/dist/__tests__/param-schema-projection-census.unit.test.d.ts +0 -2
- package/dist/__tests__/param-schema-projection-census.unit.test.d.ts.map +0 -1
- package/dist/__tests__/persistent-render-scene.unit.test.d.ts +0 -2
- package/dist/__tests__/persistent-render-scene.unit.test.d.ts.map +0 -1
- package/dist/__tests__/pipeline-error-policy-owner.unit.test.d.ts +0 -2
- package/dist/__tests__/pipeline-error-policy-owner.unit.test.d.ts.map +0 -1
- package/dist/__tests__/pipeline-pass-trace.test.d.ts +0 -2
- package/dist/__tests__/pipeline-pass-trace.test.d.ts.map +0 -1
- package/dist/__tests__/pipeline-stage-owner.test-d.d.ts +0 -2
- package/dist/__tests__/pipeline-stage-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/plugin.test.d.ts +0 -2
- package/dist/__tests__/plugin.test.d.ts.map +0 -1
- package/dist/__tests__/prepared-graphics-backend-matrix.unit.test.d.ts +0 -2
- package/dist/__tests__/prepared-graphics-backend-matrix.unit.test.d.ts.map +0 -1
- package/dist/__tests__/prepared-graphics-resolver-recording.unit.test.d.ts +0 -2
- package/dist/__tests__/prepared-graphics-resolver-recording.unit.test.d.ts.map +0 -1
- package/dist/__tests__/public-pipeline-id.test-d.d.ts +0 -2
- package/dist/__tests__/public-pipeline-id.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-dispatch-membership.unit.test.d.ts +0 -2
- package/dist/__tests__/render-dispatch-membership.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-construction.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-construction.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-error-code-owner.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-error-code-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-gpu-buffer-usage-owner.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-gpu-buffer-usage-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-graph.integration.test.d.ts +0 -2
- package/dist/__tests__/render-feature-graph.integration.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-graphics-staging.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-graphics-staging.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-order.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-order.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-prepared-graphics-recording.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-prepared-graphics-recording.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-staging.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-staging.unit.test.d.ts.map +0 -1
- package/dist/__tests__/renderer-render-scene-public.test-d.d.ts +0 -2
- package/dist/__tests__/renderer-render-scene-public.test-d.d.ts.map +0 -1
- package/dist/__tests__/scene-temporal-coverage.unit.test.d.ts +0 -2
- package/dist/__tests__/scene-temporal-coverage.unit.test.d.ts.map +0 -1
- package/dist/__tests__/sun-snapshot-consumers.test.d.ts +0 -2
- package/dist/__tests__/sun-snapshot-consumers.test.d.ts.map +0 -1
- package/dist/__tests__/surface-backend-kind-owner.test-d.d.ts +0 -2
- package/dist/__tests__/surface-backend-kind-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/taa-history-store.unit.test.d.ts +0 -2
- package/dist/__tests__/taa-history-store.unit.test.d.ts.map +0 -1
- package/dist/__tests__/temporal-frame-transaction.integration.test.d.ts +0 -2
- package/dist/__tests__/temporal-frame-transaction.integration.test.d.ts.map +0 -1
- package/dist/__tests__/temporal-inspection.unit.test.d.ts +0 -2
- package/dist/__tests__/temporal-inspection.unit.test.d.ts.map +0 -1
- package/dist/assets/__tests__/asset-decoders.unit.test.d.ts +0 -2
- package/dist/assets/__tests__/asset-decoders.unit.test.d.ts.map +0 -1
- package/dist/assets/__tests__/mipmap-generator.unit.test.d.ts +0 -2
- package/dist/assets/__tests__/mipmap-generator.unit.test.d.ts.map +0 -1
- package/dist/assets/__tests__/render-asset-port.unit.test.d.ts +0 -2
- package/dist/assets/__tests__/render-asset-port.unit.test.d.ts.map +0 -1
- package/dist/assets/__tests__/resolve-render-asset.unit.test.d.ts +0 -2
- package/dist/assets/__tests__/resolve-render-asset.unit.test.d.ts.map +0 -1
- package/dist/chunk-DJIMFYX6.mjs +0 -1439
- package/dist/chunk-DJIMFYX6.mjs.map +0 -1
- package/dist/chunk-F2SIOCRM.mjs +0 -7423
- package/dist/chunk-F2SIOCRM.mjs.map +0 -1
- package/dist/chunk-JMSB7AR4.mjs +0 -3
- package/dist/chunk-JMSB7AR4.mjs.map +0 -1
- package/dist/chunk-KHI6K4C6.mjs +0 -659
- package/dist/chunk-KHI6K4C6.mjs.map +0 -1
- package/dist/chunk-PORZOL2V.mjs +0 -569
- package/dist/chunk-PORZOL2V.mjs.map +0 -1
- package/dist/chunk-UOJGMDGP.mjs +0 -29913
- package/dist/chunk-UOJGMDGP.mjs.map +0 -1
- package/dist/components/__tests__/atmosphere-red.test.d.ts +0 -2
- package/dist/components/__tests__/atmosphere-red.test.d.ts.map +0 -1
- package/dist/components/__tests__/atmosphere.test.d.ts +0 -2
- package/dist/components/__tests__/atmosphere.test.d.ts.map +0 -1
- package/dist/components/__tests__/fog.test-d.d.ts +0 -2
- package/dist/components/__tests__/fog.test-d.d.ts.map +0 -1
- package/dist/components/__tests__/fog.test.d.ts +0 -2
- package/dist/components/__tests__/fog.test.d.ts.map +0 -1
- package/dist/components/atmosphere.d.ts +0 -18
- package/dist/components/atmosphere.d.ts.map +0 -1
- package/dist/components/environment.d.ts +0 -115
- package/dist/components/environment.d.ts.map +0 -1
- package/dist/deferred-lighting.d.ts +0 -13
- package/dist/deferred-lighting.d.ts.map +0 -1
- package/dist/dynamic-texture-store.d.ts +0 -42
- package/dist/dynamic-texture-store.d.ts.map +0 -1
- package/dist/environment/__tests__/failure-injection.test.d.ts +0 -2
- package/dist/environment/__tests__/failure-injection.test.d.ts.map +0 -1
- package/dist/environment/__tests__/generation-red.test.d.ts +0 -2
- package/dist/environment/__tests__/generation-red.test.d.ts.map +0 -1
- package/dist/environment/__tests__/generation.test.d.ts +0 -2
- package/dist/environment/__tests__/generation.test.d.ts.map +0 -1
- package/dist/environment/__tests__/graph-transaction.test.d.ts +0 -2
- package/dist/environment/__tests__/graph-transaction.test.d.ts.map +0 -1
- package/dist/environment/__tests__/inspection-red.test.d.ts +0 -2
- package/dist/environment/__tests__/inspection-red.test.d.ts.map +0 -1
- package/dist/environment/__tests__/lifecycle-evidence.test.d.ts +0 -2
- package/dist/environment/__tests__/lifecycle-evidence.test.d.ts.map +0 -1
- package/dist/environment/__tests__/pipeline-topology.test.d.ts +0 -2
- package/dist/environment/__tests__/pipeline-topology.test.d.ts.map +0 -1
- package/dist/environment/__tests__/readiness.test.d.ts +0 -2
- package/dist/environment/__tests__/readiness.test.d.ts.map +0 -1
- package/dist/environment/__tests__/recovery.test.d.ts +0 -2
- package/dist/environment/__tests__/recovery.test.d.ts.map +0 -1
- package/dist/environment/__tests__/resize-dispose.test.d.ts +0 -2
- package/dist/environment/__tests__/resize-dispose.test.d.ts.map +0 -1
- package/dist/environment/__tests__/signature-red.test.d.ts +0 -2
- package/dist/environment/__tests__/signature-red.test.d.ts.map +0 -1
- package/dist/environment/__tests__/signature.test.d.ts +0 -2
- package/dist/environment/__tests__/signature.test.d.ts.map +0 -1
- package/dist/environment/descriptors.d.ts +0 -2
- package/dist/environment/descriptors.d.ts.map +0 -1
- package/dist/environment/extracted-environment.d.ts +0 -53
- package/dist/environment/extracted-environment.d.ts.map +0 -1
- package/dist/environment/generation.d.ts +0 -62
- package/dist/environment/generation.d.ts.map +0 -1
- package/dist/environment/gpu-bundle.d.ts +0 -23
- package/dist/environment/gpu-bundle.d.ts.map +0 -1
- package/dist/environment/graph.d.ts +0 -108
- package/dist/environment/graph.d.ts.map +0 -1
- package/dist/environment/inspection.d.ts +0 -48
- package/dist/environment/inspection.d.ts.map +0 -1
- package/dist/environment/lifecycle.d.ts +0 -22
- package/dist/environment/lifecycle.d.ts.map +0 -1
- package/dist/environment/readiness.d.ts +0 -29
- package/dist/environment/readiness.d.ts.map +0 -1
- package/dist/environment/signature.d.ts +0 -70
- package/dist/environment/signature.d.ts.map +0 -1
- package/dist/extract/__tests__/directional-csm-domain.unit.test.d.ts +0 -2
- package/dist/extract/__tests__/directional-csm-domain.unit.test.d.ts.map +0 -1
- package/dist/extract/__tests__/environment-source.test.d.ts +0 -2
- package/dist/extract/__tests__/environment-source.test.d.ts.map +0 -1
- package/dist/extract/__tests__/schema-readers.unit.test.d.ts +0 -2
- package/dist/extract/__tests__/schema-readers.unit.test.d.ts.map +0 -1
- package/dist/extract/directional-csm.d.ts +0 -129
- package/dist/extract/directional-csm.d.ts.map +0 -1
- package/dist/extract/index.d.ts +0 -5
- package/dist/extract/index.d.ts.map +0 -1
- package/dist/extract/material-interface.d.ts +0 -56
- package/dist/extract/material-interface.d.ts.map +0 -1
- package/dist/extract/schema-readers.d.ts +0 -20
- package/dist/extract/schema-readers.d.ts.map +0 -1
- package/dist/features/graph-contribution.d.ts +0 -64
- package/dist/features/graph-contribution.d.ts.map +0 -1
- package/dist/features/index.d.ts +0 -21
- package/dist/features/index.d.ts.map +0 -1
- package/dist/features/morph/index.d.ts +0 -3
- package/dist/features/morph/index.d.ts.map +0 -1
- package/dist/features/morph/morph-bounds.d.ts +0 -42
- package/dist/features/morph/morph-bounds.d.ts.map +0 -1
- package/dist/features/scene-temporal.d.ts +0 -45
- package/dist/features/scene-temporal.d.ts.map +0 -1
- package/dist/features/taa-resolve.d.ts +0 -21
- package/dist/features/taa-resolve.d.ts.map +0 -1
- package/dist/frame-chain.d.ts +0 -14
- package/dist/frame-chain.d.ts.map +0 -1
- package/dist/gpu-driven/view-reference.d.ts.map +0 -1
- package/dist/gpu-resource-store.d.ts.map +0 -1
- package/dist/hdrp-cluster-membership.d.ts +0 -2
- package/dist/hdrp-cluster-membership.d.ts.map +0 -1
- package/dist/hdrp-pipeline.d.ts +0 -36
- package/dist/hdrp-pipeline.d.ts.map +0 -1
- package/dist/ibl/cubemap-projection.d.ts +0 -23
- package/dist/ibl/cubemap-projection.d.ts.map +0 -1
- package/dist/ibl/face-uniforms.d.ts +0 -65
- package/dist/ibl/face-uniforms.d.ts.map +0 -1
- package/dist/mesh-update-errors.d.ts +0 -71
- package/dist/mesh-update-errors.d.ts.map +0 -1
- package/dist/mipmap-generator.d.ts +0 -39
- package/dist/mipmap-generator.d.ts.map +0 -1
- package/dist/param-schema-projection-census.d.ts +0 -18
- package/dist/param-schema-projection-census.d.ts.map +0 -1
- package/dist/persistent-render-scene.d.ts +0 -158
- package/dist/persistent-render-scene.d.ts.map +0 -1
- package/dist/pipeline/index.d.ts +0 -11
- package/dist/pipeline/index.d.ts.map +0 -1
- package/dist/pipeline-errors.d.ts +0 -110
- package/dist/pipeline-errors.d.ts.map +0 -1
- package/dist/prepare/__tests__/schema-readers.unit.test.d.ts +0 -2
- package/dist/prepare/__tests__/schema-readers.unit.test.d.ts.map +0 -1
- package/dist/prepare/index.d.ts +0 -4
- package/dist/prepare/index.d.ts.map +0 -1
- package/dist/prepare/schema-readers.d.ts +0 -11
- package/dist/prepare/schema-readers.d.ts.map +0 -1
- package/dist/record/__tests__/environment-record.test.d.ts +0 -2
- package/dist/record/__tests__/environment-record.test.d.ts.map +0 -1
- package/dist/record/__tests__/frame-targets.unit.test.d.ts +0 -2
- package/dist/record/__tests__/frame-targets.unit.test.d.ts.map +0 -1
- package/dist/record/__tests__/membership-timing.unit.test.d.ts +0 -2
- package/dist/record/__tests__/membership-timing.unit.test.d.ts.map +0 -1
- package/dist/record/__tests__/render-submission.integration.test.d.ts +0 -2
- package/dist/record/__tests__/render-submission.integration.test.d.ts.map +0 -1
- package/dist/record/__tests__/render-submission.perf.test.d.ts +0 -2
- package/dist/record/__tests__/render-submission.perf.test.d.ts.map +0 -1
- package/dist/record/__tests__/shadow-submit-mode.unit.test.d.ts +0 -2
- package/dist/record/__tests__/shadow-submit-mode.unit.test.d.ts.map +0 -1
- package/dist/record/__tests__/view-ubo-layout.unit.test.d.ts +0 -2
- package/dist/record/__tests__/view-ubo-layout.unit.test.d.ts.map +0 -1
- package/dist/record/frame-observation.d.ts +0 -38
- package/dist/record/frame-observation.d.ts.map +0 -1
- package/dist/record/index.d.ts +0 -15
- package/dist/record/index.d.ts.map +0 -1
- package/dist/record/main-pass-skin.d.ts +0 -46
- package/dist/record/main-pass-skin.d.ts.map +0 -1
- package/dist/record/main-pass-sprite.d.ts +0 -69
- package/dist/record/main-pass-sprite.d.ts.map +0 -1
- package/dist/record/material-payload.d.ts +0 -43
- package/dist/record/material-payload.d.ts.map +0 -1
- package/dist/record/material-slot-plan.d.ts +0 -26
- package/dist/record/material-slot-plan.d.ts.map +0 -1
- package/dist/record/membership-timing.d.ts +0 -232
- package/dist/record/membership-timing.d.ts.map +0 -1
- package/dist/record/shadow-caster-uniform.d.ts +0 -8
- package/dist/record/shadow-caster-uniform.d.ts.map +0 -1
- package/dist/record/shadow-submit-mode.d.ts +0 -66
- package/dist/record/shadow-submit-mode.d.ts.map +0 -1
- package/dist/render-dispatch-membership.d.ts +0 -47
- package/dist/render-dispatch-membership.d.ts.map +0 -1
- package/dist/render-pipeline-context.d.ts +0 -289
- package/dist/render-pipeline-context.d.ts.map +0 -1
- package/dist/render-pipeline-target.d.ts +0 -16
- package/dist/render-pipeline-target.d.ts.map +0 -1
- package/dist/render-scene-projection.d.ts +0 -174
- package/dist/render-scene-projection.d.ts.map +0 -1
- package/dist/render-system-fold.d.ts +0 -266
- package/dist/render-system-fold.d.ts.map +0 -1
- package/dist/renderer/asset-service.d.ts +0 -10
- package/dist/renderer/asset-service.d.ts.map +0 -1
- package/dist/renderer/backend-selection.d.ts.map +0 -1
- package/dist/renderer/environment-classify.d.ts +0 -6
- package/dist/renderer/environment-classify.d.ts.map +0 -1
- package/dist/renderer/environment-error.d.ts +0 -13
- package/dist/renderer/environment-error.d.ts.map +0 -1
- package/dist/renderer/material/pipeline-projection.d.ts +0 -91
- package/dist/renderer/material/pipeline-projection.d.ts.map +0 -1
- package/dist/renderer/renderer-factory.d.ts +0 -289
- package/dist/renderer/renderer-factory.d.ts.map +0 -1
- package/dist/renderer.d.ts +0 -771
- package/dist/renderer.d.ts.map +0 -1
- package/dist/scene-utils/collect-subtree.d.ts +0 -11
- package/dist/scene-utils/collect-subtree.d.ts.map +0 -1
- package/dist/ssao-data.d.ts +0 -34
- package/dist/ssao-data.d.ts.map +0 -1
- package/dist/surface-format.d.ts +0 -10
- package/dist/surface-format.d.ts.map +0 -1
- package/dist/taa-history-store.d.ts +0 -88
- package/dist/taa-history-store.d.ts.map +0 -1
- package/dist/temporal-coverage.d.ts +0 -35
- package/dist/temporal-coverage.d.ts.map +0 -1
- package/dist/temporal-frame-transaction.d.ts +0 -92
- package/dist/temporal-frame-transaction.d.ts.map +0 -1
- package/dist/temporal-inspection.d.ts +0 -57
- package/dist/temporal-inspection.d.ts.map +0 -1
- package/dist/temporal-view.d.ts +0 -43
- package/dist/temporal-view.d.ts.map +0 -1
- package/dist/tilemap/resolve-tileset-runtime.d.ts +0 -23
- package/dist/tilemap/resolve-tileset-runtime.d.ts.map +0 -1
- package/dist/urp-pipeline.d.ts +0 -4
- package/dist/urp-pipeline.d.ts.map +0 -1
- package/src/__tests__/analytic-sky-contract.test.ts +0 -27
- package/src/__tests__/analytic-sky-falsify-carriers.mjs +0 -43
- package/src/__tests__/analytic-sky-falsify.test.ts +0 -94
- package/src/__tests__/assets-runtime-handoff.integration.test.ts +0 -36
- package/src/__tests__/backend-selection.integration.test.ts +0 -11
- package/src/__tests__/camera-temporal.test-d.ts +0 -8
- package/src/__tests__/camera-temporal.test.ts +0 -188
- package/src/__tests__/directional-shadow-probe-atlas-layout.unit.test.ts +0 -18
- package/src/__tests__/environment-inspection.test.ts +0 -45
- package/src/__tests__/fog-ai-user.fixture.ts +0 -350
- package/src/__tests__/fog-custom-render-feature.fixture.ts +0 -33
- package/src/__tests__/fog-custom-render-feature.integration.test.ts +0 -76
- package/src/__tests__/fog-inspection.integration.test.ts +0 -127
- package/src/__tests__/fog-owner-state.integration.test.ts +0 -112
- package/src/__tests__/fog-pipeline-topology.integration.test.ts +0 -93
- package/src/__tests__/fog-public-surface.integration.test.ts +0 -60
- package/src/__tests__/fog-ray-contract.integration.test.ts +0 -73
- package/src/__tests__/fog-source-absence.integration.test.ts +0 -51
- package/src/__tests__/fog-temporal.integration.test.ts +0 -115
- package/src/__tests__/frame-chain.unit.test.ts +0 -26
- package/src/__tests__/gpu-scene-field-type-owner.test-d.ts +0 -27
- package/src/__tests__/hdrp-pipeline.unit.test.ts +0 -100
- package/src/__tests__/ibl/ibl-fallback.unit.test.ts +0 -23
- package/src/__tests__/material-derived-error-stop-draw.integration.test.ts +0 -69
- package/src/__tests__/material-derived-payload.integration.test.ts +0 -164
- package/src/__tests__/materials.unit.test.ts +0 -25
- package/src/__tests__/param-schema-projection-census.unit.test.ts +0 -40
- package/src/__tests__/persistent-render-scene.unit.test.ts +0 -1311
- package/src/__tests__/pipeline-error-policy-owner.unit.test.ts +0 -167
- package/src/__tests__/pipeline-pass-trace.test.ts +0 -92
- package/src/__tests__/pipeline-stage-owner.test-d.ts +0 -13
- package/src/__tests__/plugin.test.ts +0 -25
- package/src/__tests__/prepared-graphics-backend-matrix.unit.test.ts +0 -129
- package/src/__tests__/prepared-graphics-resolver-recording.unit.test.ts +0 -180
- package/src/__tests__/public-pipeline-id.test-d.ts +0 -6
- package/src/__tests__/render-dispatch-membership.unit.test.ts +0 -117
- package/src/__tests__/render-feature-construction.unit.test.ts +0 -124
- package/src/__tests__/render-feature-error-code-owner.test-d.ts +0 -27
- package/src/__tests__/render-feature-gpu-buffer-usage-owner.test-d.ts +0 -46
- package/src/__tests__/render-feature-graph.integration.test.ts +0 -205
- package/src/__tests__/render-feature-graphics-staging.unit.test.ts +0 -200
- package/src/__tests__/render-feature-order.unit.test.ts +0 -66
- package/src/__tests__/render-feature-prepared-graphics-recording.unit.test.ts +0 -107
- package/src/__tests__/render-feature-staging.unit.test.ts +0 -94
- package/src/__tests__/renderer-render-scene-public.test-d.ts +0 -27
- package/src/__tests__/scene-temporal-coverage.unit.test.ts +0 -259
- package/src/__tests__/sun-snapshot-consumers.test.ts +0 -35
- package/src/__tests__/surface-backend-kind-owner.test-d.ts +0 -42
- package/src/__tests__/taa-history-store.unit.test.ts +0 -196
- package/src/__tests__/temporal-frame-transaction.integration.test.ts +0 -537
- package/src/__tests__/temporal-inspection.unit.test.ts +0 -138
- package/src/assets/__tests__/asset-decoders.unit.test.ts +0 -92
- package/src/assets/__tests__/mipmap-generator.unit.test.ts +0 -52
- package/src/assets/__tests__/render-asset-port.unit.test.ts +0 -54
- package/src/assets/__tests__/resolve-render-asset.unit.test.ts +0 -47
- package/src/components/__tests__/atmosphere-red.test.ts +0 -51
- package/src/components/__tests__/atmosphere.test.ts +0 -79
- package/src/components/__tests__/fog.test-d.ts +0 -49
- package/src/components/__tests__/fog.test.ts +0 -60
- package/src/components/atmosphere.ts +0 -64
- package/src/deferred-lighting.ts +0 -92
- package/src/dynamic-texture-store.ts +0 -111
- package/src/environment/README.md +0 -76
- package/src/environment/__tests__/failure-injection.test.ts +0 -50
- package/src/environment/__tests__/generation-red.test.ts +0 -64
- package/src/environment/__tests__/generation.test.ts +0 -37
- package/src/environment/__tests__/graph-transaction.test.ts +0 -85
- package/src/environment/__tests__/inspection-red.test.ts +0 -53
- package/src/environment/__tests__/lifecycle-evidence.test.ts +0 -40
- package/src/environment/__tests__/pipeline-topology.test.ts +0 -33
- package/src/environment/__tests__/readiness.test.ts +0 -42
- package/src/environment/__tests__/recovery.test.ts +0 -62
- package/src/environment/__tests__/resize-dispose.test.ts +0 -30
- package/src/environment/__tests__/signature-red.test.ts +0 -45
- package/src/environment/__tests__/signature.test.ts +0 -60
- package/src/environment/descriptors.ts +0 -7
- package/src/environment/extracted-environment.ts +0 -239
- package/src/environment/generation.ts +0 -158
- package/src/environment/gpu-bundle.ts +0 -144
- package/src/environment/graph.ts +0 -588
- package/src/environment/inspection.ts +0 -107
- package/src/environment/lifecycle.ts +0 -124
- package/src/environment/readiness.ts +0 -76
- package/src/environment/signature.ts +0 -185
- package/src/extract/__tests__/directional-csm-domain.unit.test.ts +0 -391
- package/src/extract/__tests__/environment-source.test.ts +0 -105
- package/src/extract/__tests__/schema-readers.unit.test.ts +0 -16
- package/src/extract/directional-csm.ts +0 -959
- package/src/extract/index.ts +0 -10
- package/src/extract/material-interface.ts +0 -604
- package/src/extract/schema-readers.ts +0 -27
- package/src/features/graph-contribution.ts +0 -577
- package/src/features/index.ts +0 -100
- package/src/features/morph/index.ts +0 -24
- package/src/features/morph/morph-bounds.ts +0 -123
- package/src/features/scene-temporal.ts +0 -274
- package/src/features/taa-resolve.ts +0 -244
- package/src/frame-chain.ts +0 -21
- package/src/hdrp-cluster-membership.ts +0 -70
- package/src/ibl/cubemap-projection.ts +0 -60
- package/src/ibl/face-uniforms.ts +0 -150
- package/src/mesh-update-errors.ts +0 -113
- package/src/mipmap-generator.ts +0 -244
- package/src/param-schema-projection-census.ts +0 -73
- package/src/persistent-render-scene.ts +0 -1752
- package/src/pipeline/index.ts +0 -40
- package/src/pipeline-errors.ts +0 -172
- package/src/prepare/__tests__/schema-readers.unit.test.ts +0 -16
- package/src/prepare/index.ts +0 -8
- package/src/prepare/schema-readers.ts +0 -20
- package/src/record/__tests__/environment-record.test.ts +0 -35
- package/src/record/__tests__/frame-targets.unit.test.ts +0 -54
- package/src/record/__tests__/membership-timing.unit.test.ts +0 -524
- package/src/record/__tests__/render-submission.integration.test.ts +0 -76
- package/src/record/__tests__/render-submission.perf.test.ts +0 -141
- package/src/record/__tests__/shadow-submit-mode.unit.test.ts +0 -88
- package/src/record/__tests__/view-ubo-layout.unit.test.ts +0 -101
- package/src/record/frame-observation.ts +0 -122
- package/src/record/index.ts +0 -15
- package/src/record/main-pass-skin.ts +0 -51
- package/src/record/main-pass-sprite.ts +0 -166
- package/src/record/material-payload.ts +0 -292
- package/src/record/material-slot-plan.ts +0 -68
- package/src/record/membership-timing.ts +0 -1012
- package/src/record/shadow-caster-uniform.ts +0 -37
- package/src/record/shadow-submit-mode.ts +0 -277
- package/src/render-dispatch-membership.ts +0 -155
- package/src/render-pipeline-context.ts +0 -332
- package/src/render-pipeline-target.ts +0 -96
- package/src/render-scene-projection.ts +0 -1738
- package/src/render-system-fold.ts +0 -531
- package/src/renderer/asset-service.ts +0 -32
- package/src/renderer/backend-selection.ts +0 -121
- package/src/renderer/environment-classify.ts +0 -30
- package/src/renderer/environment-error.ts +0 -19
- package/src/renderer/material/pipeline-projection.ts +0 -140
- package/src/renderer.ts +0 -940
- package/src/scene-utils/collect-subtree.ts +0 -40
- package/src/ssao-data.ts +0 -106
- package/src/surface-format.ts +0 -37
- package/src/taa-history-store.ts +0 -429
- package/src/temporal-coverage.ts +0 -106
- package/src/temporal-frame-transaction.ts +0 -301
- package/src/temporal-inspection.ts +0 -194
- package/src/temporal-view.ts +0 -174
- package/src/tilemap/resolve-tileset-runtime.ts +0 -72
package/src/materials.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type {
|
|
|
4
4
|
MaterialParameter,
|
|
5
5
|
MaterialPass,
|
|
6
6
|
MaterialRenderState,
|
|
7
|
-
MaterialTextureValue,
|
|
8
7
|
MaterialValue,
|
|
9
8
|
} from '@forgeax/engine-types';
|
|
10
9
|
|
|
@@ -17,21 +16,6 @@ const STANDARD_MODULE = 'forgeax_material::standard';
|
|
|
17
16
|
const UNLIT_MODULE = 'forgeax_material::unlit';
|
|
18
17
|
const SPRITE_MODULE = 'forgeax_material::sprite';
|
|
19
18
|
|
|
20
|
-
export function materialTextureValue(value: MaterialValue): MaterialValue;
|
|
21
|
-
export function materialTextureValue(value: string): MaterialValue;
|
|
22
|
-
export function materialTextureValue(value: undefined): undefined;
|
|
23
|
-
export function materialTextureValue(
|
|
24
|
-
value: MaterialValue | string | undefined,
|
|
25
|
-
): MaterialValue | undefined {
|
|
26
|
-
if (value === undefined) return undefined;
|
|
27
|
-
if (typeof value === 'string') return value;
|
|
28
|
-
if (typeof value === 'number') {
|
|
29
|
-
return { texture: value as unknown as MaterialTextureValue['texture'] };
|
|
30
|
-
}
|
|
31
|
-
if (typeof value !== 'object' || value === null || Array.isArray(value)) return value;
|
|
32
|
-
return value;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
19
|
function authoredColorParameter(
|
|
36
20
|
name: string,
|
|
37
21
|
type: 'color' | 'vec3',
|
|
@@ -119,9 +103,7 @@ function unlit(rgba: readonly [number, number, number, number], opts?: UnlitOpts
|
|
|
119
103
|
throw new Error(`Materials.unlit: alphaCutoff must be in [0, 1], got ${opts.alphaCutoff}`);
|
|
120
104
|
}
|
|
121
105
|
const values: Record<string, MaterialValue> = { baseColor: rgba };
|
|
122
|
-
if (opts?.baseColorTexture !== undefined)
|
|
123
|
-
values.baseColorTexture = materialTextureValue(opts.baseColorTexture);
|
|
124
|
-
}
|
|
106
|
+
if (opts?.baseColorTexture !== undefined) values.baseColorTexture = opts.baseColorTexture;
|
|
125
107
|
if (opts?.alphaCutoff !== undefined) values.alphaCutoff = opts.alphaCutoff;
|
|
126
108
|
const passes: [MaterialPass, ...MaterialPass[]] = [
|
|
127
109
|
pass('forward', UNLIT_MODULE, opts?.renderState, undefined, opts?.queue),
|
|
@@ -200,19 +182,15 @@ function standard(opts: StandardOpts): MaterialAsset {
|
|
|
200
182
|
if (opts.clearcoatRoughness !== undefined) values.clearcoatRoughness = opts.clearcoatRoughness;
|
|
201
183
|
if (opts.emissive !== undefined) values.emissive = opts.emissive;
|
|
202
184
|
if (opts.emissiveIntensity !== undefined) values.emissiveIntensity = opts.emissiveIntensity;
|
|
203
|
-
if (opts.emissiveTexture !== undefined)
|
|
204
|
-
|
|
205
|
-
if (opts.baseColorTexture !== undefined)
|
|
206
|
-
values.baseColorTexture = materialTextureValue(opts.baseColorTexture);
|
|
185
|
+
if (opts.emissiveTexture !== undefined) values.emissiveTexture = opts.emissiveTexture;
|
|
186
|
+
if (opts.baseColorTexture !== undefined) values.baseColorTexture = opts.baseColorTexture;
|
|
207
187
|
if (opts.metallicRoughnessTexture !== undefined) {
|
|
208
|
-
values.metallicRoughnessTexture =
|
|
188
|
+
values.metallicRoughnessTexture = opts.metallicRoughnessTexture;
|
|
209
189
|
}
|
|
210
|
-
if (opts.normalTexture !== undefined)
|
|
211
|
-
|
|
212
|
-
if (opts.occlusionTexture !== undefined)
|
|
213
|
-
values.occlusionTexture = materialTextureValue(opts.occlusionTexture);
|
|
190
|
+
if (opts.normalTexture !== undefined) values.normalTexture = opts.normalTexture;
|
|
191
|
+
if (opts.occlusionTexture !== undefined) values.occlusionTexture = opts.occlusionTexture;
|
|
214
192
|
if (opts.specularTintTexture !== undefined) {
|
|
215
|
-
values.specularTintTexture =
|
|
193
|
+
values.specularTintTexture = opts.specularTintTexture;
|
|
216
194
|
}
|
|
217
195
|
if (opts.alphaCutoff !== undefined) values.alphaCutoff = opts.alphaCutoff;
|
|
218
196
|
const passes: [MaterialPass, ...MaterialPass[]] = [
|
|
@@ -19,7 +19,6 @@ export interface ResolvedMeshMaterialBinding {
|
|
|
19
19
|
|
|
20
20
|
/** Public read-only observation of the bindings used by the last frame. */
|
|
21
21
|
export interface MeshMaterialBindingObservation {
|
|
22
|
-
/** Renderer-local identity for one attached World generation; never a draw-array index. */
|
|
23
22
|
readonly worldId: number;
|
|
24
23
|
readonly entityKey: number;
|
|
25
24
|
readonly bindings: readonly ResolvedMeshMaterialBinding[];
|
package/src/pbr-pipeline.ts
CHANGED
|
@@ -25,19 +25,17 @@ import type {
|
|
|
25
25
|
BindGroup,
|
|
26
26
|
BindGroupEntry,
|
|
27
27
|
BindGroupLayout,
|
|
28
|
+
BindGroupLayoutDescriptor,
|
|
28
29
|
Buffer,
|
|
29
30
|
PipelineLayout,
|
|
30
|
-
|
|
31
|
-
RhiError,
|
|
31
|
+
RhiDevice,
|
|
32
32
|
Sampler,
|
|
33
33
|
TextureView,
|
|
34
34
|
} from '@forgeax/engine-rhi';
|
|
35
|
-
import { DEFAULT_STANDARD_PBR_PARAM_SCHEMA } from '@forgeax/engine-shader';
|
|
36
|
-
import { type
|
|
35
|
+
import { DEFAULT_STANDARD_PBR_PARAM_SCHEMA, type ShaderCatalog } from '@forgeax/engine-shader';
|
|
36
|
+
import { derive, type ParamSchemaEntry } from '@forgeax/engine-types';
|
|
37
37
|
import { GPU_SHADER_STAGE_FRAGMENT, GPU_SHADER_STAGE_VERTEX } from './gpu-stage';
|
|
38
|
-
import {
|
|
39
|
-
|
|
40
|
-
const DEFAULT_STANDARD_PBR_DERIVED_INTERFACE = derive(DEFAULT_STANDARD_PBR_PARAM_SCHEMA);
|
|
38
|
+
import type { PipelineSpec } from './pipeline-spec-types';
|
|
41
39
|
|
|
42
40
|
// Stub PipelineSpec used by the BGL-only call sites. The dispatcher only reads
|
|
43
41
|
// `spec.shader` when a registry is supplied for reflection; for caps-driven
|
|
@@ -53,24 +51,10 @@ const BGL_ONLY_SPEC_STUB: PipelineSpec = Object.freeze({
|
|
|
53
51
|
renderState: undefined,
|
|
54
52
|
}) as PipelineSpec;
|
|
55
53
|
|
|
56
|
-
// ─── Device
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// vi.fn-based capture. The unwrap pattern matches createRenderer's
|
|
61
|
-
// `runShimSyncStep` -- the factory throws on Result.ok === false so the
|
|
62
|
-
// caller does not need to handle Result at every line.
|
|
63
|
-
|
|
64
|
-
export interface PbrPipelineDevice {
|
|
65
|
-
createBindGroupLayout(desc: {
|
|
66
|
-
label: string | undefined;
|
|
67
|
-
entries: readonly GPUBindGroupLayoutEntry[];
|
|
68
|
-
}): Result<BindGroupLayout, RhiError>;
|
|
69
|
-
createPipelineLayout(desc: {
|
|
70
|
-
label?: string;
|
|
71
|
-
bindGroupLayouts: readonly BindGroupLayout[];
|
|
72
|
-
}): Result<PipelineLayout, RhiError>;
|
|
73
|
-
}
|
|
54
|
+
// ─── Device owner ───────────────────────────────────────────────────────────
|
|
55
|
+
|
|
56
|
+
/** The PBR layout builder consumes only the two creation methods it owns. */
|
|
57
|
+
export type PbrPipelineDevice = Pick<RhiDevice, 'createBindGroupLayout' | 'createPipelineLayout'>;
|
|
74
58
|
|
|
75
59
|
// ─── Result shape ───────────────────────────────────────────────────────────
|
|
76
60
|
|
|
@@ -136,14 +120,22 @@ export interface PbrPipelineLayoutBundle {
|
|
|
136
120
|
* built-in standard-PBR shape when omitted, for the caps-driven seam).
|
|
137
121
|
*/
|
|
138
122
|
export function buildPbrMaterialUserRegionEntries(
|
|
139
|
-
|
|
123
|
+
paramSchema: readonly ParamSchemaEntry[] = DEFAULT_STANDARD_PBR_PARAM_SCHEMA,
|
|
140
124
|
): GPUBindGroupLayoutEntry[] {
|
|
141
|
-
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
|
|
146
|
-
|
|
125
|
+
const derived = derive(paramSchema);
|
|
126
|
+
// Project the engine-owned entry shape into the DOM WebGPU descriptor. Omit
|
|
127
|
+
// absent optional members so exactOptionalPropertyTypes remains true at the
|
|
128
|
+
// boundary instead of leaking an `undefined` property into the descriptor.
|
|
129
|
+
const entries = derived.bglEntries.map(
|
|
130
|
+
(entry): GPUBindGroupLayoutEntry => ({
|
|
131
|
+
binding: entry.binding,
|
|
132
|
+
visibility: entry.visibility,
|
|
133
|
+
...(entry.buffer === undefined ? {} : { buffer: entry.buffer }),
|
|
134
|
+
...(entry.sampler === undefined ? {} : { sampler: entry.sampler }),
|
|
135
|
+
...(entry.texture === undefined ? {} : { texture: entry.texture }),
|
|
136
|
+
...(entry.storageTexture === undefined ? {} : { storageTexture: entry.storageTexture }),
|
|
137
|
+
}),
|
|
138
|
+
);
|
|
147
139
|
// Patch binding 0 (the material UBO) to the dynamic-offset, vertex-visible
|
|
148
140
|
// material-UBO contract. derive() emits binding 0 as the first numeric run's
|
|
149
141
|
// merged UBO; an empty schema has no binding-0 UBO and needs no patch.
|
|
@@ -175,7 +167,7 @@ export function buildPbrMaterialUserRegionEntries(
|
|
|
175
167
|
// (sampler_comparison + texture_depth_2d, 2 entries).
|
|
176
168
|
// The active shadow bindings live in the view BGL today
|
|
177
169
|
// (group(0) bindings 3..7); this kind is the seam for
|
|
178
|
-
//
|
|
170
|
+
// each per-material shadow override surface a future feat
|
|
179
171
|
// wires onto group(1).
|
|
180
172
|
// - 'ibl' the 7 IBL / Skylight entries (irradiance / prefilter
|
|
181
173
|
// cube + brdfLut 2d + 3 samplers + intensity uniform).
|
|
@@ -196,7 +188,7 @@ const SHADOW_INJECTION_LENGTH = 2;
|
|
|
196
188
|
* Append the engine-injection BGL entries for the given `kind` after the
|
|
197
189
|
* user-region BGL entries, with binding numbers starting at `bgl.length`.
|
|
198
190
|
*
|
|
199
|
-
* The function reads `bgl.length` (NOT a hardcoded constant) so
|
|
191
|
+
* The function reads `bgl.length` (NOT a hardcoded constant) so each
|
|
200
192
|
* user-region size — derived from `derive(schema).userRegionBindingEnd` or
|
|
201
193
|
* computed manually — flows through to the injection start binding without
|
|
202
194
|
* a coupled edit.
|
|
@@ -469,7 +461,7 @@ export function buildPbrViewBglEntries(caps: PbrCaps): GPUBindGroupLayoutEntry[]
|
|
|
469
461
|
* `caps.storageBuffer===false` switches every storage-buffer BGL entry
|
|
470
462
|
* (view bindings 1+2, mesh-array, instances) to `uniform`.
|
|
471
463
|
*
|
|
472
|
-
* Throws on
|
|
464
|
+
* Throws on each `createBindGroupLayout` / `createPipelineLayout` Result
|
|
473
465
|
* failure -- the engine bootstrap path (createRenderer) wraps the call in
|
|
474
466
|
* `runShimSyncStep` to fold the throw into the structured error pipe.
|
|
475
467
|
*/
|
|
@@ -557,9 +549,9 @@ export function isStandardPbrMaterialShader(shaderId: string | undefined): boole
|
|
|
557
549
|
//
|
|
558
550
|
// The skin material shader (`forgeax::pbr-skin`, registered by
|
|
559
551
|
// `register-default-standard-pbr-skin.ts`) needs the same 4-slot layout shape
|
|
560
|
-
// as standard PBR EXCEPT for slot 2: its mesh-array BGL declares **
|
|
561
|
-
// dynamic-offset entries (binding 0 = meshes,
|
|
562
|
-
//
|
|
552
|
+
// as standard PBR EXCEPT for slot 2: its mesh-array BGL declares **2**
|
|
553
|
+
// dynamic-offset entries (binding 0 = meshes, binding 1 = palette) versus
|
|
554
|
+
// standard PBR's single binding 0. Without a dedicated pipeline layout the
|
|
563
555
|
// skin shader's `@group(2) @binding(1) palette : array<mat4x4<f32>>` reference
|
|
564
556
|
// trips a `Binding doesn't exist in [BindGroupLayoutInternal "pbr-mesh-array-bgl"]`
|
|
565
557
|
// validation error in `device.createRenderPipeline`, surfaced as
|
|
@@ -575,12 +567,11 @@ export function isStandardPbrMaterialShader(shaderId: string | undefined): boole
|
|
|
575
567
|
|
|
576
568
|
/**
|
|
577
569
|
* Build the PBR skin pipeline layout (4 slots `[view, material,
|
|
578
|
-
* mesh-array(
|
|
570
|
+
* mesh-array(2-entry), instances]`). View / material / instances BGLs are
|
|
579
571
|
* shared with the standard-PBR layout (passed in via `pbr` bundle); the only
|
|
580
|
-
* new BGL is the
|
|
581
|
-
* previous palettes.
|
|
572
|
+
* new BGL is the 2-entry mesh-array slot for `meshes` + `palette`.
|
|
582
573
|
*
|
|
583
|
-
* Throws on
|
|
574
|
+
* Throws on each `createBindGroupLayout` / `createPipelineLayout` Result
|
|
584
575
|
* failure -- the engine bootstrap path wraps the call in `runShimSyncStep`
|
|
585
576
|
* to fold the throw into the structured error pipe.
|
|
586
577
|
*/
|
|
@@ -589,7 +580,8 @@ export function buildPbrSkinLayouts(
|
|
|
589
580
|
caps: PbrCaps,
|
|
590
581
|
pbr: PbrPipelineLayoutBundle,
|
|
591
582
|
): PbrPipelineLayoutBundle {
|
|
592
|
-
//
|
|
583
|
+
// 2-entry mesh-array BGL: binding 0 meshes + binding 1 palette. Both
|
|
584
|
+
// dynamic-offset (palette window per-entity, like meshes window).
|
|
593
585
|
const skinMeshArrayBglRes = device.createBindGroupLayout(
|
|
594
586
|
buildBindGroupLayoutDescriptor(BGL_ONLY_SPEC_STUB, {
|
|
595
587
|
kind: 'pbr-skin-mesh-array',
|
|
@@ -733,17 +725,406 @@ export type { BindGroup };
|
|
|
733
725
|
*/
|
|
734
726
|
export const SPRITE_PASS_PER_INSTANCE_REGION_VARIANT_SET = '';
|
|
735
727
|
|
|
728
|
+
// BglKind dispatch (M3 / D-13) — closed union of BGL shapes the runtime ships
|
|
729
|
+
// ══════════════════════════════════════════════════════════════════════════════
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Closed union of bind-group-layout shapes the runtime constructs.
|
|
733
|
+
*
|
|
734
|
+
* Each kind names one physically distinct BGL the runtime has historically
|
|
735
|
+
* built by hand. {@link buildBindGroupLayoutDescriptor} dispatches on this
|
|
736
|
+
* union so every `device.createBindGroupLayout(...)` call site shares one
|
|
737
|
+
* SSOT for entries / labels (plan-strategy §3.2; D-13 round-2 decision).
|
|
738
|
+
*
|
|
739
|
+
* Three groups by derivation source:
|
|
740
|
+
* 1. Shader-derived (paramSchema reflection + injection chain):
|
|
741
|
+
* - `'pbr-material-merged'` — derived user region + Skylight 7 + lightmap 4
|
|
742
|
+
* - `'unlit-material'` — 7 entries: base PBR material only (no inject)
|
|
743
|
+
* - `'hdrp-7-slot'` — 7 entries (binding 0 + 3..8): HDRP cluster + SSAO group(2) BGL
|
|
744
|
+
* 2. Caps-driven literal shapes (no shader):
|
|
745
|
+
* - `'pbr-view'` — 10 entries: view UBO + lights + 6 shadow bindings
|
|
746
|
+
* (directional 3/4, point 5/6, cascade 7, spot atlas 8, spot
|
|
747
|
+
* lightViewProj matrices 9 — feat-20260625)
|
|
748
|
+
* - `'pbr-mesh-array'` — 1 entry: per-entity mesh SSBO (dynamic-offset)
|
|
749
|
+
* - `'pbr-instances'` — 1 entry: per-instance SSBO (no dynamic-offset)
|
|
750
|
+
* - `'pbr-skin-mesh-array'` — 2 entries: meshes + skin palette
|
|
751
|
+
* 3. Attachment-driven (fullscreen post-process):
|
|
752
|
+
* - `'fullscreen-post'` — 2 entries: input texture + sampler. The texture
|
|
753
|
+
* `sampleType` is derived from `spec.attachments` (plan §R3 fix):
|
|
754
|
+
* `'depth32float'` → `'depth'`; `'r32float'` → `'unfilterable-float'`;
|
|
755
|
+
* else → `'float'`.
|
|
756
|
+
* - `'fullscreen-post-with-params'` — 3 entries: the same texture@0 +
|
|
757
|
+
* sampler@1 as `'fullscreen-post'`, plus a `buffer@2` uniform for the
|
|
758
|
+
* per-frame params UBO (feat-20260621 D-2: `entry.params !== undefined`
|
|
759
|
+
* passes route here; the layout stays group(1), q3=B). `'fullscreen-post'`
|
|
760
|
+
* stays byte-identical so param-less consumers degrade with no change.
|
|
761
|
+
* - `'fullscreen-post-with-scene-depth-msaa'` — the depth-read layout with
|
|
762
|
+
* `texture.multisampled=true`, selected for a 4-sample scene depth target.
|
|
763
|
+
*/
|
|
764
|
+
export type BglKind =
|
|
765
|
+
| 'pbr-view'
|
|
766
|
+
| 'pbr-material-merged'
|
|
767
|
+
| 'pbr-mesh-array'
|
|
768
|
+
| 'pbr-instances'
|
|
769
|
+
| 'pbr-skin-mesh-array'
|
|
770
|
+
| 'unlit-material'
|
|
771
|
+
| 'hdrp-7-slot'
|
|
772
|
+
| 'fullscreen-post'
|
|
773
|
+
| 'fullscreen-post-with-params'
|
|
774
|
+
| 'fullscreen-post-with-scene-depth'
|
|
775
|
+
| 'fullscreen-post-with-scene-depth-msaa';
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* Output shape of {@link buildBindGroupLayoutDescriptor}: matches the RHI
|
|
779
|
+
* `BindGroupLayoutDescriptor` (label + entries with `ExplicitUndefined`) so
|
|
780
|
+
* the result can be passed directly to `device.createBindGroupLayout(...)`.
|
|
781
|
+
*
|
|
782
|
+
* `entries` is a mutable `Array` to match `GPUBindGroupLayoutDescriptor`
|
|
783
|
+
* (WebGPU types declare it mutable). Callers MUST treat the array as
|
|
784
|
+
* read-only — the dispatcher freezes neither the array nor its entries
|
|
785
|
+
* for hot-path performance.
|
|
786
|
+
*/
|
|
787
|
+
export interface BindGroupLayoutDescriptorOutput {
|
|
788
|
+
readonly label: string | undefined;
|
|
789
|
+
readonly entries: GPUBindGroupLayoutEntry[];
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/** Build the canonical HDRP group(2) bind-group layout. */
|
|
793
|
+
export function createHdrpBindGroupLayoutDescriptor(
|
|
794
|
+
storageBuffer: boolean = true,
|
|
795
|
+
): BindGroupLayoutDescriptor {
|
|
796
|
+
const meshBufType: GPUBufferBindingType = storageBuffer ? 'read-only-storage' : 'uniform';
|
|
797
|
+
const clusterBufType: GPUBufferBindingType = storageBuffer ? 'read-only-storage' : 'uniform';
|
|
798
|
+
return {
|
|
799
|
+
label: 'hdrp-unified-bgl-group2',
|
|
800
|
+
entries: [
|
|
801
|
+
{
|
|
802
|
+
binding: 0,
|
|
803
|
+
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
804
|
+
buffer: { type: meshBufType, hasDynamicOffset: true },
|
|
805
|
+
},
|
|
806
|
+
// Bindings 1 and 2 stay absent for the URP physical isolation gap.
|
|
807
|
+
{
|
|
808
|
+
binding: 3,
|
|
809
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
810
|
+
buffer: { type: clusterBufType, hasDynamicOffset: false },
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
binding: 4,
|
|
814
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
815
|
+
buffer: { type: clusterBufType, hasDynamicOffset: false },
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
binding: 5,
|
|
819
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
820
|
+
buffer: { type: clusterBufType, hasDynamicOffset: false },
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
binding: 6,
|
|
824
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
825
|
+
buffer: { type: 'uniform', hasDynamicOffset: false },
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
binding: 7,
|
|
829
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
830
|
+
texture: { sampleType: 'float', viewDimension: '2d', multisampled: false },
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
binding: 8,
|
|
834
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
835
|
+
sampler: { type: 'filtering' },
|
|
836
|
+
},
|
|
837
|
+
],
|
|
838
|
+
};
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* Build a `GPUBindGroupLayoutDescriptor` from a PipelineSpec, dispatching on
|
|
843
|
+
* `options.kind` to one of 9 closed BGL shapes (D-13 round-2).
|
|
844
|
+
*
|
|
845
|
+
* Shader-derived kinds (`'pbr-material-merged'` / `'unlit-material'` /
|
|
846
|
+
* `'hdrp-7-slot'`) require `options.registry` to look up the shader entry
|
|
847
|
+
* and reflect its `paramSchema` via {@link deriveBglShapeFromShader}; they
|
|
848
|
+
* compose the per-entry injection chain (Skylight + lightmap for material;
|
|
849
|
+
* HDRP variantSet for cluster-forward).
|
|
850
|
+
*
|
|
851
|
+
* Caps-driven kinds (`'pbr-view'` / `'pbr-mesh-array'` / `'pbr-instances'` /
|
|
852
|
+
* `'pbr-skin-mesh-array'`) require `options.caps` for the storage-buffer
|
|
853
|
+
* vs uniform-buffer fallback (RhiCaps.storageBuffer; PBR feat-20260526 M3 /
|
|
854
|
+
* w9). They are wholly determined by the caps shape.
|
|
855
|
+
*
|
|
856
|
+
* Attachment-driven kind (`'fullscreen-post'`) reads
|
|
857
|
+
* `spec.attachments.depthFormat` and `spec.attachments.colorFormats[0]` to
|
|
858
|
+
* pick the texture binding's `sampleType` (R3 fix: `'depth32float'` → `'depth'`,
|
|
859
|
+
* `'r32float'` → `'unfilterable-float'`, else → `'float'`).
|
|
860
|
+
*
|
|
861
|
+
* @param spec - the pipeline spec (axis source for reflection / caps fallback)
|
|
862
|
+
* @param options.kind - which BGL shape to build (closed {@link BglKind} union)
|
|
863
|
+
* @param options.registry - ShaderCatalog for shader-derived kinds
|
|
864
|
+
* @param options.caps - caps shape for caps-driven kinds (storageBuffer)
|
|
865
|
+
* @returns a WebGPU bind-group-layout descriptor (entries + label)
|
|
866
|
+
* @see plan-strategy §3.2 · plan-decisions D-13 · requirements AC-02
|
|
867
|
+
*/
|
|
736
868
|
/**
|
|
737
|
-
*
|
|
738
|
-
* `''` (canonical all-true variant key, per bug-20260708 M2 (c)) when
|
|
739
|
-
* `hasSpriteInstances` is true (the extract stage has populated
|
|
740
|
-
* `RenderableSnapshot.spriteInstances`), otherwise `undefined` so the
|
|
741
|
-
* existing sprite path stays byte-identical for non-SpriteInstances callers
|
|
742
|
-
* (plan-strategy D-4 reverse-falsifier).
|
|
869
|
+
* Resolve the material paramSchema for a per-shader user-region BGL derivation.
|
|
743
870
|
*
|
|
744
|
-
*
|
|
745
|
-
*
|
|
871
|
+
* Priority (D-1): explicit `options.materialParamSchema` > registry lookup of
|
|
872
|
+
* `spec.shader.id` > `undefined` (the user-region builder then falls back to
|
|
873
|
+
* the built-in standard-PBR 4-texture schema, whose user region is 9 entries).
|
|
746
874
|
*/
|
|
747
|
-
|
|
748
|
-
|
|
875
|
+
function resolveMaterialParamSchema(
|
|
876
|
+
spec: PipelineSpec,
|
|
877
|
+
options: { registry?: ShaderCatalog; materialParamSchema?: readonly ParamSchemaEntry[] },
|
|
878
|
+
): readonly ParamSchemaEntry[] | undefined {
|
|
879
|
+
if (options.materialParamSchema !== undefined) return options.materialParamSchema;
|
|
880
|
+
if (options.registry !== undefined) {
|
|
881
|
+
const lookup = options.registry.findMaterialArtifact(spec.shader.id);
|
|
882
|
+
if (lookup.ok) return lookup.value.paramSchema;
|
|
883
|
+
}
|
|
884
|
+
return undefined;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
export function buildBindGroupLayoutDescriptor(
|
|
888
|
+
spec: PipelineSpec,
|
|
889
|
+
options: {
|
|
890
|
+
kind: BglKind;
|
|
891
|
+
registry?: ShaderCatalog;
|
|
892
|
+
caps?: PbrCaps;
|
|
893
|
+
/**
|
|
894
|
+
* Material paramSchema for the per-shader user-region derivation
|
|
895
|
+
* (`'pbr-material-merged'` / `'unlit-material'`). When supplied it is the
|
|
896
|
+
* authoritative source for the user-region BGL shape (D-1); when omitted,
|
|
897
|
+
* `buildPbrMaterialUserRegionEntries` falls back to the built-in
|
|
898
|
+
* standard-PBR 4-texture schema (user region is 9 entries), so
|
|
899
|
+
* the caps-driven `buildPbrPipelineLayouts` seam keeps working unchanged.
|
|
900
|
+
* A registry + resolvable shader id takes precedence over this field.
|
|
901
|
+
*/
|
|
902
|
+
materialParamSchema?: readonly ParamSchemaEntry[];
|
|
903
|
+
},
|
|
904
|
+
): BindGroupLayoutDescriptorOutput {
|
|
905
|
+
switch (options.kind) {
|
|
906
|
+
case 'pbr-view': {
|
|
907
|
+
const caps = options.caps ?? { storageBuffer: true };
|
|
908
|
+
return {
|
|
909
|
+
label: 'pbr-view-bgl',
|
|
910
|
+
entries: buildPbrViewBglEntries(caps),
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
case 'pbr-mesh-array': {
|
|
914
|
+
const caps = options.caps ?? { storageBuffer: true };
|
|
915
|
+
const meshBufType: GPUBufferBindingType = caps.storageBuffer
|
|
916
|
+
? 'read-only-storage'
|
|
917
|
+
: 'uniform';
|
|
918
|
+
// sprite-lit's fragment stage does not read the mesh SSBO -- worldPos
|
|
919
|
+
// is carried through the VsOut interpolant. Visibility is kept widened
|
|
920
|
+
// to VERTEX|FRAGMENT because the BGL JSON is compared byte-identically
|
|
921
|
+
// across the sprite / sprite-lit / PBR pipelines that share this
|
|
922
|
+
// descriptor; narrowing here would change every sibling pipeline's
|
|
923
|
+
// BGL fingerprint. WebGPU rejects createRenderPipeline when a fragment
|
|
924
|
+
// stage accesses a binding whose BGL visibility excludes FRAGMENT --
|
|
925
|
+
// widening is permissive (validation-only, no perf cost).
|
|
926
|
+
return {
|
|
927
|
+
label: 'pbr-mesh-array-bgl',
|
|
928
|
+
entries: [
|
|
929
|
+
{
|
|
930
|
+
binding: 0,
|
|
931
|
+
visibility: GPU_SHADER_STAGE_VERTEX | GPU_SHADER_STAGE_FRAGMENT,
|
|
932
|
+
buffer: { type: meshBufType, hasDynamicOffset: true },
|
|
933
|
+
},
|
|
934
|
+
],
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
case 'pbr-instances': {
|
|
938
|
+
const caps = options.caps ?? { storageBuffer: true };
|
|
939
|
+
const meshBufType: GPUBufferBindingType = caps.storageBuffer
|
|
940
|
+
? 'read-only-storage'
|
|
941
|
+
: 'uniform';
|
|
942
|
+
return {
|
|
943
|
+
label: 'pbr-instances-bgl',
|
|
944
|
+
entries: [
|
|
945
|
+
{
|
|
946
|
+
binding: 0,
|
|
947
|
+
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
948
|
+
buffer: { type: meshBufType, hasDynamicOffset: false },
|
|
949
|
+
},
|
|
950
|
+
],
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
case 'pbr-skin-mesh-array': {
|
|
954
|
+
const caps = options.caps ?? { storageBuffer: true };
|
|
955
|
+
const meshBufType: GPUBufferBindingType = caps.storageBuffer
|
|
956
|
+
? 'read-only-storage'
|
|
957
|
+
: 'uniform';
|
|
958
|
+
return {
|
|
959
|
+
label: 'pbr-skin-mesh-array-bgl',
|
|
960
|
+
entries: [
|
|
961
|
+
{
|
|
962
|
+
binding: 0,
|
|
963
|
+
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
964
|
+
buffer: { type: meshBufType, hasDynamicOffset: true },
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
binding: 1,
|
|
968
|
+
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
969
|
+
buffer: { type: meshBufType, hasDynamicOffset: true },
|
|
970
|
+
},
|
|
971
|
+
],
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
case 'pbr-material-merged': {
|
|
975
|
+
// Material BGL: per-shader user-region (derive(paramSchema).bglEntries)
|
|
976
|
+
// + IBL injection (7) + lightmap injection (4). The user-region size is
|
|
977
|
+
// the only variable; injection start = userRegion.length so a 4-texture
|
|
978
|
+
// custom schema shifts IBL/lightmap by one sampler/texture pair (D-1).
|
|
979
|
+
// For the built-in 4-texture standard-PBR schema this is 9 + 7 + 4 = 20.
|
|
980
|
+
//
|
|
981
|
+
// Schema source priority (D-1): explicit materialParamSchema option >
|
|
982
|
+
// registry lookup of spec.shader.id > built-in standard-PBR fallback.
|
|
983
|
+
const resolvedSchema = resolveMaterialParamSchema(spec, options);
|
|
984
|
+
const userRegion = buildPbrMaterialUserRegionEntries(resolvedSchema);
|
|
985
|
+
const afterIbl = [...userRegion, ...appendInjection(userRegion, 'ibl')];
|
|
986
|
+
const merged = [...afterIbl, ...appendInjection(afterIbl, 'lightmap')];
|
|
987
|
+
return {
|
|
988
|
+
label: 'pbr-material-skylight-bgl',
|
|
989
|
+
entries: merged,
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
case 'unlit-material': {
|
|
993
|
+
// Unlit material BGL: per-shader user-region only. No IBL/lightmap
|
|
994
|
+
// injection (D-5 round-4: unlit demos do not pay for IBL state).
|
|
995
|
+
const resolvedSchema = resolveMaterialParamSchema(spec, options);
|
|
996
|
+
return {
|
|
997
|
+
label: 'unlit-material-bgl',
|
|
998
|
+
entries: buildPbrMaterialUserRegionEntries(resolvedSchema),
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
case 'hdrp-7-slot': {
|
|
1002
|
+
// HDRP unified BGL for group(2): 9 entries (binding 0 + 3..8). The
|
|
1003
|
+
// shape depends on caps.storageBuffer for the cluster-buffer fallback.
|
|
1004
|
+
const caps = options.caps ?? { storageBuffer: true };
|
|
1005
|
+
const desc = createHdrpBindGroupLayoutDescriptor(caps.storageBuffer);
|
|
1006
|
+
return {
|
|
1007
|
+
label: desc.label ?? 'hdrp-unified-bgl-group2',
|
|
1008
|
+
entries: desc.entries ?? [],
|
|
1009
|
+
};
|
|
1010
|
+
}
|
|
1011
|
+
case 'fullscreen-post': {
|
|
1012
|
+
// Fullscreen post-process BGL: 2 entries (input texture + sampler).
|
|
1013
|
+
// R3 fix: derive sampleType from spec.attachments. Depth attachments
|
|
1014
|
+
// (depth32float) need `sampleType: 'depth'`; r32float needs
|
|
1015
|
+
// `'unfilterable-float'`; everything else (rgba8unorm-srgb, rgba16float,
|
|
1016
|
+
// bgra8unorm, …) is filterable `'float'`.
|
|
1017
|
+
return {
|
|
1018
|
+
label: 'fullscreen-post-bgl',
|
|
1019
|
+
entries: buildFullscreenPostInputEntries(spec),
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
case 'fullscreen-post-with-params': {
|
|
1023
|
+
// feat-20260621 D-2: the same input texture@0 + sampler@1 as
|
|
1024
|
+
// 'fullscreen-post', plus binding 2 = per-frame params UBO (uniform).
|
|
1025
|
+
// The first two entries reuse buildFullscreenPostInputEntries so the
|
|
1026
|
+
// sampleType derivation stays a single SSOT; 'fullscreen-post' is
|
|
1027
|
+
// untouched (param-less zero-regression, R-A7).
|
|
1028
|
+
return {
|
|
1029
|
+
label: 'fullscreen-post-with-params-bgl',
|
|
1030
|
+
entries: [
|
|
1031
|
+
...buildFullscreenPostInputEntries(spec),
|
|
1032
|
+
{
|
|
1033
|
+
binding: 2,
|
|
1034
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1035
|
+
buffer: { type: 'uniform' },
|
|
1036
|
+
},
|
|
1037
|
+
],
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
case 'fullscreen-post-with-scene-depth': {
|
|
1041
|
+
// plan-strategy D-3: 5-entry BGL for post-process passes that read the
|
|
1042
|
+
// camera scene depth. color@0 + sampler@1 reuse buildFullscreenPostInputEntries
|
|
1043
|
+
// (float+filtering for color). depthTex@3 uses `sampleType: 'depth'` and
|
|
1044
|
+
// `dimension: '2d'`; depthSampler@4 uses `type: 'non-filtering'` (nearest
|
|
1045
|
+
// + clamp-to-edge, D-2 — NOT comparison). params@2 is always present
|
|
1046
|
+
// (uniform) to avoid a 2x2 kind explosion per D-3.
|
|
1047
|
+
return {
|
|
1048
|
+
label: 'fullscreen-post-with-scene-depth-bgl',
|
|
1049
|
+
entries: [
|
|
1050
|
+
...buildFullscreenPostInputEntries(spec),
|
|
1051
|
+
{
|
|
1052
|
+
binding: 2,
|
|
1053
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1054
|
+
buffer: { type: 'uniform' },
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
binding: 3,
|
|
1058
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1059
|
+
texture: { sampleType: 'depth', viewDimension: '2d' },
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
binding: 4,
|
|
1063
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1064
|
+
sampler: { type: 'non-filtering' },
|
|
1065
|
+
},
|
|
1066
|
+
],
|
|
1067
|
+
};
|
|
1068
|
+
}
|
|
1069
|
+
case 'fullscreen-post-with-scene-depth-msaa': {
|
|
1070
|
+
return {
|
|
1071
|
+
label: 'fullscreen-post-with-scene-depth-msaa-bgl',
|
|
1072
|
+
entries: [
|
|
1073
|
+
...buildFullscreenPostInputEntries(spec),
|
|
1074
|
+
{
|
|
1075
|
+
binding: 2,
|
|
1076
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1077
|
+
buffer: { type: 'uniform' },
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
binding: 3,
|
|
1081
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1082
|
+
texture: { sampleType: 'depth', viewDimension: '2d', multisampled: true },
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
binding: 4,
|
|
1086
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1087
|
+
sampler: { type: 'non-filtering' },
|
|
1088
|
+
},
|
|
1089
|
+
],
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
749
1093
|
}
|
|
1094
|
+
|
|
1095
|
+
/**
|
|
1096
|
+
* The shared texture@0 + sampler@1 entries for fullscreen post-process BGLs.
|
|
1097
|
+
* sampleType is derived from `spec.attachments` (R3 fix): depth attachments →
|
|
1098
|
+
* `'depth'` + `'comparison'` sampler; `'r32float'` → `'unfilterable-float'`;
|
|
1099
|
+
* else → `'float'` + `'filtering'`. Both `'fullscreen-post'` and
|
|
1100
|
+
* `'fullscreen-post-with-params'` reuse this so the derivation is one SSOT.
|
|
1101
|
+
*/
|
|
1102
|
+
function buildFullscreenPostInputEntries(spec: PipelineSpec): GPUBindGroupLayoutEntry[] {
|
|
1103
|
+
const inputFormat: GPUTextureFormat | undefined =
|
|
1104
|
+
spec.attachments.depthFormat ?? spec.attachments.colorFormats[0];
|
|
1105
|
+
const sampleType: GPUTextureSampleType =
|
|
1106
|
+
inputFormat === 'depth32float' ||
|
|
1107
|
+
inputFormat === 'depth24plus' ||
|
|
1108
|
+
inputFormat === 'depth24plus-stencil8' ||
|
|
1109
|
+
inputFormat === 'depth16unorm'
|
|
1110
|
+
? 'depth'
|
|
1111
|
+
: inputFormat === 'r32float'
|
|
1112
|
+
? 'unfilterable-float'
|
|
1113
|
+
: 'float';
|
|
1114
|
+
return [
|
|
1115
|
+
{
|
|
1116
|
+
binding: 0,
|
|
1117
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1118
|
+
texture: { sampleType, viewDimension: '2d' },
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
binding: 1,
|
|
1122
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1123
|
+
sampler: {
|
|
1124
|
+
type: sampleType === 'depth' ? 'comparison' : 'filtering',
|
|
1125
|
+
},
|
|
1126
|
+
},
|
|
1127
|
+
];
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
// ══════════════════════════════════════════════════════════════════════════════
|