@forgeax/engine-render 0.1.2
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/LICENSE +202 -0
- package/README.md +1019 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/__tests__/analytic-sky-contract.test.d.ts +2 -0
- package/dist/__tests__/analytic-sky-contract.test.d.ts.map +1 -0
- package/dist/__tests__/analytic-sky-falsify.test.d.ts +2 -0
- package/dist/__tests__/analytic-sky-falsify.test.d.ts.map +1 -0
- package/dist/__tests__/assets-runtime-handoff.integration.test.d.ts +2 -0
- package/dist/__tests__/assets-runtime-handoff.integration.test.d.ts.map +1 -0
- package/dist/__tests__/authoring-path.unit.test.d.ts +2 -0
- package/dist/__tests__/authoring-path.unit.test.d.ts.map +1 -0
- package/dist/__tests__/backend-selection-rhi-capture.test-d.d.ts +2 -0
- package/dist/__tests__/backend-selection-rhi-capture.test-d.d.ts.map +1 -0
- package/dist/__tests__/backend-selection.integration.test.d.ts +2 -0
- package/dist/__tests__/backend-selection.integration.test.d.ts.map +1 -0
- package/dist/__tests__/callback-inference.test-d.d.ts +2 -0
- package/dist/__tests__/callback-inference.test-d.d.ts.map +1 -0
- package/dist/__tests__/camera-temporal.test-d.d.ts +2 -0
- package/dist/__tests__/camera-temporal.test-d.d.ts.map +1 -0
- package/dist/__tests__/camera-temporal.test.d.ts +2 -0
- package/dist/__tests__/camera-temporal.test.d.ts.map +1 -0
- package/dist/__tests__/cluster-binner.test.d.ts +2 -0
- package/dist/__tests__/cluster-binner.test.d.ts.map +1 -0
- package/dist/__tests__/cluster-grid-default-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/cluster-grid-default-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/construct-renderer-identity.unit.test.d.ts +2 -0
- package/dist/__tests__/construct-renderer-identity.unit.test.d.ts.map +1 -0
- package/dist/__tests__/direct-extract-consumer-contract.test-d.d.ts +2 -0
- package/dist/__tests__/direct-extract-consumer-contract.test-d.d.ts.map +1 -0
- package/dist/__tests__/direct-light-snapshot.unit.test.d.ts +2 -0
- package/dist/__tests__/direct-light-snapshot.unit.test.d.ts.map +1 -0
- package/dist/__tests__/directional-shadow-probe-atlas-layout.unit.test.d.ts +2 -0
- package/dist/__tests__/directional-shadow-probe-atlas-layout.unit.test.d.ts.map +1 -0
- package/dist/__tests__/environment-inspection.test.d.ts +2 -0
- package/dist/__tests__/environment-inspection.test.d.ts.map +1 -0
- package/dist/__tests__/factory-contract.integration.test.d.ts +2 -0
- package/dist/__tests__/factory-contract.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fallback-row-stride-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/fallback-row-stride-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/fog-ai-user.fixture.d.ts +2 -0
- package/dist/__tests__/fog-ai-user.fixture.d.ts.map +1 -0
- package/dist/__tests__/fog-custom-render-feature.fixture.d.ts +16 -0
- package/dist/__tests__/fog-custom-render-feature.fixture.d.ts.map +1 -0
- package/dist/__tests__/fog-custom-render-feature.integration.test.d.ts +2 -0
- package/dist/__tests__/fog-custom-render-feature.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fog-inspection.integration.test.d.ts +2 -0
- package/dist/__tests__/fog-inspection.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fog-owner-state.integration.test.d.ts +2 -0
- package/dist/__tests__/fog-owner-state.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fog-pipeline-topology.integration.test.d.ts +2 -0
- package/dist/__tests__/fog-pipeline-topology.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fog-public-surface.integration.test.d.ts +2 -0
- package/dist/__tests__/fog-public-surface.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fog-ray-contract.integration.test.d.ts +2 -0
- package/dist/__tests__/fog-ray-contract.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fog-source-absence.integration.test.d.ts +2 -0
- package/dist/__tests__/fog-source-absence.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fog-temporal.integration.test.d.ts +2 -0
- package/dist/__tests__/fog-temporal.integration.test.d.ts.map +1 -0
- package/dist/__tests__/frame-chain.unit.test.d.ts +2 -0
- package/dist/__tests__/frame-chain.unit.test.d.ts.map +1 -0
- package/dist/__tests__/frame-observation.contract.test.d.ts +2 -0
- package/dist/__tests__/frame-observation.contract.test.d.ts.map +1 -0
- package/dist/__tests__/glyph-text-layout-recovery.unit.test.d.ts +2 -0
- package/dist/__tests__/glyph-text-layout-recovery.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-indirect-raster-evidence.d.ts +6 -0
- package/dist/__tests__/gpu-driven-indirect-raster-evidence.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-indirect-raster.browser.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-indirect-raster.browser.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-indirect-raster.dawn.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-indirect-raster.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-production.integration.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-production.integration.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-scaling.unit.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-scaling.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts +12 -0
- package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-view-graph.integration.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-view-graph.integration.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-view.browser.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-view.browser.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-view.dawn.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-view.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-view.unit.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-view.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-resource-store-stride.unit.test.d.ts +2 -0
- package/dist/__tests__/gpu-resource-store-stride.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene-field-type-owner.test-d.d.ts +2 -0
- package/dist/__tests__/gpu-scene-field-type-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene-render-graph-gpu.d.ts +7 -0
- package/dist/__tests__/gpu-scene-render-graph-gpu.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene-render-graph.browser.test.d.ts +2 -0
- package/dist/__tests__/gpu-scene-render-graph.browser.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene-render-graph.dawn.test.d.ts +2 -0
- package/dist/__tests__/gpu-scene-render-graph.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene-schema.unit.test.d.ts +2 -0
- package/dist/__tests__/gpu-scene-schema.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene.dawn.test.d.ts +2 -0
- package/dist/__tests__/gpu-scene.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene.unit.test.d.ts +2 -0
- package/dist/__tests__/gpu-scene.unit.test.d.ts.map +1 -0
- package/dist/__tests__/hdrp-pipeline.unit.test.d.ts +2 -0
- package/dist/__tests__/hdrp-pipeline.unit.test.d.ts.map +1 -0
- package/dist/__tests__/ibl/ibl-fallback.unit.test.d.ts +2 -0
- package/dist/__tests__/ibl/ibl-fallback.unit.test.d.ts.map +1 -0
- package/dist/__tests__/infinite-grid-no-vertex-probe.unit.test.d.ts +2 -0
- package/dist/__tests__/infinite-grid-no-vertex-probe.unit.test.d.ts.map +1 -0
- package/dist/__tests__/injection-kind-owner.test-d.d.ts +2 -0
- package/dist/__tests__/injection-kind-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/ktx2-basis-gpu-consumer.dawn.test.d.ts +2 -0
- package/dist/__tests__/ktx2-basis-gpu-consumer.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/light-buffer-layout.unit.test.d.ts +2 -0
- package/dist/__tests__/light-buffer-layout.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-contract-inventory.unit.test.d.ts +2 -0
- package/dist/__tests__/material-contract-inventory.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-cooked-projection.unit.test.d.ts +2 -0
- package/dist/__tests__/material-cooked-projection.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-derived-error-stop-draw.integration.test.d.ts +2 -0
- package/dist/__tests__/material-derived-error-stop-draw.integration.test.d.ts.map +1 -0
- package/dist/__tests__/material-derived-payload.integration.test.d.ts +2 -0
- package/dist/__tests__/material-derived-payload.integration.test.d.ts.map +1 -0
- package/dist/__tests__/material-snapshot-mutation.integration.test.d.ts +2 -0
- package/dist/__tests__/material-snapshot-mutation.integration.test.d.ts.map +1 -0
- package/dist/__tests__/material-static-dynamic-route.unit.test.d.ts +2 -0
- package/dist/__tests__/material-static-dynamic-route.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-stride-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/material-stride-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/materials.unit.test.d.ts +2 -0
- package/dist/__tests__/materials.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-buffer-usage-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-buffer-usage-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-material-bindings.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-material-bindings.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-stride-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-stride-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/morph-culling-reentry.dawn.test.d.ts +2 -0
- package/dist/__tests__/morph-culling-reentry.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/morph-feature-gpu-work.integration.test.d.ts +2 -0
- package/dist/__tests__/morph-feature-gpu-work.integration.test.d.ts.map +1 -0
- package/dist/__tests__/morph-visual-evidence.integration.test.d.ts +2 -0
- package/dist/__tests__/morph-visual-evidence.integration.test.d.ts.map +1 -0
- package/dist/__tests__/nineslice-handle-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/nineslice-handle-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/param-schema-projection-census.unit.test.d.ts +2 -0
- package/dist/__tests__/param-schema-projection-census.unit.test.d.ts.map +1 -0
- package/dist/__tests__/persistent-render-scene.unit.test.d.ts +2 -0
- package/dist/__tests__/persistent-render-scene.unit.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline-error-policy-owner.unit.test.d.ts +2 -0
- package/dist/__tests__/pipeline-error-policy-owner.unit.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline-pass-trace.test.d.ts +2 -0
- package/dist/__tests__/pipeline-pass-trace.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline-stage-owner.test-d.d.ts +2 -0
- package/dist/__tests__/pipeline-stage-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/plugin.test.d.ts +2 -0
- package/dist/__tests__/plugin.test.d.ts.map +1 -0
- package/dist/__tests__/post-process-error-policy-owner.unit.test.d.ts +2 -0
- package/dist/__tests__/post-process-error-policy-owner.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-buffer-kind-owner.test-d.d.ts +2 -0
- package/dist/__tests__/prepared-buffer-kind-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-backend-matrix.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-backend-matrix.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-capability.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-capability.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-generation.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-generation.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-lifecycle.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-lifecycle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-pipeline-warmup.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-pipeline-warmup.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-resolver-recording.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-resolver-recording.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-resolver.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-resolver.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-snapshot.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-snapshot.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-store.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-store.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-validation.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-validation.unit.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-default-off.test.d.ts +2 -0
- package/dist/__tests__/profiler-default-off.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-phase-catalog.test.d.ts +2 -0
- package/dist/__tests__/profiler-phase-catalog.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-phase-integration.test.d.ts +2 -0
- package/dist/__tests__/profiler-phase-integration.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-phase-token.test.d.ts +2 -0
- package/dist/__tests__/profiler-phase-token.test.d.ts.map +1 -0
- package/dist/__tests__/public-pipeline-id.test-d.d.ts +2 -0
- package/dist/__tests__/public-pipeline-id.test-d.d.ts.map +1 -0
- package/dist/__tests__/public-surface.test-d.d.ts +2 -0
- package/dist/__tests__/public-surface.test-d.d.ts.map +1 -0
- package/dist/__tests__/recover-error-policy-owner.unit.test.d.ts +2 -0
- package/dist/__tests__/recover-error-policy-owner.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-dispatch-membership.unit.test.d.ts +2 -0
- package/dist/__tests__/render-dispatch-membership.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-error-code-owner.test-d.d.ts +2 -0
- package/dist/__tests__/render-error-code-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-error-detail-ssot.test-d.d.ts +2 -0
- package/dist/__tests__/render-error-detail-ssot.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts +2 -0
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-assembly.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-assembly.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-construction.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-construction.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-context.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-context.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-contract.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-contract.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-diagnostics.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-diagnostics.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-docs.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-docs.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-error-code-owner.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-error-code-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-errors.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-errors.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-gpu-buffer-usage-owner.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-gpu-buffer-usage-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-gpu-work.integration.test.d.ts +2 -0
- package/dist/__tests__/render-feature-gpu-work.integration.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-graph.integration.test.d.ts +2 -0
- package/dist/__tests__/render-feature-graph.integration.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-graphics-staging.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-graphics-staging.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-order.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-order.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-diagnostics.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-diagnostics.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-errors.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-errors.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-graphics-docs.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-graphics-docs.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-graphics-isolation.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-graphics-isolation.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-graphics-negative.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-graphics-negative.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-graphics-recording.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-graphics-recording.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-graphics.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-graphics.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-graphics.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-graphics.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-public-surface.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-public-surface.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-retry.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-retry.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-scheduling.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-scheduling.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-stage-failed-policy-owner.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-stage-failed-policy-owner.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-stage-fault-recovery.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-stage-fault-recovery.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-staging.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-staging.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-visibility-context.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-visibility-context.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-visibility-context.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-visibility-context.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-zero-work.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-zero-work.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-compute-raster-gpu.d.ts +7 -0
- package/dist/__tests__/render-graph-compute-raster-gpu.d.ts.map +1 -0
- package/dist/__tests__/render-graph-compute-raster.browser.test.d.ts +2 -0
- package/dist/__tests__/render-graph-compute-raster.browser.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-compute-raster.dawn.test.d.ts +2 -0
- package/dist/__tests__/render-graph-compute-raster.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-hzb-gpu.d.ts +7 -0
- package/dist/__tests__/render-graph-hzb-gpu.d.ts.map +1 -0
- package/dist/__tests__/render-graph-hzb.browser.test.d.ts +2 -0
- package/dist/__tests__/render-graph-hzb.browser.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-hzb.dawn.test.d.ts +2 -0
- package/dist/__tests__/render-graph-hzb.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-primitives.unit.test.d.ts +2 -0
- package/dist/__tests__/render-graph-primitives.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-storage-indirect-gpu.d.ts +12 -0
- package/dist/__tests__/render-graph-storage-indirect-gpu.d.ts.map +1 -0
- package/dist/__tests__/render-graph-storage-indirect.browser.test.d.ts +2 -0
- package/dist/__tests__/render-graph-storage-indirect.browser.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-storage-indirect.dawn.test.d.ts +2 -0
- package/dist/__tests__/render-graph-storage-indirect.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/render-scene-projection.unit.test.d.ts +2 -0
- package/dist/__tests__/render-scene-projection.unit.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-factory-material-contract.unit.test.d.ts +2 -0
- package/dist/__tests__/renderer-factory-material-contract.unit.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-lifecycle.integration.test.d.ts +2 -0
- package/dist/__tests__/renderer-lifecycle.integration.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-render-scene-public.test-d.d.ts +2 -0
- package/dist/__tests__/renderer-render-scene-public.test-d.d.ts.map +1 -0
- package/dist/__tests__/rhi-backend-package-boundary.unit.test.d.ts +2 -0
- package/dist/__tests__/rhi-backend-package-boundary.unit.test.d.ts.map +1 -0
- package/dist/__tests__/scene-temporal-coverage.unit.test.d.ts +2 -0
- package/dist/__tests__/scene-temporal-coverage.unit.test.d.ts.map +1 -0
- package/dist/__tests__/scriptable-pack-consumer.test-d.d.ts +2 -0
- package/dist/__tests__/scriptable-pack-consumer.test-d.d.ts.map +1 -0
- package/dist/__tests__/shader-stage-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/shader-stage-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/ssao-kernel-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/ssao-kernel-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/sun-snapshot-consumers.test.d.ts +2 -0
- package/dist/__tests__/sun-snapshot-consumers.test.d.ts.map +1 -0
- package/dist/__tests__/surface-backend-kind-owner.test-d.d.ts +2 -0
- package/dist/__tests__/surface-backend-kind-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/surface-configuration.unit.test.d.ts +2 -0
- package/dist/__tests__/surface-configuration.unit.test.d.ts.map +1 -0
- package/dist/__tests__/taa-history-store.unit.test.d.ts +2 -0
- package/dist/__tests__/taa-history-store.unit.test.d.ts.map +1 -0
- package/dist/__tests__/temporal-frame-transaction.integration.test.d.ts +2 -0
- package/dist/__tests__/temporal-frame-transaction.integration.test.d.ts.map +1 -0
- package/dist/__tests__/temporal-inspection.unit.test.d.ts +2 -0
- package/dist/__tests__/temporal-inspection.unit.test.d.ts.map +1 -0
- package/dist/__tests__/texture-usage-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/texture-usage-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/typed-pipeline-topology.unit.test.d.ts +2 -0
- package/dist/__tests__/typed-pipeline-topology.unit.test.d.ts.map +1 -0
- package/dist/__tests__/urp-pipeline-targets.unit.test.d.ts +2 -0
- package/dist/__tests__/urp-pipeline-targets.unit.test.d.ts.map +1 -0
- package/dist/__tests__/urp-pipeline.unit.test.d.ts +2 -0
- package/dist/__tests__/urp-pipeline.unit.test.d.ts.map +1 -0
- package/dist/__tests__/vertex-color-pipeline.unit.test.d.ts +2 -0
- package/dist/__tests__/vertex-color-pipeline.unit.test.d.ts.map +1 -0
- package/dist/__tests__/vertex-layout-consumer.unit.test.d.ts +2 -0
- package/dist/__tests__/vertex-layout-consumer.unit.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-diagnostics.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-diagnostics.integration.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-extract.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-extract.integration.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-extract.perf.test.d.ts +2 -0
- package/dist/__tests__/visibility-extract.perf.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-feature-dedup.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-feature-dedup.integration.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-hidden-report.unit.test.d.ts +2 -0
- package/dist/__tests__/visibility-hidden-report.unit.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-instances.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-instances.integration.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-multi-world.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-multi-world.integration.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-producer-matrix.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-producer-matrix.integration.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-producer-matrix.unit.test.d.ts +2 -0
- package/dist/__tests__/visibility-producer-matrix.unit.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-public-surface.test-d.d.ts +2 -0
- package/dist/__tests__/visibility-public-surface.test-d.d.ts.map +1 -0
- package/dist/__tests__/visibility-resolver.unit.test.d.ts +2 -0
- package/dist/__tests__/visibility-resolver.unit.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-snapshot-contract.unit.test.d.ts +2 -0
- package/dist/__tests__/visibility-snapshot-contract.unit.test.d.ts.map +1 -0
- package/dist/__tests__/vocabulary.unit.test.d.ts +2 -0
- package/dist/__tests__/vocabulary.unit.test.d.ts.map +1 -0
- package/dist/assets/__tests__/asset-decoders.unit.test.d.ts +2 -0
- package/dist/assets/__tests__/asset-decoders.unit.test.d.ts.map +1 -0
- package/dist/assets/__tests__/mipmap-generator.unit.test.d.ts +2 -0
- package/dist/assets/__tests__/mipmap-generator.unit.test.d.ts.map +1 -0
- package/dist/assets/__tests__/render-asset-port.unit.test.d.ts +2 -0
- package/dist/assets/__tests__/render-asset-port.unit.test.d.ts.map +1 -0
- package/dist/assets/__tests__/resolve-render-asset.unit.test.d.ts +2 -0
- package/dist/assets/__tests__/resolve-render-asset.unit.test.d.ts.map +1 -0
- package/dist/assets/asset-decoders.d.ts +5 -0
- package/dist/assets/asset-decoders.d.ts.map +1 -0
- package/dist/assets/render-asset-port.d.ts +17 -0
- package/dist/assets/render-asset-port.d.ts.map +1 -0
- package/dist/assets/resolve-render-asset.d.ts +6 -0
- package/dist/assets/resolve-render-asset.d.ts.map +1 -0
- package/dist/authoring.d.ts +12 -0
- package/dist/authoring.d.ts.map +1 -0
- package/dist/authoring.mjs +5 -0
- package/dist/authoring.mjs.map +1 -0
- package/dist/chunk-33UF5SAO.mjs +7397 -0
- package/dist/chunk-33UF5SAO.mjs.map +1 -0
- package/dist/chunk-A5QCJSNL.mjs +29913 -0
- package/dist/chunk-A5QCJSNL.mjs.map +1 -0
- package/dist/chunk-JMSB7AR4.mjs +3 -0
- package/dist/chunk-JMSB7AR4.mjs.map +1 -0
- package/dist/chunk-LXNGO6AO.mjs +569 -0
- package/dist/chunk-LXNGO6AO.mjs.map +1 -0
- package/dist/chunk-QRXPSX4X.mjs +659 -0
- package/dist/chunk-QRXPSX4X.mjs.map +1 -0
- package/dist/chunk-YAKEQPWO.mjs +1439 -0
- package/dist/chunk-YAKEQPWO.mjs.map +1 -0
- package/dist/cluster-binner.d.ts +152 -0
- package/dist/cluster-binner.d.ts.map +1 -0
- package/dist/components/__tests__/atmosphere-red.test.d.ts +2 -0
- package/dist/components/__tests__/atmosphere-red.test.d.ts.map +1 -0
- package/dist/components/__tests__/atmosphere.test.d.ts +2 -0
- package/dist/components/__tests__/atmosphere.test.d.ts.map +1 -0
- package/dist/components/__tests__/fog.test-d.d.ts +2 -0
- package/dist/components/__tests__/fog.test-d.d.ts.map +1 -0
- package/dist/components/__tests__/fog.test.d.ts +2 -0
- package/dist/components/__tests__/fog.test.d.ts.map +1 -0
- package/dist/components/__tests__/schema-parity.unit.test.d.ts +2 -0
- package/dist/components/__tests__/schema-parity.unit.test.d.ts.map +1 -0
- package/dist/components/__tests__/visibility-schema.unit.test.d.ts +2 -0
- package/dist/components/__tests__/visibility-schema.unit.test.d.ts.map +1 -0
- package/dist/components/atmosphere.d.ts +18 -0
- package/dist/components/atmosphere.d.ts.map +1 -0
- package/dist/components/camera.d.ts +311 -0
- package/dist/components/camera.d.ts.map +1 -0
- package/dist/components/directional-light.d.ts +76 -0
- package/dist/components/directional-light.d.ts.map +1 -0
- package/dist/components/environment.d.ts +116 -0
- package/dist/components/environment.d.ts.map +1 -0
- package/dist/components/glyph-text.d.ts +26 -0
- package/dist/components/glyph-text.d.ts.map +1 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/instances.d.ts +41 -0
- package/dist/components/instances.d.ts.map +1 -0
- package/dist/components/layer.d.ts +34 -0
- package/dist/components/layer.d.ts.map +1 -0
- package/dist/components/light-helpers.d.ts +53 -0
- package/dist/components/light-helpers.d.ts.map +1 -0
- package/dist/components/mesh-filter.d.ts +24 -0
- package/dist/components/mesh-filter.d.ts.map +1 -0
- package/dist/components/mesh-renderer.d.ts +33 -0
- package/dist/components/mesh-renderer.d.ts.map +1 -0
- package/dist/components/point-light-shadow.d.ts +27 -0
- package/dist/components/point-light-shadow.d.ts.map +1 -0
- package/dist/components/point-light.d.ts +35 -0
- package/dist/components/point-light.d.ts.map +1 -0
- package/dist/components/post-process-params.d.ts +5 -0
- package/dist/components/post-process-params.d.ts.map +1 -0
- package/dist/components/scene-instance.d.ts +140 -0
- package/dist/components/scene-instance.d.ts.map +1 -0
- package/dist/components/sort-key.d.ts +44 -0
- package/dist/components/sort-key.d.ts.map +1 -0
- package/dist/components/spot-light.d.ts +81 -0
- package/dist/components/spot-light.d.ts.map +1 -0
- package/dist/components/sprite-animation.d.ts +75 -0
- package/dist/components/sprite-animation.d.ts.map +1 -0
- package/dist/components/sprite-instances.d.ts +51 -0
- package/dist/components/sprite-instances.d.ts.map +1 -0
- package/dist/components/sprite-playback-mode.d.ts +37 -0
- package/dist/components/sprite-playback-mode.d.ts.map +1 -0
- package/dist/components/sprite-region-override.d.ts +47 -0
- package/dist/components/sprite-region-override.d.ts.map +1 -0
- package/dist/components/tile-layer.d.ts +101 -0
- package/dist/components/tile-layer.d.ts.map +1 -0
- package/dist/components/tilemap.d.ts +25 -0
- package/dist/components/tilemap.d.ts.map +1 -0
- package/dist/components/visibility.d.ts +22 -0
- package/dist/components/visibility.d.ts.map +1 -0
- package/dist/construct-renderer.d.ts +2 -0
- package/dist/construct-renderer.d.ts.map +1 -0
- package/dist/construct-renderer.mjs +6 -0
- package/dist/construct-renderer.mjs.map +1 -0
- package/dist/debug-draw-glue.d.ts +56 -0
- package/dist/debug-draw-glue.d.ts.map +1 -0
- package/dist/deferred-lighting.d.ts +13 -0
- package/dist/deferred-lighting.d.ts.map +1 -0
- package/dist/dynamic-texture-store.d.ts +42 -0
- package/dist/dynamic-texture-store.d.ts.map +1 -0
- package/dist/engine-metrics.d.ts +23 -0
- package/dist/engine-metrics.d.ts.map +1 -0
- package/dist/environment/__tests__/failure-injection.test.d.ts +2 -0
- package/dist/environment/__tests__/failure-injection.test.d.ts.map +1 -0
- package/dist/environment/__tests__/generation-red.test.d.ts +2 -0
- package/dist/environment/__tests__/generation-red.test.d.ts.map +1 -0
- package/dist/environment/__tests__/generation.test.d.ts +2 -0
- package/dist/environment/__tests__/generation.test.d.ts.map +1 -0
- package/dist/environment/__tests__/graph-transaction.test.d.ts +2 -0
- package/dist/environment/__tests__/graph-transaction.test.d.ts.map +1 -0
- package/dist/environment/__tests__/inspection-red.test.d.ts +2 -0
- package/dist/environment/__tests__/inspection-red.test.d.ts.map +1 -0
- package/dist/environment/__tests__/lifecycle-evidence.test.d.ts +2 -0
- package/dist/environment/__tests__/lifecycle-evidence.test.d.ts.map +1 -0
- package/dist/environment/__tests__/pipeline-topology.test.d.ts +2 -0
- package/dist/environment/__tests__/pipeline-topology.test.d.ts.map +1 -0
- package/dist/environment/__tests__/readiness.test.d.ts +2 -0
- package/dist/environment/__tests__/readiness.test.d.ts.map +1 -0
- package/dist/environment/__tests__/recovery.test.d.ts +2 -0
- package/dist/environment/__tests__/recovery.test.d.ts.map +1 -0
- package/dist/environment/__tests__/resize-dispose.test.d.ts +2 -0
- package/dist/environment/__tests__/resize-dispose.test.d.ts.map +1 -0
- package/dist/environment/__tests__/signature-red.test.d.ts +2 -0
- package/dist/environment/__tests__/signature-red.test.d.ts.map +1 -0
- package/dist/environment/__tests__/signature.test.d.ts +2 -0
- package/dist/environment/__tests__/signature.test.d.ts.map +1 -0
- package/dist/environment/descriptors.d.ts +2 -0
- package/dist/environment/descriptors.d.ts.map +1 -0
- package/dist/environment/extracted-environment.d.ts +53 -0
- package/dist/environment/extracted-environment.d.ts.map +1 -0
- package/dist/environment/generation.d.ts +62 -0
- package/dist/environment/generation.d.ts.map +1 -0
- package/dist/environment/gpu-bundle.d.ts +23 -0
- package/dist/environment/gpu-bundle.d.ts.map +1 -0
- package/dist/environment/graph.d.ts +108 -0
- package/dist/environment/graph.d.ts.map +1 -0
- package/dist/environment/inspection.d.ts +48 -0
- package/dist/environment/inspection.d.ts.map +1 -0
- package/dist/environment/lifecycle.d.ts +22 -0
- package/dist/environment/lifecycle.d.ts.map +1 -0
- package/dist/environment/readiness.d.ts +29 -0
- package/dist/environment/readiness.d.ts.map +1 -0
- package/dist/environment/signature.d.ts +70 -0
- package/dist/environment/signature.d.ts.map +1 -0
- package/dist/errors/ecs-validation.d.ts +3 -0
- package/dist/errors/ecs-validation.d.ts.map +1 -0
- package/dist/errors/index.d.ts +4 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/recover.d.ts +78 -0
- package/dist/errors/recover.d.ts.map +1 -0
- package/dist/errors/render.d.ts +633 -0
- package/dist/errors/render.d.ts.map +1 -0
- package/dist/extract/__tests__/directional-csm-domain.unit.test.d.ts +2 -0
- package/dist/extract/__tests__/directional-csm-domain.unit.test.d.ts.map +1 -0
- package/dist/extract/__tests__/environment-source.test.d.ts +2 -0
- package/dist/extract/__tests__/environment-source.test.d.ts.map +1 -0
- package/dist/extract/__tests__/schema-readers.unit.test.d.ts +2 -0
- package/dist/extract/__tests__/schema-readers.unit.test.d.ts.map +1 -0
- package/dist/extract/directional-csm.d.ts +129 -0
- package/dist/extract/directional-csm.d.ts.map +1 -0
- package/dist/extract/index.d.ts +5 -0
- package/dist/extract/index.d.ts.map +1 -0
- package/dist/extract/material-interface.d.ts +56 -0
- package/dist/extract/material-interface.d.ts.map +1 -0
- package/dist/extract/schema-readers.d.ts +20 -0
- package/dist/extract/schema-readers.d.ts.map +1 -0
- package/dist/extract/visibility.d.ts +26 -0
- package/dist/extract/visibility.d.ts.map +1 -0
- package/dist/features/graph-contribution.d.ts +64 -0
- package/dist/features/graph-contribution.d.ts.map +1 -0
- package/dist/features/host.d.ts +100 -0
- package/dist/features/host.d.ts.map +1 -0
- package/dist/features/index.d.ts +21 -0
- package/dist/features/index.d.ts.map +1 -0
- package/dist/features/morph/index.d.ts +3 -0
- package/dist/features/morph/index.d.ts.map +1 -0
- package/dist/features/morph/morph-bounds.d.ts +42 -0
- package/dist/features/morph/morph-bounds.d.ts.map +1 -0
- package/dist/features/morph/morph-feature.d.ts +45 -0
- package/dist/features/morph/morph-feature.d.ts.map +1 -0
- package/dist/features/prepared-gpu-work.d.ts +113 -0
- package/dist/features/prepared-gpu-work.d.ts.map +1 -0
- package/dist/features/prepared-graphics-store.d.ts +65 -0
- package/dist/features/prepared-graphics-store.d.ts.map +1 -0
- package/dist/features/prepared-graphics.d.ts +225 -0
- package/dist/features/prepared-graphics.d.ts.map +1 -0
- package/dist/features/render-graph-compute.d.ts +13 -0
- package/dist/features/render-graph-compute.d.ts.map +1 -0
- package/dist/features/render-graph-contribution.d.ts +15 -0
- package/dist/features/render-graph-contribution.d.ts.map +1 -0
- package/dist/features/render-graph-raster.d.ts +34 -0
- package/dist/features/render-graph-raster.d.ts.map +1 -0
- package/dist/features/render-graph-resources.d.ts +11 -0
- package/dist/features/render-graph-resources.d.ts.map +1 -0
- package/dist/features/scene-temporal.d.ts +45 -0
- package/dist/features/scene-temporal.d.ts.map +1 -0
- package/dist/features/taa-resolve.d.ts +21 -0
- package/dist/features/taa-resolve.d.ts.map +1 -0
- package/dist/features/targets.d.ts +32 -0
- package/dist/features/targets.d.ts.map +1 -0
- package/dist/features/types.d.ts +247 -0
- package/dist/features/types.d.ts.map +1 -0
- package/dist/frame-chain.d.ts +14 -0
- package/dist/frame-chain.d.ts.map +1 -0
- package/dist/fullscreen-post-process-pass.d.ts +178 -0
- package/dist/fullscreen-post-process-pass.d.ts.map +1 -0
- package/dist/glyph-text-layout-system.d.ts +18 -0
- package/dist/glyph-text-layout-system.d.ts.map +1 -0
- package/dist/gpu-driven/batch-topology.d.ts +124 -0
- package/dist/gpu-driven/batch-topology.d.ts.map +1 -0
- package/dist/gpu-driven/production-raster.d.ts +150 -0
- package/dist/gpu-driven/production-raster.d.ts.map +1 -0
- package/dist/gpu-driven/view-gpu.d.ts +141 -0
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -0
- package/dist/gpu-driven/view-reference.d.ts +15 -0
- package/dist/gpu-driven/view-reference.d.ts.map +1 -0
- package/dist/gpu-resource-store.d.ts +294 -0
- package/dist/gpu-resource-store.d.ts.map +1 -0
- package/dist/gpu-resource.d.ts +73 -0
- package/dist/gpu-resource.d.ts.map +1 -0
- package/dist/gpu-scene-schema.d.ts +171 -0
- package/dist/gpu-scene-schema.d.ts.map +1 -0
- package/dist/gpu-scene.d.ts +81 -0
- package/dist/gpu-scene.d.ts.map +1 -0
- package/dist/gpu-stage.d.ts +4 -0
- package/dist/gpu-stage.d.ts.map +1 -0
- package/dist/gpu-texture-usage.d.ts +6 -0
- package/dist/gpu-texture-usage.d.ts.map +1 -0
- package/dist/gpu-usage.d.ts +9 -0
- package/dist/gpu-usage.d.ts.map +1 -0
- package/dist/hdrp-buffers.d.ts +213 -0
- package/dist/hdrp-buffers.d.ts.map +1 -0
- package/dist/hdrp-cluster-membership.d.ts +2 -0
- package/dist/hdrp-cluster-membership.d.ts.map +1 -0
- package/dist/hdrp-pipeline.d.ts +36 -0
- package/dist/hdrp-pipeline.d.ts.map +1 -0
- package/dist/ibl/IblPipelineCache.d.ts +274 -0
- package/dist/ibl/IblPipelineCache.d.ts.map +1 -0
- package/dist/ibl/cubemap-projection.d.ts +23 -0
- package/dist/ibl/cubemap-projection.d.ts.map +1 -0
- package/dist/ibl/face-uniforms.d.ts +65 -0
- package/dist/ibl/face-uniforms.d.ts.map +1 -0
- package/dist/ibl/skylight-bind-group.d.ts +130 -0
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -0
- package/dist/instance-buffer-cache.d.ts +59 -0
- package/dist/instance-buffer-cache.d.ts.map +1 -0
- package/dist/internal.d.ts +74 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.mjs +45 -0
- package/dist/internal.mjs.map +1 -0
- package/dist/lifecycle.d.ts +28 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/light-buffer-layout.d.ts +164 -0
- package/dist/light-buffer-layout.d.ts.map +1 -0
- package/dist/materials.d.ts +50 -0
- package/dist/materials.d.ts.map +1 -0
- package/dist/mesh-material-bindings.d.ts +44 -0
- package/dist/mesh-material-bindings.d.ts.map +1 -0
- package/dist/mesh-update-errors.d.ts +71 -0
- package/dist/mesh-update-errors.d.ts.map +1 -0
- package/dist/mipmap-generator.d.ts +39 -0
- package/dist/mipmap-generator.d.ts.map +1 -0
- package/dist/param-schema-projection-census.d.ts +18 -0
- package/dist/param-schema-projection-census.d.ts.map +1 -0
- package/dist/pbr-pipeline.d.ts +253 -0
- package/dist/pbr-pipeline.d.ts.map +1 -0
- package/dist/persistent-render-scene.d.ts +158 -0
- package/dist/persistent-render-scene.d.ts.map +1 -0
- package/dist/pipeline/index.d.ts +11 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline-builder.d.ts +122 -0
- package/dist/pipeline-builder.d.ts.map +1 -0
- package/dist/pipeline-errors.d.ts +110 -0
- package/dist/pipeline-errors.d.ts.map +1 -0
- package/dist/pipeline-spec.d.ts +506 -0
- package/dist/pipeline-spec.d.ts.map +1 -0
- package/dist/plugin.d.ts +17 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/post-process-errors.d.ts +182 -0
- package/dist/post-process-errors.d.ts.map +1 -0
- package/dist/prepare/__tests__/schema-readers.unit.test.d.ts +2 -0
- package/dist/prepare/__tests__/schema-readers.unit.test.d.ts.map +1 -0
- package/dist/prepare/index.d.ts +4 -0
- package/dist/prepare/index.d.ts.map +1 -0
- package/dist/prepare/prepared-graphics-resolver.d.ts +62 -0
- package/dist/prepare/prepared-graphics-resolver.d.ts.map +1 -0
- package/dist/prepare/schema-readers.d.ts +11 -0
- package/dist/prepare/schema-readers.d.ts.map +1 -0
- package/dist/record/__tests__/environment-record.test.d.ts +2 -0
- package/dist/record/__tests__/environment-record.test.d.ts.map +1 -0
- package/dist/record/__tests__/frame-targets.unit.test.d.ts +2 -0
- package/dist/record/__tests__/frame-targets.unit.test.d.ts.map +1 -0
- package/dist/record/__tests__/material-bg-cache.unit.test.d.ts +2 -0
- package/dist/record/__tests__/material-bg-cache.unit.test.d.ts.map +1 -0
- package/dist/record/__tests__/material-slot-plan.unit.test.d.ts +2 -0
- package/dist/record/__tests__/material-slot-plan.unit.test.d.ts.map +1 -0
- package/dist/record/__tests__/membership-timing.unit.test.d.ts +2 -0
- package/dist/record/__tests__/membership-timing.unit.test.d.ts.map +1 -0
- package/dist/record/__tests__/render-submission.integration.test.d.ts +2 -0
- package/dist/record/__tests__/render-submission.integration.test.d.ts.map +1 -0
- package/dist/record/__tests__/render-submission.perf.test.d.ts +2 -0
- package/dist/record/__tests__/render-submission.perf.test.d.ts.map +1 -0
- package/dist/record/__tests__/shadow-submit-mode.unit.test.d.ts +2 -0
- package/dist/record/__tests__/shadow-submit-mode.unit.test.d.ts.map +1 -0
- package/dist/record/__tests__/video-texture-view.unit.test.d.ts +2 -0
- package/dist/record/__tests__/video-texture-view.unit.test.d.ts.map +1 -0
- package/dist/record/__tests__/view-ubo-layout.unit.test.d.ts +2 -0
- package/dist/record/__tests__/view-ubo-layout.unit.test.d.ts.map +1 -0
- package/dist/record/frame-lighting.d.ts +187 -0
- package/dist/record/frame-lighting.d.ts.map +1 -0
- package/dist/record/frame-observation.d.ts +38 -0
- package/dist/record/frame-observation.d.ts.map +1 -0
- package/dist/record/frame-snapshot.d.ts +429 -0
- package/dist/record/frame-snapshot.d.ts.map +1 -0
- package/dist/record/frame-targets.d.ts +53 -0
- package/dist/record/frame-targets.d.ts.map +1 -0
- package/dist/record/frame.d.ts +59 -0
- package/dist/record/frame.d.ts.map +1 -0
- package/dist/record/helpers.d.ts +101 -0
- package/dist/record/helpers.d.ts.map +1 -0
- package/dist/record/index.d.ts +15 -0
- package/dist/record/index.d.ts.map +1 -0
- package/dist/record/main-pass-geometry.d.ts +20 -0
- package/dist/record/main-pass-geometry.d.ts.map +1 -0
- package/dist/record/main-pass-material.d.ts +173 -0
- package/dist/record/main-pass-material.d.ts.map +1 -0
- package/dist/record/main-pass-skin.d.ts +46 -0
- package/dist/record/main-pass-skin.d.ts.map +1 -0
- package/dist/record/main-pass-sprite-draws.d.ts +18 -0
- package/dist/record/main-pass-sprite-draws.d.ts.map +1 -0
- package/dist/record/main-pass-sprite.d.ts +69 -0
- package/dist/record/main-pass-sprite.d.ts.map +1 -0
- package/dist/record/main-pass.d.ts +20 -0
- package/dist/record/main-pass.d.ts.map +1 -0
- package/dist/record/material-payload.d.ts +43 -0
- package/dist/record/material-payload.d.ts.map +1 -0
- package/dist/record/material-slot-plan.d.ts +26 -0
- package/dist/record/material-slot-plan.d.ts.map +1 -0
- package/dist/record/membership-timing.d.ts +232 -0
- package/dist/record/membership-timing.d.ts.map +1 -0
- package/dist/record/mesh-ssbo.d.ts +173 -0
- package/dist/record/mesh-ssbo.d.ts.map +1 -0
- package/dist/record/shadow-caster-uniform.d.ts +8 -0
- package/dist/record/shadow-caster-uniform.d.ts.map +1 -0
- package/dist/record/shadow-pass.d.ts +125 -0
- package/dist/record/shadow-pass.d.ts.map +1 -0
- package/dist/record/shadow-submit-mode.d.ts +66 -0
- package/dist/record/shadow-submit-mode.d.ts.map +1 -0
- package/dist/record/skybox-post-pass.d.ts +33 -0
- package/dist/record/skybox-post-pass.d.ts.map +1 -0
- package/dist/record/typed-frame-graph.d.ts +13 -0
- package/dist/record/typed-frame-graph.d.ts.map +1 -0
- package/dist/record/view-ubo.d.ts +39 -0
- package/dist/record/view-ubo.d.ts.map +1 -0
- package/dist/render-data.d.ts +143 -0
- package/dist/render-data.d.ts.map +1 -0
- package/dist/render-dispatch-membership.d.ts +47 -0
- package/dist/render-dispatch-membership.d.ts.map +1 -0
- package/dist/render-graph-primitives.d.ts +424 -0
- package/dist/render-graph-primitives.d.ts.map +1 -0
- package/dist/render-pipeline-context.d.ts +289 -0
- package/dist/render-pipeline-context.d.ts.map +1 -0
- package/dist/render-pipeline-target.d.ts +16 -0
- package/dist/render-pipeline-target.d.ts.map +1 -0
- package/dist/render-pipeline.d.ts +149 -0
- package/dist/render-pipeline.d.ts.map +1 -0
- package/dist/render-scene-projection.d.ts +174 -0
- package/dist/render-scene-projection.d.ts.map +1 -0
- package/dist/render-system-extract.d.ts +1096 -0
- package/dist/render-system-extract.d.ts.map +1 -0
- package/dist/render-system-fold.d.ts +266 -0
- package/dist/render-system-fold.d.ts.map +1 -0
- package/dist/render-system.d.ts +814 -0
- package/dist/render-system.d.ts.map +1 -0
- package/dist/renderer/asset-service.d.ts +10 -0
- package/dist/renderer/asset-service.d.ts.map +1 -0
- package/dist/renderer/backend-selection.d.ts +26 -0
- package/dist/renderer/backend-selection.d.ts.map +1 -0
- package/dist/renderer/environment-classify.d.ts +6 -0
- package/dist/renderer/environment-classify.d.ts.map +1 -0
- package/dist/renderer/environment-error.d.ts +13 -0
- package/dist/renderer/environment-error.d.ts.map +1 -0
- package/dist/renderer/material/assembly.d.ts +22 -0
- package/dist/renderer/material/assembly.d.ts.map +1 -0
- package/dist/renderer/material/pipeline-projection.d.ts +91 -0
- package/dist/renderer/material/pipeline-projection.d.ts.map +1 -0
- package/dist/renderer/renderer-factory.d.ts +283 -0
- package/dist/renderer/renderer-factory.d.ts.map +1 -0
- package/dist/renderer.d.ts +771 -0
- package/dist/renderer.d.ts.map +1 -0
- package/dist/scene-instances/post-spawn-resolve-joints.d.ts +33 -0
- package/dist/scene-instances/post-spawn-resolve-joints.d.ts.map +1 -0
- package/dist/scene-utils/collect-subtree.d.ts +11 -0
- package/dist/scene-utils/collect-subtree.d.ts.map +1 -0
- package/dist/shadow-atlas.d.ts +117 -0
- package/dist/shadow-atlas.d.ts.map +1 -0
- package/dist/ssao-buffers.d.ts +31 -0
- package/dist/ssao-buffers.d.ts.map +1 -0
- package/dist/ssao-config.d.ts +28 -0
- package/dist/ssao-config.d.ts.map +1 -0
- package/dist/ssao-data.d.ts +34 -0
- package/dist/ssao-data.d.ts.map +1 -0
- package/dist/surface-format.d.ts +10 -0
- package/dist/surface-format.d.ts.map +1 -0
- package/dist/systems/active-camera.d.ts +53 -0
- package/dist/systems/active-camera.d.ts.map +1 -0
- package/dist/systems/pass-selector.d.ts +24 -0
- package/dist/systems/pass-selector.d.ts.map +1 -0
- package/dist/systems/skin-palette-allocator.d.ts +51 -0
- package/dist/systems/skin-palette-allocator.d.ts.map +1 -0
- package/dist/systems/transparent-sort-config.d.ts +91 -0
- package/dist/systems/transparent-sort-config.d.ts.map +1 -0
- package/dist/taa-history-store.d.ts +88 -0
- package/dist/taa-history-store.d.ts.map +1 -0
- package/dist/temporal-coverage.d.ts +35 -0
- package/dist/temporal-coverage.d.ts.map +1 -0
- package/dist/temporal-frame-transaction.d.ts +92 -0
- package/dist/temporal-frame-transaction.d.ts.map +1 -0
- package/dist/temporal-inspection.d.ts +57 -0
- package/dist/temporal-inspection.d.ts.map +1 -0
- package/dist/temporal-view.d.ts +43 -0
- package/dist/temporal-view.d.ts.map +1 -0
- package/dist/tilemap/resolve-tileset-runtime.d.ts +23 -0
- package/dist/tilemap/resolve-tileset-runtime.d.ts.map +1 -0
- package/dist/tilemap-chunk-extract-system.d.ts +142 -0
- package/dist/tilemap-chunk-extract-system.d.ts.map +1 -0
- package/dist/typed-render-graph-primitives.d.ts +59 -0
- package/dist/typed-render-graph-primitives.d.ts.map +1 -0
- package/dist/typed-shadow-passes.d.ts +11 -0
- package/dist/typed-shadow-passes.d.ts.map +1 -0
- package/dist/urp-pipeline.d.ts +4 -0
- package/dist/urp-pipeline.d.ts.map +1 -0
- package/package.json +94 -0
- package/src/__tests__/analytic-sky-contract.test.ts +27 -0
- package/src/__tests__/analytic-sky-falsify-carriers.mjs +43 -0
- package/src/__tests__/analytic-sky-falsify.test.ts +94 -0
- package/src/__tests__/assets-runtime-handoff.integration.test.ts +36 -0
- package/src/__tests__/authoring-path.unit.test.ts +14 -0
- package/src/__tests__/backend-selection-rhi-capture.test-d.ts +21 -0
- package/src/__tests__/backend-selection.integration.test.ts +11 -0
- package/src/__tests__/callback-inference.test-d.ts +5 -0
- package/src/__tests__/camera-temporal.test-d.ts +8 -0
- package/src/__tests__/camera-temporal.test.ts +188 -0
- package/src/__tests__/cluster-binner.test.ts +272 -0
- package/src/__tests__/cluster-grid-default-surface.unit.test.ts +17 -0
- package/src/__tests__/construct-renderer-identity.unit.test.ts +10 -0
- package/src/__tests__/direct-extract-consumer-contract.test-d.ts +34 -0
- package/src/__tests__/direct-light-snapshot.unit.test.ts +71 -0
- package/src/__tests__/directional-shadow-probe-atlas-layout.unit.test.ts +18 -0
- package/src/__tests__/environment-inspection.test.ts +45 -0
- package/src/__tests__/factory-contract.integration.test.ts +331 -0
- package/src/__tests__/fallback-row-stride-surface.unit.test.ts +18 -0
- package/src/__tests__/fog-ai-user.fixture.ts +350 -0
- package/src/__tests__/fog-custom-render-feature.fixture.ts +33 -0
- package/src/__tests__/fog-custom-render-feature.integration.test.ts +76 -0
- package/src/__tests__/fog-inspection.integration.test.ts +127 -0
- package/src/__tests__/fog-owner-state.integration.test.ts +112 -0
- package/src/__tests__/fog-pipeline-topology.integration.test.ts +93 -0
- package/src/__tests__/fog-public-surface.integration.test.ts +60 -0
- package/src/__tests__/fog-ray-contract.integration.test.ts +73 -0
- package/src/__tests__/fog-source-absence.integration.test.ts +51 -0
- package/src/__tests__/fog-temporal.integration.test.ts +115 -0
- package/src/__tests__/frame-chain.unit.test.ts +26 -0
- package/src/__tests__/frame-observation.contract.test.ts +103 -0
- package/src/__tests__/glyph-text-layout-recovery.unit.test.ts +172 -0
- package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +347 -0
- package/src/__tests__/gpu-driven-indirect-raster.browser.test.ts +12 -0
- package/src/__tests__/gpu-driven-indirect-raster.dawn.test.ts +16 -0
- package/src/__tests__/gpu-driven-production.integration.test.ts +609 -0
- package/src/__tests__/gpu-driven-scaling.unit.test.ts +90 -0
- package/src/__tests__/gpu-driven-view-gpu-evidence.ts +192 -0
- package/src/__tests__/gpu-driven-view-graph.integration.test.ts +128 -0
- package/src/__tests__/gpu-driven-view.browser.test.ts +19 -0
- package/src/__tests__/gpu-driven-view.dawn.test.ts +17 -0
- package/src/__tests__/gpu-driven-view.unit.test.ts +455 -0
- package/src/__tests__/gpu-resource-store-stride.unit.test.ts +59 -0
- package/src/__tests__/gpu-scene-field-type-owner.test-d.ts +27 -0
- package/src/__tests__/gpu-scene-render-graph-gpu.ts +309 -0
- package/src/__tests__/gpu-scene-render-graph.browser.test.ts +19 -0
- package/src/__tests__/gpu-scene-render-graph.dawn.test.ts +19 -0
- package/src/__tests__/gpu-scene-schema.unit.test.ts +16 -0
- package/src/__tests__/gpu-scene.dawn.test.ts +209 -0
- package/src/__tests__/gpu-scene.unit.test.ts +161 -0
- package/src/__tests__/hdrp-pipeline.unit.test.ts +100 -0
- package/src/__tests__/ibl/ibl-fallback.unit.test.ts +23 -0
- package/src/__tests__/infinite-grid-no-vertex-probe.unit.test.ts +124 -0
- package/src/__tests__/injection-kind-owner.test-d.ts +14 -0
- package/src/__tests__/ktx2-basis-gpu-consumer.dawn.test.ts +719 -0
- package/src/__tests__/light-buffer-layout.unit.test.ts +85 -0
- package/src/__tests__/material-contract-inventory.unit.test.ts +24 -0
- package/src/__tests__/material-cooked-projection.unit.test.ts +177 -0
- package/src/__tests__/material-derived-error-stop-draw.integration.test.ts +69 -0
- package/src/__tests__/material-derived-payload.integration.test.ts +164 -0
- package/src/__tests__/material-snapshot-mutation.integration.test.ts +58 -0
- package/src/__tests__/material-static-dynamic-route.unit.test.ts +113 -0
- package/src/__tests__/material-stride-surface.unit.test.ts +32 -0
- package/src/__tests__/materials.unit.test.ts +25 -0
- package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +107 -0
- package/src/__tests__/mesh-material-bindings.unit.test.ts +89 -0
- package/src/__tests__/mesh-stride-surface.unit.test.ts +16 -0
- package/src/__tests__/morph-culling-reentry.dawn.test.ts +166 -0
- package/src/__tests__/morph-feature-gpu-work.integration.test.ts +78 -0
- package/src/__tests__/morph-visual-evidence.integration.test.ts +66 -0
- package/src/__tests__/nineslice-handle-surface.unit.test.ts +14 -0
- package/src/__tests__/param-schema-projection-census.unit.test.ts +40 -0
- package/src/__tests__/persistent-render-scene.unit.test.ts +1311 -0
- package/src/__tests__/pipeline-error-policy-owner.unit.test.ts +167 -0
- package/src/__tests__/pipeline-pass-trace.test.ts +92 -0
- package/src/__tests__/pipeline-stage-owner.test-d.ts +13 -0
- package/src/__tests__/plugin.test.ts +25 -0
- package/src/__tests__/post-process-error-policy-owner.unit.test.ts +208 -0
- package/src/__tests__/prepared-buffer-kind-owner.test-d.ts +29 -0
- package/src/__tests__/prepared-graphics-backend-matrix.unit.test.ts +129 -0
- package/src/__tests__/prepared-graphics-capability.unit.test.ts +140 -0
- package/src/__tests__/prepared-graphics-generation.unit.test.ts +175 -0
- package/src/__tests__/prepared-graphics-lifecycle.unit.test.ts +206 -0
- package/src/__tests__/prepared-graphics-pipeline-warmup.unit.test.ts +29 -0
- package/src/__tests__/prepared-graphics-resolver-recording.unit.test.ts +180 -0
- package/src/__tests__/prepared-graphics-resolver.unit.test.ts +287 -0
- package/src/__tests__/prepared-graphics-snapshot.unit.test.ts +105 -0
- package/src/__tests__/prepared-graphics-store.unit.test.ts +154 -0
- package/src/__tests__/prepared-graphics-validation.unit.test.ts +176 -0
- package/src/__tests__/profiler-default-off.test.ts +22 -0
- package/src/__tests__/profiler-phase-catalog.test.ts +66 -0
- package/src/__tests__/profiler-phase-integration.test.ts +70 -0
- package/src/__tests__/profiler-phase-token.test.ts +84 -0
- package/src/__tests__/public-pipeline-id.test-d.ts +6 -0
- package/src/__tests__/public-surface.test-d.ts +32 -0
- package/src/__tests__/recover-error-policy-owner.unit.test.ts +127 -0
- package/src/__tests__/render-dispatch-membership.unit.test.ts +117 -0
- package/src/__tests__/render-error-code-owner.test-d.ts +115 -0
- package/src/__tests__/render-error-detail-ssot.test-d.ts +234 -0
- package/src/__tests__/render-error-exhaustive.test-d.ts +84 -0
- package/src/__tests__/render-feature-assembly.test-d.ts +51 -0
- package/src/__tests__/render-feature-construction.unit.test.ts +124 -0
- package/src/__tests__/render-feature-context.test-d.ts +81 -0
- package/src/__tests__/render-feature-contract.test-d.ts +58 -0
- package/src/__tests__/render-feature-diagnostics.unit.test.ts +151 -0
- package/src/__tests__/render-feature-docs.unit.test.ts +88 -0
- package/src/__tests__/render-feature-error-code-owner.test-d.ts +27 -0
- package/src/__tests__/render-feature-errors.unit.test.ts +47 -0
- package/src/__tests__/render-feature-gpu-buffer-usage-owner.test-d.ts +46 -0
- package/src/__tests__/render-feature-gpu-work.integration.test.ts +377 -0
- package/src/__tests__/render-feature-graph.integration.test.ts +205 -0
- package/src/__tests__/render-feature-graphics-staging.unit.test.ts +200 -0
- package/src/__tests__/render-feature-order.unit.test.ts +66 -0
- package/src/__tests__/render-feature-prepared-diagnostics.unit.test.ts +101 -0
- package/src/__tests__/render-feature-prepared-errors.test-d.ts +82 -0
- package/src/__tests__/render-feature-prepared-graphics-docs.unit.test.ts +141 -0
- package/src/__tests__/render-feature-prepared-graphics-isolation.unit.test.ts +122 -0
- package/src/__tests__/render-feature-prepared-graphics-negative.test-d.ts +59 -0
- package/src/__tests__/render-feature-prepared-graphics-recording.unit.test.ts +107 -0
- package/src/__tests__/render-feature-prepared-graphics.test-d.ts +96 -0
- package/src/__tests__/render-feature-prepared-graphics.unit.test.ts +121 -0
- package/src/__tests__/render-feature-public-surface.test-d.ts +75 -0
- package/src/__tests__/render-feature-retry.unit.test.ts +128 -0
- package/src/__tests__/render-feature-scheduling.unit.test.ts +122 -0
- package/src/__tests__/render-feature-stage-failed-policy-owner.unit.test.ts +146 -0
- package/src/__tests__/render-feature-stage-fault-recovery.unit.test.ts +236 -0
- package/src/__tests__/render-feature-staging.unit.test.ts +94 -0
- package/src/__tests__/render-feature-visibility-context.test-d.ts +38 -0
- package/src/__tests__/render-feature-visibility-context.unit.test.ts +38 -0
- package/src/__tests__/render-feature-zero-work.unit.test.ts +82 -0
- package/src/__tests__/render-graph-compute-raster-gpu.ts +342 -0
- package/src/__tests__/render-graph-compute-raster.browser.test.ts +16 -0
- package/src/__tests__/render-graph-compute-raster.dawn.test.ts +22 -0
- package/src/__tests__/render-graph-hzb-gpu.ts +239 -0
- package/src/__tests__/render-graph-hzb.browser.test.ts +16 -0
- package/src/__tests__/render-graph-hzb.dawn.test.ts +23 -0
- package/src/__tests__/render-graph-primitives.unit.test.ts +22 -0
- package/src/__tests__/render-graph-storage-indirect-gpu.ts +162 -0
- package/src/__tests__/render-graph-storage-indirect.browser.test.ts +21 -0
- package/src/__tests__/render-graph-storage-indirect.dawn.test.ts +28 -0
- package/src/__tests__/render-scene-projection.unit.test.ts +206 -0
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +125 -0
- package/src/__tests__/renderer-lifecycle.integration.test.ts +10 -0
- package/src/__tests__/renderer-render-scene-public.test-d.ts +27 -0
- package/src/__tests__/rhi-backend-package-boundary.unit.test.ts +11 -0
- package/src/__tests__/scene-temporal-coverage.unit.test.ts +259 -0
- package/src/__tests__/scriptable-pack-consumer.test-d.ts +14 -0
- package/src/__tests__/shader-stage-surface.unit.test.ts +38 -0
- package/src/__tests__/ssao-kernel-surface.unit.test.ts +15 -0
- package/src/__tests__/sun-snapshot-consumers.test.ts +35 -0
- package/src/__tests__/surface-backend-kind-owner.test-d.ts +42 -0
- package/src/__tests__/surface-configuration.unit.test.ts +92 -0
- package/src/__tests__/taa-history-store.unit.test.ts +196 -0
- package/src/__tests__/temporal-frame-transaction.integration.test.ts +537 -0
- package/src/__tests__/temporal-inspection.unit.test.ts +138 -0
- package/src/__tests__/texture-usage-surface.unit.test.ts +61 -0
- package/src/__tests__/typed-pipeline-topology.unit.test.ts +389 -0
- package/src/__tests__/urp-pipeline-targets.unit.test.ts +52 -0
- package/src/__tests__/urp-pipeline.unit.test.ts +14 -0
- package/src/__tests__/vertex-color-pipeline.unit.test.ts +124 -0
- package/src/__tests__/vertex-layout-consumer.unit.test.ts +25 -0
- package/src/__tests__/visibility-diagnostics.integration.test.ts +66 -0
- package/src/__tests__/visibility-extract.integration.test.ts +89 -0
- package/src/__tests__/visibility-extract.perf.test.ts +96 -0
- package/src/__tests__/visibility-feature-dedup.integration.test.ts +57 -0
- package/src/__tests__/visibility-hidden-report.unit.test.ts +37 -0
- package/src/__tests__/visibility-instances.integration.test.ts +50 -0
- package/src/__tests__/visibility-multi-world.integration.test.ts +54 -0
- package/src/__tests__/visibility-producer-matrix.integration.test.ts +191 -0
- package/src/__tests__/visibility-producer-matrix.unit.test.ts +96 -0
- package/src/__tests__/visibility-public-surface.test-d.ts +26 -0
- package/src/__tests__/visibility-resolver.unit.test.ts +84 -0
- package/src/__tests__/visibility-snapshot-contract.unit.test.ts +59 -0
- package/src/__tests__/vocabulary.unit.test.ts +21 -0
- package/src/assets/__tests__/asset-decoders.unit.test.ts +92 -0
- package/src/assets/__tests__/mipmap-generator.unit.test.ts +52 -0
- package/src/assets/__tests__/render-asset-port.unit.test.ts +54 -0
- package/src/assets/__tests__/resolve-render-asset.unit.test.ts +47 -0
- package/src/assets/asset-decoders.ts +158 -0
- package/src/assets/render-asset-port.ts +44 -0
- package/src/assets/resolve-render-asset.ts +13 -0
- package/src/authoring.ts +24 -0
- package/src/cluster-binner.ts +700 -0
- package/src/components/__tests__/atmosphere-red.test.ts +51 -0
- package/src/components/__tests__/atmosphere.test.ts +79 -0
- package/src/components/__tests__/fog.test-d.ts +49 -0
- package/src/components/__tests__/fog.test.ts +60 -0
- package/src/components/__tests__/schema-parity.unit.test.ts +25 -0
- package/src/components/__tests__/visibility-schema.unit.test.ts +35 -0
- package/src/components/atmosphere.ts +64 -0
- package/src/components/camera.ts +512 -0
- package/src/components/directional-light.ts +120 -0
- package/src/components/environment.ts +206 -0
- package/src/components/glyph-text.ts +63 -0
- package/src/components/index.ts +49 -0
- package/src/components/instances.ts +207 -0
- package/src/components/layer.ts +69 -0
- package/src/components/light-helpers.ts +188 -0
- package/src/components/mesh-filter.ts +59 -0
- package/src/components/mesh-renderer.ts +61 -0
- package/src/components/point-light-shadow.ts +43 -0
- package/src/components/point-light.ts +65 -0
- package/src/components/post-process-params.ts +35 -0
- package/src/components/scene-instance.ts +193 -0
- package/src/components/sort-key.ts +75 -0
- package/src/components/spot-light.ts +124 -0
- package/src/components/sprite-animation.ts +169 -0
- package/src/components/sprite-instances.ts +179 -0
- package/src/components/sprite-playback-mode.ts +73 -0
- package/src/components/sprite-region-override.ts +106 -0
- package/src/components/tile-layer.ts +161 -0
- package/src/components/tilemap.ts +48 -0
- package/src/components/visibility.ts +53 -0
- package/src/construct-renderer.ts +4 -0
- package/src/debug-draw-glue.ts +169 -0
- package/src/deferred-lighting.ts +92 -0
- package/src/dynamic-texture-store.ts +111 -0
- package/src/engine-metrics.ts +89 -0
- package/src/environment/README.md +76 -0
- package/src/environment/__tests__/failure-injection.test.ts +50 -0
- package/src/environment/__tests__/generation-red.test.ts +64 -0
- package/src/environment/__tests__/generation.test.ts +37 -0
- package/src/environment/__tests__/graph-transaction.test.ts +85 -0
- package/src/environment/__tests__/inspection-red.test.ts +53 -0
- package/src/environment/__tests__/lifecycle-evidence.test.ts +40 -0
- package/src/environment/__tests__/pipeline-topology.test.ts +33 -0
- package/src/environment/__tests__/readiness.test.ts +42 -0
- package/src/environment/__tests__/recovery.test.ts +62 -0
- package/src/environment/__tests__/resize-dispose.test.ts +30 -0
- package/src/environment/__tests__/signature-red.test.ts +45 -0
- package/src/environment/__tests__/signature.test.ts +60 -0
- package/src/environment/descriptors.ts +7 -0
- package/src/environment/extracted-environment.ts +239 -0
- package/src/environment/generation.ts +158 -0
- package/src/environment/gpu-bundle.ts +144 -0
- package/src/environment/graph.ts +588 -0
- package/src/environment/inspection.ts +107 -0
- package/src/environment/lifecycle.ts +124 -0
- package/src/environment/readiness.ts +76 -0
- package/src/environment/signature.ts +185 -0
- package/src/errors/ecs-validation.ts +16 -0
- package/src/errors/index.ts +3 -0
- package/src/errors/recover.ts +119 -0
- package/src/errors/render.ts +1244 -0
- package/src/extract/__tests__/directional-csm-domain.unit.test.ts +391 -0
- package/src/extract/__tests__/environment-source.test.ts +105 -0
- package/src/extract/__tests__/schema-readers.unit.test.ts +16 -0
- package/src/extract/directional-csm.ts +959 -0
- package/src/extract/index.ts +10 -0
- package/src/extract/material-interface.ts +604 -0
- package/src/extract/schema-readers.ts +27 -0
- package/src/extract/visibility.ts +120 -0
- package/src/features/graph-contribution.ts +577 -0
- package/src/features/host.ts +1097 -0
- package/src/features/index.ts +100 -0
- package/src/features/morph/index.ts +24 -0
- package/src/features/morph/morph-bounds.ts +123 -0
- package/src/features/morph/morph-feature.ts +287 -0
- package/src/features/prepared-gpu-work.ts +902 -0
- package/src/features/prepared-graphics-store.ts +435 -0
- package/src/features/prepared-graphics.ts +479 -0
- package/src/features/render-graph-compute.ts +60 -0
- package/src/features/render-graph-contribution.ts +95 -0
- package/src/features/render-graph-raster.ts +308 -0
- package/src/features/render-graph-resources.ts +36 -0
- package/src/features/scene-temporal.ts +274 -0
- package/src/features/taa-resolve.ts +244 -0
- package/src/features/targets.ts +83 -0
- package/src/features/types.ts +291 -0
- package/src/frame-chain.ts +21 -0
- package/src/fullscreen-post-process-pass.ts +406 -0
- package/src/glyph-text-layout-system.ts +447 -0
- package/src/gpu-driven/batch-topology.ts +423 -0
- package/src/gpu-driven/production-raster.ts +1705 -0
- package/src/gpu-driven/view-gpu.ts +849 -0
- package/src/gpu-driven/view-reference.ts +110 -0
- package/src/gpu-resource-store.ts +1921 -0
- package/src/gpu-resource.ts +159 -0
- package/src/gpu-scene-schema.ts +224 -0
- package/src/gpu-scene.ts +855 -0
- package/src/gpu-stage.ts +9 -0
- package/src/gpu-texture-usage.ts +12 -0
- package/src/gpu-usage.ts +14 -0
- package/src/hdrp-buffers.ts +689 -0
- package/src/hdrp-cluster-membership.ts +70 -0
- package/src/hdrp-pipeline.ts +525 -0
- package/src/ibl/IblPipelineCache.ts +1246 -0
- package/src/ibl/cubemap-projection.ts +60 -0
- package/src/ibl/face-uniforms.ts +150 -0
- package/src/ibl/skylight-bind-group.ts +513 -0
- package/src/index.ts +271 -0
- package/src/instance-buffer-cache.ts +123 -0
- package/src/internal.ts +88 -0
- package/src/lifecycle.ts +123 -0
- package/src/light-buffer-layout.ts +346 -0
- package/src/materials.ts +236 -0
- package/src/mesh-material-bindings.ts +104 -0
- package/src/mesh-update-errors.ts +113 -0
- package/src/mipmap-generator.ts +244 -0
- package/src/param-schema-projection-census.ts +73 -0
- package/src/pbr-pipeline.ts +749 -0
- package/src/persistent-render-scene.ts +1752 -0
- package/src/pipeline/index.ts +40 -0
- package/src/pipeline-builder.ts +386 -0
- package/src/pipeline-errors.ts +172 -0
- package/src/pipeline-spec.ts +1768 -0
- package/src/plugin.ts +137 -0
- package/src/post-process-errors.ts +304 -0
- package/src/prepare/__tests__/schema-readers.unit.test.ts +16 -0
- package/src/prepare/index.ts +8 -0
- package/src/prepare/prepared-graphics-resolver.ts +455 -0
- package/src/prepare/schema-readers.ts +20 -0
- package/src/record/__tests__/environment-record.test.ts +35 -0
- package/src/record/__tests__/frame-targets.unit.test.ts +54 -0
- package/src/record/__tests__/material-bg-cache.unit.test.ts +41 -0
- package/src/record/__tests__/material-slot-plan.unit.test.ts +76 -0
- package/src/record/__tests__/membership-timing.unit.test.ts +524 -0
- package/src/record/__tests__/render-submission.integration.test.ts +76 -0
- package/src/record/__tests__/render-submission.perf.test.ts +141 -0
- package/src/record/__tests__/shadow-submit-mode.unit.test.ts +88 -0
- package/src/record/__tests__/video-texture-view.unit.test.ts +90 -0
- package/src/record/__tests__/view-ubo-layout.unit.test.ts +101 -0
- package/src/record/frame-lighting.ts +1183 -0
- package/src/record/frame-observation.ts +122 -0
- package/src/record/frame-snapshot.ts +515 -0
- package/src/record/frame-targets.ts +372 -0
- package/src/record/frame.ts +1874 -0
- package/src/record/helpers.ts +289 -0
- package/src/record/index.ts +15 -0
- package/src/record/main-pass-geometry.ts +1014 -0
- package/src/record/main-pass-material.ts +716 -0
- package/src/record/main-pass-skin.ts +51 -0
- package/src/record/main-pass-sprite-draws.ts +1056 -0
- package/src/record/main-pass-sprite.ts +166 -0
- package/src/record/main-pass.ts +588 -0
- package/src/record/material-payload.ts +292 -0
- package/src/record/material-slot-plan.ts +68 -0
- package/src/record/membership-timing.ts +1012 -0
- package/src/record/mesh-ssbo.ts +406 -0
- package/src/record/shadow-caster-uniform.ts +37 -0
- package/src/record/shadow-pass.ts +2387 -0
- package/src/record/shadow-submit-mode.ts +277 -0
- package/src/record/skybox-post-pass.ts +594 -0
- package/src/record/typed-frame-graph.ts +499 -0
- package/src/record/view-ubo.ts +206 -0
- package/src/render-data.ts +385 -0
- package/src/render-dispatch-membership.ts +155 -0
- package/src/render-graph-primitives.ts +1586 -0
- package/src/render-pipeline-context.ts +332 -0
- package/src/render-pipeline-target.ts +96 -0
- package/src/render-pipeline.ts +343 -0
- package/src/render-scene-projection.ts +1738 -0
- package/src/render-system-extract.ts +5203 -0
- package/src/render-system-fold.ts +531 -0
- package/src/render-system.ts +3258 -0
- package/src/renderer/asset-service.ts +32 -0
- package/src/renderer/backend-selection.ts +121 -0
- package/src/renderer/environment-classify.ts +30 -0
- package/src/renderer/environment-error.ts +19 -0
- package/src/renderer/material/assembly.ts +53 -0
- package/src/renderer/material/pipeline-projection.ts +140 -0
- package/src/renderer/renderer-factory.ts +9062 -0
- package/src/renderer.ts +940 -0
- package/src/scene-instances/post-spawn-resolve-joints.ts +168 -0
- package/src/scene-utils/collect-subtree.ts +40 -0
- package/src/shadow-atlas.ts +244 -0
- package/src/ssao-buffers.ts +175 -0
- package/src/ssao-config.ts +61 -0
- package/src/ssao-data.ts +106 -0
- package/src/surface-format.ts +37 -0
- package/src/systems/active-camera.ts +116 -0
- package/src/systems/pass-selector.ts +49 -0
- package/src/systems/skin-palette-allocator.ts +294 -0
- package/src/systems/transparent-sort-config.ts +211 -0
- package/src/taa-history-store.ts +429 -0
- package/src/temporal-coverage.ts +106 -0
- package/src/temporal-frame-transaction.ts +301 -0
- package/src/temporal-inspection.ts +194 -0
- package/src/temporal-view.ts +174 -0
- package/src/tilemap/resolve-tileset-runtime.ts +72 -0
- package/src/tilemap-chunk-extract-system.ts +1307 -0
- package/src/typed-render-graph-primitives.ts +530 -0
- package/src/typed-shadow-passes.ts +195 -0
- package/src/urp-pipeline.ts +340 -0
|
@@ -0,0 +1,1246 @@
|
|
|
1
|
+
// IblPipelineCache.ts -- Per-device WeakMap pipeline cache for IBL precompute.
|
|
2
|
+
//
|
|
3
|
+
// Plan-strategy D-1/D-7: cache for 4 GPU passes (equirect->cube /
|
|
4
|
+
// irradiance / prefilter / BRDF LUT). M2 provides the cache skeleton;
|
|
5
|
+
// M3 (t18/t20) wires real shader math from ibl.wgsl.
|
|
6
|
+
//
|
|
7
|
+
// Structure mirrors mipmap-generator.ts per-device WeakMap pattern:
|
|
8
|
+
// WeakMap<device, IblPipelineCachePerDevice>
|
|
9
|
+
//
|
|
10
|
+
// Public surface (M3):
|
|
11
|
+
// - getOrCreateIblCache(device): get or initialize per-device cache
|
|
12
|
+
// - iblCacheSize(): introspection hook
|
|
13
|
+
// - hasIblCache(device): introspection hook
|
|
14
|
+
// - setIblWgslSource(source): set the ibl.wgsl WGSL source string
|
|
15
|
+
// - createIblShaderModules(device, factory): create shader modules from ibl.wgsl
|
|
16
|
+
// - createIblPipelines(device, factory, modules): create 4 render pipelines
|
|
17
|
+
// - runIblPrecompute(opts): execute 4 GPU precompute passes (M3 t20)
|
|
18
|
+
//
|
|
19
|
+
// M3 t20: pipeline slots are filled with real render pipelines loaded from
|
|
20
|
+
// ibl.wgsl, replacing the M2 stub undefined slots. The 4 GPU passes are
|
|
21
|
+
// executed in the standard order (equirect->cube -> irradiance -> prefilter
|
|
22
|
+
// -> BRDF LUT), with counters set post-execution per AC-04/05/06.
|
|
23
|
+
|
|
24
|
+
// ─── Device shim shapes ──────────────────────────────────────────────────────
|
|
25
|
+
|
|
26
|
+
import { GPU_SHADER_STAGE_FRAGMENT, GPU_SHADER_STAGE_VERTEX } from '../gpu-stage';
|
|
27
|
+
import {
|
|
28
|
+
GPU_TEXTURE_USAGE_COPY_DST,
|
|
29
|
+
GPU_TEXTURE_USAGE_COPY_SRC,
|
|
30
|
+
GPU_TEXTURE_USAGE_RENDER_ATTACHMENT_AND_TEXTURE_BINDING,
|
|
31
|
+
} from '../gpu-texture-usage';
|
|
32
|
+
import { cubemapCaptureProjection } from './cubemap-projection';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Shader module factory (async, injected via configureGpuDevice).
|
|
36
|
+
* Mirrors `MipmapShaderModuleFactory` from mipmap-generator.
|
|
37
|
+
*/
|
|
38
|
+
export type IblShaderModuleFactory = (
|
|
39
|
+
device: object,
|
|
40
|
+
desc: { code: string; label?: string },
|
|
41
|
+
) => Promise<{ ok: boolean; value?: unknown; error?: { code: string; message: string } }>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Per-device IBL pipeline cache instance.
|
|
45
|
+
*
|
|
46
|
+
* M3.5 (round-2 t52): the 4 pipeline slots are mutable so createIblPipelines
|
|
47
|
+
* can fill them after construction. The 4 textures + their views are also
|
|
48
|
+
* cached here so runIblPrecompute targets are stable across calls
|
|
49
|
+
* (idempotent).
|
|
50
|
+
*/
|
|
51
|
+
export interface IblPipelineCachePerDevice {
|
|
52
|
+
/** Color format shared by all precompute outputs for this device. */
|
|
53
|
+
outputFormat?: string;
|
|
54
|
+
/** Equirectangular-to-cubemap pipeline. */
|
|
55
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU pipeline handle
|
|
56
|
+
equirectToCubePipeline?: any;
|
|
57
|
+
/** Diffuse irradiance convolution pipeline. */
|
|
58
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU pipeline handle
|
|
59
|
+
irradiancePipeline?: any;
|
|
60
|
+
/** Specular prefilter pipeline. */
|
|
61
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU pipeline handle
|
|
62
|
+
prefilterPipeline?: any;
|
|
63
|
+
/** BRDF integration LUT pipeline. */
|
|
64
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU pipeline handle
|
|
65
|
+
brdfLutPipeline?: any;
|
|
66
|
+
|
|
67
|
+
/** Face uniforms BGL (shared across equirect/irradiance/prefilter, D-9). */
|
|
68
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque BGL
|
|
69
|
+
faceUniformsBgl?: any;
|
|
70
|
+
/** group(1) BGL for the equirect-to-cube pass (texture_2d + sampler). */
|
|
71
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque BGL
|
|
72
|
+
equirectGroup1Bgl?: any;
|
|
73
|
+
/** group(1) BGL for irradiance + prefilter (texture_cube + sampler). */
|
|
74
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque BGL
|
|
75
|
+
cubeGroup1Bgl?: any;
|
|
76
|
+
/** group(0) BGL for prefilter (face + prefilter uniforms). */
|
|
77
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque BGL
|
|
78
|
+
prefilterGroup0Bgl?: any;
|
|
79
|
+
|
|
80
|
+
/** Irradiance cubemap texture (32x32; outputFormat, cube). */
|
|
81
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture
|
|
82
|
+
irradianceTexture?: any;
|
|
83
|
+
/** Irradiance cubemap view (dimension:cube). */
|
|
84
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture view
|
|
85
|
+
irradianceView?: any;
|
|
86
|
+
/** Per-face 2D views for irradiance (render-attachment use). */
|
|
87
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture views
|
|
88
|
+
irradianceFaceViews?: ReadonlyArray<any>;
|
|
89
|
+
/** Specular prefilter cubemap (128x128, 5 mip levels). */
|
|
90
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture
|
|
91
|
+
prefilterTexture?: any;
|
|
92
|
+
/** Prefilter cubemap view (dimension:cube, all mips). */
|
|
93
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture view
|
|
94
|
+
prefilterView?: any;
|
|
95
|
+
/** Per-face 2D views per mip for prefilter (5 mips x 6 faces). */
|
|
96
|
+
// biome-ignore lint/suspicious/noExplicitAny: nested mip x face views
|
|
97
|
+
prefilterFaceViewsByMip?: ReadonlyArray<ReadonlyArray<any>>;
|
|
98
|
+
/** BRDF LUT (256x256; outputFormat). */
|
|
99
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture
|
|
100
|
+
brdfLutTexture?: any;
|
|
101
|
+
/** BRDF LUT view. */
|
|
102
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture view
|
|
103
|
+
brdfLutView?: any;
|
|
104
|
+
|
|
105
|
+
/** Counter: times irradiance pass has executed. AC-04: == 1 after first cook. */
|
|
106
|
+
irradianceBakeCount: number;
|
|
107
|
+
/** Counter: times prefilter pass has executed. AC-05: == 1 after first cook. */
|
|
108
|
+
prefilterBakeCount: number;
|
|
109
|
+
/** Counter: times BRDF LUT pass has executed. AC-06: == 1 after first cook. */
|
|
110
|
+
brdfLutBakeCount: number;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Per-device cache map. The WeakMap key is the opaque device object;
|
|
115
|
+
* destroying the device naturally clears its cache entry.
|
|
116
|
+
*/
|
|
117
|
+
const deviceCache: WeakMap<object, IblPipelineCachePerDevice> = new WeakMap();
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Get or create the per-device IBL pipeline cache.
|
|
121
|
+
*/
|
|
122
|
+
export function getOrCreateIblCache(device: object): IblPipelineCachePerDevice {
|
|
123
|
+
const existing = deviceCache.get(device);
|
|
124
|
+
if (existing !== undefined) return existing;
|
|
125
|
+
|
|
126
|
+
const cache: IblPipelineCachePerDevice = {
|
|
127
|
+
irradianceBakeCount: 0,
|
|
128
|
+
prefilterBakeCount: 0,
|
|
129
|
+
brdfLutBakeCount: 0,
|
|
130
|
+
};
|
|
131
|
+
deviceCache.set(device, cache);
|
|
132
|
+
return cache;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Number of cached per-device instances (introspection hook for tests).
|
|
137
|
+
*/
|
|
138
|
+
export function iblCacheSize(): number {
|
|
139
|
+
// WeakMap doesn't expose size; approximate by iteration.
|
|
140
|
+
let count = 0;
|
|
141
|
+
try {
|
|
142
|
+
// biome-ignore lint/suspicious/noExplicitAny: WeakMap iteration hack
|
|
143
|
+
for (const _ of deviceCache as any) {
|
|
144
|
+
count++;
|
|
145
|
+
}
|
|
146
|
+
} catch {
|
|
147
|
+
// WeakMap is not iterable; this is expected.
|
|
148
|
+
}
|
|
149
|
+
return count;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Check whether a device has an active cache entry (introspection for tests).
|
|
154
|
+
*/
|
|
155
|
+
export function hasIblCache(device: object): boolean {
|
|
156
|
+
return deviceCache.has(device);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Clear the per-device cache entry for the given device, if any.
|
|
161
|
+
*
|
|
162
|
+
* feat-20260612-rhi-destroy-renderer-dispose-gpu-lifecycle / M5: called from
|
|
163
|
+
* `Renderer.dispose()` step 4 (plan-strategy D-2 6-step walk) so the IBL
|
|
164
|
+
* pipelines / textures attached to a torn-down device do not survive in the
|
|
165
|
+
* runtime cache. The underlying GPU pipeline / texture handles are not
|
|
166
|
+
* separately destroyed here -- they were created on the same RhiDevice the
|
|
167
|
+
* dispose chain is about to release at step 5 (`context.unconfigure`); the
|
|
168
|
+
* spec contract is that releasing the device tears down its child pipelines
|
|
169
|
+
* implicitly. Clearing the WeakMap entry simply lets GC reclaim the JS-side
|
|
170
|
+
* cache record.
|
|
171
|
+
*
|
|
172
|
+
* Idempotent (architecture-principles §6): a second call after the entry
|
|
173
|
+
* was deleted is a no-op.
|
|
174
|
+
*/
|
|
175
|
+
export function clearIblCacheForDevice(device: object): void {
|
|
176
|
+
deviceCache.delete(device);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// ─── IBL WGSL source management ──────────────────────────────────────────────
|
|
180
|
+
|
|
181
|
+
let iblWgslSourceCache: string | undefined;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Set the ibl.wgsl source string. Called once by the consumer
|
|
185
|
+
* (e.g., AssetRegistry) when the shader module source is loaded.
|
|
186
|
+
*/
|
|
187
|
+
export function setIblWgslSource(source: string): void {
|
|
188
|
+
iblWgslSourceCache = source;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Get the cached ibl.wgsl source string.
|
|
193
|
+
* Throws if not yet loaded.
|
|
194
|
+
*/
|
|
195
|
+
export function getIblWgslSource(): string {
|
|
196
|
+
if (iblWgslSourceCache === undefined) {
|
|
197
|
+
throw new Error(
|
|
198
|
+
'ibl.wgsl source not loaded -- call setIblWgslSource before using IBL pipelines',
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
return iblWgslSourceCache;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// ─── M3.5 composed ibl-* shader source registry ─────────────────────────────
|
|
205
|
+
//
|
|
206
|
+
// 4 composed WGSL strings -- one per render pipeline. Each string is the
|
|
207
|
+
// output of @forgeax/engine-naga composeShader after merging ibl_shared +
|
|
208
|
+
// the per-pass module. Built by ShaderRegistry / vite-plugin-shader at
|
|
209
|
+
// build-time so the runtime cache never reaches into engine-naga
|
|
210
|
+
// (AGENTS.md grep gate forbids).
|
|
211
|
+
|
|
212
|
+
export interface IblComposedShaders {
|
|
213
|
+
/** ibl-equirect-to-cube composed (cubemap_vs + equirectToCube_fs). */
|
|
214
|
+
readonly equirectToCube: string;
|
|
215
|
+
/** ibl-irradiance composed (cubemap_vs + irradianceConvolve_fs). */
|
|
216
|
+
readonly irradiance: string;
|
|
217
|
+
/** ibl-prefilter composed (cubemap_vs + prefilterEnv_fs). */
|
|
218
|
+
readonly prefilter: string;
|
|
219
|
+
/** ibl-brdf-lut composed (fullscreen_vs + brdfLutBake_fs). */
|
|
220
|
+
readonly brdfLut: string;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
let iblComposedShadersCache: IblComposedShaders | undefined;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Inject the composed ibl-* shader sources used by createIblPipelines.
|
|
227
|
+
* Called once by the engine bootstrap (createRenderer step "shader-load")
|
|
228
|
+
* with the 4 composed entries from ShaderRegistry.
|
|
229
|
+
*/
|
|
230
|
+
export function setIblComposedShaders(sources: IblComposedShaders): void {
|
|
231
|
+
iblComposedShadersCache = sources;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Retrieve the cached composed shader bundle.
|
|
236
|
+
* Returns undefined when the runtime is operating without a real shader
|
|
237
|
+
* source (mock device unit tests that exercise pipeline dispatch surface
|
|
238
|
+
* only).
|
|
239
|
+
*/
|
|
240
|
+
export function getIblComposedShaders(): IblComposedShaders | undefined {
|
|
241
|
+
return iblComposedShadersCache;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// ─── Standard cube vertices for cubemap face rendering ───────────────────────
|
|
245
|
+
// 36 vertices (6 faces * 2 triangles * 3 vertices), vec3<f32> format.
|
|
246
|
+
// Unit cube [-1, 1]^3 centered at origin.
|
|
247
|
+
export const CUBEMAP_FACE_VERTICES = new Float32Array([
|
|
248
|
+
// +X face (+1, 0, 0)
|
|
249
|
+
1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0,
|
|
250
|
+
// -X face (-1, 0, 0)
|
|
251
|
+
-1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, -1.0, -1.0, 1.0,
|
|
252
|
+
1.0,
|
|
253
|
+
// +Y face (0, +1, 0)
|
|
254
|
+
-1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0,
|
|
255
|
+
// -Y face (0, -1, 0)
|
|
256
|
+
-1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0,
|
|
257
|
+
1.0,
|
|
258
|
+
// +Z face (0, 0, +1)
|
|
259
|
+
-1.0, -1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0,
|
|
260
|
+
// -Z face (0, 0, -1)
|
|
261
|
+
1.0, -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0,
|
|
262
|
+
-1.0,
|
|
263
|
+
]);
|
|
264
|
+
|
|
265
|
+
// 6 capture view-projection matrices (right-handed, from origin).
|
|
266
|
+
// Projection Y is negated for WebGPU top-left framebuffer origin.
|
|
267
|
+
// Target directions: +X, -X, +Y, -Y, +Z, -Z.
|
|
268
|
+
// Up vectors: -Y for X/Z faces, +Z for +Y, -Z for -Y.
|
|
269
|
+
export const CAPTURE_VIEW_PROJS = buildCaptureViewProjs();
|
|
270
|
+
|
|
271
|
+
function buildCaptureViewProjs(): Float32Array[] {
|
|
272
|
+
const targets: [number, number, number][] = [
|
|
273
|
+
[1, 0, 0],
|
|
274
|
+
[-1, 0, 0],
|
|
275
|
+
[0, 1, 0],
|
|
276
|
+
[0, -1, 0],
|
|
277
|
+
[0, 0, 1],
|
|
278
|
+
[0, 0, -1],
|
|
279
|
+
];
|
|
280
|
+
const ups: [number, number, number][] = [
|
|
281
|
+
[0, -1, 0],
|
|
282
|
+
[0, -1, 0],
|
|
283
|
+
[0, 0, 1],
|
|
284
|
+
[0, 0, -1],
|
|
285
|
+
[0, -1, 0],
|
|
286
|
+
[0, -1, 0],
|
|
287
|
+
];
|
|
288
|
+
|
|
289
|
+
const proj = cubemapCaptureProjection(Math.PI / 2, 0.1, 10.0);
|
|
290
|
+
|
|
291
|
+
return targets.map((_t, i) => {
|
|
292
|
+
const t = _t;
|
|
293
|
+
const u = ups[i] ?? [0, -1, 0];
|
|
294
|
+
const view = lookAtMatrix([0, 0, 0], t, u);
|
|
295
|
+
return mulMat4(proj, view);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
function lookAtMatrix(
|
|
300
|
+
eye: readonly number[],
|
|
301
|
+
target: readonly number[],
|
|
302
|
+
up: readonly number[],
|
|
303
|
+
): Float32Array {
|
|
304
|
+
const [ex, ey0, ez] = [eye[0] ?? 0, eye[1] ?? 0, eye[2] ?? 0];
|
|
305
|
+
const [tx, ty, tz] = [target[0] ?? 0, target[1] ?? 0, target[2] ?? 0];
|
|
306
|
+
const [upx, upy, upz] = [up[0] ?? 0, up[1] ?? 0, up[2] ?? 0];
|
|
307
|
+
let fx = ex - tx,
|
|
308
|
+
fy = ey0 - ty,
|
|
309
|
+
fz = ez - tz;
|
|
310
|
+
const fLen = Math.sqrt(fx * fx + fy * fy + fz * fz);
|
|
311
|
+
fx /= fLen;
|
|
312
|
+
fy /= fLen;
|
|
313
|
+
fz /= fLen;
|
|
314
|
+
|
|
315
|
+
let rx = upy * fz - upz * fy;
|
|
316
|
+
let ry = upz * fx - upx * fz;
|
|
317
|
+
let rz = upx * fy - upy * fx;
|
|
318
|
+
const rLen = Math.sqrt(rx * rx + ry * ry + rz * rz);
|
|
319
|
+
rx /= rLen;
|
|
320
|
+
ry /= rLen;
|
|
321
|
+
rz /= rLen;
|
|
322
|
+
|
|
323
|
+
const ux = fy * rz - fz * ry;
|
|
324
|
+
const uy = fz * rx - fx * rz;
|
|
325
|
+
const uz = fx * ry - fy * rx;
|
|
326
|
+
|
|
327
|
+
return new Float32Array([
|
|
328
|
+
rx,
|
|
329
|
+
ux,
|
|
330
|
+
fx,
|
|
331
|
+
0,
|
|
332
|
+
ry,
|
|
333
|
+
uy,
|
|
334
|
+
fy,
|
|
335
|
+
0,
|
|
336
|
+
rz,
|
|
337
|
+
uz,
|
|
338
|
+
fz,
|
|
339
|
+
0,
|
|
340
|
+
-(rx * ex + ry * ey0 + rz * ez),
|
|
341
|
+
-(ux * ex + uy * ey0 + uz * ez),
|
|
342
|
+
-(fx * ex + fy * ey0 + fz * ez),
|
|
343
|
+
1,
|
|
344
|
+
]);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// Column-major matrix product `r = a * b` where each Float32Array stores
|
|
348
|
+
// 4 contiguous column vectors of 4 floats (WGSL `mat4x4<f32>` uniform
|
|
349
|
+
// layout). For column-major storage `flat[c*4 + row] = M[col=c, row]`, so:
|
|
350
|
+
// (a * b)[col=c, row=r] = sum_k a[col=k, row=r] * b[col=c, row=k]
|
|
351
|
+
// flat_out[c*4 + r] = sum_k a[k*4 + r] * b[c*4 + k]
|
|
352
|
+
//
|
|
353
|
+
// The prior row-major iteration silently transposed the result, producing
|
|
354
|
+
// `b * a` in WGSL's view -- IBL equirect-to-cube vertices then projected
|
|
355
|
+
// to clip with w=0 / w=-1, every face fell outside the [-1,1] frustum, no
|
|
356
|
+
// fragments drew, and every downstream IBL texture (irradiance / prefilter)
|
|
357
|
+
// inherited the clearValue=(0,0,0,1). Demo 3x3 sphere matrix rendered
|
|
358
|
+
// pure black because `ambient = kD * 0 + specular * 0 = 0` and there are
|
|
359
|
+
// no direct lights in the IBL demo scene.
|
|
360
|
+
function mulMat4(a: Float32Array, b: Float32Array): Float32Array {
|
|
361
|
+
const r = new Float32Array(16);
|
|
362
|
+
for (let c = 0; c < 4; c++) {
|
|
363
|
+
for (let row = 0; row < 4; row++) {
|
|
364
|
+
let sum = 0;
|
|
365
|
+
for (let k = 0; k < 4; k++) {
|
|
366
|
+
sum += (a[k * 4 + row] ?? 0) * (b[c * 4 + k] ?? 0);
|
|
367
|
+
}
|
|
368
|
+
r[c * 4 + row] = sum;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return r;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// ─── M3.5 t52: createIblPipelines (4 independent GPURenderPipelines) ─────────
|
|
375
|
+
|
|
376
|
+
// IBL output texture sizes (plan D-10 SSOT, mirrored in ibl-brdf-lut.wgsl).
|
|
377
|
+
export const IRRADIANCE_SIZE = 32;
|
|
378
|
+
export const PREFILTER_SIZE = 128;
|
|
379
|
+
export const PREFILTER_MIP_LEVELS = 5;
|
|
380
|
+
export const BRDF_LUT_SIZE = 256;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Minimal device shape used by createIblPipelines + runIblPrecompute. The
|
|
384
|
+
* surface is intentionally narrow so unit-level mock devices can exercise
|
|
385
|
+
* the dispatch path without standing up the full RHI shim.
|
|
386
|
+
*/
|
|
387
|
+
export interface IblPipelineDevice {
|
|
388
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim shapes
|
|
389
|
+
createBindGroupLayout(desc: any): { ok: true; value: any } | { ok: false; error: unknown };
|
|
390
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim shapes
|
|
391
|
+
createPipelineLayout(desc: any): { ok: true; value: any } | { ok: false; error: unknown };
|
|
392
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim shapes
|
|
393
|
+
createRenderPipeline(desc: any): { ok: true; value: any } | { ok: false; error: unknown };
|
|
394
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim shapes
|
|
395
|
+
createBuffer(desc: any): { ok: true; value: any } | { ok: false; error: unknown };
|
|
396
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim shapes
|
|
397
|
+
createTexture(desc: any): { ok: true; value: any } | { ok: false; error: unknown };
|
|
398
|
+
createTextureView(
|
|
399
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture
|
|
400
|
+
texture: any,
|
|
401
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim shapes
|
|
402
|
+
desc: any,
|
|
403
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim shapes
|
|
404
|
+
): { ok: true; value: any } | { ok: false; error: unknown };
|
|
405
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim shapes
|
|
406
|
+
createSampler(desc?: any): { ok: true; value: any } | { ok: false; error: unknown };
|
|
407
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim shapes
|
|
408
|
+
createBindGroup(desc: any): { ok: true; value: any } | { ok: false; error: unknown };
|
|
409
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim shapes
|
|
410
|
+
createCommandEncoder(desc?: any): { ok: true; value: any } | { ok: false; error: unknown };
|
|
411
|
+
readonly queue: {
|
|
412
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim shapes
|
|
413
|
+
submit(buffers: ReadonlyArray<any>): unknown;
|
|
414
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim shapes
|
|
415
|
+
writeBuffer?: (...args: any[]) => unknown;
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Create 4 independent GPURenderPipelines + their shared / per-pass bind
|
|
421
|
+
* group layouts. Pipeline slots are stored on the per-device cache and
|
|
422
|
+
* survive across calls (D-1 startup-once cook).
|
|
423
|
+
*
|
|
424
|
+
* D-9: faceUniforms BGL (@group(0) for equirect/irradiance/prefilter) is
|
|
425
|
+
* a single instance reused across 3 pipelines (binary-compatible).
|
|
426
|
+
* group(1) is per-pipeline: texture_2d for equirect, texture_cube for
|
|
427
|
+
* irradiance + prefilter, none for brdf-lut.
|
|
428
|
+
*/
|
|
429
|
+
export async function createIblPipelines(
|
|
430
|
+
device: IblPipelineDevice,
|
|
431
|
+
factory: IblShaderModuleFactory,
|
|
432
|
+
// biome-ignore lint/suspicious/noExplicitAny: cubemap output format opaque
|
|
433
|
+
cubeOutputFormat: any = 'rgba16float',
|
|
434
|
+
): Promise<
|
|
435
|
+
| {
|
|
436
|
+
ok: true;
|
|
437
|
+
value: {
|
|
438
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU pipelines
|
|
439
|
+
equirectToCubePipeline: any;
|
|
440
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU pipelines
|
|
441
|
+
irradiancePipeline: any;
|
|
442
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU pipelines
|
|
443
|
+
prefilterPipeline: any;
|
|
444
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU pipelines
|
|
445
|
+
brdfLutPipeline: any;
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
| { ok: false; error: unknown }
|
|
449
|
+
> {
|
|
450
|
+
const cache = getOrCreateIblCache(device);
|
|
451
|
+
if (cache.equirectToCubePipeline !== undefined) {
|
|
452
|
+
return {
|
|
453
|
+
ok: true,
|
|
454
|
+
value: {
|
|
455
|
+
equirectToCubePipeline: cache.equirectToCubePipeline,
|
|
456
|
+
irradiancePipeline: cache.irradiancePipeline,
|
|
457
|
+
prefilterPipeline: cache.prefilterPipeline,
|
|
458
|
+
brdfLutPipeline: cache.brdfLutPipeline,
|
|
459
|
+
},
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
// Keep the output format on the per-device cache so the four pipelines and
|
|
463
|
+
// their lazily-created side textures cannot drift. WebGL2 may need the
|
|
464
|
+
// renderable rgba8 fallback even when the source equirect remains float.
|
|
465
|
+
const outputFormat = cubeOutputFormat;
|
|
466
|
+
cache.outputFormat = outputFormat;
|
|
467
|
+
|
|
468
|
+
const composed = iblComposedShadersCache;
|
|
469
|
+
// Mock-device path: factory returns synthetic modules. Both production
|
|
470
|
+
// (composed) and unit-test (placeholder code) paths converge here.
|
|
471
|
+
const fallbackCode = '@vertex fn vs() -> @builtin(position) vec4<f32> { return vec4<f32>(0.0); }';
|
|
472
|
+
const src = composed ?? {
|
|
473
|
+
equirectToCube: fallbackCode,
|
|
474
|
+
irradiance: fallbackCode,
|
|
475
|
+
prefilter: fallbackCode,
|
|
476
|
+
brdfLut: fallbackCode,
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
// M5-amend Bug 1: normalise shim/raw return shapes. See runIblPrecompute
|
|
480
|
+
// for full rationale -- same helper applied across both functions so
|
|
481
|
+
// dawn-node (raw GPUDevice) + browser (rhi-shim) both succeed.
|
|
482
|
+
// biome-ignore lint/suspicious/noExplicitAny: union of shim/raw return shapes
|
|
483
|
+
const unwrap = (r: any): any => {
|
|
484
|
+
if (r === null || r === undefined) return undefined;
|
|
485
|
+
if (typeof r === 'object' && 'ok' in r) return r.ok ? r.value : undefined;
|
|
486
|
+
return r;
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
const modules = await Promise.all([
|
|
490
|
+
factory(device, { code: src.equirectToCube, label: 'ibl-equirect-to-cube' }),
|
|
491
|
+
factory(device, { code: src.irradiance, label: 'ibl-irradiance' }),
|
|
492
|
+
factory(device, { code: src.prefilter, label: 'ibl-prefilter' }),
|
|
493
|
+
factory(device, { code: src.brdfLut, label: 'ibl-brdf-lut' }),
|
|
494
|
+
]);
|
|
495
|
+
for (const m of modules) {
|
|
496
|
+
if (!m.ok) return { ok: false, error: m.error };
|
|
497
|
+
}
|
|
498
|
+
// biome-ignore lint/style/noNonNullAssertion: checked above
|
|
499
|
+
const [mEq, mIr, mPr, mBr] = modules.map((m) => m.value!) as [unknown, unknown, unknown, unknown];
|
|
500
|
+
|
|
501
|
+
// D-9: faceUniforms BGL shared across 3 pipelines (equirect / irradiance /
|
|
502
|
+
// prefilter). The prefilter additionally needs binding(1) for prefUniforms;
|
|
503
|
+
// we keep a separate BGL for the prefilter group(0) to honour the WGSL
|
|
504
|
+
// declaration in ibl-prefilter.wgsl.
|
|
505
|
+
const faceBgl = unwrap(
|
|
506
|
+
device.createBindGroupLayout({
|
|
507
|
+
label: 'ibl-face-uniforms-bgl',
|
|
508
|
+
entries: [{ binding: 0, visibility: GPU_SHADER_STAGE_VERTEX, buffer: { type: 'uniform' } }],
|
|
509
|
+
}),
|
|
510
|
+
);
|
|
511
|
+
if (faceBgl === undefined) return { ok: false, error: 'ibl-face-uniforms-bgl' };
|
|
512
|
+
cache.faceUniformsBgl = faceBgl;
|
|
513
|
+
|
|
514
|
+
const prefilterGroup0 = unwrap(
|
|
515
|
+
device.createBindGroupLayout({
|
|
516
|
+
label: 'ibl-prefilter-group0-bgl',
|
|
517
|
+
entries: [
|
|
518
|
+
{ binding: 0, visibility: GPU_SHADER_STAGE_VERTEX, buffer: { type: 'uniform' } },
|
|
519
|
+
{ binding: 1, visibility: GPU_SHADER_STAGE_FRAGMENT, buffer: { type: 'uniform' } },
|
|
520
|
+
],
|
|
521
|
+
}),
|
|
522
|
+
);
|
|
523
|
+
if (prefilterGroup0 === undefined) return { ok: false, error: 'ibl-prefilter-group0-bgl' };
|
|
524
|
+
cache.prefilterGroup0Bgl = prefilterGroup0;
|
|
525
|
+
|
|
526
|
+
const equirectGroup1 = unwrap(
|
|
527
|
+
device.createBindGroupLayout({
|
|
528
|
+
label: 'ibl-equirect-group1-bgl',
|
|
529
|
+
entries: [
|
|
530
|
+
{
|
|
531
|
+
binding: 0,
|
|
532
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
533
|
+
texture: { sampleType: 'float', viewDimension: '2d' },
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
binding: 1,
|
|
537
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
538
|
+
sampler: { type: 'filtering' },
|
|
539
|
+
},
|
|
540
|
+
],
|
|
541
|
+
}),
|
|
542
|
+
);
|
|
543
|
+
if (equirectGroup1 === undefined) return { ok: false, error: 'ibl-equirect-group1-bgl' };
|
|
544
|
+
cache.equirectGroup1Bgl = equirectGroup1;
|
|
545
|
+
|
|
546
|
+
const cubeGroup1 = unwrap(
|
|
547
|
+
device.createBindGroupLayout({
|
|
548
|
+
label: 'ibl-cube-group1-bgl',
|
|
549
|
+
entries: [
|
|
550
|
+
{
|
|
551
|
+
binding: 0,
|
|
552
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
553
|
+
texture: { sampleType: 'float', viewDimension: 'cube' },
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
binding: 1,
|
|
557
|
+
visibility: GPU_SHADER_STAGE_FRAGMENT,
|
|
558
|
+
sampler: { type: 'filtering' },
|
|
559
|
+
},
|
|
560
|
+
],
|
|
561
|
+
}),
|
|
562
|
+
);
|
|
563
|
+
if (cubeGroup1 === undefined) return { ok: false, error: 'ibl-cube-group1-bgl' };
|
|
564
|
+
cache.cubeGroup1Bgl = cubeGroup1;
|
|
565
|
+
|
|
566
|
+
// Pipeline layouts.
|
|
567
|
+
const equirectLayout = unwrap(
|
|
568
|
+
device.createPipelineLayout({
|
|
569
|
+
label: 'ibl-equirect-pipeline-layout',
|
|
570
|
+
bindGroupLayouts: [cache.faceUniformsBgl, cache.equirectGroup1Bgl],
|
|
571
|
+
}),
|
|
572
|
+
);
|
|
573
|
+
if (equirectLayout === undefined) return { ok: false, error: 'ibl-equirect-pipeline-layout' };
|
|
574
|
+
const irradianceLayout = unwrap(
|
|
575
|
+
device.createPipelineLayout({
|
|
576
|
+
label: 'ibl-irradiance-pipeline-layout',
|
|
577
|
+
bindGroupLayouts: [cache.faceUniformsBgl, cache.cubeGroup1Bgl],
|
|
578
|
+
}),
|
|
579
|
+
);
|
|
580
|
+
if (irradianceLayout === undefined) return { ok: false, error: 'ibl-irradiance-pipeline-layout' };
|
|
581
|
+
const prefilterLayout = unwrap(
|
|
582
|
+
device.createPipelineLayout({
|
|
583
|
+
label: 'ibl-prefilter-pipeline-layout',
|
|
584
|
+
bindGroupLayouts: [prefilterGroup0, cache.cubeGroup1Bgl],
|
|
585
|
+
}),
|
|
586
|
+
);
|
|
587
|
+
if (prefilterLayout === undefined) return { ok: false, error: 'ibl-prefilter-pipeline-layout' };
|
|
588
|
+
const brdfLutLayout = unwrap(
|
|
589
|
+
device.createPipelineLayout({
|
|
590
|
+
label: 'ibl-brdf-lut-pipeline-layout',
|
|
591
|
+
bindGroupLayouts: [],
|
|
592
|
+
}),
|
|
593
|
+
);
|
|
594
|
+
if (brdfLutLayout === undefined) return { ok: false, error: 'ibl-brdf-lut-pipeline-layout' };
|
|
595
|
+
|
|
596
|
+
const vertexLayout3F = {
|
|
597
|
+
arrayStride: 12,
|
|
598
|
+
attributes: [{ shaderLocation: 0, offset: 0, format: 'float32x3' as const }],
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
const pipeEquirect = unwrap(
|
|
602
|
+
device.createRenderPipeline({
|
|
603
|
+
label: 'ibl-equirect-to-cube-pipeline',
|
|
604
|
+
layout: equirectLayout,
|
|
605
|
+
vertex: { module: mEq, entryPoint: 'cubemap_vs', buffers: [vertexLayout3F] },
|
|
606
|
+
fragment: {
|
|
607
|
+
module: mEq,
|
|
608
|
+
entryPoint: 'equirectToCube_fs',
|
|
609
|
+
targets: [{ format: cubeOutputFormat }],
|
|
610
|
+
},
|
|
611
|
+
primitive: { topology: 'triangle-list', cullMode: 'none' },
|
|
612
|
+
}),
|
|
613
|
+
);
|
|
614
|
+
if (pipeEquirect === undefined) return { ok: false, error: 'ibl-equirect-to-cube-pipeline' };
|
|
615
|
+
cache.equirectToCubePipeline = pipeEquirect;
|
|
616
|
+
|
|
617
|
+
const pipeIrradiance = unwrap(
|
|
618
|
+
device.createRenderPipeline({
|
|
619
|
+
label: 'ibl-irradiance-pipeline',
|
|
620
|
+
layout: irradianceLayout,
|
|
621
|
+
vertex: { module: mIr, entryPoint: 'cubemap_vs', buffers: [vertexLayout3F] },
|
|
622
|
+
fragment: {
|
|
623
|
+
module: mIr,
|
|
624
|
+
entryPoint: 'irradianceConvolve_fs',
|
|
625
|
+
targets: [{ format: cubeOutputFormat }],
|
|
626
|
+
},
|
|
627
|
+
primitive: { topology: 'triangle-list', cullMode: 'none' },
|
|
628
|
+
}),
|
|
629
|
+
);
|
|
630
|
+
if (pipeIrradiance === undefined) return { ok: false, error: 'ibl-irradiance-pipeline' };
|
|
631
|
+
cache.irradiancePipeline = pipeIrradiance;
|
|
632
|
+
|
|
633
|
+
const pipePrefilter = unwrap(
|
|
634
|
+
device.createRenderPipeline({
|
|
635
|
+
label: 'ibl-prefilter-pipeline',
|
|
636
|
+
layout: prefilterLayout,
|
|
637
|
+
vertex: { module: mPr, entryPoint: 'cubemap_vs', buffers: [vertexLayout3F] },
|
|
638
|
+
fragment: {
|
|
639
|
+
module: mPr,
|
|
640
|
+
entryPoint: 'prefilterEnv_fs',
|
|
641
|
+
targets: [{ format: cubeOutputFormat }],
|
|
642
|
+
},
|
|
643
|
+
primitive: { topology: 'triangle-list', cullMode: 'none' },
|
|
644
|
+
}),
|
|
645
|
+
);
|
|
646
|
+
if (pipePrefilter === undefined) return { ok: false, error: 'ibl-prefilter-pipeline' };
|
|
647
|
+
cache.prefilterPipeline = pipePrefilter;
|
|
648
|
+
|
|
649
|
+
const pipeBrdfLut = unwrap(
|
|
650
|
+
device.createRenderPipeline({
|
|
651
|
+
label: 'ibl-brdf-lut-pipeline',
|
|
652
|
+
layout: brdfLutLayout,
|
|
653
|
+
vertex: { module: mBr, entryPoint: 'fullscreen_vs', buffers: [] },
|
|
654
|
+
fragment: {
|
|
655
|
+
module: mBr,
|
|
656
|
+
entryPoint: 'brdfLutBake_fs',
|
|
657
|
+
targets: [{ format: cubeOutputFormat }],
|
|
658
|
+
},
|
|
659
|
+
primitive: { topology: 'triangle-list', cullMode: 'none' },
|
|
660
|
+
}),
|
|
661
|
+
);
|
|
662
|
+
if (pipeBrdfLut === undefined) return { ok: false, error: 'ibl-brdf-lut-pipeline' };
|
|
663
|
+
cache.brdfLutPipeline = pipeBrdfLut;
|
|
664
|
+
|
|
665
|
+
return {
|
|
666
|
+
ok: true,
|
|
667
|
+
value: {
|
|
668
|
+
equirectToCubePipeline: cache.equirectToCubePipeline,
|
|
669
|
+
irradiancePipeline: cache.irradiancePipeline,
|
|
670
|
+
prefilterPipeline: cache.prefilterPipeline,
|
|
671
|
+
brdfLutPipeline: cache.brdfLutPipeline,
|
|
672
|
+
},
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// ─── M3.5 t53: runIblPrecompute (4-pass dispatch + queue.submit) ─────────────
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Options consumed by runIblPrecompute. The caller (the internal
|
|
680
|
+
* GpuResourceStore equirect-to-cubemap projection) provides the equirect input
|
|
681
|
+
* + cubemap target GPU resources; the face-uniform / prefilter-uniform buffers
|
|
682
|
+
* come from the t55 helpers.
|
|
683
|
+
*/
|
|
684
|
+
export interface RunIblPrecomputeOptions {
|
|
685
|
+
readonly device: IblPipelineDevice;
|
|
686
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture (input equirect)
|
|
687
|
+
readonly equirectGpuTex: any;
|
|
688
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture view (input equirect 2D view)
|
|
689
|
+
readonly equirectView: any;
|
|
690
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture (output cube)
|
|
691
|
+
readonly cubeGpuTex: any;
|
|
692
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque cube view (for sampling)
|
|
693
|
+
readonly cubeView: any;
|
|
694
|
+
// biome-ignore lint/suspicious/noExplicitAny: per-face 2D views (6) for render attachments
|
|
695
|
+
readonly cubeFaceViews: ReadonlyArray<any>;
|
|
696
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU buffer (6 x 256-byte face uniforms)
|
|
697
|
+
readonly faceUniformsBuffer: any;
|
|
698
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU buffer (30 x 256-byte prefilter uniforms)
|
|
699
|
+
readonly prefilterUniformsBuffer: any;
|
|
700
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque vertex buffer (36 cube verts)
|
|
701
|
+
readonly cubeVertexBuffer: any;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Execute the 4 IBL precompute passes (equirect-to-cube / irradiance /
|
|
706
|
+
* prefilter / brdf-lut) in a single CommandEncoder and submit.
|
|
707
|
+
*
|
|
708
|
+
* Counter invariant (AC-20, plan D-7 / N-3): the
|
|
709
|
+
* `irradiance/prefilter/brdfLut BakeCount` counters are incremented
|
|
710
|
+
* AFTER queue.submit returns. If submit throws or returns Result.err, the
|
|
711
|
+
* counters stay at 0 -- this is the prime safety guard against the
|
|
712
|
+
* round-1 "counter += 1 as dispatch proxy" anti-pattern.
|
|
713
|
+
*
|
|
714
|
+
* Returns Result.err with code='ibl-precompute-not-dispatched' when the
|
|
715
|
+
* underlying device lacks queue.submit or any of the 4 pipelines was not
|
|
716
|
+
* created (createIblPipelines must run first).
|
|
717
|
+
*/
|
|
718
|
+
export function runIblPrecompute(
|
|
719
|
+
opts: RunIblPrecomputeOptions,
|
|
720
|
+
):
|
|
721
|
+
| { ok: true; value: { submitted: boolean } }
|
|
722
|
+
| { ok: false; error: { code: string; expected: string; hint: string } } {
|
|
723
|
+
const { device } = opts;
|
|
724
|
+
const cache = getOrCreateIblCache(device);
|
|
725
|
+
const outputFormat = cache.outputFormat ?? 'rgba16float';
|
|
726
|
+
|
|
727
|
+
// M5-amend Bug 1: support both rhi-shim path (Result<T, RhiError>) and raw
|
|
728
|
+
// GPUDevice path (returns value directly). The shim returns
|
|
729
|
+
// `{ok, value}`; raw devices return the GPU resource handle directly.
|
|
730
|
+
// Same root cause + remedy as the mesh-upload raw-device fix at
|
|
731
|
+
// uploadMeshById. Without this normalisation, every `device.createXxx(...)`
|
|
732
|
+
// call inside this function bails on `!res.ok` (== !undefined == true)
|
|
733
|
+
// when invoked from dawn-node / native bindings, silently skipping the
|
|
734
|
+
// entire dispatch chain.
|
|
735
|
+
// biome-ignore lint/suspicious/noExplicitAny: union of shim/raw return shapes
|
|
736
|
+
const unwrap = (r: any): any => {
|
|
737
|
+
if (r === null || r === undefined) return undefined;
|
|
738
|
+
if (typeof r === 'object' && 'ok' in r) return r.ok ? r.value : undefined;
|
|
739
|
+
return r;
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
// M5-amend Bug 1: detect raw GPUDevice vs rhi-shim. The shim's
|
|
743
|
+
// `createBindGroup` accepts the forgeax tagged-union resource shape
|
|
744
|
+
// (`{kind: 'buffer', value: {buffer, offset, size}}` etc.); raw
|
|
745
|
+
// GPUDevice strictly requires WebGPU spec shape (`{buffer, offset,
|
|
746
|
+
// size}` directly as `resource` for buffer bindings, raw view/sampler
|
|
747
|
+
// handles directly for the other kinds). Probe by creating a no-op
|
|
748
|
+
// empty BGL: shim wraps in `{ok, value}`; raw returns the BGL handle
|
|
749
|
+
// directly. We discard the probe result; the cache already has BGLs.
|
|
750
|
+
// biome-ignore lint/suspicious/noExplicitAny: probe call
|
|
751
|
+
const probe: any = device.createBindGroupLayout({
|
|
752
|
+
label: 'ibl-shape-probe',
|
|
753
|
+
entries: [],
|
|
754
|
+
});
|
|
755
|
+
const isRawDevice =
|
|
756
|
+
probe === null || probe === undefined || typeof probe !== 'object' || !('ok' in probe);
|
|
757
|
+
|
|
758
|
+
// biome-ignore lint/suspicious/noExplicitAny: spec buffer-binding shape
|
|
759
|
+
type SpecBgEntry = { binding: number; resource: any };
|
|
760
|
+
// biome-ignore lint/suspicious/noExplicitAny: forgeax tagged-union resource
|
|
761
|
+
const toSpecResource = (r: any): any => {
|
|
762
|
+
if (r === null || r === undefined) return r;
|
|
763
|
+
if (typeof r !== 'object' || !('kind' in r)) return r;
|
|
764
|
+
if (r.kind === 'sampler') return r.value;
|
|
765
|
+
if (r.kind === 'textureView') return r.value;
|
|
766
|
+
if (r.kind === 'externalTexture') return r.value;
|
|
767
|
+
if (r.kind === 'buffer') {
|
|
768
|
+
const v = r.value;
|
|
769
|
+
if (v !== null && typeof v === 'object' && 'buffer' in v) return v;
|
|
770
|
+
// legacy shape -- shouldn't occur after Bug 1 fix but tolerate
|
|
771
|
+
return { buffer: v };
|
|
772
|
+
}
|
|
773
|
+
return r;
|
|
774
|
+
};
|
|
775
|
+
// biome-ignore lint/suspicious/noExplicitAny: descriptor builder
|
|
776
|
+
const buildBgDesc = (desc: any): any => {
|
|
777
|
+
if (!isRawDevice) return desc;
|
|
778
|
+
const entries: SpecBgEntry[] = (
|
|
779
|
+
desc.entries as ReadonlyArray<{ binding: number; resource: unknown }>
|
|
780
|
+
).map((e) => ({
|
|
781
|
+
binding: e.binding,
|
|
782
|
+
resource: toSpecResource(e.resource),
|
|
783
|
+
}));
|
|
784
|
+
const out: { label?: string; layout: unknown; entries: SpecBgEntry[] } = {
|
|
785
|
+
layout: desc.layout,
|
|
786
|
+
entries,
|
|
787
|
+
};
|
|
788
|
+
if ('label' in desc && desc.label !== undefined) out.label = desc.label;
|
|
789
|
+
return out;
|
|
790
|
+
};
|
|
791
|
+
|
|
792
|
+
if (
|
|
793
|
+
cache.equirectToCubePipeline === undefined ||
|
|
794
|
+
cache.irradiancePipeline === undefined ||
|
|
795
|
+
cache.prefilterPipeline === undefined ||
|
|
796
|
+
cache.brdfLutPipeline === undefined
|
|
797
|
+
) {
|
|
798
|
+
return {
|
|
799
|
+
ok: false,
|
|
800
|
+
error: {
|
|
801
|
+
code: 'ibl-precompute-not-dispatched',
|
|
802
|
+
expected: '4 IBL pipelines created via createIblPipelines',
|
|
803
|
+
hint: 'check IblPipelineCache.createIblPipelines was called before runIblPrecompute; counters must not increment before queue.submit',
|
|
804
|
+
},
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
if (typeof device.queue?.submit !== 'function') {
|
|
808
|
+
return {
|
|
809
|
+
ok: false,
|
|
810
|
+
error: {
|
|
811
|
+
code: 'ibl-precompute-not-dispatched',
|
|
812
|
+
expected: 'device.queue.submit callable',
|
|
813
|
+
hint: 'check IblPipelineCache.runIblPrecompute is called inside the GpuResourceStore equirect-to-cubemap projection; counters must not increment before queue.submit',
|
|
814
|
+
},
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
// Allocate side textures (irradiance / prefilter / brdf-lut) lazily.
|
|
819
|
+
// M5-amend Bug 1: dawn readback (t51 + reference baker) copies the
|
|
820
|
+
// side textures back to a buffer via copyTextureToBuffer, which
|
|
821
|
+
// requires the TextureUsage::CopySrc bit on the source. Without it
|
|
822
|
+
// Dawn fails-fast "usage doesn't include CopySrc".
|
|
823
|
+
|
|
824
|
+
// M5-amend Bug 1: helper that normalises shim/raw texture-view creation.
|
|
825
|
+
// Raw GPUDevice exposes `gpuTexture.createView(desc)` on the texture
|
|
826
|
+
// object itself; the rhi-shim exposes `device.createTextureView(tex, desc)`
|
|
827
|
+
// and returns Result<T>.
|
|
828
|
+
// biome-ignore lint/suspicious/noExplicitAny: shim/raw device split
|
|
829
|
+
const makeView = (texture: any, desc: any): any => {
|
|
830
|
+
// biome-ignore lint/suspicious/noExplicitAny: device shim shape
|
|
831
|
+
const dev = device as any;
|
|
832
|
+
if (typeof dev.createTextureView === 'function') {
|
|
833
|
+
const r = dev.createTextureView(texture, desc);
|
|
834
|
+
const u = unwrap(r);
|
|
835
|
+
if (u !== undefined) return u;
|
|
836
|
+
}
|
|
837
|
+
if (texture !== null && texture !== undefined && typeof texture.createView === 'function') {
|
|
838
|
+
try {
|
|
839
|
+
return texture.createView(desc);
|
|
840
|
+
} catch {
|
|
841
|
+
return undefined;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
return undefined;
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
if (cache.irradianceTexture === undefined) {
|
|
848
|
+
const tRaw = device.createTexture({
|
|
849
|
+
label: 'ibl-irradiance-cube',
|
|
850
|
+
size: { width: IRRADIANCE_SIZE, height: IRRADIANCE_SIZE, depthOrArrayLayers: 6 },
|
|
851
|
+
mipLevelCount: 1,
|
|
852
|
+
sampleCount: 1,
|
|
853
|
+
dimension: '2d',
|
|
854
|
+
format: outputFormat,
|
|
855
|
+
usage:
|
|
856
|
+
GPU_TEXTURE_USAGE_RENDER_ATTACHMENT_AND_TEXTURE_BINDING |
|
|
857
|
+
GPU_TEXTURE_USAGE_COPY_DST |
|
|
858
|
+
GPU_TEXTURE_USAGE_COPY_SRC,
|
|
859
|
+
viewFormats: [],
|
|
860
|
+
});
|
|
861
|
+
const tVal = unwrap(tRaw);
|
|
862
|
+
if (tVal === undefined) return { ok: false, error: badAlloc('irradiance-texture') };
|
|
863
|
+
cache.irradianceTexture = tVal;
|
|
864
|
+
const cubeView = makeView(tVal, {
|
|
865
|
+
label: 'ibl-irradiance-cube-view',
|
|
866
|
+
dimension: 'cube',
|
|
867
|
+
arrayLayerCount: 6,
|
|
868
|
+
});
|
|
869
|
+
if (cubeView === undefined) return { ok: false, error: badAlloc('irradiance-view') };
|
|
870
|
+
cache.irradianceView = cubeView;
|
|
871
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU views
|
|
872
|
+
const faceViews: any[] = [];
|
|
873
|
+
for (let f = 0; f < 6; f++) {
|
|
874
|
+
const v = makeView(tVal, {
|
|
875
|
+
label: `ibl-irradiance-face-${f}`,
|
|
876
|
+
dimension: '2d',
|
|
877
|
+
baseArrayLayer: f,
|
|
878
|
+
arrayLayerCount: 1,
|
|
879
|
+
});
|
|
880
|
+
if (v === undefined) return { ok: false, error: badAlloc('irradiance-face-view') };
|
|
881
|
+
faceViews.push(v);
|
|
882
|
+
}
|
|
883
|
+
cache.irradianceFaceViews = faceViews;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
if (cache.prefilterTexture === undefined) {
|
|
887
|
+
const tRaw = device.createTexture({
|
|
888
|
+
label: 'ibl-prefilter-cube',
|
|
889
|
+
size: { width: PREFILTER_SIZE, height: PREFILTER_SIZE, depthOrArrayLayers: 6 },
|
|
890
|
+
mipLevelCount: PREFILTER_MIP_LEVELS,
|
|
891
|
+
sampleCount: 1,
|
|
892
|
+
dimension: '2d',
|
|
893
|
+
format: outputFormat,
|
|
894
|
+
usage:
|
|
895
|
+
GPU_TEXTURE_USAGE_RENDER_ATTACHMENT_AND_TEXTURE_BINDING |
|
|
896
|
+
GPU_TEXTURE_USAGE_COPY_DST |
|
|
897
|
+
GPU_TEXTURE_USAGE_COPY_SRC,
|
|
898
|
+
viewFormats: [],
|
|
899
|
+
});
|
|
900
|
+
const tVal = unwrap(tRaw);
|
|
901
|
+
if (tVal === undefined) return { ok: false, error: badAlloc('prefilter-texture') };
|
|
902
|
+
cache.prefilterTexture = tVal;
|
|
903
|
+
const cubeView = makeView(tVal, {
|
|
904
|
+
label: 'ibl-prefilter-cube-view',
|
|
905
|
+
dimension: 'cube',
|
|
906
|
+
arrayLayerCount: 6,
|
|
907
|
+
baseMipLevel: 0,
|
|
908
|
+
mipLevelCount: PREFILTER_MIP_LEVELS,
|
|
909
|
+
});
|
|
910
|
+
if (cubeView === undefined) return { ok: false, error: badAlloc('prefilter-view') };
|
|
911
|
+
cache.prefilterView = cubeView;
|
|
912
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU views
|
|
913
|
+
const mipViews: any[][] = [];
|
|
914
|
+
for (let m = 0; m < PREFILTER_MIP_LEVELS; m++) {
|
|
915
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU views
|
|
916
|
+
const faces: any[] = [];
|
|
917
|
+
for (let f = 0; f < 6; f++) {
|
|
918
|
+
const v = makeView(tVal, {
|
|
919
|
+
label: `ibl-prefilter-mip${m}-face${f}`,
|
|
920
|
+
dimension: '2d',
|
|
921
|
+
baseMipLevel: m,
|
|
922
|
+
mipLevelCount: 1,
|
|
923
|
+
baseArrayLayer: f,
|
|
924
|
+
arrayLayerCount: 1,
|
|
925
|
+
});
|
|
926
|
+
if (v === undefined) return { ok: false, error: badAlloc('prefilter-face-view') };
|
|
927
|
+
faces.push(v);
|
|
928
|
+
}
|
|
929
|
+
mipViews.push(faces);
|
|
930
|
+
}
|
|
931
|
+
cache.prefilterFaceViewsByMip = mipViews;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
if (cache.brdfLutTexture === undefined) {
|
|
935
|
+
const tRaw = device.createTexture({
|
|
936
|
+
label: 'ibl-brdf-lut',
|
|
937
|
+
size: { width: BRDF_LUT_SIZE, height: BRDF_LUT_SIZE, depthOrArrayLayers: 1 },
|
|
938
|
+
mipLevelCount: 1,
|
|
939
|
+
sampleCount: 1,
|
|
940
|
+
dimension: '2d',
|
|
941
|
+
format: outputFormat,
|
|
942
|
+
usage:
|
|
943
|
+
GPU_TEXTURE_USAGE_RENDER_ATTACHMENT_AND_TEXTURE_BINDING |
|
|
944
|
+
GPU_TEXTURE_USAGE_COPY_DST |
|
|
945
|
+
GPU_TEXTURE_USAGE_COPY_SRC,
|
|
946
|
+
viewFormats: [],
|
|
947
|
+
});
|
|
948
|
+
const tVal = unwrap(tRaw);
|
|
949
|
+
if (tVal === undefined) return { ok: false, error: badAlloc('brdf-lut-texture') };
|
|
950
|
+
cache.brdfLutTexture = tVal;
|
|
951
|
+
const v = makeView(tVal, {
|
|
952
|
+
label: 'ibl-brdf-lut-view',
|
|
953
|
+
dimension: '2d',
|
|
954
|
+
});
|
|
955
|
+
if (v === undefined) return { ok: false, error: badAlloc('brdf-lut-view') };
|
|
956
|
+
cache.brdfLutView = v;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
// Shared sampler (filtering, linear-linear).
|
|
960
|
+
// U=repeat because equirect wraps horizontally (atan2 seam at ±π);
|
|
961
|
+
// V=clamp because equirect poles are clamped vertically.
|
|
962
|
+
const samplerRaw = device.createSampler({
|
|
963
|
+
label: 'ibl-precompute-sampler',
|
|
964
|
+
magFilter: 'linear',
|
|
965
|
+
minFilter: 'linear',
|
|
966
|
+
mipmapFilter: 'linear',
|
|
967
|
+
addressModeU: 'repeat',
|
|
968
|
+
addressModeV: 'clamp-to-edge',
|
|
969
|
+
addressModeW: 'clamp-to-edge',
|
|
970
|
+
});
|
|
971
|
+
const sampler = unwrap(samplerRaw);
|
|
972
|
+
if (sampler === undefined) return { ok: false, error: badAlloc('sampler') };
|
|
973
|
+
|
|
974
|
+
const encoderRaw = device.createCommandEncoder({ label: 'ibl-precompute-encoder' });
|
|
975
|
+
const encoder = unwrap(encoderRaw);
|
|
976
|
+
if (encoder === undefined) return { ok: false, error: badAlloc('encoder') };
|
|
977
|
+
|
|
978
|
+
// Bind group: equirect group(1).
|
|
979
|
+
const equirectBg = unwrap(
|
|
980
|
+
device.createBindGroup(
|
|
981
|
+
buildBgDesc({
|
|
982
|
+
label: 'ibl-equirect-bg',
|
|
983
|
+
layout: cache.equirectGroup1Bgl,
|
|
984
|
+
entries: [
|
|
985
|
+
{ binding: 0, resource: { kind: 'textureView', value: opts.equirectView } },
|
|
986
|
+
{ binding: 1, resource: { kind: 'sampler', value: sampler } },
|
|
987
|
+
],
|
|
988
|
+
}),
|
|
989
|
+
),
|
|
990
|
+
);
|
|
991
|
+
if (equirectBg === undefined) return { ok: false, error: badAlloc('equirect-bg') };
|
|
992
|
+
|
|
993
|
+
// Bind group: cube group(1) for irradiance + prefilter.
|
|
994
|
+
const cubeBg = unwrap(
|
|
995
|
+
device.createBindGroup(
|
|
996
|
+
buildBgDesc({
|
|
997
|
+
label: 'ibl-cube-bg',
|
|
998
|
+
layout: cache.cubeGroup1Bgl,
|
|
999
|
+
entries: [
|
|
1000
|
+
{ binding: 0, resource: { kind: 'textureView', value: opts.cubeView } },
|
|
1001
|
+
{ binding: 1, resource: { kind: 'sampler', value: sampler } },
|
|
1002
|
+
],
|
|
1003
|
+
}),
|
|
1004
|
+
),
|
|
1005
|
+
);
|
|
1006
|
+
if (cubeBg === undefined) return { ok: false, error: badAlloc('cube-bg') };
|
|
1007
|
+
|
|
1008
|
+
// (a) equirect-to-cube: 6 face draws.
|
|
1009
|
+
const cubeFaceViews = opts.cubeFaceViews;
|
|
1010
|
+
for (let face = 0; face < 6; face++) {
|
|
1011
|
+
const pass = encoder.beginRenderPass({
|
|
1012
|
+
label: 'ibl-equirect-to-cube',
|
|
1013
|
+
colorAttachments: [
|
|
1014
|
+
{
|
|
1015
|
+
view: cubeFaceViews[face],
|
|
1016
|
+
clearValue: { r: 0, g: 0, b: 0, a: 1 },
|
|
1017
|
+
loadOp: 'clear',
|
|
1018
|
+
storeOp: 'store',
|
|
1019
|
+
},
|
|
1020
|
+
],
|
|
1021
|
+
});
|
|
1022
|
+
// Face uniform: dynamic offset = face * 256.
|
|
1023
|
+
const faceBg = unwrap(
|
|
1024
|
+
device.createBindGroup(
|
|
1025
|
+
buildBgDesc({
|
|
1026
|
+
label: `ibl-face-bg-${face}`,
|
|
1027
|
+
layout: cache.faceUniformsBgl,
|
|
1028
|
+
entries: [
|
|
1029
|
+
{
|
|
1030
|
+
binding: 0,
|
|
1031
|
+
resource: {
|
|
1032
|
+
kind: 'buffer',
|
|
1033
|
+
value: {
|
|
1034
|
+
buffer: opts.faceUniformsBuffer,
|
|
1035
|
+
offset: face * 256,
|
|
1036
|
+
size: 64,
|
|
1037
|
+
},
|
|
1038
|
+
},
|
|
1039
|
+
},
|
|
1040
|
+
],
|
|
1041
|
+
}),
|
|
1042
|
+
),
|
|
1043
|
+
);
|
|
1044
|
+
if (faceBg === undefined) return { ok: false, error: badAlloc('face-bg') };
|
|
1045
|
+
pass.setPipeline(cache.equirectToCubePipeline);
|
|
1046
|
+
pass.setBindGroup(0, faceBg);
|
|
1047
|
+
pass.setBindGroup(1, equirectBg);
|
|
1048
|
+
pass.setVertexBuffer(0, opts.cubeVertexBuffer);
|
|
1049
|
+
pass.draw(6, 1, face * 6, 0);
|
|
1050
|
+
pass.end();
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
// (b) irradiance convolve: 6 face draws.
|
|
1054
|
+
const irrFaceViews = cache.irradianceFaceViews ?? [];
|
|
1055
|
+
for (let face = 0; face < 6; face++) {
|
|
1056
|
+
const pass = encoder.beginRenderPass({
|
|
1057
|
+
label: 'ibl-irradiance',
|
|
1058
|
+
colorAttachments: [
|
|
1059
|
+
{
|
|
1060
|
+
view: irrFaceViews[face],
|
|
1061
|
+
clearValue: { r: 0, g: 0, b: 0, a: 1 },
|
|
1062
|
+
loadOp: 'clear',
|
|
1063
|
+
storeOp: 'store',
|
|
1064
|
+
},
|
|
1065
|
+
],
|
|
1066
|
+
});
|
|
1067
|
+
const faceBg = unwrap(
|
|
1068
|
+
device.createBindGroup(
|
|
1069
|
+
buildBgDesc({
|
|
1070
|
+
label: `ibl-irr-face-bg-${face}`,
|
|
1071
|
+
layout: cache.faceUniformsBgl,
|
|
1072
|
+
entries: [
|
|
1073
|
+
{
|
|
1074
|
+
binding: 0,
|
|
1075
|
+
resource: {
|
|
1076
|
+
kind: 'buffer',
|
|
1077
|
+
value: {
|
|
1078
|
+
buffer: opts.faceUniformsBuffer,
|
|
1079
|
+
offset: face * 256,
|
|
1080
|
+
size: 64,
|
|
1081
|
+
},
|
|
1082
|
+
},
|
|
1083
|
+
},
|
|
1084
|
+
],
|
|
1085
|
+
}),
|
|
1086
|
+
),
|
|
1087
|
+
);
|
|
1088
|
+
if (faceBg === undefined) return { ok: false, error: badAlloc('irr-face-bg') };
|
|
1089
|
+
pass.setPipeline(cache.irradiancePipeline);
|
|
1090
|
+
pass.setBindGroup(0, faceBg);
|
|
1091
|
+
pass.setBindGroup(1, cubeBg);
|
|
1092
|
+
pass.setVertexBuffer(0, opts.cubeVertexBuffer);
|
|
1093
|
+
pass.draw(6, 1, face * 6, 0);
|
|
1094
|
+
pass.end();
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
// (c) prefilter env: 5 mips x 6 faces = 30 sub-passes.
|
|
1098
|
+
const prefMipViews = cache.prefilterFaceViewsByMip ?? [];
|
|
1099
|
+
for (let mip = 0; mip < PREFILTER_MIP_LEVELS; mip++) {
|
|
1100
|
+
const mipFaceViews = prefMipViews[mip] ?? [];
|
|
1101
|
+
for (let face = 0; face < 6; face++) {
|
|
1102
|
+
const subIdx = mip * 6 + face;
|
|
1103
|
+
const pass = encoder.beginRenderPass({
|
|
1104
|
+
label: 'ibl-prefilter',
|
|
1105
|
+
colorAttachments: [
|
|
1106
|
+
{
|
|
1107
|
+
view: mipFaceViews[face],
|
|
1108
|
+
clearValue: { r: 0, g: 0, b: 0, a: 1 },
|
|
1109
|
+
loadOp: 'clear',
|
|
1110
|
+
storeOp: 'store',
|
|
1111
|
+
},
|
|
1112
|
+
],
|
|
1113
|
+
});
|
|
1114
|
+
const bg = unwrap(
|
|
1115
|
+
device.createBindGroup(
|
|
1116
|
+
buildBgDesc({
|
|
1117
|
+
label: `ibl-pref-bg-${subIdx}`,
|
|
1118
|
+
layout: prefilterGroup0LayoutOf(cache),
|
|
1119
|
+
entries: [
|
|
1120
|
+
{
|
|
1121
|
+
binding: 0,
|
|
1122
|
+
resource: {
|
|
1123
|
+
kind: 'buffer',
|
|
1124
|
+
value: {
|
|
1125
|
+
buffer: opts.faceUniformsBuffer,
|
|
1126
|
+
offset: face * 256,
|
|
1127
|
+
size: 64,
|
|
1128
|
+
},
|
|
1129
|
+
},
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
binding: 1,
|
|
1133
|
+
resource: {
|
|
1134
|
+
kind: 'buffer',
|
|
1135
|
+
value: {
|
|
1136
|
+
buffer: opts.prefilterUniformsBuffer,
|
|
1137
|
+
offset: subIdx * 256,
|
|
1138
|
+
size: 16,
|
|
1139
|
+
},
|
|
1140
|
+
},
|
|
1141
|
+
},
|
|
1142
|
+
],
|
|
1143
|
+
}),
|
|
1144
|
+
),
|
|
1145
|
+
);
|
|
1146
|
+
if (bg === undefined) return { ok: false, error: badAlloc('pref-bg') };
|
|
1147
|
+
pass.setPipeline(cache.prefilterPipeline);
|
|
1148
|
+
pass.setBindGroup(0, bg);
|
|
1149
|
+
pass.setBindGroup(1, cubeBg);
|
|
1150
|
+
pass.setVertexBuffer(0, opts.cubeVertexBuffer);
|
|
1151
|
+
pass.draw(6, 1, face * 6, 0);
|
|
1152
|
+
pass.end();
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
// (d) brdf-lut: fullscreen triangle.
|
|
1157
|
+
{
|
|
1158
|
+
const pass = encoder.beginRenderPass({
|
|
1159
|
+
label: 'ibl-brdf-lut',
|
|
1160
|
+
colorAttachments: [
|
|
1161
|
+
{
|
|
1162
|
+
view: cache.brdfLutView,
|
|
1163
|
+
clearValue: { r: 0, g: 0, b: 0, a: 1 },
|
|
1164
|
+
loadOp: 'clear',
|
|
1165
|
+
storeOp: 'store',
|
|
1166
|
+
},
|
|
1167
|
+
],
|
|
1168
|
+
});
|
|
1169
|
+
pass.setPipeline(cache.brdfLutPipeline);
|
|
1170
|
+
pass.draw(3, 1, 0, 0);
|
|
1171
|
+
pass.end();
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
// Finish + submit. Counter increments are STRICTLY after submit; if
|
|
1175
|
+
// submit throws or fails, counters stay at 0 (AC-20 critical invariant).
|
|
1176
|
+
const finishRes = encoder.finish();
|
|
1177
|
+
// biome-ignore lint/suspicious/noExplicitAny: command buffer opaque
|
|
1178
|
+
let cmdBuffer: any;
|
|
1179
|
+
if (
|
|
1180
|
+
finishRes !== null &&
|
|
1181
|
+
finishRes !== undefined &&
|
|
1182
|
+
typeof finishRes === 'object' &&
|
|
1183
|
+
'ok' in finishRes
|
|
1184
|
+
) {
|
|
1185
|
+
if (!finishRes.ok) return { ok: false, error: badAlloc('finish') };
|
|
1186
|
+
cmdBuffer = finishRes.value;
|
|
1187
|
+
} else {
|
|
1188
|
+
cmdBuffer = finishRes;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
// Submit -- may throw on mock devices in failure-injection tests, or
|
|
1192
|
+
// return a structured Result.err on the rhi shim path. AC-20 critical:
|
|
1193
|
+
// counters are incremented ONLY if submit returns cleanly (no throw +
|
|
1194
|
+
// no .ok === false).
|
|
1195
|
+
let submitOk = true;
|
|
1196
|
+
let submitError: unknown;
|
|
1197
|
+
try {
|
|
1198
|
+
// biome-ignore lint/suspicious/noExplicitAny: submit returns Result|undefined
|
|
1199
|
+
const submitRes = device.queue.submit([cmdBuffer]) as any;
|
|
1200
|
+
if (
|
|
1201
|
+
submitRes !== null &&
|
|
1202
|
+
submitRes !== undefined &&
|
|
1203
|
+
typeof submitRes === 'object' &&
|
|
1204
|
+
'ok' in submitRes &&
|
|
1205
|
+
submitRes.ok === false
|
|
1206
|
+
) {
|
|
1207
|
+
submitOk = false;
|
|
1208
|
+
submitError = submitRes.error;
|
|
1209
|
+
}
|
|
1210
|
+
} catch (e) {
|
|
1211
|
+
submitOk = false;
|
|
1212
|
+
submitError = e;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
if (!submitOk) {
|
|
1216
|
+
return {
|
|
1217
|
+
ok: false,
|
|
1218
|
+
error: {
|
|
1219
|
+
code: 'ibl-precompute-not-dispatched',
|
|
1220
|
+
expected: 'device.queue.submit returned successfully',
|
|
1221
|
+
hint: `queue.submit failed: ${String(submitError)}; counters must not increment before queue.submit`,
|
|
1222
|
+
},
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
// POST-SUBMIT counter increments (AC-20).
|
|
1227
|
+
cache.irradianceBakeCount += 1;
|
|
1228
|
+
cache.prefilterBakeCount += 1;
|
|
1229
|
+
cache.brdfLutBakeCount += 1;
|
|
1230
|
+
|
|
1231
|
+
return { ok: true, value: { submitted: true } };
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
// Local helper -- structured error payload shared across allocation paths.
|
|
1235
|
+
function badAlloc(stage: string): { code: string; expected: string; hint: string } {
|
|
1236
|
+
return {
|
|
1237
|
+
code: 'ibl-precompute-not-dispatched',
|
|
1238
|
+
expected: `${stage} allocated successfully`,
|
|
1239
|
+
hint: `check queue.submit path is reachable and ${stage} GPU resource creation did not fail; counters must not increment before queue.submit`,
|
|
1240
|
+
};
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
// biome-ignore lint/suspicious/noExplicitAny: opaque BGL return
|
|
1244
|
+
function prefilterGroup0LayoutOf(cache: IblPipelineCachePerDevice): any {
|
|
1245
|
+
return cache.prefilterGroup0Bgl;
|
|
1246
|
+
}
|