@forgeax/engine-render 0.1.4 → 0.1.7
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 +268 -640
- 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 +214 -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 +11 -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-HCOGPHKS.mjs +93 -0
- package/dist/chunk-HCOGPHKS.mjs.map +1 -0
- package/dist/chunk-YEJIUW7D.mjs +1152 -0
- package/dist/chunk-YEJIUW7D.mjs.map +1 -0
- package/dist/components/__tests__/points-lines-admission.unit.test.d.ts +2 -0
- package/dist/components/__tests__/points-lines-admission.unit.test.d.ts.map +1 -0
- package/dist/components/__tests__/points-lines-schema.unit.test.d.ts +2 -0
- package/dist/components/__tests__/points-lines-schema.unit.test.d.ts.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 +4 -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/lines.d.ts +5 -0
- package/dist/components/lines.d.ts.map +1 -0
- package/dist/components/mesh-filter.d.ts +7 -7
- package/dist/components/mesh-filter.d.ts.map +1 -1
- package/dist/components/points.d.ts +15 -0
- package/dist/components/points.d.ts.map +1 -0
- 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 +27463 -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 +320 -248
- 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 +7 -3
- 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 +17 -43
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +167 -3
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +72 -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 +77 -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/points-lines/__tests__/bounds.unit.test.d.ts +2 -0
- package/dist/points-lines/__tests__/bounds.unit.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/cache-recovery.unit.test.d.ts +2 -0
- package/dist/points-lines/__tests__/cache-recovery.unit.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/inspection-lanes.integration.test.d.ts +2 -0
- package/dist/points-lines/__tests__/inspection-lanes.integration.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/inspection.unit.test.d.ts +2 -0
- package/dist/points-lines/__tests__/inspection.unit.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/lane-structural.integration.test.d.ts +2 -0
- package/dist/points-lines/__tests__/lane-structural.integration.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/points-lines.bench.d.ts +2 -0
- package/dist/points-lines/__tests__/points-lines.bench.d.ts.map +1 -0
- package/dist/points-lines/__tests__/raster-lane.integration.test.d.ts +2 -0
- package/dist/points-lines/__tests__/raster-lane.integration.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/snapshot.unit.test.d.ts +2 -0
- package/dist/points-lines/__tests__/snapshot.unit.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/view-ubo.unit.test.d.ts +2 -0
- package/dist/points-lines/__tests__/view-ubo.unit.test.d.ts.map +1 -0
- package/dist/points-lines/admission.d.ts +36 -0
- package/dist/points-lines/admission.d.ts.map +1 -0
- package/dist/points-lines/bounds.d.ts +8 -0
- package/dist/points-lines/bounds.d.ts.map +1 -0
- package/dist/points-lines/expansion-cache.d.ts +28 -0
- package/dist/points-lines/expansion-cache.d.ts.map +1 -0
- package/dist/points-lines/inspection.d.ts +53 -0
- package/dist/points-lines/inspection.d.ts.map +1 -0
- package/dist/points-lines/prepare.d.ts +67 -0
- package/dist/points-lines/prepare.d.ts.map +1 -0
- package/dist/points-lines/record.d.ts +60 -0
- package/dist/points-lines/record.d.ts.map +1 -0
- package/dist/points-lines/snapshot.d.ts +49 -0
- package/dist/points-lines/snapshot.d.ts.map +1 -0
- 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 +12 -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 +252 -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 +9 -3
- package/dist/record/view-ubo.d.ts.map +1 -1
- package/dist/render-contract.d.ts +424 -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 +110 -338
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system.d.ts +24 -713
- package/dist/render-system.d.ts.map +1 -1
- package/dist/scene/render-scene-types.d.ts +61 -0
- package/dist/scene/render-scene-types.d.ts.map +1 -0
- package/dist/scene/render-scene.d.ts +112 -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__/authoring-path.unit.test.ts +9 -0
- 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 +21 -18
- 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 +31 -58
- package/src/__tests__/material-snapshot-mutation.integration.test.ts +10 -15
- package/src/__tests__/material-static-dynamic-route.unit.test.ts +31 -50
- 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 +24 -23
- package/src/__tests__/render-error-detail-ssot.test-d.ts +0 -95
- package/src/__tests__/render-error-exhaustive.test-d.ts +27 -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 +82 -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} +1741 -2699
- package/src/assembly/host-contract.ts +101 -0
- package/src/{renderer → assembly}/material/assembly.ts +2 -7
- package/src/assembly/material/pipeline-projection.ts +63 -0
- package/src/authoring.ts +15 -22
- package/src/components/__tests__/points-lines-admission.unit.test.ts +219 -0
- package/src/components/__tests__/points-lines-schema.unit.test.ts +56 -0
- package/src/components/__tests__/schema-contract.unit.test.ts +10 -0
- package/src/components/glyph-text.ts +3 -2
- package/src/components/index.ts +14 -9
- package/src/components/instances.ts +4 -5
- package/src/components/light-helpers.ts +1 -1
- package/src/components/lines.ts +18 -0
- package/src/components/mesh-filter.ts +11 -10
- package/src/components/points.ts +40 -0
- 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 +469 -429
- 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 +32 -8
- 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 +99 -1109
- 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 +75 -217
- package/src/inspection-types.ts +80 -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 +441 -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 +7 -75
- package/src/points-lines/__tests__/bounds.unit.test.ts +21 -0
- package/src/points-lines/__tests__/cache-recovery.unit.test.ts +157 -0
- package/src/points-lines/__tests__/inspection-lanes.integration.test.ts +146 -0
- package/src/points-lines/__tests__/inspection.unit.test.ts +173 -0
- package/src/points-lines/__tests__/lane-structural.integration.test.ts +122 -0
- package/src/points-lines/__tests__/points-lines.bench.ts +400 -0
- package/src/points-lines/__tests__/raster-lane.integration.test.ts +44 -0
- package/src/points-lines/__tests__/snapshot.unit.test.ts +101 -0
- package/src/points-lines/__tests__/view-ubo.unit.test.ts +73 -0
- package/src/points-lines/admission.ts +238 -0
- package/src/points-lines/bounds.ts +23 -0
- package/src/points-lines/expansion-cache.ts +215 -0
- package/src/points-lines/inspection.ts +97 -0
- package/src/points-lines/prepare.ts +177 -0
- package/src/points-lines/record.ts +125 -0
- package/src/points-lines/snapshot.ts +130 -0
- 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 +88 -197
- package/src/record/frame-snapshot.ts +45 -60
- package/src/record/frame-targets.ts +8 -243
- package/src/record/frame.ts +521 -797
- package/src/record/helpers.ts +6 -11
- package/src/record/main-pass-geometry.ts +198 -147
- package/src/record/main-pass-material.ts +517 -190
- package/src/record/main-pass-sprite-draws.ts +199 -118
- package/src/record/main-pass.ts +166 -144
- package/src/record/mesh-ssbo.ts +517 -38
- package/src/record/render-context.ts +384 -0
- package/src/record/shadow-pass.ts +154 -1843
- package/src/record/skybox-post-pass.ts +14 -15
- package/src/record/typed-frame-graph.ts +224 -262
- package/src/record/view-ubo.ts +53 -37
- package/src/render-contract.ts +582 -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 +1114 -1732
- package/src/render-system.ts +614 -1939
- package/src/scene/render-scene-types.ts +67 -0
- package/src/scene/render-scene.ts +1087 -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.
|
|
@@ -355,6 +347,8 @@ export interface PbrCaps {
|
|
|
355
347
|
* (always-on bindings 5/6 paired with the unconditional `POINT_SHADOW_AVAILABLE`
|
|
356
348
|
* define registered in vite-plugin-shader) +
|
|
357
349
|
* feat-20260613-csm-cascaded-shadow-maps M5 / w28 (binding 7 cascade UBO).
|
|
350
|
+
* binding 10 (Points/Lines viewport UBO; always bound for the shared view
|
|
351
|
+
* layout and consumed only by the dedicated points-lines shader).
|
|
358
352
|
* Isolated here so M4 round-4 tests can recreate the layout.
|
|
359
353
|
*
|
|
360
354
|
* feat-20260526-pbr-uniform-fallback-no-storage-buffer M3 / w9:
|
|
@@ -456,6 +450,11 @@ export function buildPbrViewBglEntries(caps: PbrCaps): GPUBindGroupLayoutEntry[]
|
|
|
456
450
|
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
457
451
|
texture: { sampleType: 'depth', viewDimension: '2d' },
|
|
458
452
|
},
|
|
453
|
+
{
|
|
454
|
+
binding: 10,
|
|
455
|
+
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
456
|
+
buffer: { type: 'uniform', hasDynamicOffset: true },
|
|
457
|
+
},
|
|
459
458
|
];
|
|
460
459
|
}
|
|
461
460
|
|
|
@@ -469,7 +468,7 @@ export function buildPbrViewBglEntries(caps: PbrCaps): GPUBindGroupLayoutEntry[]
|
|
|
469
468
|
* `caps.storageBuffer===false` switches every storage-buffer BGL entry
|
|
470
469
|
* (view bindings 1+2, mesh-array, instances) to `uniform`.
|
|
471
470
|
*
|
|
472
|
-
* Throws on
|
|
471
|
+
* Throws on each `createBindGroupLayout` / `createPipelineLayout` Result
|
|
473
472
|
* failure -- the engine bootstrap path (createRenderer) wraps the call in
|
|
474
473
|
* `runShimSyncStep` to fold the throw into the structured error pipe.
|
|
475
474
|
*/
|
|
@@ -557,9 +556,9 @@ export function isStandardPbrMaterialShader(shaderId: string | undefined): boole
|
|
|
557
556
|
//
|
|
558
557
|
// The skin material shader (`forgeax::pbr-skin`, registered by
|
|
559
558
|
// `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
|
-
//
|
|
559
|
+
// as standard PBR EXCEPT for slot 2: its mesh-array BGL declares **2**
|
|
560
|
+
// dynamic-offset entries (binding 0 = meshes, binding 1 = palette) versus
|
|
561
|
+
// standard PBR's single binding 0. Without a dedicated pipeline layout the
|
|
563
562
|
// skin shader's `@group(2) @binding(1) palette : array<mat4x4<f32>>` reference
|
|
564
563
|
// trips a `Binding doesn't exist in [BindGroupLayoutInternal "pbr-mesh-array-bgl"]`
|
|
565
564
|
// validation error in `device.createRenderPipeline`, surfaced as
|
|
@@ -575,12 +574,11 @@ export function isStandardPbrMaterialShader(shaderId: string | undefined): boole
|
|
|
575
574
|
|
|
576
575
|
/**
|
|
577
576
|
* Build the PBR skin pipeline layout (4 slots `[view, material,
|
|
578
|
-
* mesh-array(
|
|
577
|
+
* mesh-array(2-entry), instances]`). View / material / instances BGLs are
|
|
579
578
|
* shared with the standard-PBR layout (passed in via `pbr` bundle); the only
|
|
580
|
-
* new BGL is the
|
|
581
|
-
* previous palettes.
|
|
579
|
+
* new BGL is the 2-entry mesh-array slot for `meshes` + `palette`.
|
|
582
580
|
*
|
|
583
|
-
* Throws on
|
|
581
|
+
* Throws on each `createBindGroupLayout` / `createPipelineLayout` Result
|
|
584
582
|
* failure -- the engine bootstrap path wraps the call in `runShimSyncStep`
|
|
585
583
|
* to fold the throw into the structured error pipe.
|
|
586
584
|
*/
|
|
@@ -589,7 +587,8 @@ export function buildPbrSkinLayouts(
|
|
|
589
587
|
caps: PbrCaps,
|
|
590
588
|
pbr: PbrPipelineLayoutBundle,
|
|
591
589
|
): PbrPipelineLayoutBundle {
|
|
592
|
-
//
|
|
590
|
+
// 2-entry mesh-array BGL: binding 0 meshes + binding 1 palette. Both
|
|
591
|
+
// dynamic-offset (palette window per-entity, like meshes window).
|
|
593
592
|
const skinMeshArrayBglRes = device.createBindGroupLayout(
|
|
594
593
|
buildBindGroupLayoutDescriptor(BGL_ONLY_SPEC_STUB, {
|
|
595
594
|
kind: 'pbr-skin-mesh-array',
|
|
@@ -733,17 +732,406 @@ export type { BindGroup };
|
|
|
733
732
|
*/
|
|
734
733
|
export const SPRITE_PASS_PER_INSTANCE_REGION_VARIANT_SET = '';
|
|
735
734
|
|
|
735
|
+
// BglKind dispatch (M3 / D-13) — closed union of BGL shapes the runtime ships
|
|
736
|
+
// ══════════════════════════════════════════════════════════════════════════════
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Closed union of bind-group-layout shapes the runtime constructs.
|
|
740
|
+
*
|
|
741
|
+
* Each kind names one physically distinct BGL the runtime has historically
|
|
742
|
+
* built by hand. {@link buildBindGroupLayoutDescriptor} dispatches on this
|
|
743
|
+
* union so every `device.createBindGroupLayout(...)` call site shares one
|
|
744
|
+
* SSOT for entries / labels (plan-strategy §3.2; D-13 round-2 decision).
|
|
745
|
+
*
|
|
746
|
+
* Three groups by derivation source:
|
|
747
|
+
* 1. Shader-derived (paramSchema reflection + injection chain):
|
|
748
|
+
* - `'pbr-material-merged'` — derived user region + Skylight 7 + lightmap 4
|
|
749
|
+
* - `'unlit-material'` — 7 entries: base PBR material only (no inject)
|
|
750
|
+
* - `'hdrp-7-slot'` — 7 entries (binding 0 + 3..8): HDRP cluster + SSAO group(2) BGL
|
|
751
|
+
* 2. Caps-driven literal shapes (no shader):
|
|
752
|
+
* - `'pbr-view'` — 10 entries: view UBO + lights + 6 shadow bindings
|
|
753
|
+
* (directional 3/4, point 5/6, cascade 7, spot atlas 8, spot
|
|
754
|
+
* lightViewProj matrices 9 — feat-20260625)
|
|
755
|
+
* - `'pbr-mesh-array'` — 1 entry: per-entity mesh SSBO (dynamic-offset)
|
|
756
|
+
* - `'pbr-instances'` — 1 entry: per-instance SSBO (no dynamic-offset)
|
|
757
|
+
* - `'pbr-skin-mesh-array'` — 2 entries: meshes + skin palette
|
|
758
|
+
* 3. Attachment-driven (fullscreen post-process):
|
|
759
|
+
* - `'fullscreen-post'` — 2 entries: input texture + sampler. The texture
|
|
760
|
+
* `sampleType` is derived from `spec.attachments` (plan §R3 fix):
|
|
761
|
+
* `'depth32float'` → `'depth'`; `'r32float'` → `'unfilterable-float'`;
|
|
762
|
+
* else → `'float'`.
|
|
763
|
+
* - `'fullscreen-post-with-params'` — 3 entries: the same texture@0 +
|
|
764
|
+
* sampler@1 as `'fullscreen-post'`, plus a `buffer@2` uniform for the
|
|
765
|
+
* per-frame params UBO (feat-20260621 D-2: `entry.params !== undefined`
|
|
766
|
+
* passes route here; the layout stays group(1), q3=B). `'fullscreen-post'`
|
|
767
|
+
* stays byte-identical so param-less consumers degrade with no change.
|
|
768
|
+
* - `'fullscreen-post-with-scene-depth-msaa'` — the depth-read layout with
|
|
769
|
+
* `texture.multisampled=true`, selected for a 4-sample scene depth target.
|
|
770
|
+
*/
|
|
771
|
+
export type BglKind =
|
|
772
|
+
| 'pbr-view'
|
|
773
|
+
| 'pbr-material-merged'
|
|
774
|
+
| 'pbr-mesh-array'
|
|
775
|
+
| 'pbr-instances'
|
|
776
|
+
| 'pbr-skin-mesh-array'
|
|
777
|
+
| 'unlit-material'
|
|
778
|
+
| 'hdrp-7-slot'
|
|
779
|
+
| 'fullscreen-post'
|
|
780
|
+
| 'fullscreen-post-with-params'
|
|
781
|
+
| 'fullscreen-post-with-scene-depth'
|
|
782
|
+
| 'fullscreen-post-with-scene-depth-msaa';
|
|
783
|
+
|
|
736
784
|
/**
|
|
737
|
-
*
|
|
738
|
-
* `
|
|
739
|
-
*
|
|
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).
|
|
785
|
+
* Output shape of {@link buildBindGroupLayoutDescriptor}: matches the RHI
|
|
786
|
+
* `BindGroupLayoutDescriptor` (label + entries with `ExplicitUndefined`) so
|
|
787
|
+
* the result can be passed directly to `device.createBindGroupLayout(...)`.
|
|
743
788
|
*
|
|
744
|
-
*
|
|
745
|
-
*
|
|
789
|
+
* `entries` is a mutable `Array` to match `GPUBindGroupLayoutDescriptor`
|
|
790
|
+
* (WebGPU types declare it mutable). Callers MUST treat the array as
|
|
791
|
+
* read-only — the dispatcher freezes neither the array nor its entries
|
|
792
|
+
* for hot-path performance.
|
|
746
793
|
*/
|
|
747
|
-
export
|
|
748
|
-
|
|
794
|
+
export interface BindGroupLayoutDescriptorOutput {
|
|
795
|
+
readonly label: string | undefined;
|
|
796
|
+
readonly entries: GPUBindGroupLayoutEntry[];
|
|
749
797
|
}
|
|
798
|
+
|
|
799
|
+
/** Build the canonical HDRP group(2) bind-group layout. */
|
|
800
|
+
export function createHdrpBindGroupLayoutDescriptor(
|
|
801
|
+
storageBuffer: boolean = true,
|
|
802
|
+
): BindGroupLayoutDescriptor {
|
|
803
|
+
const meshBufType: GPUBufferBindingType = storageBuffer ? 'read-only-storage' : 'uniform';
|
|
804
|
+
const clusterBufType: GPUBufferBindingType = storageBuffer ? 'read-only-storage' : 'uniform';
|
|
805
|
+
return {
|
|
806
|
+
label: 'hdrp-unified-bgl-group2',
|
|
807
|
+
entries: [
|
|
808
|
+
{
|
|
809
|
+
binding: 0,
|
|
810
|
+
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
811
|
+
buffer: { type: meshBufType, hasDynamicOffset: true },
|
|
812
|
+
},
|
|
813
|
+
// Bindings 1 and 2 stay absent for the URP physical isolation gap.
|
|
814
|
+
{
|
|
815
|
+
binding: 3,
|
|
816
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
817
|
+
buffer: { type: clusterBufType, hasDynamicOffset: false },
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
binding: 4,
|
|
821
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
822
|
+
buffer: { type: clusterBufType, hasDynamicOffset: false },
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
binding: 5,
|
|
826
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
827
|
+
buffer: { type: clusterBufType, hasDynamicOffset: false },
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
binding: 6,
|
|
831
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
832
|
+
buffer: { type: 'uniform', hasDynamicOffset: false },
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
binding: 7,
|
|
836
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
837
|
+
texture: { sampleType: 'float', viewDimension: '2d', multisampled: false },
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
binding: 8,
|
|
841
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
842
|
+
sampler: { type: 'filtering' },
|
|
843
|
+
},
|
|
844
|
+
],
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* Build a `GPUBindGroupLayoutDescriptor` from a PipelineSpec, dispatching on
|
|
850
|
+
* `options.kind` to one of 9 closed BGL shapes (D-13 round-2).
|
|
851
|
+
*
|
|
852
|
+
* Shader-derived kinds (`'pbr-material-merged'` / `'unlit-material'` /
|
|
853
|
+
* `'hdrp-7-slot'`) require `options.registry` to look up the shader entry
|
|
854
|
+
* and reflect its `paramSchema` via {@link deriveBglShapeFromShader}; they
|
|
855
|
+
* compose the per-entry injection chain (Skylight + lightmap for material;
|
|
856
|
+
* HDRP variantSet for cluster-forward).
|
|
857
|
+
*
|
|
858
|
+
* Caps-driven kinds (`'pbr-view'` / `'pbr-mesh-array'` / `'pbr-instances'` /
|
|
859
|
+
* `'pbr-skin-mesh-array'`) require `options.caps` for the storage-buffer
|
|
860
|
+
* vs uniform-buffer fallback (RhiCaps.storageBuffer; PBR feat-20260526 M3 /
|
|
861
|
+
* w9). They are wholly determined by the caps shape.
|
|
862
|
+
*
|
|
863
|
+
* Attachment-driven kind (`'fullscreen-post'`) reads
|
|
864
|
+
* `spec.attachments.depthFormat` and `spec.attachments.colorFormats[0]` to
|
|
865
|
+
* pick the texture binding's `sampleType` (R3 fix: `'depth32float'` → `'depth'`,
|
|
866
|
+
* `'r32float'` → `'unfilterable-float'`, else → `'float'`).
|
|
867
|
+
*
|
|
868
|
+
* @param spec - the pipeline spec (axis source for reflection / caps fallback)
|
|
869
|
+
* @param options.kind - which BGL shape to build (closed {@link BglKind} union)
|
|
870
|
+
* @param options.registry - ShaderCatalog for shader-derived kinds
|
|
871
|
+
* @param options.caps - caps shape for caps-driven kinds (storageBuffer)
|
|
872
|
+
* @returns a WebGPU bind-group-layout descriptor (entries + label)
|
|
873
|
+
* @see plan-strategy §3.2 · plan-decisions D-13 · requirements AC-02
|
|
874
|
+
*/
|
|
875
|
+
/**
|
|
876
|
+
* Resolve the material paramSchema for a per-shader user-region BGL derivation.
|
|
877
|
+
*
|
|
878
|
+
* Priority (D-1): explicit `options.materialParamSchema` > registry lookup of
|
|
879
|
+
* `spec.shader.id` > `undefined` (the user-region builder then falls back to
|
|
880
|
+
* the built-in standard-PBR 4-texture schema, whose user region is 9 entries).
|
|
881
|
+
*/
|
|
882
|
+
function resolveMaterialParamSchema(
|
|
883
|
+
spec: PipelineSpec,
|
|
884
|
+
options: { registry?: ShaderCatalog; materialParamSchema?: readonly ParamSchemaEntry[] },
|
|
885
|
+
): readonly ParamSchemaEntry[] | undefined {
|
|
886
|
+
if (options.materialParamSchema !== undefined) return options.materialParamSchema;
|
|
887
|
+
if (options.registry !== undefined) {
|
|
888
|
+
const lookup = options.registry.findMaterialArtifact(spec.shader.id);
|
|
889
|
+
if (lookup.ok) return lookup.value.paramSchema;
|
|
890
|
+
}
|
|
891
|
+
return undefined;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
export function buildBindGroupLayoutDescriptor(
|
|
895
|
+
spec: PipelineSpec,
|
|
896
|
+
options: {
|
|
897
|
+
kind: BglKind;
|
|
898
|
+
registry?: ShaderCatalog;
|
|
899
|
+
caps?: PbrCaps;
|
|
900
|
+
/**
|
|
901
|
+
* Material paramSchema for the per-shader user-region derivation
|
|
902
|
+
* (`'pbr-material-merged'` / `'unlit-material'`). When supplied it is the
|
|
903
|
+
* authoritative source for the user-region BGL shape (D-1); when omitted,
|
|
904
|
+
* `buildPbrMaterialUserRegionEntries` falls back to the built-in
|
|
905
|
+
* standard-PBR 4-texture schema (user region is 9 entries), so
|
|
906
|
+
* the caps-driven `buildPbrPipelineLayouts` seam keeps working unchanged.
|
|
907
|
+
* A registry + resolvable shader id takes precedence over this field.
|
|
908
|
+
*/
|
|
909
|
+
materialParamSchema?: readonly ParamSchemaEntry[];
|
|
910
|
+
},
|
|
911
|
+
): BindGroupLayoutDescriptorOutput {
|
|
912
|
+
switch (options.kind) {
|
|
913
|
+
case 'pbr-view': {
|
|
914
|
+
const caps = options.caps ?? { storageBuffer: true };
|
|
915
|
+
return {
|
|
916
|
+
label: 'pbr-view-bgl',
|
|
917
|
+
entries: buildPbrViewBglEntries(caps),
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
case 'pbr-mesh-array': {
|
|
921
|
+
const caps = options.caps ?? { storageBuffer: true };
|
|
922
|
+
const meshBufType: GPUBufferBindingType = caps.storageBuffer
|
|
923
|
+
? 'read-only-storage'
|
|
924
|
+
: 'uniform';
|
|
925
|
+
// sprite-lit's fragment stage does not read the mesh SSBO -- worldPos
|
|
926
|
+
// is carried through the VsOut interpolant. Visibility is kept widened
|
|
927
|
+
// to VERTEX|FRAGMENT because the BGL JSON is compared byte-identically
|
|
928
|
+
// across the sprite / sprite-lit / PBR pipelines that share this
|
|
929
|
+
// descriptor; narrowing here would change every sibling pipeline's
|
|
930
|
+
// BGL fingerprint. WebGPU rejects createRenderPipeline when a fragment
|
|
931
|
+
// stage accesses a binding whose BGL visibility excludes FRAGMENT --
|
|
932
|
+
// widening is permissive (validation-only, no perf cost).
|
|
933
|
+
return {
|
|
934
|
+
label: 'pbr-mesh-array-bgl',
|
|
935
|
+
entries: [
|
|
936
|
+
{
|
|
937
|
+
binding: 0,
|
|
938
|
+
visibility: GPU_SHADER_STAGE_VERTEX | GPU_SHADER_STAGE_FRAGMENT,
|
|
939
|
+
buffer: { type: meshBufType, hasDynamicOffset: true },
|
|
940
|
+
},
|
|
941
|
+
],
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
case 'pbr-instances': {
|
|
945
|
+
const caps = options.caps ?? { storageBuffer: true };
|
|
946
|
+
const meshBufType: GPUBufferBindingType = caps.storageBuffer
|
|
947
|
+
? 'read-only-storage'
|
|
948
|
+
: 'uniform';
|
|
949
|
+
return {
|
|
950
|
+
label: 'pbr-instances-bgl',
|
|
951
|
+
entries: [
|
|
952
|
+
{
|
|
953
|
+
binding: 0,
|
|
954
|
+
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
955
|
+
buffer: { type: meshBufType, hasDynamicOffset: false },
|
|
956
|
+
},
|
|
957
|
+
],
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
case 'pbr-skin-mesh-array': {
|
|
961
|
+
const caps = options.caps ?? { storageBuffer: true };
|
|
962
|
+
const meshBufType: GPUBufferBindingType = caps.storageBuffer
|
|
963
|
+
? 'read-only-storage'
|
|
964
|
+
: 'uniform';
|
|
965
|
+
return {
|
|
966
|
+
label: 'pbr-skin-mesh-array-bgl',
|
|
967
|
+
entries: [
|
|
968
|
+
{
|
|
969
|
+
binding: 0,
|
|
970
|
+
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
971
|
+
buffer: { type: meshBufType, hasDynamicOffset: true },
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
binding: 1,
|
|
975
|
+
visibility: GPU_SHADER_STAGE_VERTEX,
|
|
976
|
+
buffer: { type: meshBufType, hasDynamicOffset: true },
|
|
977
|
+
},
|
|
978
|
+
],
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
case 'pbr-material-merged': {
|
|
982
|
+
// Material BGL: per-shader user-region (derive(paramSchema).bglEntries)
|
|
983
|
+
// + IBL injection (7) + lightmap injection (4). The user-region size is
|
|
984
|
+
// the only variable; injection start = userRegion.length so a 4-texture
|
|
985
|
+
// custom schema shifts IBL/lightmap by one sampler/texture pair (D-1).
|
|
986
|
+
// For the built-in 4-texture standard-PBR schema this is 9 + 7 + 4 = 20.
|
|
987
|
+
//
|
|
988
|
+
// Schema source priority (D-1): explicit materialParamSchema option >
|
|
989
|
+
// registry lookup of spec.shader.id > built-in standard-PBR fallback.
|
|
990
|
+
const resolvedSchema = resolveMaterialParamSchema(spec, options);
|
|
991
|
+
const userRegion = buildPbrMaterialUserRegionEntries(resolvedSchema);
|
|
992
|
+
const afterIbl = [...userRegion, ...appendInjection(userRegion, 'ibl')];
|
|
993
|
+
const merged = [...afterIbl, ...appendInjection(afterIbl, 'lightmap')];
|
|
994
|
+
return {
|
|
995
|
+
label: 'pbr-material-skylight-bgl',
|
|
996
|
+
entries: merged,
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
case 'unlit-material': {
|
|
1000
|
+
// Unlit material BGL: per-shader user-region only. No IBL/lightmap
|
|
1001
|
+
// injection (D-5 round-4: unlit demos do not pay for IBL state).
|
|
1002
|
+
const resolvedSchema = resolveMaterialParamSchema(spec, options);
|
|
1003
|
+
return {
|
|
1004
|
+
label: 'unlit-material-bgl',
|
|
1005
|
+
entries: buildPbrMaterialUserRegionEntries(resolvedSchema),
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
case 'hdrp-7-slot': {
|
|
1009
|
+
// HDRP unified BGL for group(2): 9 entries (binding 0 + 3..8). The
|
|
1010
|
+
// shape depends on caps.storageBuffer for the cluster-buffer fallback.
|
|
1011
|
+
const caps = options.caps ?? { storageBuffer: true };
|
|
1012
|
+
const desc = createHdrpBindGroupLayoutDescriptor(caps.storageBuffer);
|
|
1013
|
+
return {
|
|
1014
|
+
label: desc.label ?? 'hdrp-unified-bgl-group2',
|
|
1015
|
+
entries: [...(desc.entries ?? [])],
|
|
1016
|
+
};
|
|
1017
|
+
}
|
|
1018
|
+
case 'fullscreen-post': {
|
|
1019
|
+
// Fullscreen post-process BGL: 2 entries (input texture + sampler).
|
|
1020
|
+
// R3 fix: derive sampleType from spec.attachments. Depth attachments
|
|
1021
|
+
// (depth32float) need `sampleType: 'depth'`; r32float needs
|
|
1022
|
+
// `'unfilterable-float'`; everything else (rgba8unorm-srgb, rgba16float,
|
|
1023
|
+
// bgra8unorm, …) is filterable `'float'`.
|
|
1024
|
+
return {
|
|
1025
|
+
label: 'fullscreen-post-bgl',
|
|
1026
|
+
entries: buildFullscreenPostInputEntries(spec),
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
case 'fullscreen-post-with-params': {
|
|
1030
|
+
// feat-20260621 D-2: the same input texture@0 + sampler@1 as
|
|
1031
|
+
// 'fullscreen-post', plus binding 2 = per-frame params UBO (uniform).
|
|
1032
|
+
// The first two entries reuse buildFullscreenPostInputEntries so the
|
|
1033
|
+
// sampleType derivation stays a single SSOT; 'fullscreen-post' is
|
|
1034
|
+
// untouched (param-less zero-regression, R-A7).
|
|
1035
|
+
return {
|
|
1036
|
+
label: 'fullscreen-post-with-params-bgl',
|
|
1037
|
+
entries: [
|
|
1038
|
+
...buildFullscreenPostInputEntries(spec),
|
|
1039
|
+
{
|
|
1040
|
+
binding: 2,
|
|
1041
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1042
|
+
buffer: { type: 'uniform' },
|
|
1043
|
+
},
|
|
1044
|
+
],
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
case 'fullscreen-post-with-scene-depth': {
|
|
1048
|
+
// plan-strategy D-3: 5-entry BGL for post-process passes that read the
|
|
1049
|
+
// camera scene depth. color@0 + sampler@1 reuse buildFullscreenPostInputEntries
|
|
1050
|
+
// (float+filtering for color). depthTex@3 uses `sampleType: 'depth'` and
|
|
1051
|
+
// `dimension: '2d'`; depthSampler@4 uses `type: 'non-filtering'` (nearest
|
|
1052
|
+
// + clamp-to-edge, D-2 — NOT comparison). params@2 is always present
|
|
1053
|
+
// (uniform) to avoid a 2x2 kind explosion per D-3.
|
|
1054
|
+
return {
|
|
1055
|
+
label: 'fullscreen-post-with-scene-depth-bgl',
|
|
1056
|
+
entries: [
|
|
1057
|
+
...buildFullscreenPostInputEntries(spec),
|
|
1058
|
+
{
|
|
1059
|
+
binding: 2,
|
|
1060
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1061
|
+
buffer: { type: 'uniform' },
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
binding: 3,
|
|
1065
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1066
|
+
texture: { sampleType: 'depth', viewDimension: '2d' },
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
binding: 4,
|
|
1070
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1071
|
+
sampler: { type: 'non-filtering' },
|
|
1072
|
+
},
|
|
1073
|
+
],
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
case 'fullscreen-post-with-scene-depth-msaa': {
|
|
1077
|
+
return {
|
|
1078
|
+
label: 'fullscreen-post-with-scene-depth-msaa-bgl',
|
|
1079
|
+
entries: [
|
|
1080
|
+
...buildFullscreenPostInputEntries(spec),
|
|
1081
|
+
{
|
|
1082
|
+
binding: 2,
|
|
1083
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1084
|
+
buffer: { type: 'uniform' },
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
binding: 3,
|
|
1088
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1089
|
+
texture: { sampleType: 'depth', viewDimension: '2d', multisampled: true },
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
binding: 4,
|
|
1093
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1094
|
+
sampler: { type: 'non-filtering' },
|
|
1095
|
+
},
|
|
1096
|
+
],
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
/**
|
|
1103
|
+
* The shared texture@0 + sampler@1 entries for fullscreen post-process BGLs.
|
|
1104
|
+
* sampleType is derived from `spec.attachments` (R3 fix): depth attachments →
|
|
1105
|
+
* `'depth'` + `'comparison'` sampler; `'r32float'` → `'unfilterable-float'`;
|
|
1106
|
+
* else → `'float'` + `'filtering'`. Both `'fullscreen-post'` and
|
|
1107
|
+
* `'fullscreen-post-with-params'` reuse this so the derivation is one SSOT.
|
|
1108
|
+
*/
|
|
1109
|
+
function buildFullscreenPostInputEntries(spec: PipelineSpec): GPUBindGroupLayoutEntry[] {
|
|
1110
|
+
const inputFormat: GPUTextureFormat | undefined =
|
|
1111
|
+
spec.attachments.depthFormat ?? spec.attachments.colorFormats[0];
|
|
1112
|
+
const sampleType: GPUTextureSampleType =
|
|
1113
|
+
inputFormat === 'depth32float' ||
|
|
1114
|
+
inputFormat === 'depth24plus' ||
|
|
1115
|
+
inputFormat === 'depth24plus-stencil8' ||
|
|
1116
|
+
inputFormat === 'depth16unorm'
|
|
1117
|
+
? 'depth'
|
|
1118
|
+
: inputFormat === 'r32float'
|
|
1119
|
+
? 'unfilterable-float'
|
|
1120
|
+
: 'float';
|
|
1121
|
+
return [
|
|
1122
|
+
{
|
|
1123
|
+
binding: 0,
|
|
1124
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1125
|
+
texture: { sampleType, viewDimension: '2d' },
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
binding: 1,
|
|
1129
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
1130
|
+
sampler: {
|
|
1131
|
+
type: sampleType === 'depth' ? 'comparison' : 'filtering',
|
|
1132
|
+
},
|
|
1133
|
+
},
|
|
1134
|
+
];
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
// ══════════════════════════════════════════════════════════════════════════════
|