@forgeax/engine-render 0.1.3 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +130 -641
- package/dist/.tsbuildinfo +1 -1
- package/dist/__tests__/device-scope-lifecycle.unit.test.d.ts +2 -0
- package/dist/__tests__/device-scope-lifecycle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/device-scope-stale-matrix.unit.test.d.ts +2 -0
- package/dist/__tests__/device-scope-stale-matrix.unit.test.d.ts.map +1 -0
- package/dist/__tests__/fullscreen-feature-plan.unit.test.d.ts +2 -0
- package/dist/__tests__/fullscreen-feature-plan.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-indirect-raster-evidence.d.ts.map +1 -1
- package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts +6 -0
- package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts.map +1 -1
- package/dist/{gpu-driven/view-reference.d.ts → __tests__/gpu-driven-view-reference.d.ts} +4 -4
- package/dist/__tests__/gpu-driven-view-reference.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene-render-graph-gpu.d.ts.map +1 -1
- package/dist/__tests__/ibl/face-uniforms.unit.test.d.ts +2 -0
- package/dist/__tests__/ibl/face-uniforms.unit.test.d.ts.map +1 -0
- package/dist/__tests__/morph-feature-plan.unit.test.d.ts +2 -0
- package/dist/__tests__/morph-feature-plan.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-plan.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-plan.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-plan.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-plan.unit.test.d.ts.map +1 -0
- package/dist/__tests__/ssao-config.unit.test.d.ts +2 -0
- package/dist/__tests__/ssao-config.unit.test.d.ts.map +1 -0
- package/dist/__tests__/standard-clustered-pipeline.unit.test.d.ts +2 -0
- package/dist/__tests__/standard-clustered-pipeline.unit.test.d.ts.map +1 -0
- package/dist/__tests__/standard-descriptors.test-d.d.ts +2 -0
- package/dist/__tests__/standard-descriptors.test-d.d.ts.map +1 -0
- package/dist/__tests__/standard-pipeline.dawn.test.d.ts +2 -0
- package/dist/__tests__/standard-pipeline.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/standard-pipeline.integration.test.d.ts +2 -0
- package/dist/__tests__/standard-pipeline.integration.test.d.ts.map +1 -0
- package/dist/__tests__/standard-profile-oracle.unit.test.d.ts +2 -0
- package/dist/__tests__/standard-profile-oracle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-resource-short-circuit.unit.test.d.ts +2 -0
- package/dist/__tests__/visibility-resource-short-circuit.unit.test.d.ts.map +1 -0
- package/dist/{renderer/backend-selection.d.ts → assembly/backend-contract.d.ts} +15 -4
- package/dist/assembly/backend-contract.d.ts.map +1 -0
- package/dist/assembly/factory.d.ts +207 -0
- package/dist/assembly/factory.d.ts.map +1 -0
- package/dist/assembly/host-contract.d.ts +84 -0
- package/dist/assembly/host-contract.d.ts.map +1 -0
- package/dist/{renderer → assembly}/material/assembly.d.ts +1 -2
- package/dist/{renderer → assembly}/material/assembly.d.ts.map +1 -1
- package/dist/assembly/material/pipeline-projection.d.ts +30 -0
- package/dist/assembly/material/pipeline-projection.d.ts.map +1 -0
- package/dist/authoring.d.ts +10 -11
- package/dist/authoring.d.ts.map +1 -1
- package/dist/authoring.mjs +25 -3
- package/dist/authoring.mjs.map +1 -1
- package/dist/chunk-CQXZC5XI.mjs +182 -0
- package/dist/chunk-CQXZC5XI.mjs.map +1 -0
- package/dist/chunk-QC4VW3XJ.mjs +79 -0
- package/dist/chunk-QC4VW3XJ.mjs.map +1 -0
- package/dist/chunk-SCRSAK5B.mjs +480 -0
- package/dist/chunk-SCRSAK5B.mjs.map +1 -0
- package/dist/components/__tests__/schema-contract.unit.test.d.ts +2 -0
- package/dist/components/__tests__/schema-contract.unit.test.d.ts.map +1 -0
- package/dist/components/glyph-text.d.ts +1 -1
- package/dist/components/glyph-text.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/instances.d.ts +1 -1
- package/dist/components/instances.d.ts.map +1 -1
- package/dist/components/light-helpers.d.ts +1 -1
- package/dist/components/light-helpers.d.ts.map +1 -1
- package/dist/components/mesh-filter.d.ts +7 -7
- package/dist/components/mesh-filter.d.ts.map +1 -1
- package/dist/components/scene-instance.d.ts +11 -11
- package/dist/components/skybox-background.d.ts +56 -0
- package/dist/components/skybox-background.d.ts.map +1 -0
- package/dist/components/skylight.d.ts +55 -0
- package/dist/components/skylight.d.ts.map +1 -0
- package/dist/components/sprite-animation.d.ts +2 -3
- package/dist/components/sprite-animation.d.ts.map +1 -1
- package/dist/components/sprite-instances.d.ts +1 -1
- package/dist/components/sprite-playback-mode.d.ts +6 -1
- package/dist/components/sprite-playback-mode.d.ts.map +1 -1
- package/dist/components/sprite-region-override.d.ts +2 -3
- package/dist/components/sprite-region-override.d.ts.map +1 -1
- package/dist/components/tile-layer.d.ts +5 -0
- package/dist/components/tile-layer.d.ts.map +1 -1
- package/dist/construct-renderer.d.ts +18 -1
- package/dist/construct-renderer.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +27008 -4
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/debug-draw-glue.d.ts +2 -53
- package/dist/debug-draw-glue.d.ts.map +1 -1
- package/dist/device/device-scope.d.ts +83 -0
- package/dist/device/device-scope.d.ts.map +1 -0
- package/dist/{gpu-resource-store.d.ts → device/gpu-residency.d.ts} +91 -48
- package/dist/device/gpu-residency.d.ts.map +1 -0
- package/dist/device/resource-types.d.ts +8 -0
- package/dist/device/resource-types.d.ts.map +1 -0
- package/dist/engine-metrics.d.ts +2 -2
- package/dist/engine-metrics.d.ts.map +1 -1
- package/dist/errors/recover.d.ts +28 -1
- package/dist/errors/recover.d.ts.map +1 -1
- package/dist/errors/render.d.ts +249 -258
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/features/fullscreen.d.ts +19 -0
- package/dist/features/fullscreen.d.ts.map +1 -0
- package/dist/features/host.d.ts +32 -26
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/morph/morph-feature.d.ts +39 -5
- package/dist/features/morph/morph-feature.d.ts.map +1 -1
- package/dist/features/plan.d.ts +182 -0
- package/dist/features/plan.d.ts.map +1 -0
- package/dist/features/prepared-gpu-work.d.ts +21 -17
- package/dist/features/prepared-gpu-work.d.ts.map +1 -1
- package/dist/features/prepared-graphics-store.d.ts +2 -1
- package/dist/features/prepared-graphics-store.d.ts.map +1 -1
- package/dist/features/prepared-graphics.d.ts +11 -21
- package/dist/features/prepared-graphics.d.ts.map +1 -1
- package/dist/features/render-graph-compute.d.ts +2 -2
- package/dist/features/render-graph-compute.d.ts.map +1 -1
- package/dist/features/render-graph-contribution.d.ts +4 -7
- package/dist/features/render-graph-contribution.d.ts.map +1 -1
- package/dist/features/render-graph-raster.d.ts +2 -2
- package/dist/features/render-graph-raster.d.ts.map +1 -1
- package/dist/features/render-graph-resources.d.ts +6 -6
- package/dist/features/render-graph-resources.d.ts.map +1 -1
- package/dist/features/targets.d.ts +5 -5
- package/dist/features/targets.d.ts.map +1 -1
- package/dist/features/types.d.ts +11 -190
- package/dist/features/types.d.ts.map +1 -1
- package/dist/features/vocabulary.d.ts +14 -0
- package/dist/features/vocabulary.d.ts.map +1 -0
- package/dist/fullscreen-post-process-pass.d.ts +4 -25
- package/dist/fullscreen-post-process-pass.d.ts.map +1 -1
- package/dist/glyph-text-layout-system.d.ts +3 -2
- package/dist/glyph-text-layout-system.d.ts.map +1 -1
- package/dist/gpu-driven/batch-topology.d.ts +6 -75
- package/dist/gpu-driven/batch-topology.d.ts.map +1 -1
- package/dist/gpu-driven/production-raster.d.ts +13 -112
- package/dist/gpu-driven/production-raster.d.ts.map +1 -1
- package/dist/gpu-driven/view-gpu.d.ts +10 -66
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
- package/dist/gpu-resource.d.ts +3 -3
- package/dist/gpu-scene-schema.d.ts +1 -94
- package/dist/gpu-scene-schema.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +7 -33
- package/dist/gpu-scene.d.ts.map +1 -1
- package/dist/hdrp-buffers.d.ts +3 -53
- package/dist/hdrp-buffers.d.ts.map +1 -1
- package/dist/ibl/IblPipelineCache.d.ts +74 -180
- package/dist/ibl/IblPipelineCache.d.ts.map +1 -1
- package/dist/ibl/skylight-bind-group.d.ts +1 -1
- package/dist/index.d.ts +13 -43
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +165 -3
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +69 -0
- package/dist/inspection-types.d.ts.map +1 -0
- package/dist/instance-buffer-cache.d.ts +1 -4
- package/dist/instance-buffer-cache.d.ts.map +1 -1
- package/dist/internal.d.ts +1 -73
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.mjs +1 -43
- package/dist/internal.mjs.map +1 -1
- package/dist/lifecycle.d.ts +36 -2
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/materials.d.ts +0 -3
- package/dist/materials.d.ts.map +1 -1
- package/dist/mesh-material-bindings.d.ts +0 -1
- package/dist/mesh-material-bindings.d.ts.map +1 -1
- package/dist/pbr-pipeline.d.ts +75 -29
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-forward-lane.d.ts +5 -0
- package/dist/pipeline/standard-forward-lane.d.ts.map +1 -0
- package/dist/pipeline/standard-pipeline.d.ts +31 -0
- package/dist/pipeline/standard-pipeline.d.ts.map +1 -0
- package/dist/pipeline/standard-profile.d.ts +40 -0
- package/dist/pipeline/standard-profile.d.ts.map +1 -0
- package/dist/pipeline-builder.d.ts +3 -3
- package/dist/pipeline-builder.d.ts.map +1 -1
- package/dist/pipeline-spec-types.d.ts +24 -0
- package/dist/pipeline-spec-types.d.ts.map +1 -0
- package/dist/pipeline-spec.d.ts +16 -155
- package/dist/pipeline-spec.d.ts.map +1 -1
- package/dist/plugin.d.ts +1 -14
- package/dist/plugin.d.ts.map +1 -1
- package/dist/post-process-errors.d.ts +18 -18
- package/dist/post-process-errors.d.ts.map +1 -1
- package/dist/prepare/prepared-graphics-resolver.d.ts +2 -5
- package/dist/prepare/prepared-graphics-resolver.d.ts.map +1 -1
- package/dist/record/__tests__/typed-frame-graph-plan.unit.test.d.ts +2 -0
- package/dist/record/__tests__/typed-frame-graph-plan.unit.test.d.ts.map +1 -0
- package/dist/record/frame-lighting.d.ts +7 -73
- package/dist/record/frame-lighting.d.ts.map +1 -1
- package/dist/record/frame-snapshot.d.ts +44 -44
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame-targets.d.ts +5 -38
- package/dist/record/frame-targets.d.ts.map +1 -1
- package/dist/record/frame.d.ts +64 -52
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/helpers.d.ts +3 -2
- package/dist/record/helpers.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +5 -4
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +90 -59
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass-sprite-draws.d.ts +28 -3
- package/dist/record/main-pass-sprite-draws.d.ts.map +1 -1
- package/dist/record/main-pass.d.ts +1 -1
- package/dist/record/main-pass.d.ts.map +1 -1
- package/dist/record/mesh-ssbo.d.ts +276 -3
- package/dist/record/mesh-ssbo.d.ts.map +1 -1
- package/dist/record/render-context.d.ts +235 -0
- package/dist/record/render-context.d.ts.map +1 -0
- package/dist/record/shadow-pass.d.ts +15 -88
- package/dist/record/shadow-pass.d.ts.map +1 -1
- package/dist/record/skybox-post-pass.d.ts +1 -1
- package/dist/record/skybox-post-pass.d.ts.map +1 -1
- package/dist/record/typed-frame-graph.d.ts +29 -7
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/record/view-ubo.d.ts +3 -3
- package/dist/record/view-ubo.d.ts.map +1 -1
- package/dist/render-contract.d.ts +416 -0
- package/dist/render-contract.d.ts.map +1 -0
- package/dist/render-data.d.ts.map +1 -1
- package/dist/render-graph-primitives.d.ts +14 -362
- package/dist/render-graph-primitives.d.ts.map +1 -1
- package/dist/render-pipeline.d.ts +25 -64
- package/dist/render-pipeline.d.ts.map +1 -1
- package/dist/render-system-extract.d.ts +107 -338
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system.d.ts +21 -713
- package/dist/render-system.d.ts.map +1 -1
- package/dist/scene/render-scene-types.d.ts +58 -0
- package/dist/scene/render-scene-types.d.ts.map +1 -0
- package/dist/scene/render-scene.d.ts +105 -0
- package/dist/scene/render-scene.d.ts.map +1 -0
- package/dist/scene-instances/post-spawn-resolve-joints.d.ts +2 -5
- package/dist/scene-instances/post-spawn-resolve-joints.d.ts.map +1 -1
- package/dist/ssao-buffers.d.ts +22 -3
- package/dist/ssao-buffers.d.ts.map +1 -1
- package/dist/systems/skin-palette-allocator.d.ts +2 -4
- package/dist/systems/skin-palette-allocator.d.ts.map +1 -1
- package/dist/systems/skin-palette-types.d.ts +14 -0
- package/dist/systems/skin-palette-types.d.ts.map +1 -0
- package/dist/systems/transparent-sort-config.d.ts +23 -2
- package/dist/systems/transparent-sort-config.d.ts.map +1 -1
- package/dist/tilemap-chunk-extract-system.d.ts +4 -3
- package/dist/tilemap-chunk-extract-system.d.ts.map +1 -1
- package/dist/typed-render-graph-primitives.d.ts +2 -4
- package/dist/typed-render-graph-primitives.d.ts.map +1 -1
- package/dist/typed-shadow-passes.d.ts +3 -3
- package/dist/typed-shadow-passes.d.ts.map +1 -1
- package/package.json +23 -23
- package/src/__tests__/backend-selection-rhi-capture.test-d.ts +1 -1
- package/src/__tests__/callback-inference.test-d.ts +6 -3
- package/src/__tests__/cluster-grid-default-surface.unit.test.ts +7 -4
- package/src/__tests__/construct-renderer-identity.unit.test.ts +15 -2
- package/src/__tests__/device-scope-lifecycle.unit.test.ts +151 -0
- package/src/__tests__/device-scope-stale-matrix.unit.test.ts +42 -0
- package/src/__tests__/direct-extract-consumer-contract.test-d.ts +8 -19
- package/src/__tests__/direct-light-snapshot.unit.test.ts +3 -13
- package/src/__tests__/factory-contract.integration.test.ts +158 -209
- package/src/__tests__/fallback-row-stride-surface.unit.test.ts +1 -4
- package/src/__tests__/frame-observation.contract.test.ts +17 -8
- package/src/__tests__/fullscreen-feature-plan.unit.test.ts +32 -0
- package/src/__tests__/glyph-text-layout-recovery.unit.test.ts +6 -11
- package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +9 -16
- package/src/__tests__/gpu-driven-production.integration.test.ts +32 -205
- package/src/__tests__/gpu-driven-scaling.unit.test.ts +4 -7
- package/src/__tests__/gpu-driven-view-gpu-evidence.ts +87 -8
- package/src/__tests__/gpu-driven-view-graph.integration.test.ts +170 -8
- package/src/{gpu-driven/view-reference.ts → __tests__/gpu-driven-view-reference.ts} +4 -3
- package/src/__tests__/gpu-driven-view.browser.test.ts +12 -1
- package/src/__tests__/gpu-driven-view.dawn.test.ts +12 -1
- package/src/__tests__/gpu-driven-view.unit.test.ts +11 -267
- package/src/__tests__/gpu-resource-store-stride.unit.test.ts +3 -3
- package/src/__tests__/gpu-scene-render-graph-gpu.ts +2 -3
- package/src/__tests__/gpu-scene.dawn.test.ts +2 -6
- package/src/__tests__/gpu-scene.unit.test.ts +10 -24
- package/src/__tests__/ibl/face-uniforms.unit.test.ts +46 -0
- package/src/__tests__/infinite-grid-no-vertex-probe.unit.test.ts +34 -66
- package/src/__tests__/ktx2-basis-gpu-consumer.dawn.test.ts +14 -5
- package/src/__tests__/light-buffer-layout.unit.test.ts +4 -49
- package/src/__tests__/material-cooked-projection.unit.test.ts +2 -51
- package/src/__tests__/material-snapshot-mutation.integration.test.ts +10 -15
- package/src/__tests__/material-static-dynamic-route.unit.test.ts +4 -23
- package/src/__tests__/material-stride-surface.unit.test.ts +2 -2
- package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +7 -8
- package/src/__tests__/morph-culling-reentry.dawn.test.ts +29 -38
- package/src/__tests__/morph-feature-gpu-work.integration.test.ts +45 -43
- package/src/__tests__/morph-feature-plan.unit.test.ts +53 -0
- package/src/__tests__/morph-visual-evidence.integration.test.ts +47 -33
- package/src/__tests__/nineslice-handle-surface.unit.test.ts +11 -6
- package/src/__tests__/post-process-error-policy-owner.unit.test.ts +6 -13
- package/src/__tests__/prepared-graphics-capability.unit.test.ts +6 -81
- package/src/__tests__/prepared-graphics-generation.unit.test.ts +3 -17
- package/src/__tests__/prepared-graphics-lifecycle.unit.test.ts +6 -74
- package/src/__tests__/prepared-graphics-resolver.unit.test.ts +1 -3
- package/src/__tests__/prepared-graphics-snapshot.unit.test.ts +2 -2
- package/src/__tests__/profiler-default-off.test.ts +1 -1
- package/src/__tests__/profiler-phase-catalog.test.ts +2 -2
- package/src/__tests__/profiler-phase-integration.test.ts +5 -13
- package/src/__tests__/profiler-phase-token.test.ts +3 -8
- package/src/__tests__/public-surface.test-d.ts +65 -3
- package/src/__tests__/recover-error-policy-owner.unit.test.ts +1 -21
- package/src/__tests__/render-error-code-owner.test-d.ts +18 -23
- package/src/__tests__/render-error-detail-ssot.test-d.ts +0 -95
- package/src/__tests__/render-error-exhaustive.test-d.ts +8 -1
- package/src/__tests__/render-feature-assembly.test-d.ts +8 -16
- package/src/__tests__/render-feature-context.test-d.ts +16 -40
- package/src/__tests__/render-feature-contract.test-d.ts +9 -18
- package/src/__tests__/render-feature-diagnostics.unit.test.ts +6 -8
- package/src/__tests__/render-feature-docs.unit.test.ts +8 -7
- package/src/__tests__/render-feature-gpu-work.integration.test.ts +14 -75
- package/src/__tests__/render-feature-plan.test-d.ts +161 -0
- package/src/__tests__/render-feature-plan.unit.test.ts +170 -0
- package/src/__tests__/render-feature-prepared-diagnostics.unit.test.ts +8 -19
- package/src/__tests__/render-feature-prepared-errors.test-d.ts +3 -6
- package/src/__tests__/render-feature-prepared-graphics-docs.unit.test.ts +10 -71
- package/src/__tests__/render-feature-prepared-graphics-isolation.unit.test.ts +11 -61
- package/src/__tests__/render-feature-prepared-graphics-negative.test-d.ts +20 -43
- package/src/__tests__/render-feature-prepared-graphics.test-d.ts +56 -78
- package/src/__tests__/render-feature-public-surface.test-d.ts +6 -24
- package/src/__tests__/render-feature-retry.unit.test.ts +7 -48
- package/src/__tests__/render-feature-scheduling.unit.test.ts +15 -27
- package/src/__tests__/render-feature-stage-failed-policy-owner.unit.test.ts +0 -9
- package/src/__tests__/render-feature-stage-fault-recovery.unit.test.ts +19 -109
- package/src/__tests__/render-feature-visibility-context.test-d.ts +1 -6
- package/src/__tests__/render-feature-visibility-context.unit.test.ts +1 -2
- package/src/__tests__/render-feature-zero-work.unit.test.ts +14 -20
- package/src/__tests__/render-scene-projection.unit.test.ts +73 -111
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +46 -50
- package/src/__tests__/renderer-lifecycle.integration.test.ts +49 -1
- package/src/__tests__/shader-stage-surface.unit.test.ts +14 -9
- package/src/__tests__/ssao-config.unit.test.ts +36 -0
- package/src/__tests__/ssao-kernel-surface.unit.test.ts +4 -5
- package/src/__tests__/standard-clustered-pipeline.unit.test.ts +28 -0
- package/src/__tests__/standard-descriptors.test-d.ts +22 -0
- package/src/__tests__/standard-pipeline.dawn.test.ts +61 -0
- package/src/__tests__/standard-pipeline.integration.test.ts +124 -0
- package/src/__tests__/standard-profile-oracle.unit.test.ts +62 -0
- package/src/__tests__/surface-configuration.unit.test.ts +1 -2
- package/src/__tests__/texture-usage-surface.unit.test.ts +3 -6
- package/src/__tests__/typed-pipeline-topology.unit.test.ts +40 -206
- package/src/__tests__/urp-pipeline-targets.unit.test.ts +1 -11
- package/src/__tests__/urp-pipeline.unit.test.ts +2 -2
- package/src/__tests__/vertex-color-pipeline.unit.test.ts +10 -2
- package/src/__tests__/vertex-layout-consumer.unit.test.ts +1 -1
- package/src/__tests__/visibility-diagnostics.integration.test.ts +7 -11
- package/src/__tests__/visibility-extract.integration.test.ts +20 -11
- package/src/__tests__/visibility-extract.perf.test.ts +66 -32
- package/src/__tests__/visibility-feature-dedup.integration.test.ts +2 -4
- package/src/__tests__/visibility-hidden-report.unit.test.ts +1 -2
- package/src/__tests__/visibility-instances.integration.test.ts +7 -11
- package/src/__tests__/visibility-multi-world.integration.test.ts +38 -6
- package/src/__tests__/visibility-producer-matrix.integration.test.ts +18 -41
- package/src/__tests__/visibility-public-surface.test-d.ts +10 -9
- package/src/__tests__/visibility-resolver.unit.test.ts +2 -1
- package/src/__tests__/visibility-resource-short-circuit.unit.test.ts +80 -0
- package/src/__tests__/visibility-snapshot-contract.unit.test.ts +2 -1
- package/src/__tests__/vocabulary.unit.test.ts +1 -1
- package/src/assembly/backend-contract.ts +57 -0
- package/src/{renderer/renderer-factory.ts → assembly/factory.ts} +1709 -2693
- package/src/assembly/host-contract.ts +101 -0
- package/src/{renderer → assembly}/material/assembly.ts +1 -3
- package/src/assembly/material/pipeline-projection.ts +63 -0
- package/src/authoring.ts +14 -22
- package/src/components/__tests__/schema-contract.unit.test.ts +10 -0
- package/src/components/glyph-text.ts +3 -2
- package/src/components/index.ts +7 -9
- package/src/components/instances.ts +4 -5
- package/src/components/light-helpers.ts +1 -1
- package/src/components/mesh-filter.ts +11 -10
- package/src/components/post-process-params.ts +3 -3
- package/src/components/scene-instance.ts +12 -12
- package/src/components/skybox-background.ts +103 -0
- package/src/components/{environment.ts → skylight.ts} +2 -111
- package/src/components/sprite-animation.ts +3 -4
- package/src/components/sprite-instances.ts +2 -2
- package/src/components/sprite-playback-mode.ts +7 -1
- package/src/components/sprite-region-override.ts +2 -3
- package/src/components/tile-layer.ts +8 -2
- package/src/construct-renderer.ts +67 -4
- package/src/debug-draw-glue.ts +8 -129
- package/src/device/device-scope.ts +306 -0
- package/src/{gpu-resource-store.ts → device/gpu-residency.ts} +540 -639
- package/src/device/resource-types.ts +20 -0
- package/src/engine-metrics.ts +12 -19
- package/src/errors/recover.ts +45 -3
- package/src/errors/render.ts +357 -460
- package/src/features/fullscreen.ts +46 -0
- package/src/features/host.ts +575 -309
- package/src/features/morph/morph-feature.ts +195 -105
- package/src/features/plan.ts +447 -0
- package/src/features/prepared-gpu-work.ts +72 -15
- package/src/features/prepared-graphics-store.ts +20 -6
- package/src/features/prepared-graphics.ts +12 -71
- package/src/features/render-graph-compute.ts +14 -5
- package/src/features/render-graph-contribution.ts +43 -63
- package/src/features/render-graph-raster.ts +11 -6
- package/src/features/render-graph-resources.ts +25 -23
- package/src/features/targets.ts +8 -21
- package/src/features/types.ts +39 -227
- package/src/features/vocabulary.ts +24 -0
- package/src/fullscreen-post-process-pass.ts +14 -57
- package/src/glyph-text-layout-system.ts +70 -96
- package/src/gpu-driven/batch-topology.ts +24 -202
- package/src/gpu-driven/production-raster.ts +93 -1108
- package/src/gpu-driven/view-gpu.ts +46 -192
- package/src/gpu-resource.ts +4 -4
- package/src/gpu-scene-schema.ts +11 -99
- package/src/gpu-scene.ts +231 -364
- package/src/hdrp-buffers.ts +12 -221
- package/src/ibl/IblPipelineCache.ts +471 -711
- package/src/ibl/skylight-bind-group.ts +4 -4
- package/src/index.ts +58 -217
- package/src/inspection-types.ts +76 -0
- package/src/instance-buffer-cache.ts +1 -29
- package/src/internal.ts +6 -85
- package/src/lifecycle.ts +64 -19
- package/src/materials.ts +7 -29
- package/src/mesh-material-bindings.ts +0 -1
- package/src/pbr-pipeline.ts +434 -53
- package/src/{urp-pipeline.ts → pipeline/standard-forward-lane.ts} +38 -149
- package/src/{hdrp-pipeline.ts → pipeline/standard-pipeline.ts} +221 -191
- package/src/pipeline/standard-profile.ts +65 -0
- package/src/pipeline-builder.ts +60 -64
- package/src/pipeline-spec-types.ts +28 -0
- package/src/pipeline-spec.ts +72 -609
- package/src/plugin.ts +3 -75
- package/src/post-process-errors.ts +31 -33
- package/src/prepare/prepared-graphics-resolver.ts +5 -4
- package/src/record/__tests__/material-slot-plan.unit.test.ts +1 -33
- package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +41 -0
- package/src/record/__tests__/video-texture-view.unit.test.ts +1 -1
- package/src/record/frame-lighting.ts +74 -195
- package/src/record/frame-snapshot.ts +45 -60
- package/src/record/frame-targets.ts +8 -243
- package/src/record/frame.ts +509 -796
- package/src/record/helpers.ts +6 -11
- package/src/record/main-pass-geometry.ts +106 -147
- package/src/record/main-pass-material.ts +517 -190
- package/src/record/main-pass-sprite-draws.ts +198 -117
- package/src/record/main-pass.ts +162 -143
- package/src/record/mesh-ssbo.ts +517 -38
- package/src/record/render-context.ts +364 -0
- package/src/record/shadow-pass.ts +138 -1838
- package/src/record/skybox-post-pass.ts +12 -14
- package/src/record/typed-frame-graph.ts +215 -254
- package/src/record/view-ubo.ts +6 -37
- package/src/render-contract.ts +571 -0
- package/src/render-data.ts +3 -3
- package/src/render-graph-primitives.ts +76 -851
- package/src/render-pipeline.ts +104 -188
- package/src/render-system-extract.ts +1048 -1729
- package/src/render-system.ts +330 -1957
- package/src/scene/render-scene-types.ts +64 -0
- package/src/scene/render-scene.ts +1032 -0
- package/src/scene-instances/post-spawn-resolve-joints.ts +4 -7
- package/src/ssao-buffers.ts +167 -8
- package/src/systems/skin-palette-allocator.ts +21 -64
- package/src/systems/skin-palette-types.ts +14 -0
- package/src/systems/transparent-sort-config.ts +25 -3
- package/src/tilemap-chunk-extract-system.ts +53 -70
- package/src/typed-render-graph-primitives.ts +35 -24
- package/src/typed-shadow-passes.ts +26 -56
- package/dist/__tests__/analytic-sky-contract.test.d.ts +0 -2
- package/dist/__tests__/analytic-sky-contract.test.d.ts.map +0 -1
- package/dist/__tests__/analytic-sky-falsify.test.d.ts +0 -2
- package/dist/__tests__/analytic-sky-falsify.test.d.ts.map +0 -1
- package/dist/__tests__/assets-runtime-handoff.integration.test.d.ts +0 -2
- package/dist/__tests__/assets-runtime-handoff.integration.test.d.ts.map +0 -1
- package/dist/__tests__/backend-selection.integration.test.d.ts +0 -2
- package/dist/__tests__/backend-selection.integration.test.d.ts.map +0 -1
- package/dist/__tests__/camera-temporal.test-d.d.ts +0 -2
- package/dist/__tests__/camera-temporal.test-d.d.ts.map +0 -1
- package/dist/__tests__/camera-temporal.test.d.ts +0 -2
- package/dist/__tests__/camera-temporal.test.d.ts.map +0 -1
- package/dist/__tests__/directional-shadow-probe-atlas-layout.unit.test.d.ts +0 -2
- package/dist/__tests__/directional-shadow-probe-atlas-layout.unit.test.d.ts.map +0 -1
- package/dist/__tests__/environment-inspection.test.d.ts +0 -2
- package/dist/__tests__/environment-inspection.test.d.ts.map +0 -1
- package/dist/__tests__/fog-ai-user.fixture.d.ts +0 -2
- package/dist/__tests__/fog-ai-user.fixture.d.ts.map +0 -1
- package/dist/__tests__/fog-custom-render-feature.fixture.d.ts +0 -16
- package/dist/__tests__/fog-custom-render-feature.fixture.d.ts.map +0 -1
- package/dist/__tests__/fog-custom-render-feature.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-custom-render-feature.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-inspection.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-inspection.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-owner-state.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-owner-state.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-pipeline-topology.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-pipeline-topology.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-public-surface.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-public-surface.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-ray-contract.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-ray-contract.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-source-absence.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-source-absence.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fog-temporal.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-temporal.integration.test.d.ts.map +0 -1
- package/dist/__tests__/frame-chain.unit.test.d.ts +0 -2
- package/dist/__tests__/frame-chain.unit.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-scene-field-type-owner.test-d.d.ts +0 -2
- package/dist/__tests__/gpu-scene-field-type-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/hdrp-pipeline.unit.test.d.ts +0 -2
- package/dist/__tests__/hdrp-pipeline.unit.test.d.ts.map +0 -1
- package/dist/__tests__/ibl/ibl-fallback.unit.test.d.ts +0 -2
- package/dist/__tests__/ibl/ibl-fallback.unit.test.d.ts.map +0 -1
- package/dist/__tests__/material-derived-error-stop-draw.integration.test.d.ts +0 -2
- package/dist/__tests__/material-derived-error-stop-draw.integration.test.d.ts.map +0 -1
- package/dist/__tests__/material-derived-payload.integration.test.d.ts +0 -2
- package/dist/__tests__/material-derived-payload.integration.test.d.ts.map +0 -1
- package/dist/__tests__/materials.unit.test.d.ts +0 -2
- package/dist/__tests__/materials.unit.test.d.ts.map +0 -1
- package/dist/__tests__/param-schema-projection-census.unit.test.d.ts +0 -2
- package/dist/__tests__/param-schema-projection-census.unit.test.d.ts.map +0 -1
- package/dist/__tests__/persistent-render-scene.unit.test.d.ts +0 -2
- package/dist/__tests__/persistent-render-scene.unit.test.d.ts.map +0 -1
- package/dist/__tests__/pipeline-error-policy-owner.unit.test.d.ts +0 -2
- package/dist/__tests__/pipeline-error-policy-owner.unit.test.d.ts.map +0 -1
- package/dist/__tests__/pipeline-pass-trace.test.d.ts +0 -2
- package/dist/__tests__/pipeline-pass-trace.test.d.ts.map +0 -1
- package/dist/__tests__/pipeline-stage-owner.test-d.d.ts +0 -2
- package/dist/__tests__/pipeline-stage-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/plugin.test.d.ts +0 -2
- package/dist/__tests__/plugin.test.d.ts.map +0 -1
- package/dist/__tests__/prepared-graphics-backend-matrix.unit.test.d.ts +0 -2
- package/dist/__tests__/prepared-graphics-backend-matrix.unit.test.d.ts.map +0 -1
- package/dist/__tests__/prepared-graphics-resolver-recording.unit.test.d.ts +0 -2
- package/dist/__tests__/prepared-graphics-resolver-recording.unit.test.d.ts.map +0 -1
- package/dist/__tests__/public-pipeline-id.test-d.d.ts +0 -2
- package/dist/__tests__/public-pipeline-id.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-dispatch-membership.unit.test.d.ts +0 -2
- package/dist/__tests__/render-dispatch-membership.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-construction.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-construction.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-error-code-owner.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-error-code-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-gpu-buffer-usage-owner.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-gpu-buffer-usage-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-graph.integration.test.d.ts +0 -2
- package/dist/__tests__/render-feature-graph.integration.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-graphics-staging.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-graphics-staging.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-order.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-order.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-prepared-graphics-recording.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-prepared-graphics-recording.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-staging.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-staging.unit.test.d.ts.map +0 -1
- package/dist/__tests__/renderer-render-scene-public.test-d.d.ts +0 -2
- package/dist/__tests__/renderer-render-scene-public.test-d.d.ts.map +0 -1
- package/dist/__tests__/scene-temporal-coverage.unit.test.d.ts +0 -2
- package/dist/__tests__/scene-temporal-coverage.unit.test.d.ts.map +0 -1
- package/dist/__tests__/sun-snapshot-consumers.test.d.ts +0 -2
- package/dist/__tests__/sun-snapshot-consumers.test.d.ts.map +0 -1
- package/dist/__tests__/surface-backend-kind-owner.test-d.d.ts +0 -2
- package/dist/__tests__/surface-backend-kind-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/taa-history-store.unit.test.d.ts +0 -2
- package/dist/__tests__/taa-history-store.unit.test.d.ts.map +0 -1
- package/dist/__tests__/temporal-frame-transaction.integration.test.d.ts +0 -2
- package/dist/__tests__/temporal-frame-transaction.integration.test.d.ts.map +0 -1
- package/dist/__tests__/temporal-inspection.unit.test.d.ts +0 -2
- package/dist/__tests__/temporal-inspection.unit.test.d.ts.map +0 -1
- package/dist/assets/__tests__/asset-decoders.unit.test.d.ts +0 -2
- package/dist/assets/__tests__/asset-decoders.unit.test.d.ts.map +0 -1
- package/dist/assets/__tests__/mipmap-generator.unit.test.d.ts +0 -2
- package/dist/assets/__tests__/mipmap-generator.unit.test.d.ts.map +0 -1
- package/dist/assets/__tests__/render-asset-port.unit.test.d.ts +0 -2
- package/dist/assets/__tests__/render-asset-port.unit.test.d.ts.map +0 -1
- package/dist/assets/__tests__/resolve-render-asset.unit.test.d.ts +0 -2
- package/dist/assets/__tests__/resolve-render-asset.unit.test.d.ts.map +0 -1
- package/dist/chunk-33UF5SAO.mjs +0 -7397
- package/dist/chunk-33UF5SAO.mjs.map +0 -1
- package/dist/chunk-A5QCJSNL.mjs +0 -29913
- package/dist/chunk-A5QCJSNL.mjs.map +0 -1
- package/dist/chunk-JMSB7AR4.mjs +0 -3
- package/dist/chunk-JMSB7AR4.mjs.map +0 -1
- package/dist/chunk-LXNGO6AO.mjs +0 -569
- package/dist/chunk-LXNGO6AO.mjs.map +0 -1
- package/dist/chunk-QRXPSX4X.mjs +0 -659
- package/dist/chunk-QRXPSX4X.mjs.map +0 -1
- package/dist/chunk-YAKEQPWO.mjs +0 -1439
- package/dist/chunk-YAKEQPWO.mjs.map +0 -1
- package/dist/components/__tests__/atmosphere-red.test.d.ts +0 -2
- package/dist/components/__tests__/atmosphere-red.test.d.ts.map +0 -1
- package/dist/components/__tests__/atmosphere.test.d.ts +0 -2
- package/dist/components/__tests__/atmosphere.test.d.ts.map +0 -1
- package/dist/components/__tests__/fog.test-d.d.ts +0 -2
- package/dist/components/__tests__/fog.test-d.d.ts.map +0 -1
- package/dist/components/__tests__/fog.test.d.ts +0 -2
- package/dist/components/__tests__/fog.test.d.ts.map +0 -1
- package/dist/components/atmosphere.d.ts +0 -18
- package/dist/components/atmosphere.d.ts.map +0 -1
- package/dist/components/environment.d.ts +0 -116
- package/dist/components/environment.d.ts.map +0 -1
- package/dist/deferred-lighting.d.ts +0 -13
- package/dist/deferred-lighting.d.ts.map +0 -1
- package/dist/dynamic-texture-store.d.ts +0 -42
- package/dist/dynamic-texture-store.d.ts.map +0 -1
- package/dist/environment/__tests__/failure-injection.test.d.ts +0 -2
- package/dist/environment/__tests__/failure-injection.test.d.ts.map +0 -1
- package/dist/environment/__tests__/generation-red.test.d.ts +0 -2
- package/dist/environment/__tests__/generation-red.test.d.ts.map +0 -1
- package/dist/environment/__tests__/generation.test.d.ts +0 -2
- package/dist/environment/__tests__/generation.test.d.ts.map +0 -1
- package/dist/environment/__tests__/graph-transaction.test.d.ts +0 -2
- package/dist/environment/__tests__/graph-transaction.test.d.ts.map +0 -1
- package/dist/environment/__tests__/inspection-red.test.d.ts +0 -2
- package/dist/environment/__tests__/inspection-red.test.d.ts.map +0 -1
- package/dist/environment/__tests__/lifecycle-evidence.test.d.ts +0 -2
- package/dist/environment/__tests__/lifecycle-evidence.test.d.ts.map +0 -1
- package/dist/environment/__tests__/pipeline-topology.test.d.ts +0 -2
- package/dist/environment/__tests__/pipeline-topology.test.d.ts.map +0 -1
- package/dist/environment/__tests__/readiness.test.d.ts +0 -2
- package/dist/environment/__tests__/readiness.test.d.ts.map +0 -1
- package/dist/environment/__tests__/recovery.test.d.ts +0 -2
- package/dist/environment/__tests__/recovery.test.d.ts.map +0 -1
- package/dist/environment/__tests__/resize-dispose.test.d.ts +0 -2
- package/dist/environment/__tests__/resize-dispose.test.d.ts.map +0 -1
- package/dist/environment/__tests__/signature-red.test.d.ts +0 -2
- package/dist/environment/__tests__/signature-red.test.d.ts.map +0 -1
- package/dist/environment/__tests__/signature.test.d.ts +0 -2
- package/dist/environment/__tests__/signature.test.d.ts.map +0 -1
- package/dist/environment/descriptors.d.ts +0 -2
- package/dist/environment/descriptors.d.ts.map +0 -1
- package/dist/environment/extracted-environment.d.ts +0 -53
- package/dist/environment/extracted-environment.d.ts.map +0 -1
- package/dist/environment/generation.d.ts +0 -62
- package/dist/environment/generation.d.ts.map +0 -1
- package/dist/environment/gpu-bundle.d.ts +0 -23
- package/dist/environment/gpu-bundle.d.ts.map +0 -1
- package/dist/environment/graph.d.ts +0 -108
- package/dist/environment/graph.d.ts.map +0 -1
- package/dist/environment/inspection.d.ts +0 -48
- package/dist/environment/inspection.d.ts.map +0 -1
- package/dist/environment/lifecycle.d.ts +0 -22
- package/dist/environment/lifecycle.d.ts.map +0 -1
- package/dist/environment/readiness.d.ts +0 -29
- package/dist/environment/readiness.d.ts.map +0 -1
- package/dist/environment/signature.d.ts +0 -70
- package/dist/environment/signature.d.ts.map +0 -1
- package/dist/extract/__tests__/directional-csm-domain.unit.test.d.ts +0 -2
- package/dist/extract/__tests__/directional-csm-domain.unit.test.d.ts.map +0 -1
- package/dist/extract/__tests__/environment-source.test.d.ts +0 -2
- package/dist/extract/__tests__/environment-source.test.d.ts.map +0 -1
- package/dist/extract/__tests__/schema-readers.unit.test.d.ts +0 -2
- package/dist/extract/__tests__/schema-readers.unit.test.d.ts.map +0 -1
- package/dist/extract/directional-csm.d.ts +0 -129
- package/dist/extract/directional-csm.d.ts.map +0 -1
- package/dist/extract/index.d.ts +0 -5
- package/dist/extract/index.d.ts.map +0 -1
- package/dist/extract/material-interface.d.ts +0 -56
- package/dist/extract/material-interface.d.ts.map +0 -1
- package/dist/extract/schema-readers.d.ts +0 -20
- package/dist/extract/schema-readers.d.ts.map +0 -1
- package/dist/features/graph-contribution.d.ts +0 -64
- package/dist/features/graph-contribution.d.ts.map +0 -1
- package/dist/features/index.d.ts +0 -21
- package/dist/features/index.d.ts.map +0 -1
- package/dist/features/morph/index.d.ts +0 -3
- package/dist/features/morph/index.d.ts.map +0 -1
- package/dist/features/morph/morph-bounds.d.ts +0 -42
- package/dist/features/morph/morph-bounds.d.ts.map +0 -1
- package/dist/features/scene-temporal.d.ts +0 -45
- package/dist/features/scene-temporal.d.ts.map +0 -1
- package/dist/features/taa-resolve.d.ts +0 -21
- package/dist/features/taa-resolve.d.ts.map +0 -1
- package/dist/frame-chain.d.ts +0 -14
- package/dist/frame-chain.d.ts.map +0 -1
- package/dist/gpu-driven/view-reference.d.ts.map +0 -1
- package/dist/gpu-resource-store.d.ts.map +0 -1
- package/dist/hdrp-cluster-membership.d.ts +0 -2
- package/dist/hdrp-cluster-membership.d.ts.map +0 -1
- package/dist/hdrp-pipeline.d.ts +0 -36
- package/dist/hdrp-pipeline.d.ts.map +0 -1
- package/dist/ibl/cubemap-projection.d.ts +0 -23
- package/dist/ibl/cubemap-projection.d.ts.map +0 -1
- package/dist/ibl/face-uniforms.d.ts +0 -65
- package/dist/ibl/face-uniforms.d.ts.map +0 -1
- package/dist/mesh-update-errors.d.ts +0 -71
- package/dist/mesh-update-errors.d.ts.map +0 -1
- package/dist/mipmap-generator.d.ts +0 -39
- package/dist/mipmap-generator.d.ts.map +0 -1
- package/dist/param-schema-projection-census.d.ts +0 -18
- package/dist/param-schema-projection-census.d.ts.map +0 -1
- package/dist/persistent-render-scene.d.ts +0 -158
- package/dist/persistent-render-scene.d.ts.map +0 -1
- package/dist/pipeline/index.d.ts +0 -11
- package/dist/pipeline/index.d.ts.map +0 -1
- package/dist/pipeline-errors.d.ts +0 -110
- package/dist/pipeline-errors.d.ts.map +0 -1
- package/dist/prepare/__tests__/schema-readers.unit.test.d.ts +0 -2
- package/dist/prepare/__tests__/schema-readers.unit.test.d.ts.map +0 -1
- package/dist/prepare/index.d.ts +0 -4
- package/dist/prepare/index.d.ts.map +0 -1
- package/dist/prepare/schema-readers.d.ts +0 -11
- package/dist/prepare/schema-readers.d.ts.map +0 -1
- package/dist/record/__tests__/environment-record.test.d.ts +0 -2
- package/dist/record/__tests__/environment-record.test.d.ts.map +0 -1
- package/dist/record/__tests__/frame-targets.unit.test.d.ts +0 -2
- package/dist/record/__tests__/frame-targets.unit.test.d.ts.map +0 -1
- package/dist/record/__tests__/membership-timing.unit.test.d.ts +0 -2
- package/dist/record/__tests__/membership-timing.unit.test.d.ts.map +0 -1
- package/dist/record/__tests__/render-submission.integration.test.d.ts +0 -2
- package/dist/record/__tests__/render-submission.integration.test.d.ts.map +0 -1
- package/dist/record/__tests__/render-submission.perf.test.d.ts +0 -2
- package/dist/record/__tests__/render-submission.perf.test.d.ts.map +0 -1
- package/dist/record/__tests__/shadow-submit-mode.unit.test.d.ts +0 -2
- package/dist/record/__tests__/shadow-submit-mode.unit.test.d.ts.map +0 -1
- package/dist/record/__tests__/view-ubo-layout.unit.test.d.ts +0 -2
- package/dist/record/__tests__/view-ubo-layout.unit.test.d.ts.map +0 -1
- package/dist/record/frame-observation.d.ts +0 -38
- package/dist/record/frame-observation.d.ts.map +0 -1
- package/dist/record/index.d.ts +0 -15
- package/dist/record/index.d.ts.map +0 -1
- package/dist/record/main-pass-skin.d.ts +0 -46
- package/dist/record/main-pass-skin.d.ts.map +0 -1
- package/dist/record/main-pass-sprite.d.ts +0 -69
- package/dist/record/main-pass-sprite.d.ts.map +0 -1
- package/dist/record/material-payload.d.ts +0 -43
- package/dist/record/material-payload.d.ts.map +0 -1
- package/dist/record/material-slot-plan.d.ts +0 -26
- package/dist/record/material-slot-plan.d.ts.map +0 -1
- package/dist/record/membership-timing.d.ts +0 -232
- package/dist/record/membership-timing.d.ts.map +0 -1
- package/dist/record/shadow-caster-uniform.d.ts +0 -8
- package/dist/record/shadow-caster-uniform.d.ts.map +0 -1
- package/dist/record/shadow-submit-mode.d.ts +0 -66
- package/dist/record/shadow-submit-mode.d.ts.map +0 -1
- package/dist/render-dispatch-membership.d.ts +0 -47
- package/dist/render-dispatch-membership.d.ts.map +0 -1
- package/dist/render-pipeline-context.d.ts +0 -289
- package/dist/render-pipeline-context.d.ts.map +0 -1
- package/dist/render-pipeline-target.d.ts +0 -16
- package/dist/render-pipeline-target.d.ts.map +0 -1
- package/dist/render-scene-projection.d.ts +0 -174
- package/dist/render-scene-projection.d.ts.map +0 -1
- package/dist/render-system-fold.d.ts +0 -266
- package/dist/render-system-fold.d.ts.map +0 -1
- package/dist/renderer/asset-service.d.ts +0 -10
- package/dist/renderer/asset-service.d.ts.map +0 -1
- package/dist/renderer/backend-selection.d.ts.map +0 -1
- package/dist/renderer/environment-classify.d.ts +0 -6
- package/dist/renderer/environment-classify.d.ts.map +0 -1
- package/dist/renderer/environment-error.d.ts +0 -13
- package/dist/renderer/environment-error.d.ts.map +0 -1
- package/dist/renderer/material/pipeline-projection.d.ts +0 -91
- package/dist/renderer/material/pipeline-projection.d.ts.map +0 -1
- package/dist/renderer/renderer-factory.d.ts +0 -283
- package/dist/renderer/renderer-factory.d.ts.map +0 -1
- package/dist/renderer.d.ts +0 -771
- package/dist/renderer.d.ts.map +0 -1
- package/dist/scene-utils/collect-subtree.d.ts +0 -11
- package/dist/scene-utils/collect-subtree.d.ts.map +0 -1
- package/dist/ssao-data.d.ts +0 -34
- package/dist/ssao-data.d.ts.map +0 -1
- package/dist/surface-format.d.ts +0 -10
- package/dist/surface-format.d.ts.map +0 -1
- package/dist/taa-history-store.d.ts +0 -88
- package/dist/taa-history-store.d.ts.map +0 -1
- package/dist/temporal-coverage.d.ts +0 -35
- package/dist/temporal-coverage.d.ts.map +0 -1
- package/dist/temporal-frame-transaction.d.ts +0 -92
- package/dist/temporal-frame-transaction.d.ts.map +0 -1
- package/dist/temporal-inspection.d.ts +0 -57
- package/dist/temporal-inspection.d.ts.map +0 -1
- package/dist/temporal-view.d.ts +0 -43
- package/dist/temporal-view.d.ts.map +0 -1
- package/dist/tilemap/resolve-tileset-runtime.d.ts +0 -23
- package/dist/tilemap/resolve-tileset-runtime.d.ts.map +0 -1
- package/dist/urp-pipeline.d.ts +0 -4
- package/dist/urp-pipeline.d.ts.map +0 -1
- package/src/__tests__/analytic-sky-contract.test.ts +0 -27
- package/src/__tests__/analytic-sky-falsify-carriers.mjs +0 -43
- package/src/__tests__/analytic-sky-falsify.test.ts +0 -94
- package/src/__tests__/assets-runtime-handoff.integration.test.ts +0 -36
- package/src/__tests__/backend-selection.integration.test.ts +0 -11
- package/src/__tests__/camera-temporal.test-d.ts +0 -8
- package/src/__tests__/camera-temporal.test.ts +0 -188
- package/src/__tests__/directional-shadow-probe-atlas-layout.unit.test.ts +0 -18
- package/src/__tests__/environment-inspection.test.ts +0 -45
- package/src/__tests__/fog-ai-user.fixture.ts +0 -350
- package/src/__tests__/fog-custom-render-feature.fixture.ts +0 -33
- package/src/__tests__/fog-custom-render-feature.integration.test.ts +0 -76
- package/src/__tests__/fog-inspection.integration.test.ts +0 -127
- package/src/__tests__/fog-owner-state.integration.test.ts +0 -112
- package/src/__tests__/fog-pipeline-topology.integration.test.ts +0 -93
- package/src/__tests__/fog-public-surface.integration.test.ts +0 -60
- package/src/__tests__/fog-ray-contract.integration.test.ts +0 -73
- package/src/__tests__/fog-source-absence.integration.test.ts +0 -51
- package/src/__tests__/fog-temporal.integration.test.ts +0 -115
- package/src/__tests__/frame-chain.unit.test.ts +0 -26
- package/src/__tests__/gpu-scene-field-type-owner.test-d.ts +0 -27
- package/src/__tests__/hdrp-pipeline.unit.test.ts +0 -100
- package/src/__tests__/ibl/ibl-fallback.unit.test.ts +0 -23
- package/src/__tests__/material-derived-error-stop-draw.integration.test.ts +0 -69
- package/src/__tests__/material-derived-payload.integration.test.ts +0 -164
- package/src/__tests__/materials.unit.test.ts +0 -25
- package/src/__tests__/param-schema-projection-census.unit.test.ts +0 -40
- package/src/__tests__/persistent-render-scene.unit.test.ts +0 -1311
- package/src/__tests__/pipeline-error-policy-owner.unit.test.ts +0 -167
- package/src/__tests__/pipeline-pass-trace.test.ts +0 -92
- package/src/__tests__/pipeline-stage-owner.test-d.ts +0 -13
- package/src/__tests__/plugin.test.ts +0 -25
- package/src/__tests__/prepared-graphics-backend-matrix.unit.test.ts +0 -129
- package/src/__tests__/prepared-graphics-resolver-recording.unit.test.ts +0 -180
- package/src/__tests__/public-pipeline-id.test-d.ts +0 -6
- package/src/__tests__/render-dispatch-membership.unit.test.ts +0 -117
- package/src/__tests__/render-feature-construction.unit.test.ts +0 -124
- package/src/__tests__/render-feature-error-code-owner.test-d.ts +0 -27
- package/src/__tests__/render-feature-gpu-buffer-usage-owner.test-d.ts +0 -46
- package/src/__tests__/render-feature-graph.integration.test.ts +0 -205
- package/src/__tests__/render-feature-graphics-staging.unit.test.ts +0 -200
- package/src/__tests__/render-feature-order.unit.test.ts +0 -66
- package/src/__tests__/render-feature-prepared-graphics-recording.unit.test.ts +0 -107
- package/src/__tests__/render-feature-staging.unit.test.ts +0 -94
- package/src/__tests__/renderer-render-scene-public.test-d.ts +0 -27
- package/src/__tests__/scene-temporal-coverage.unit.test.ts +0 -259
- package/src/__tests__/sun-snapshot-consumers.test.ts +0 -35
- package/src/__tests__/surface-backend-kind-owner.test-d.ts +0 -42
- package/src/__tests__/taa-history-store.unit.test.ts +0 -196
- package/src/__tests__/temporal-frame-transaction.integration.test.ts +0 -537
- package/src/__tests__/temporal-inspection.unit.test.ts +0 -138
- package/src/assets/__tests__/asset-decoders.unit.test.ts +0 -92
- package/src/assets/__tests__/mipmap-generator.unit.test.ts +0 -52
- package/src/assets/__tests__/render-asset-port.unit.test.ts +0 -54
- package/src/assets/__tests__/resolve-render-asset.unit.test.ts +0 -47
- package/src/components/__tests__/atmosphere-red.test.ts +0 -51
- package/src/components/__tests__/atmosphere.test.ts +0 -79
- package/src/components/__tests__/fog.test-d.ts +0 -49
- package/src/components/__tests__/fog.test.ts +0 -60
- package/src/components/atmosphere.ts +0 -64
- package/src/deferred-lighting.ts +0 -92
- package/src/dynamic-texture-store.ts +0 -111
- package/src/environment/README.md +0 -76
- package/src/environment/__tests__/failure-injection.test.ts +0 -50
- package/src/environment/__tests__/generation-red.test.ts +0 -64
- package/src/environment/__tests__/generation.test.ts +0 -37
- package/src/environment/__tests__/graph-transaction.test.ts +0 -85
- package/src/environment/__tests__/inspection-red.test.ts +0 -53
- package/src/environment/__tests__/lifecycle-evidence.test.ts +0 -40
- package/src/environment/__tests__/pipeline-topology.test.ts +0 -33
- package/src/environment/__tests__/readiness.test.ts +0 -42
- package/src/environment/__tests__/recovery.test.ts +0 -62
- package/src/environment/__tests__/resize-dispose.test.ts +0 -30
- package/src/environment/__tests__/signature-red.test.ts +0 -45
- package/src/environment/__tests__/signature.test.ts +0 -60
- package/src/environment/descriptors.ts +0 -7
- package/src/environment/extracted-environment.ts +0 -239
- package/src/environment/generation.ts +0 -158
- package/src/environment/gpu-bundle.ts +0 -144
- package/src/environment/graph.ts +0 -588
- package/src/environment/inspection.ts +0 -107
- package/src/environment/lifecycle.ts +0 -124
- package/src/environment/readiness.ts +0 -76
- package/src/environment/signature.ts +0 -185
- package/src/extract/__tests__/directional-csm-domain.unit.test.ts +0 -391
- package/src/extract/__tests__/environment-source.test.ts +0 -105
- package/src/extract/__tests__/schema-readers.unit.test.ts +0 -16
- package/src/extract/directional-csm.ts +0 -959
- package/src/extract/index.ts +0 -10
- package/src/extract/material-interface.ts +0 -604
- package/src/extract/schema-readers.ts +0 -27
- package/src/features/graph-contribution.ts +0 -577
- package/src/features/index.ts +0 -100
- package/src/features/morph/index.ts +0 -24
- package/src/features/morph/morph-bounds.ts +0 -123
- package/src/features/scene-temporal.ts +0 -274
- package/src/features/taa-resolve.ts +0 -244
- package/src/frame-chain.ts +0 -21
- package/src/hdrp-cluster-membership.ts +0 -70
- package/src/ibl/cubemap-projection.ts +0 -60
- package/src/ibl/face-uniforms.ts +0 -150
- package/src/mesh-update-errors.ts +0 -113
- package/src/mipmap-generator.ts +0 -244
- package/src/param-schema-projection-census.ts +0 -73
- package/src/persistent-render-scene.ts +0 -1752
- package/src/pipeline/index.ts +0 -40
- package/src/pipeline-errors.ts +0 -172
- package/src/prepare/__tests__/schema-readers.unit.test.ts +0 -16
- package/src/prepare/index.ts +0 -8
- package/src/prepare/schema-readers.ts +0 -20
- package/src/record/__tests__/environment-record.test.ts +0 -35
- package/src/record/__tests__/frame-targets.unit.test.ts +0 -54
- package/src/record/__tests__/membership-timing.unit.test.ts +0 -524
- package/src/record/__tests__/render-submission.integration.test.ts +0 -76
- package/src/record/__tests__/render-submission.perf.test.ts +0 -141
- package/src/record/__tests__/shadow-submit-mode.unit.test.ts +0 -88
- package/src/record/__tests__/view-ubo-layout.unit.test.ts +0 -101
- package/src/record/frame-observation.ts +0 -122
- package/src/record/index.ts +0 -15
- package/src/record/main-pass-skin.ts +0 -51
- package/src/record/main-pass-sprite.ts +0 -166
- package/src/record/material-payload.ts +0 -292
- package/src/record/material-slot-plan.ts +0 -68
- package/src/record/membership-timing.ts +0 -1012
- package/src/record/shadow-caster-uniform.ts +0 -37
- package/src/record/shadow-submit-mode.ts +0 -277
- package/src/render-dispatch-membership.ts +0 -155
- package/src/render-pipeline-context.ts +0 -332
- package/src/render-pipeline-target.ts +0 -96
- package/src/render-scene-projection.ts +0 -1738
- package/src/render-system-fold.ts +0 -531
- package/src/renderer/asset-service.ts +0 -32
- package/src/renderer/backend-selection.ts +0 -121
- package/src/renderer/environment-classify.ts +0 -30
- package/src/renderer/environment-error.ts +0 -19
- package/src/renderer/material/pipeline-projection.ts +0 -140
- package/src/renderer.ts +0 -940
- package/src/scene-utils/collect-subtree.ts +0 -40
- package/src/ssao-data.ts +0 -106
- package/src/surface-format.ts +0 -37
- package/src/taa-history-store.ts +0 -429
- package/src/temporal-coverage.ts +0 -106
- package/src/temporal-frame-transaction.ts +0 -301
- package/src/temporal-inspection.ts +0 -194
- package/src/temporal-view.ts +0 -174
- package/src/tilemap/resolve-tileset-runtime.ts +0 -72
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// @forgeax/engine-runtime - WebGPU HDRP cluster membership producer.
|
|
2
|
-
//
|
|
3
|
-
// The CPU binner remains the owner of bounds, occupancy, ordering, and
|
|
4
|
-
// overflow validation. This compute entry only materializes the already
|
|
5
|
-
// reserved ordered list on storage-buffer devices. Keeping the source here
|
|
6
|
-
// makes the producer boot-time compiled and avoids adding a material shader
|
|
7
|
-
// artifact or a second manifest identity.
|
|
8
|
-
|
|
9
|
-
export const HDRP_CLUSTER_MEMBERSHIP_WGSL = /* wgsl */ `
|
|
10
|
-
struct ClusterUniform {
|
|
11
|
-
grid : vec4<u32>,
|
|
12
|
-
near_far_log : vec4<f32>,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
@group(0) @binding(0) var<storage, read> cluster_grid : array<u32>;
|
|
16
|
-
@group(0) @binding(1) var<storage, read_write> light_index_list : array<u32>;
|
|
17
|
-
@group(0) @binding(2) var<uniform> cluster_uniform : ClusterUniform;
|
|
18
|
-
@group(0) @binding(3) var<storage, read> light_bounds : array<i32>;
|
|
19
|
-
|
|
20
|
-
@compute @workgroup_size(64)
|
|
21
|
-
fn cs_cluster_membership(@builtin(global_invocation_id) global_id : vec3<u32>) {
|
|
22
|
-
let cluster_index = global_id.x;
|
|
23
|
-
let grid_x = cluster_uniform.grid.x;
|
|
24
|
-
let grid_y = cluster_uniform.grid.y;
|
|
25
|
-
let grid_z = cluster_uniform.grid.z;
|
|
26
|
-
let cluster_count = grid_x * grid_y * grid_z;
|
|
27
|
-
if (cluster_index >= cluster_count) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
let cluster_x = cluster_index % grid_x;
|
|
32
|
-
let cluster_yz = cluster_index / grid_x;
|
|
33
|
-
let cluster_y = cluster_yz % grid_y;
|
|
34
|
-
let cluster_z = cluster_yz / grid_y;
|
|
35
|
-
let grid_offset = cluster_index * 2u;
|
|
36
|
-
let output_offset = cluster_grid[grid_offset];
|
|
37
|
-
let output_count = cluster_grid[grid_offset + 1u];
|
|
38
|
-
let cluster_x_i = i32(cluster_x);
|
|
39
|
-
let cluster_y_i = i32(cluster_y);
|
|
40
|
-
let cluster_z_i = i32(cluster_z);
|
|
41
|
-
var output_index = output_offset;
|
|
42
|
-
|
|
43
|
-
var light_index = 0u;
|
|
44
|
-
loop {
|
|
45
|
-
if (light_index >= cluster_uniform.grid.w || light_index >= 256u) {
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
let bounds_offset = light_index * 6u;
|
|
49
|
-
let min_x = light_bounds[bounds_offset];
|
|
50
|
-
if (min_x >= 0) {
|
|
51
|
-
let min_y = light_bounds[bounds_offset + 1u];
|
|
52
|
-
let min_z = light_bounds[bounds_offset + 2u];
|
|
53
|
-
let max_x = light_bounds[bounds_offset + 3u];
|
|
54
|
-
let max_y = light_bounds[bounds_offset + 4u];
|
|
55
|
-
let max_z = light_bounds[bounds_offset + 5u];
|
|
56
|
-
if (
|
|
57
|
-
cluster_x_i >= min_x && cluster_x_i <= max_x &&
|
|
58
|
-
cluster_y_i >= min_y && cluster_y_i <= max_y &&
|
|
59
|
-
cluster_z_i >= min_z && cluster_z_i <= max_z
|
|
60
|
-
) {
|
|
61
|
-
if (output_index < output_offset + output_count) {
|
|
62
|
-
light_index_list[output_index] = light_index;
|
|
63
|
-
output_index += 1u;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
light_index += 1u;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
`;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// Shared cubemap capture projection — Y negated for WebGPU top-left framebuffer origin.
|
|
2
|
-
|
|
3
|
-
/** The canonical diffuse IBL payload stores irradiance as E times pi. */
|
|
4
|
-
export const IBL_DIFFUSE_PAYLOAD_SEMANTIC = 'irradianceEOverPi' as const;
|
|
5
|
-
export type IblDiffusePayloadSemantic = typeof IBL_DIFFUSE_PAYLOAD_SEMANTIC;
|
|
6
|
-
|
|
7
|
-
export interface IblCapabilityReport {
|
|
8
|
-
readonly capabilityStatus: 'supported' | 'degraded';
|
|
9
|
-
readonly executionStatus: 'notExecuted' | 'complete';
|
|
10
|
-
readonly verdict: 'failed' | 'passed';
|
|
11
|
-
readonly rgba16floatRenderable: boolean;
|
|
12
|
-
readonly outputFormat: 'rgba16float' | null;
|
|
13
|
-
readonly fallbackArtifact: 'white-cube' | null;
|
|
14
|
-
readonly expectedImpact: string;
|
|
15
|
-
readonly hint: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function describeIblCapability(input: {
|
|
19
|
-
readonly rgba16floatRenderable: boolean;
|
|
20
|
-
}): IblCapabilityReport {
|
|
21
|
-
if (input.rgba16floatRenderable) {
|
|
22
|
-
return {
|
|
23
|
-
capabilityStatus: 'supported',
|
|
24
|
-
executionStatus: 'complete',
|
|
25
|
-
verdict: 'passed',
|
|
26
|
-
rgba16floatRenderable: true,
|
|
27
|
-
outputFormat: 'rgba16float',
|
|
28
|
-
fallbackArtifact: null,
|
|
29
|
-
expectedImpact: 'HDR IBL irradiance and specular lighting execute normally',
|
|
30
|
-
hint: 'capture the named rgba16float producer attachment for raw evidence',
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
return {
|
|
34
|
-
capabilityStatus: 'degraded',
|
|
35
|
-
executionStatus: 'notExecuted',
|
|
36
|
-
verdict: 'failed',
|
|
37
|
-
rgba16floatRenderable: false,
|
|
38
|
-
outputFormat: null,
|
|
39
|
-
fallbackArtifact: 'white-cube',
|
|
40
|
-
expectedImpact: 'HDR IBL producer execution is unavailable; lighting cannot be calibrated',
|
|
41
|
-
hint: 'inspect rgba16floatRenderable and restore HDR capability before retrying the IBL case',
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Build a perspective projection matrix for rendering into cubemap faces.
|
|
47
|
-
* Y is negated to match WebGPU's top-left framebuffer origin (unlike OpenGL's bottom-left).
|
|
48
|
-
* All cubemap passes (equirect-to-cube / irradiance / prefilter) should use this.
|
|
49
|
-
*/
|
|
50
|
-
export function cubemapCaptureProjection(fovy: number, near: number, far: number): Float32Array {
|
|
51
|
-
const f = 1.0 / Math.tan(fovy / 2);
|
|
52
|
-
const nf = 1.0 / (near - far);
|
|
53
|
-
// biome-ignore format: manual column-major mat4
|
|
54
|
-
return new Float32Array([
|
|
55
|
-
f, 0, 0, 0,
|
|
56
|
-
0, -f, 0, 0,
|
|
57
|
-
0, 0, (far + near) * nf, -1,
|
|
58
|
-
0, 0, 2 * far * near * nf, 0,
|
|
59
|
-
]);
|
|
60
|
-
}
|
package/src/ibl/face-uniforms.ts
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
// face-uniforms.ts -- M3.5 t55.
|
|
2
|
-
//
|
|
3
|
-
// CPU-side helpers that allocate + populate the per-face viewProj uniform
|
|
4
|
-
// buffer (6 entries) and the per-prefilter-sub-pass roughness uniform
|
|
5
|
-
// buffer (5 mip x 6 face = 30 entries). Both are 256-byte stride to honour
|
|
6
|
-
// the WebGPU dynamic-offset alignment SSOT (plan-strategy section 3.2
|
|
7
|
-
// sequence diagram, D-9 face-uniforms layout cross-pipeline reuse).
|
|
8
|
-
//
|
|
9
|
-
// The buffer payloads are:
|
|
10
|
-
// faceUniforms[face] = mat4x4<f32> viewProj (64 byte usable; 256 byte stride)
|
|
11
|
-
// prefilterUniforms[idx] = { roughness: f32, faceSize: f32, _pad0, _pad1 }
|
|
12
|
-
// (16 byte usable; 256 byte stride)
|
|
13
|
-
//
|
|
14
|
-
// Indexed as:
|
|
15
|
-
// face = 0..5
|
|
16
|
-
// prefilter = mip * 6 + face (mip 0..4, face 0..5)
|
|
17
|
-
|
|
18
|
-
import { GPU_BUFFER_USAGE_COPY_DST, GPU_BUFFER_USAGE_UNIFORM } from '../gpu-usage';
|
|
19
|
-
import { CAPTURE_VIEW_PROJS, PREFILTER_MIP_LEVELS, PREFILTER_SIZE } from './IblPipelineCache';
|
|
20
|
-
|
|
21
|
-
const DYNAMIC_OFFSET_STRIDE = 256;
|
|
22
|
-
const FACE_COUNT = 6;
|
|
23
|
-
const PREFILTER_SUBPASS_COUNT = PREFILTER_MIP_LEVELS * FACE_COUNT;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Minimal device shape consumed by the helpers -- mirrors
|
|
27
|
-
* `IblPipelineDevice` createBuffer surface plus queue.writeBuffer.
|
|
28
|
-
*/
|
|
29
|
-
export interface FaceUniformsDevice {
|
|
30
|
-
// biome-ignore lint/suspicious/noExplicitAny: shim shape
|
|
31
|
-
createBuffer(desc: any): { ok: true; value: any } | { ok: false; error: unknown };
|
|
32
|
-
readonly queue: {
|
|
33
|
-
// biome-ignore lint/suspicious/noExplicitAny: shim shape
|
|
34
|
-
writeBuffer?: (...args: any[]) => unknown;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Allocate the 6-face viewProj uniform buffer. Size = 6 * 256 bytes so
|
|
40
|
-
* each face slot is dynamic-offset addressable.
|
|
41
|
-
*/
|
|
42
|
-
export function createFaceUniformsBuffer(
|
|
43
|
-
device: FaceUniformsDevice,
|
|
44
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU buffer
|
|
45
|
-
): { ok: true; value: any } | { ok: false; error: unknown } {
|
|
46
|
-
return device.createBuffer({
|
|
47
|
-
label: 'ibl-face-uniforms',
|
|
48
|
-
size: FACE_COUNT * DYNAMIC_OFFSET_STRIDE,
|
|
49
|
-
usage: GPU_BUFFER_USAGE_UNIFORM | GPU_BUFFER_USAGE_COPY_DST,
|
|
50
|
-
mappedAtCreation: false,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Allocate the prefilter sub-pass uniform buffer. Size = 30 * 256 bytes.
|
|
56
|
-
*/
|
|
57
|
-
export function createPrefilterUniformsBuffer(
|
|
58
|
-
device: FaceUniformsDevice,
|
|
59
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU buffer
|
|
60
|
-
): { ok: true; value: any } | { ok: false; error: unknown } {
|
|
61
|
-
return device.createBuffer({
|
|
62
|
-
label: 'ibl-prefilter-uniforms',
|
|
63
|
-
size: PREFILTER_SUBPASS_COUNT * DYNAMIC_OFFSET_STRIDE,
|
|
64
|
-
usage: GPU_BUFFER_USAGE_UNIFORM | GPU_BUFFER_USAGE_COPY_DST,
|
|
65
|
-
mappedAtCreation: false,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Write a single face's viewProj matrix at the dynamic-offset slot.
|
|
71
|
-
*
|
|
72
|
-
* @param device device with queue.writeBuffer
|
|
73
|
-
* @param buffer face-uniforms buffer from createFaceUniformsBuffer
|
|
74
|
-
* @param faceIdx 0..5
|
|
75
|
-
* @param viewProj 16-element column-major mat4
|
|
76
|
-
*/
|
|
77
|
-
export function writeFaceUniforms(
|
|
78
|
-
device: FaceUniformsDevice,
|
|
79
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU buffer
|
|
80
|
-
buffer: any,
|
|
81
|
-
faceIdx: number,
|
|
82
|
-
viewProj: Float32Array,
|
|
83
|
-
): void {
|
|
84
|
-
if (typeof device.queue.writeBuffer !== 'function') return;
|
|
85
|
-
if (faceIdx < 0 || faceIdx >= FACE_COUNT) {
|
|
86
|
-
throw new Error(`writeFaceUniforms: faceIdx ${faceIdx} out of range [0,5]`);
|
|
87
|
-
}
|
|
88
|
-
if (viewProj.length !== 16) {
|
|
89
|
-
throw new Error(`writeFaceUniforms: viewProj must be 16 floats, got ${viewProj.length}`);
|
|
90
|
-
}
|
|
91
|
-
device.queue.writeBuffer(buffer, faceIdx * DYNAMIC_OFFSET_STRIDE, viewProj);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Write all 6 capture viewProj matrices into the face-uniforms buffer.
|
|
96
|
-
* Uses the static CAPTURE_VIEW_PROJS SSOT from IblPipelineCache.
|
|
97
|
-
*/
|
|
98
|
-
export function writeAllFaceUniforms(
|
|
99
|
-
device: FaceUniformsDevice,
|
|
100
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU buffer
|
|
101
|
-
buffer: any,
|
|
102
|
-
): void {
|
|
103
|
-
for (let face = 0; face < FACE_COUNT; face++) {
|
|
104
|
-
const vp = CAPTURE_VIEW_PROJS[face];
|
|
105
|
-
if (vp === undefined) continue;
|
|
106
|
-
writeFaceUniforms(device, buffer, face, vp);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Write a single prefilter sub-pass uniform slot (roughness + faceSize).
|
|
112
|
-
* subPassIdx = mip * 6 + face.
|
|
113
|
-
*/
|
|
114
|
-
export function writePrefilterUniforms(
|
|
115
|
-
device: FaceUniformsDevice,
|
|
116
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU buffer
|
|
117
|
-
buffer: any,
|
|
118
|
-
subPassIdx: number,
|
|
119
|
-
roughness: number,
|
|
120
|
-
mipFaceSize: number,
|
|
121
|
-
): void {
|
|
122
|
-
if (typeof device.queue.writeBuffer !== 'function') return;
|
|
123
|
-
if (subPassIdx < 0 || subPassIdx >= PREFILTER_SUBPASS_COUNT) {
|
|
124
|
-
throw new Error(`writePrefilterUniforms: subPassIdx ${subPassIdx} out of range`);
|
|
125
|
-
}
|
|
126
|
-
const payload = new Float32Array([roughness, mipFaceSize, 0, 0]);
|
|
127
|
-
device.queue.writeBuffer(buffer, subPassIdx * DYNAMIC_OFFSET_STRIDE, payload);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Write all 30 prefilter sub-pass uniforms (5 mip x 6 face) with
|
|
132
|
-
* roughness = mip / (mipLevels - 1) and mipFaceSize halved per mip.
|
|
133
|
-
*/
|
|
134
|
-
export function writeAllPrefilterUniforms(
|
|
135
|
-
device: FaceUniformsDevice,
|
|
136
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU buffer
|
|
137
|
-
buffer: any,
|
|
138
|
-
): void {
|
|
139
|
-
for (let mip = 0; mip < PREFILTER_MIP_LEVELS; mip++) {
|
|
140
|
-
const roughness = mip / (PREFILTER_MIP_LEVELS - 1);
|
|
141
|
-
const mipFaceSize = PREFILTER_SIZE / 2 ** mip;
|
|
142
|
-
for (let face = 0; face < FACE_COUNT; face++) {
|
|
143
|
-
writePrefilterUniforms(device, buffer, mip * FACE_COUNT + face, roughness, mipFaceSize);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export const FACE_UNIFORMS_STRIDE = DYNAMIC_OFFSET_STRIDE;
|
|
149
|
-
export const FACE_UNIFORMS_BUFFER_SIZE = FACE_COUNT * DYNAMIC_OFFSET_STRIDE;
|
|
150
|
-
export const PREFILTER_UNIFORMS_BUFFER_SIZE = PREFILTER_SUBPASS_COUNT * DYNAMIC_OFFSET_STRIDE;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/** Structured failures for typed resident-mesh updates. */
|
|
2
|
-
|
|
3
|
-
export type MeshUpdateErrorCode = keyof typeof MESH_UPDATE_POLICY;
|
|
4
|
-
|
|
5
|
-
export interface MeshNotResidentDetail {
|
|
6
|
-
readonly handle: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface MeshShapeMismatchDetail {
|
|
10
|
-
readonly handle: number;
|
|
11
|
-
readonly expected: string;
|
|
12
|
-
readonly actual: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type MeshRangeInvalidReason =
|
|
16
|
-
| 'non-integer'
|
|
17
|
-
| 'negative'
|
|
18
|
-
| 'empty'
|
|
19
|
-
| 'out-of-bounds'
|
|
20
|
-
| 'stride-mismatch';
|
|
21
|
-
|
|
22
|
-
interface MeshRangeInvalidLocationDetail {
|
|
23
|
-
readonly handle: number;
|
|
24
|
-
readonly firstVertex: number;
|
|
25
|
-
readonly vertexCount: number;
|
|
26
|
-
readonly residentVertexCount: number;
|
|
27
|
-
readonly reason: Exclude<MeshRangeInvalidReason, 'stride-mismatch'>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface MeshRangeInvalidStrideDetail {
|
|
31
|
-
readonly handle: number;
|
|
32
|
-
readonly firstVertex: number;
|
|
33
|
-
readonly vertexCount: number;
|
|
34
|
-
readonly residentVertexCount: number;
|
|
35
|
-
readonly reason: 'stride-mismatch';
|
|
36
|
-
readonly expectedByteLength: number;
|
|
37
|
-
readonly actualByteLength: number;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export type MeshRangeInvalidDetail = MeshRangeInvalidLocationDetail | MeshRangeInvalidStrideDetail;
|
|
41
|
-
|
|
42
|
-
export type MeshUpdateErrorDetailFor<C extends MeshUpdateErrorCode> = C extends 'mesh-not-resident'
|
|
43
|
-
? MeshNotResidentDetail
|
|
44
|
-
: C extends 'mesh-shape-mismatch'
|
|
45
|
-
? MeshShapeMismatchDetail
|
|
46
|
-
: C extends 'mesh-range-invalid'
|
|
47
|
-
? MeshRangeInvalidDetail
|
|
48
|
-
: never;
|
|
49
|
-
|
|
50
|
-
type MeshUpdateErrorDetail = MeshUpdateErrorDetailFor<MeshUpdateErrorCode>;
|
|
51
|
-
|
|
52
|
-
const MESH_UPDATE_POLICY = {
|
|
53
|
-
'mesh-not-resident': {
|
|
54
|
-
expected: 'the mesh handle is resident in the renderer before it is updated',
|
|
55
|
-
hint: (detail: MeshNotResidentDetail) =>
|
|
56
|
-
`mesh handle ${detail.handle} is not resident; call renderer.assets.get(handle) and ensure the mesh is resident before updating`,
|
|
57
|
-
},
|
|
58
|
-
'mesh-shape-mismatch': {
|
|
59
|
-
expected: 'a same-shape update preserves the resident mesh layout, counts, and index format',
|
|
60
|
-
hint: (detail: MeshShapeMismatchDetail) =>
|
|
61
|
-
`mesh handle ${detail.handle} cannot be updated in place: expected ${detail.expected}, got ${detail.actual}; use a new mesh asset handle for a shape change`,
|
|
62
|
-
},
|
|
63
|
-
'mesh-range-invalid': {
|
|
64
|
-
expected: 'a vertex range is within the resident mesh and matches the resident stride',
|
|
65
|
-
hint: (detail: MeshRangeInvalidDetail) => {
|
|
66
|
-
if (detail.reason === 'stride-mismatch') {
|
|
67
|
-
return `vertex range for mesh handle ${detail.handle} has ${detail.actualByteLength} bytes; expected ${detail.expectedByteLength} bytes for the resident stride`;
|
|
68
|
-
}
|
|
69
|
-
return `vertex range [${detail.firstVertex}, ${detail.firstVertex + detail.vertexCount}) is invalid (${detail.reason}) for resident mesh handle ${detail.handle} with ${detail.residentVertexCount} vertices`;
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
} satisfies Record<string, { readonly expected: string; readonly hint: (detail: never) => string }>;
|
|
73
|
-
|
|
74
|
-
class MeshUpdateErrorClass extends Error {
|
|
75
|
-
readonly code: MeshUpdateErrorCode;
|
|
76
|
-
readonly expected: string;
|
|
77
|
-
readonly hint: string;
|
|
78
|
-
readonly detail: MeshUpdateErrorDetail;
|
|
79
|
-
|
|
80
|
-
constructor(args: { code: MeshUpdateErrorCode; detail: MeshUpdateErrorDetail }) {
|
|
81
|
-
const policy = MESH_UPDATE_POLICY[args.code] as {
|
|
82
|
-
readonly expected: string;
|
|
83
|
-
readonly hint: (detail: MeshUpdateErrorDetail) => string;
|
|
84
|
-
};
|
|
85
|
-
const hint = policy.hint(args.detail);
|
|
86
|
-
super(`mesh update: ${args.code} (${hint})`);
|
|
87
|
-
this.name = 'MeshUpdateError';
|
|
88
|
-
this.code = args.code;
|
|
89
|
-
this.expected = policy.expected;
|
|
90
|
-
this.hint = hint;
|
|
91
|
-
this.detail = args.detail;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
type MeshUpdateErrorVariant<C extends MeshUpdateErrorCode> = MeshUpdateErrorClass & {
|
|
96
|
-
readonly code: C;
|
|
97
|
-
readonly detail: MeshUpdateErrorDetailFor<C>;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export type MeshUpdateError = {
|
|
101
|
-
[C in MeshUpdateErrorCode]: MeshUpdateErrorVariant<C>;
|
|
102
|
-
}[MeshUpdateErrorCode];
|
|
103
|
-
|
|
104
|
-
interface MeshUpdateErrorConstructor {
|
|
105
|
-
new <C extends MeshUpdateErrorCode>(args: {
|
|
106
|
-
code: C;
|
|
107
|
-
detail: MeshUpdateErrorDetailFor<C>;
|
|
108
|
-
}): MeshUpdateErrorVariant<C>;
|
|
109
|
-
readonly prototype: MeshUpdateErrorClass;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export const MeshUpdateError: MeshUpdateErrorConstructor =
|
|
113
|
-
MeshUpdateErrorClass as unknown as MeshUpdateErrorConstructor;
|
package/src/mipmap-generator.ts
DELETED
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import { err, ok, type Result, RhiError } from '@forgeax/engine-rhi';
|
|
2
|
-
|
|
3
|
-
export type MipmapDevice = {
|
|
4
|
-
// biome-ignore lint/suspicious/noExplicitAny: RHI descriptors are opaque here
|
|
5
|
-
createSampler(desc?: any): Result<any, any>;
|
|
6
|
-
// biome-ignore lint/suspicious/noExplicitAny: RHI descriptors are opaque here
|
|
7
|
-
createBindGroupLayout(desc: any): Result<any, any>;
|
|
8
|
-
// biome-ignore lint/suspicious/noExplicitAny: RHI descriptors are opaque here
|
|
9
|
-
createPipelineLayout(desc: any): Result<any, any>;
|
|
10
|
-
// biome-ignore lint/suspicious/noExplicitAny: RHI descriptors are opaque here
|
|
11
|
-
createRenderPipeline(desc: any): Result<any, any>;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export type MipmapShaderModuleFactory = (
|
|
15
|
-
device: MipmapDevice,
|
|
16
|
-
desc: { code: string; label?: string },
|
|
17
|
-
) => Promise<Result<unknown, RhiError>>;
|
|
18
|
-
|
|
19
|
-
interface MipmapPipelineCache {
|
|
20
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU handles
|
|
21
|
-
readonly sampler: any;
|
|
22
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU handles
|
|
23
|
-
readonly module: any;
|
|
24
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU handles
|
|
25
|
-
readonly layout: any;
|
|
26
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU handles
|
|
27
|
-
readonly pipelines: Map<GPUTextureFormat, any>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const deviceCache = new WeakMap<MipmapDevice, MipmapPipelineCache>();
|
|
31
|
-
const MIPMAP_WGSL = `
|
|
32
|
-
struct VsOut { @builtin(position) clip : vec4<f32>, @location(0) uv : vec2<f32> };
|
|
33
|
-
@vertex fn vs_main(@builtin(vertex_index) vid : u32) -> VsOut {
|
|
34
|
-
var positions = array<vec2<f32>, 3>(vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));
|
|
35
|
-
let pos = positions[vid];
|
|
36
|
-
var out : VsOut;
|
|
37
|
-
out.clip = vec4<f32>(pos, 0.0, 1.0);
|
|
38
|
-
out.uv = pos * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5);
|
|
39
|
-
return out;
|
|
40
|
-
}
|
|
41
|
-
@group(0) @binding(0) var src_sampler : sampler;
|
|
42
|
-
@group(0) @binding(1) var src_texture : texture_2d<f32>;
|
|
43
|
-
@fragment fn fs_main(in : VsOut) -> @location(0) vec4<f32> { return textureSample(src_texture, src_sampler, in.uv); }
|
|
44
|
-
`;
|
|
45
|
-
|
|
46
|
-
export function numMipLevels(size: { width: number; height: number }): number {
|
|
47
|
-
const max = Math.max(size.width, size.height);
|
|
48
|
-
return max <= 1 ? 1 : Math.floor(Math.log2(max)) + 1;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function mipmapCacheSize(device: MipmapDevice): number {
|
|
52
|
-
return deviceCache.get(device)?.pipelines.size ?? 0;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export async function getOrCreateMipmapPipeline(
|
|
56
|
-
device: MipmapDevice,
|
|
57
|
-
format: GPUTextureFormat,
|
|
58
|
-
asyncCreateShaderModule: MipmapShaderModuleFactory,
|
|
59
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU pipeline
|
|
60
|
-
): Promise<Result<any, unknown>> {
|
|
61
|
-
const cache = await ensureDeviceCache(device, asyncCreateShaderModule);
|
|
62
|
-
if (!cache.ok) return cache;
|
|
63
|
-
const existing = cache.value.pipelines.get(format);
|
|
64
|
-
if (existing !== undefined) return ok(existing);
|
|
65
|
-
const layoutRes = device.createPipelineLayout({
|
|
66
|
-
label: 'mipmap-pl',
|
|
67
|
-
bindGroupLayouts: [cache.value.layout],
|
|
68
|
-
});
|
|
69
|
-
if (!layoutRes.ok) return layoutRes;
|
|
70
|
-
const pipelineRes = device.createRenderPipeline({
|
|
71
|
-
label: `mipmap-pipeline-${format}`,
|
|
72
|
-
layout: layoutRes.value,
|
|
73
|
-
vertex: { module: cache.value.module, entryPoint: 'vs_main' },
|
|
74
|
-
fragment: { module: cache.value.module, entryPoint: 'fs_main', targets: [{ format }] },
|
|
75
|
-
primitive: { topology: 'triangle-list' },
|
|
76
|
-
});
|
|
77
|
-
if (!pipelineRes.ok) return pipelineRes;
|
|
78
|
-
cache.value.pipelines.set(format, pipelineRes.value);
|
|
79
|
-
return pipelineRes;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
async function ensureDeviceCache(
|
|
83
|
-
device: MipmapDevice,
|
|
84
|
-
asyncCreateShaderModule: MipmapShaderModuleFactory,
|
|
85
|
-
): Promise<Result<MipmapPipelineCache, RhiError>> {
|
|
86
|
-
const existing = deviceCache.get(device);
|
|
87
|
-
if (existing !== undefined) return ok(existing);
|
|
88
|
-
const moduleRes = await asyncCreateShaderModule(device, {
|
|
89
|
-
code: MIPMAP_WGSL,
|
|
90
|
-
label: 'mipmap-wgsl',
|
|
91
|
-
});
|
|
92
|
-
if (!moduleRes.ok) return moduleRes;
|
|
93
|
-
const samplerRes = device.createSampler({
|
|
94
|
-
magFilter: 'linear',
|
|
95
|
-
minFilter: 'linear',
|
|
96
|
-
mipmapFilter: 'linear',
|
|
97
|
-
});
|
|
98
|
-
if (!samplerRes.ok) return samplerRes;
|
|
99
|
-
const layoutRes = device.createBindGroupLayout({
|
|
100
|
-
label: 'mipmap-bgl',
|
|
101
|
-
entries: [
|
|
102
|
-
{ binding: 0, visibility: 0x2, sampler: { type: 'filtering' } },
|
|
103
|
-
{ binding: 1, visibility: 0x2, texture: { sampleType: 'float', viewDimension: '2d' } },
|
|
104
|
-
],
|
|
105
|
-
});
|
|
106
|
-
if (!layoutRes.ok) return layoutRes;
|
|
107
|
-
const cache: MipmapPipelineCache = {
|
|
108
|
-
sampler: samplerRes.value,
|
|
109
|
-
module: moduleRes.value,
|
|
110
|
-
layout: layoutRes.value,
|
|
111
|
-
pipelines: new Map(),
|
|
112
|
-
};
|
|
113
|
-
deviceCache.set(device, cache);
|
|
114
|
-
return ok(cache);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export type MipmapBlitDevice = MipmapDevice & {
|
|
118
|
-
// biome-ignore lint/suspicious/noExplicitAny: RHI descriptors are opaque here
|
|
119
|
-
createTexture(desc: any): Result<any, any>;
|
|
120
|
-
// biome-ignore lint/suspicious/noExplicitAny: RHI descriptors are opaque here
|
|
121
|
-
createBindGroup(desc: any): Result<any, any>;
|
|
122
|
-
// biome-ignore lint/suspicious/noExplicitAny: RHI descriptors are opaque here
|
|
123
|
-
createTextureView(texture: any, desc: any): Result<any, any>;
|
|
124
|
-
// biome-ignore lint/suspicious/noExplicitAny: RHI descriptors are opaque here
|
|
125
|
-
createCommandEncoder(desc?: any): Result<any, any>;
|
|
126
|
-
readonly queue: { submit(buffers: ReadonlyArray<unknown>): Result<void, unknown> };
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
function recordMipmapBlit<E>(
|
|
130
|
-
device: MipmapBlitDevice,
|
|
131
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture handle
|
|
132
|
-
texture: any,
|
|
133
|
-
levels: number,
|
|
134
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU pipeline handle
|
|
135
|
-
pipeline: any,
|
|
136
|
-
cache: MipmapPipelineCache,
|
|
137
|
-
): Result<void, E> {
|
|
138
|
-
const encoderRes = device.createCommandEncoder({ label: 'mipmap-encoder' });
|
|
139
|
-
if (!encoderRes.ok) return encoderRes;
|
|
140
|
-
const encoder = encoderRes.value;
|
|
141
|
-
for (let i = 1; i < levels; i++) {
|
|
142
|
-
const srcViewRes = device.createTextureView(texture, {
|
|
143
|
-
baseMipLevel: i - 1,
|
|
144
|
-
mipLevelCount: 1,
|
|
145
|
-
dimension: '2d',
|
|
146
|
-
});
|
|
147
|
-
if (!srcViewRes.ok) return srcViewRes;
|
|
148
|
-
const dstViewRes = device.createTextureView(texture, {
|
|
149
|
-
baseMipLevel: i,
|
|
150
|
-
mipLevelCount: 1,
|
|
151
|
-
dimension: '2d',
|
|
152
|
-
});
|
|
153
|
-
if (!dstViewRes.ok) return dstViewRes;
|
|
154
|
-
const bindGroupRes = device.createBindGroup({
|
|
155
|
-
label: `mipmap-bg-${i}`,
|
|
156
|
-
layout: cache.layout,
|
|
157
|
-
entries: [
|
|
158
|
-
{ binding: 0, resource: { kind: 'sampler', value: cache.sampler } },
|
|
159
|
-
{ binding: 1, resource: { kind: 'textureView', value: srcViewRes.value } },
|
|
160
|
-
],
|
|
161
|
-
});
|
|
162
|
-
if (!bindGroupRes.ok) return bindGroupRes;
|
|
163
|
-
const pass = encoder.beginRenderPass({
|
|
164
|
-
label: `mipmap-pass-${i}`,
|
|
165
|
-
colorAttachments: [
|
|
166
|
-
{
|
|
167
|
-
view: dstViewRes.value,
|
|
168
|
-
clearValue: { r: 0, g: 0, b: 0, a: 1 },
|
|
169
|
-
loadOp: 'clear',
|
|
170
|
-
storeOp: 'store',
|
|
171
|
-
},
|
|
172
|
-
],
|
|
173
|
-
});
|
|
174
|
-
pass.setPipeline(pipeline);
|
|
175
|
-
pass.setBindGroup(0, bindGroupRes.value);
|
|
176
|
-
pass.draw(3, 1, 0, 0);
|
|
177
|
-
pass.end();
|
|
178
|
-
}
|
|
179
|
-
const finishRes = encoder.finish();
|
|
180
|
-
if (!finishRes.ok) return finishRes;
|
|
181
|
-
return device.queue.submit([finishRes.value]) as Result<void, E>;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export async function generateMipmaps(
|
|
185
|
-
device: MipmapBlitDevice,
|
|
186
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture handle
|
|
187
|
-
texture: any,
|
|
188
|
-
descriptor: {
|
|
189
|
-
readonly format: GPUTextureFormat;
|
|
190
|
-
readonly width: number;
|
|
191
|
-
readonly height: number;
|
|
192
|
-
readonly levels?: number;
|
|
193
|
-
},
|
|
194
|
-
asyncCreateShaderModule: MipmapShaderModuleFactory,
|
|
195
|
-
): Promise<Result<void, unknown>> {
|
|
196
|
-
const levels = descriptor.levels ?? numMipLevels(descriptor);
|
|
197
|
-
if (levels <= 1) return ok(undefined);
|
|
198
|
-
const pipelineRes = await getOrCreateMipmapPipeline(
|
|
199
|
-
device,
|
|
200
|
-
descriptor.format,
|
|
201
|
-
asyncCreateShaderModule,
|
|
202
|
-
);
|
|
203
|
-
if (!pipelineRes.ok) return pipelineRes;
|
|
204
|
-
const cache = deviceCache.get(device);
|
|
205
|
-
if (cache === undefined)
|
|
206
|
-
return err({ code: 'webgpu-runtime-error', message: 'mipmap cache missing' });
|
|
207
|
-
return recordMipmapBlit<unknown>(device, texture, levels, pipelineRes.value, cache);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export function blitMipmapsSync(
|
|
211
|
-
device: MipmapBlitDevice,
|
|
212
|
-
// biome-ignore lint/suspicious/noExplicitAny: opaque GPU texture handle
|
|
213
|
-
texture: any,
|
|
214
|
-
descriptor: {
|
|
215
|
-
readonly format: GPUTextureFormat;
|
|
216
|
-
readonly width: number;
|
|
217
|
-
readonly height: number;
|
|
218
|
-
readonly levels?: number;
|
|
219
|
-
},
|
|
220
|
-
): Result<void, RhiError> {
|
|
221
|
-
const levels = descriptor.levels ?? numMipLevels(descriptor);
|
|
222
|
-
if (levels <= 1) return ok(undefined);
|
|
223
|
-
const cache = deviceCache.get(device);
|
|
224
|
-
if (cache === undefined) {
|
|
225
|
-
return err(
|
|
226
|
-
new RhiError({
|
|
227
|
-
code: 'rhi-not-available',
|
|
228
|
-
expected: 'mipmap pipeline cache prewarmed for this device before blitMipmapsSync',
|
|
229
|
-
hint: 'prewarm the mipmap pipeline before the synchronous record-stage blit',
|
|
230
|
-
}),
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
const pipeline = cache.pipelines.get(descriptor.format);
|
|
234
|
-
if (pipeline === undefined) {
|
|
235
|
-
return err(
|
|
236
|
-
new RhiError({
|
|
237
|
-
code: 'rhi-not-available',
|
|
238
|
-
expected: `mipmap pipeline for format ${descriptor.format} prewarmed`,
|
|
239
|
-
hint: `prewarm format ${descriptor.format} before the synchronous blit`,
|
|
240
|
-
}),
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
return recordMipmapBlit<RhiError>(device, texture, levels, pipeline, cache);
|
|
244
|
-
}
|