@forgeax/engine-render 0.1.23 → 0.1.24
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 +131 -9
- package/dist/assembly/bundler-contract.d.ts +9 -0
- package/dist/assembly/bundler-contract.d.ts.map +1 -0
- package/dist/assembly/device-feature-admission.d.ts +8 -0
- package/dist/assembly/device-feature-admission.d.ts.map +1 -1
- package/dist/assembly/extended-lighting-fallback.d.ts +13 -0
- package/dist/assembly/extended-lighting-fallback.d.ts.map +1 -0
- package/dist/assembly/factory.d.ts +7 -243
- package/dist/assembly/factory.d.ts.map +1 -1
- package/dist/assembly/material/assembly.d.ts +3 -2
- package/dist/assembly/material/assembly.d.ts.map +1 -1
- package/dist/assembly/material/standard-layer-projection.d.ts +10 -0
- package/dist/assembly/material/standard-layer-projection.d.ts.map +1 -0
- package/dist/assembly/material-shader-policy.d.ts +168 -0
- package/dist/assembly/material-shader-policy.d.ts.map +1 -0
- package/dist/assembly/material-shader-prewarm.d.ts +21 -0
- package/dist/assembly/material-shader-prewarm.d.ts.map +1 -0
- package/dist/assembly/mesh-ssbo-grow.d.ts +88 -0
- package/dist/assembly/mesh-ssbo-grow.d.ts.map +1 -0
- package/dist/assembly/recovery/device-loss-fanout.d.ts +14 -0
- package/dist/assembly/recovery/device-loss-fanout.d.ts.map +1 -0
- package/dist/assembly/recovery/generation.d.ts +46 -0
- package/dist/assembly/recovery/generation.d.ts.map +1 -0
- package/dist/assembly/recovery/recovery-attempt.d.ts +63 -0
- package/dist/assembly/recovery/recovery-attempt.d.ts.map +1 -0
- package/dist/assembly/recovery/renderer-recover.d.ts +115 -0
- package/dist/assembly/recovery/renderer-recover.d.ts.map +1 -0
- package/dist/assembly/renderer-facade.d.ts +10 -0
- package/dist/assembly/renderer-facade.d.ts.map +1 -0
- package/dist/assembly/renderer-frame-transaction.d.ts +17 -0
- package/dist/assembly/renderer-frame-transaction.d.ts.map +1 -1
- package/dist/assembly/renderer-helpers.d.ts +19 -0
- package/dist/assembly/renderer-helpers.d.ts.map +1 -0
- package/dist/assembly/renderer-lifecycle.d.ts +34 -0
- package/dist/assembly/renderer-lifecycle.d.ts.map +1 -1
- package/dist/assembly/shader-prewarm-policy.d.ts +15 -0
- package/dist/assembly/shader-prewarm-policy.d.ts.map +1 -0
- package/dist/assembly/webgpu-ready-contract.d.ts +9 -0
- package/dist/assembly/webgpu-ready-contract.d.ts.map +1 -0
- package/dist/assembly/webgpu-ready.d.ts +55 -0
- package/dist/assembly/webgpu-ready.d.ts.map +1 -0
- package/dist/assembly/webgpu-renderer.d.ts +152 -0
- package/dist/assembly/webgpu-renderer.d.ts.map +1 -0
- package/dist/authoring.mjs +1 -1
- package/dist/{chunk-4L3P6DT5.mjs → chunk-GE3SDD72.mjs} +37 -5
- package/dist/chunk-GE3SDD72.mjs.map +1 -0
- package/dist/{chunk-HZUPSYW7.mjs → chunk-KZFTK6DO.mjs} +102 -15
- package/dist/chunk-KZFTK6DO.mjs.map +1 -0
- package/dist/{chunk-FF7K3FSO.mjs → chunk-Q752SHI5.mjs} +89 -89
- package/dist/{chunk-FF7K3FSO.mjs.map → chunk-Q752SHI5.mjs.map} +1 -1
- package/dist/{chunk-QODA5UKU.mjs → chunk-RR5L4SRS.mjs} +2 -2
- package/dist/chunk-RR5L4SRS.mjs.map +1 -0
- package/dist/{chunk-YALPS44A.mjs → chunk-TFH5I7JJ.mjs} +47 -47
- package/dist/chunk-TFH5I7JJ.mjs.map +1 -0
- package/dist/{chunk-FBC4R44J.mjs → chunk-UQYS7FRM.mjs} +57 -57
- package/dist/chunk-UQYS7FRM.mjs.map +1 -0
- package/dist/{chunk-4NPUASZR.mjs → chunk-YKB5DQV7.mjs} +161 -19
- package/dist/chunk-YKB5DQV7.mjs.map +1 -0
- package/dist/{chunk-ZUWKAZ2I.mjs → chunk-YRUYGA4A.mjs} +615 -237
- package/dist/chunk-YRUYGA4A.mjs.map +1 -0
- package/dist/{chunk-DIYW3M5D.mjs → chunk-Z3YYH2MB.mjs} +2210 -2213
- package/dist/chunk-Z3YYH2MB.mjs.map +1 -0
- package/dist/construct-renderer.mjs +19841 -16190
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/device-scope.d.ts +2 -0
- package/dist/device/device-scope.d.ts.map +1 -1
- package/dist/device/gpu-residency.d.ts +24 -4
- package/dist/device/gpu-residency.d.ts.map +1 -1
- package/dist/environment/frame.d.ts +5 -0
- package/dist/environment/frame.d.ts.map +1 -1
- package/dist/environment/inspection.d.ts +7 -0
- package/dist/environment/inspection.d.ts.map +1 -1
- package/dist/environment/lifecycle.d.ts +20 -2
- package/dist/environment/lifecycle.d.ts.map +1 -1
- package/dist/errors/recover.d.ts +58 -2
- package/dist/errors/recover.d.ts.map +1 -1
- package/dist/errors/render.d.ts +13 -0
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/extract/contracts.d.ts +899 -0
- package/dist/extract/contracts.d.ts.map +1 -0
- package/dist/features/host.d.ts +2 -0
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/prepared-gpu-work.d.ts +3 -0
- package/dist/features/prepared-gpu-work.d.ts.map +1 -1
- package/dist/features/prepared-graphics-store.d.ts +2 -0
- package/dist/features/prepared-graphics-store.d.ts.map +1 -1
- package/dist/gpu-driven/production-raster.d.ts +28 -0
- package/dist/gpu-driven/production-raster.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +1 -0
- package/dist/gpu-scene.d.ts.map +1 -1
- package/dist/ibl/IblPipelineCache.d.ts +7 -6
- package/dist/ibl/IblPipelineCache.d.ts.map +1 -1
- package/dist/ibl/skylight-bind-group.d.ts +7 -1
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/internal.mjs +6 -6
- package/dist/light-buffer-layout.d.ts +3 -0
- package/dist/light-buffer-layout.d.ts.map +1 -1
- package/dist/materials.d.ts +34 -10
- package/dist/materials.d.ts.map +1 -1
- package/dist/mesh-material-bindings.d.ts +56 -0
- package/dist/mesh-material-bindings.d.ts.map +1 -1
- package/dist/occlusion-proxy.d.ts +4 -0
- package/dist/occlusion-proxy.d.ts.map +1 -0
- package/dist/pbr-pipeline.d.ts +32 -9
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/points-lines/prepare.d.ts +3 -0
- package/dist/points-lines/prepare.d.ts.map +1 -1
- package/dist/points-lines/standard-owner.d.ts +33 -0
- package/dist/points-lines/standard-owner.d.ts.map +1 -0
- package/dist/record/frame-snapshot.d.ts +5 -0
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame-targets.d.ts.map +1 -1
- package/dist/record/frame.d.ts +14 -2
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +14 -1
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +7 -17
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass.d.ts.map +1 -1
- package/dist/record/mesh-ssbo.d.ts +11 -3
- package/dist/record/mesh-ssbo.d.ts.map +1 -1
- package/dist/record/recovery-pipeline.d.ts +30 -0
- package/dist/record/recovery-pipeline.d.ts.map +1 -0
- package/dist/record/render-context.d.ts +26 -4
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/typed-frame-graph.d.ts +1 -1
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/recovery/render-system-candidate.d.ts +65 -0
- package/dist/recovery/render-system-candidate.d.ts.map +1 -0
- package/dist/render-contract.d.ts +64 -7
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-system-extract-tail.d.ts +12 -0
- package/dist/render-system-extract-tail.d.ts.map +1 -0
- package/dist/render-system-extract.d.ts +156 -22
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system.d.ts +128 -4
- package/dist/render-system.d.ts.map +1 -1
- package/dist/scene/render-scene.d.ts +19 -0
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/temporal/frame-coordinator.d.ts.map +1 -1
- package/dist/temporal/index.mjs +6 -6
- package/dist/temporal/taa-history-store.d.ts +15 -1
- package/dist/temporal/taa-history-store.d.ts.map +1 -1
- package/dist/temporal/transaction.d.ts +5 -0
- package/dist/temporal/transaction.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/__tests__/device-feature-admission.unit.test.ts +6 -0
- package/src/__tests__/device-loss-fanout.unit.test.ts +107 -0
- package/src/__tests__/device-scope-lifecycle.unit.test.ts +21 -0
- package/src/__tests__/environment-generation.integration.test.ts +23 -0
- package/src/__tests__/expose-renderer-errors.unit.test.ts +34 -0
- package/src/__tests__/factory-contract.integration.test.ts +122 -7
- package/src/__tests__/fallback-row-stride-surface.unit.test.ts +4 -1
- package/src/__tests__/ibl/face-uniforms.unit.test.ts +2 -0
- package/src/__tests__/ibl-residency-publication.unit.test.ts +113 -0
- package/src/__tests__/material-contract-inventory.unit.test.ts +24 -9
- package/src/__tests__/material-cooked-projection.unit.test.ts +19 -1
- package/src/__tests__/material-static-dynamic-route.unit.test.ts +29 -0
- package/src/__tests__/material-stride-surface.unit.test.ts +7 -3
- package/src/__tests__/materials-standard-contract.unit.test.ts +104 -0
- package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +1 -1
- package/src/__tests__/physical-clearcoat.integration.test.ts +89 -0
- package/src/__tests__/prepared-gpu-driven-pbr.integration.test.ts +1 -1
- package/src/__tests__/prepared-graphics-pipeline-warmup.unit.test.ts +1 -1
- package/src/__tests__/recover-error-policy-owner.unit.test.ts +6 -3
- package/src/__tests__/recovery-candidate-prepare.contract.test.ts +140 -0
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +85 -18
- package/src/__tests__/renderer-frame-generation-fence.integration.test.ts +47 -0
- package/src/__tests__/renderer-generation-assembly.unit.test.ts +77 -0
- package/src/__tests__/renderer-generation-failure.unit.test.ts +108 -0
- package/src/__tests__/renderer-producer-root-matrix.integration.test.ts +33 -0
- package/src/__tests__/renderer-recovery-capability-matrix.unit.test.ts +59 -0
- package/src/__tests__/renderer-recovery-contract.unit.test.ts +73 -0
- package/src/__tests__/renderer-recovery-lifecycle.unit.test.ts +216 -0
- package/src/__tests__/renderer-target-history-recovery.integration.test.ts +80 -0
- package/src/__tests__/shader-manifest-fixture.ts +13 -16
- package/src/__tests__/shader-stage-surface.unit.test.ts +1 -1
- package/src/__tests__/standard-layer-projection.unit.test.ts +23 -0
- package/src/__tests__/transmission-prewarm.unit.test.ts +95 -85
- package/src/__tests__/volumetric-fog-topology.unit.test.ts +3 -1
- package/src/assembly/bundler-contract.ts +9 -0
- package/src/assembly/device-feature-admission.ts +15 -5
- package/src/assembly/extended-lighting-fallback.ts +216 -0
- package/src/assembly/factory.ts +81 -10088
- package/src/assembly/material/assembly.ts +18 -2
- package/src/assembly/material/standard-layer-projection.ts +16 -0
- package/src/assembly/material-shader-policy.ts +854 -0
- package/src/assembly/material-shader-prewarm.ts +88 -0
- package/src/assembly/mesh-ssbo-grow.ts +270 -0
- package/src/assembly/recovery/device-loss-fanout.ts +89 -0
- package/src/assembly/recovery/generation.ts +141 -0
- package/src/assembly/recovery/recovery-attempt.ts +800 -0
- package/src/assembly/recovery/renderer-recover.ts +906 -0
- package/src/assembly/renderer-facade.ts +342 -0
- package/src/assembly/renderer-frame-transaction.ts +45 -0
- package/src/assembly/renderer-helpers.ts +99 -0
- package/src/assembly/renderer-lifecycle.ts +159 -0
- package/src/assembly/shader-prewarm-policy.ts +157 -0
- package/src/assembly/webgpu-ready-contract.ts +14 -0
- package/src/assembly/webgpu-ready.ts +4079 -0
- package/src/assembly/webgpu-renderer.ts +4095 -0
- package/src/components/camera.ts +1 -1
- package/src/debug-draw-glue.ts +1 -1
- package/src/device/device-scope.ts +35 -6
- package/src/device/gpu-residency.ts +194 -26
- package/src/environment/frame.ts +6 -0
- package/src/environment/inspection.ts +10 -0
- package/src/environment/lifecycle.ts +114 -8
- package/src/errors/recover.ts +76 -5
- package/src/errors/render.ts +17 -0
- package/src/extract/contracts.ts +974 -0
- package/src/features/host.ts +16 -0
- package/src/features/prepared-gpu-work.ts +20 -2
- package/src/features/prepared-graphics-store.ts +17 -0
- package/src/gpu-driven/production-raster.ts +97 -2
- package/src/gpu-scene.ts +3 -2
- package/src/ibl/IblPipelineCache.ts +134 -50
- package/src/ibl/skylight-bind-group.ts +26 -0
- package/src/index.ts +9 -1
- package/src/light-buffer-layout.ts +3 -0
- package/src/materials.ts +262 -45
- package/src/mesh-material-bindings.ts +59 -0
- package/src/occlusion-proxy.ts +64 -0
- package/src/pbr-pipeline.ts +139 -15
- package/src/points-lines/__tests__/cache-recovery.unit.test.ts +22 -0
- package/src/points-lines/prepare.ts +9 -0
- package/src/points-lines/standard-owner.ts +403 -0
- package/src/record/__tests__/frame-targets-recovery.unit.test.ts +60 -0
- package/src/record/__tests__/main-pass-geometry.unit.test.ts +26 -1
- package/src/record/__tests__/mesh-ssbo.unit.test.ts +38 -0
- package/src/record/__tests__/recovery-pipeline.unit.test.ts +124 -0
- package/src/record/__tests__/sprite-material-abi.unit.test.ts +28 -13
- package/src/record/__tests__/standard-pbr-ubo-layout.unit.test.ts +47 -4
- package/src/record/__tests__/temporal-payload.unit.test.ts +22 -43
- package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +1 -1
- package/src/record/frame-snapshot.ts +15 -0
- package/src/record/frame-targets.ts +11 -1
- package/src/record/frame.ts +6 -2
- package/src/record/helpers.ts +1 -1
- package/src/record/main-pass-geometry.ts +230 -5
- package/src/record/main-pass-material.ts +316 -209
- package/src/record/main-pass-sprite-draws.ts +6 -7
- package/src/record/main-pass.ts +94 -6
- package/src/record/mesh-ssbo.ts +32 -10
- package/src/record/recovery-pipeline.ts +695 -0
- package/src/record/render-context.ts +35 -4
- package/src/record/typed-frame-graph.ts +45 -1
- package/src/record/view-ubo.ts +3 -3
- package/src/recovery/render-system-candidate.ts +839 -0
- package/src/render-contract.ts +65 -7
- package/src/render-system-extract-tail.ts +2983 -0
- package/src/render-system-extract.ts +124 -2977
- package/src/render-system.ts +868 -659
- package/src/scene/render-scene.ts +124 -1
- package/src/temporal/frame-coordinator.ts +4 -1
- package/src/temporal/taa-history-store.ts +46 -2
- package/src/temporal/temporal-view.ts +1 -1
- package/src/temporal/transaction.ts +9 -0
- package/src/tilemap-chunk-extract-system.ts +1 -1
- package/src/transmission/__tests__/standard-transmission.dawn.test.ts +19 -12
- package/dist/chunk-4L3P6DT5.mjs.map +0 -1
- package/dist/chunk-4NPUASZR.mjs.map +0 -1
- package/dist/chunk-DIYW3M5D.mjs.map +0 -1
- package/dist/chunk-FBC4R44J.mjs.map +0 -1
- package/dist/chunk-HZUPSYW7.mjs.map +0 -1
- package/dist/chunk-QODA5UKU.mjs.map +0 -1
- package/dist/chunk-YALPS44A.mjs.map +0 -1
- package/dist/chunk-ZUWKAZ2I.mjs.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Result, RhiCanvasContext, RhiDevice } from '@forgeax/engine-rhi';
|
|
2
|
+
import { RhiError } from '@forgeax/engine-rhi';
|
|
3
|
+
import type { RhiErrorListenerRegistry } from '../lifecycle';
|
|
4
|
+
import { type PipelineState } from '../render-system';
|
|
5
|
+
/** Minimum device-bound surface contract needed by lazy context configuration. */
|
|
6
|
+
export interface RendererSurfaceInternals {
|
|
7
|
+
readonly device: RhiDevice;
|
|
8
|
+
readonly context: RhiCanvasContext;
|
|
9
|
+
readonly pack: {
|
|
10
|
+
readonly instrumentation?: {
|
|
11
|
+
readonly resolveSurfaceDevice?: (device: RhiDevice) => Result<RhiDevice, RhiError>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare function wrapDisposeError(cause: unknown, step: string): RhiError;
|
|
16
|
+
export declare function ensureContextConfigured(internals: RendererSurfaceInternals, state: PipelineState, errorRegistry: RhiErrorListenerRegistry, context?: RhiCanvasContext, device?: RhiDevice): Result<void, RhiError>;
|
|
17
|
+
export declare function runShimSyncStep<T>(fn: () => Result<T, RhiError>, fallbackCode: 'shader-compile-failed' | 'webgpu-runtime-error' | 'queue-write-buffer-out-of-bounds', expected: string, hint: string): Result<T, RhiError>;
|
|
18
|
+
export declare function runShimStep<T>(fn: () => Promise<Result<T, RhiError>>, fallbackCode: 'shader-compile-failed' | 'webgpu-runtime-error', expected: string, hint: string): Promise<Result<T, RhiError>>;
|
|
19
|
+
//# sourceMappingURL=renderer-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-helpers.d.ts","sourceRoot":"","sources":["../../src/assembly/renderer-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAW,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAExE,kFAAkF;AAClF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,eAAe,CAAC,EAAE;YACzB,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;SACpF,CAAC;KACH,CAAC;CACH;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAQvE;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,wBAAwB,EACnC,KAAK,EAAE,aAAa,EACpB,aAAa,EAAE,wBAAwB,EACvC,OAAO,GAAE,gBAAoC,EAC7C,MAAM,GAAE,SAA4B,GACnC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAqBxB;AAED,wBAAgB,eAAe,CAAC,CAAC,EAC/B,EAAE,EAAE,MAAM,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,EAC7B,YAAY,EACR,uBAAuB,GACvB,sBAAsB,GACtB,kCAAkC,EACtC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAcrB;AAED,wBAAsB,WAAW,CAAC,CAAC,EACjC,EAAE,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EACtC,YAAY,EAAE,uBAAuB,GAAG,sBAAsB,EAC9D,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAc9B"}
|
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
import type { RendererState } from '../render-contract';
|
|
2
2
|
/** Lifecycle states that may accept a new frame operation. */
|
|
3
3
|
export declare function isRendererStateOperational(state: RendererState): boolean;
|
|
4
|
+
export declare const RECOVERY_TOTAL_DEADLINE_MS = 20000;
|
|
5
|
+
export declare const RECOVERY_ADAPTER_DEADLINE_MS = 10000;
|
|
6
|
+
export declare const RECOVERY_DEVICE_DEADLINE_MS = 10000;
|
|
7
|
+
export declare const RECOVERY_PHASES: readonly ["quiesce", "acquire-adapter", "acquire-device", "rehydrate", "compile-graph", "publish", "cleanup"];
|
|
8
|
+
export type RecoveryPhase = (typeof RECOVERY_PHASES)[number];
|
|
9
|
+
export type RecoveryGuidance = 'retry' | 'repair-owner' | 'rebuild-renderer';
|
|
10
|
+
export interface RendererLifecycle {
|
|
11
|
+
state(): RendererState;
|
|
12
|
+
transition(next: RendererState): boolean;
|
|
13
|
+
states(): readonly RendererState[];
|
|
14
|
+
}
|
|
15
|
+
export declare function createRendererLifecycle(initial?: RendererState): RendererLifecycle;
|
|
16
|
+
export interface RecoveryDeadline {
|
|
17
|
+
readonly startedAt: number;
|
|
18
|
+
readonly totalDeadlineMs: number;
|
|
19
|
+
readonly adapterDeadlineMs: number;
|
|
20
|
+
readonly deviceDeadlineMs: number;
|
|
21
|
+
readonly deadlineAt: number;
|
|
22
|
+
beginDeviceAcquisition(now: number): void;
|
|
23
|
+
isValid(phase: RecoveryPhase, now: number): boolean;
|
|
24
|
+
elapsed(now: number): number;
|
|
25
|
+
}
|
|
26
|
+
export declare function createRecoveryDeadline(startedAt: number): RecoveryDeadline;
|
|
27
|
+
export interface RecoveryContinuation {
|
|
28
|
+
isValid(phase: RecoveryPhase, now: number): boolean;
|
|
29
|
+
abandon(now: number): void;
|
|
30
|
+
cleanupOnce(): void;
|
|
31
|
+
}
|
|
32
|
+
export declare function createRecoveryContinuation(deadline: RecoveryDeadline, cleanup: () => void): RecoveryContinuation;
|
|
33
|
+
export interface SingleFlight<T> {
|
|
34
|
+
run(): Promise<T>;
|
|
35
|
+
inFlight(): Promise<T> | undefined;
|
|
36
|
+
}
|
|
37
|
+
export declare function createSingleFlight<T>(factory: () => Promise<T>): SingleFlight<T>;
|
|
4
38
|
//# sourceMappingURL=renderer-lifecycle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-lifecycle.d.ts","sourceRoot":"","sources":["../../src/assembly/renderer-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,8DAA8D;AAC9D,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAExE"}
|
|
1
|
+
{"version":3,"file":"renderer-lifecycle.d.ts","sourceRoot":"","sources":["../../src/assembly/renderer-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,8DAA8D;AAC9D,wBAAgB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E,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,IAAI,IAAI,CAAC;CACrB;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,MAAM,IAAI,GAClB,oBAAoB,CAqBtB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAClB,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACpC;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAwBhF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Result, RhiError, ShaderModule } from '@forgeax/engine-rhi';
|
|
2
|
+
import { type MaterialShaderManifestEntry } from '@forgeax/engine-shader';
|
|
3
|
+
/** Minimum sampled-texture limit needed by Standard transmission variants. */
|
|
4
|
+
export declare const STANDARD_PBR_REQUIRED_SAMPLED_TEXTURES = 17;
|
|
5
|
+
/** Select HDRP variants that must be seeded during ready-state construction. */
|
|
6
|
+
export declare function selectHdrpPbrPrewarmVariants(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean, extendedLightingShaderAvailableOrTransmissionCapable?: boolean, transmissionCapable?: boolean, directionalPcssAvailable?: boolean, projectorAvailable?: boolean): readonly MaterialShaderManifestEntry['variants'][number][];
|
|
7
|
+
/** Return every active-capability pbr-skin variant used by URP and HDRP draws. */
|
|
8
|
+
export declare function selectSkinPrewarmVariants(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean): readonly MaterialShaderManifestEntry['variants'][number][];
|
|
9
|
+
/** Select probe-enabled material modules for recovery candidate prewarming. */
|
|
10
|
+
export declare function selectProbePrewarmVariants(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean, extendedLightingShaderAvailable?: boolean, transmissionCapable?: boolean, directionalPcssAvailable?: boolean, projectorAvailable?: boolean, webgl2Downlevel?: boolean): readonly MaterialShaderManifestEntry['variants'][number][];
|
|
11
|
+
/** Compile and seed a selected material-shader variant set without duplicate modules. */
|
|
12
|
+
export declare function prewarmMaterialShaderVariants(variants: readonly MaterialShaderManifestEntry['variants'][number][], prewarmedModules: Map<string, ShaderModule>, compile: (variant: MaterialShaderManifestEntry['variants'][number], moduleLabel: string) => Promise<Result<ShaderModule, RhiError>>, seed: (moduleLabel: string, module: ShaderModule) => void): Promise<void>;
|
|
13
|
+
/** Select the declared Standard URP transmission variants for exact prewarm. */
|
|
14
|
+
export declare function selectStandardPbrTransmissionPrewarmVariants(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean, directionalPcssAvailable?: boolean, projectorAvailable?: boolean, extendedLightingShaderAvailable?: boolean): readonly MaterialShaderManifestEntry['variants'][number][];
|
|
15
|
+
//# sourceMappingURL=shader-prewarm-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader-prewarm-policy.d.ts","sourceRoot":"","sources":["../../src/assembly/shader-prewarm-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAoB,KAAK,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE5F,8EAA8E;AAC9E,eAAO,MAAM,sCAAsC,KAAK,CAAC;AAEzD,gFAAgF;AAChF,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,2BAA2B,GAAG,SAAS,EACtD,oBAAoB,EAAE,OAAO,EAC7B,oDAAoD,UAAO,EAC3D,mBAAmB,UAAO,EAC1B,wBAAwB,UAAO,EAC/B,kBAAkB,GAAE,OAAc,GACjC,SAAS,2BAA2B,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAE,CA2B5D;AAED,kFAAkF;AAClF,wBAAgB,yBAAyB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
|
+
export declare const MIPMAP_PREWARM_FORMATS: readonly GPUTextureFormat[];
|
|
4
|
+
export declare const BRIGHT_PARAMS_BYTES = 16;
|
|
5
|
+
export declare const BLUR_PARAMS_BYTES = 16;
|
|
6
|
+
export declare const COMPOSITE_PARAMS_BYTES = 16;
|
|
7
|
+
export declare const HDR_COLOR_ATTACHMENT_FORMAT: GPUTextureFormat;
|
|
8
|
+
export declare const DEPTH_TEXTURE_FORMAT: GPUTextureFormat;
|
|
9
|
+
//# sourceMappingURL=webgpu-ready-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgpu-ready-contract.d.ts","sourceRoot":"","sources":["../../src/assembly/webgpu-ready-contract.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,eAAO,MAAM,cAAc,QAA2B,CAAC;AACvD,eAAO,MAAM,sBAAsB,EAAE,SAAS,gBAAgB,EAI7D,CAAC;AACF,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,2BAA2B,EAAE,gBAAgC,CAAC;AAC3E,eAAO,MAAM,oBAAoB,EAAE,gBAAyC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { RenderPipeline, Result, RhiDevice, ShaderModule } from '@forgeax/engine-rhi';
|
|
2
|
+
import { RhiError } from '@forgeax/engine-rhi';
|
|
3
|
+
import { type ShaderCatalog } from '@forgeax/engine-shader';
|
|
4
|
+
export type { MaterialShaderManifestEntry } from '@forgeax/engine-shader';
|
|
5
|
+
import type { GpuResidencyCache } from '../device/gpu-residency';
|
|
6
|
+
import type { DeviceScope, RhiErrorListenerRegistry } from '../lifecycle';
|
|
7
|
+
import { type PipelineGroup2Contract } from '../pbr-pipeline';
|
|
8
|
+
import { type VolumetricFogShaderSources } from '../render-contract';
|
|
9
|
+
import { type PipelineState } from '../render-system';
|
|
10
|
+
import { type MeshSsboGrowResult, type MeshSsboState } from './mesh-ssbo-grow';
|
|
11
|
+
/**
|
|
12
|
+
* Build the `Renderer.initialization` Promise (D-S3 three-step strict-serial chain).
|
|
13
|
+
*
|
|
14
|
+
* Steps run in order; each rejection short-circuits the chain and the
|
|
15
|
+
* resulting Promise rejects with a structured `RhiError` / `ShaderError`.
|
|
16
|
+
* AI users `await renderer.initialization` once before the first `draw(world)` call;
|
|
17
|
+
* subsequent frames may skip the await (the Promise stays resolved).
|
|
18
|
+
*
|
|
19
|
+
* Step 1 (manifest load): `shader.loadManifest()` populates the runtime
|
|
20
|
+
* registry. Failure = `ShaderError 'manifest-malformed'` /
|
|
21
|
+
* `'shader-not-found'`.
|
|
22
|
+
*
|
|
23
|
+
* Step 2 (pipeline compile): synthesises the PBR pipeline (3 BindGroupLayout
|
|
24
|
+
* + 1 PipelineLayout + 1 ShaderModule + 1 RenderPipeline). Failure =
|
|
25
|
+
* `RhiError 'shader-compile-failed'` / `'feature-not-enabled'` /
|
|
26
|
+
* `'limit-exceeded'`.
|
|
27
|
+
*
|
|
28
|
+
* Step 3 (asset upload): allocates GPU buffers for the builtin cube and
|
|
29
|
+
* triangle meshes via `device.createBuffer` + `queue.writeBuffer`. Failure
|
|
30
|
+
* = `RhiError 'limit-exceeded'` / `'webgpu-runtime-error'` /
|
|
31
|
+
* `'queue-write-buffer-out-of-bounds'`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildReadyWebGPU(rhiDevice: RhiDevice, rendererScope: DeviceScope, getShader: () => ShaderCatalog, gpuStore: GpuResidencyCache, asyncCreateShaderModule: ((device: RhiDevice, desc: {
|
|
34
|
+
code: string;
|
|
35
|
+
label?: string | undefined;
|
|
36
|
+
}) => Promise<Result<ShaderModule, RhiError>>) | undefined, errorRegistry: RhiErrorListenerRegistry,
|
|
37
|
+
/**
|
|
38
|
+
* Material shader modules declared by producer features. These are compiled
|
|
39
|
+
* during Renderer.initialization so prepared graphics do not fail on their first
|
|
40
|
+
* frame while the shared async shader adapter is still warming up.
|
|
41
|
+
*/
|
|
42
|
+
requiredMaterialShaders: readonly string[],
|
|
43
|
+
/** Fullscreen feature modules compiled before the first synchronous frame. */
|
|
44
|
+
requiredFullscreenPostProcesses: readonly {
|
|
45
|
+
readonly identity: string;
|
|
46
|
+
readonly source: string;
|
|
47
|
+
}[], setGrowMeshSsboHook: (hook: (neededSlots: number) => MeshSsboGrowResult, state: MeshSsboState) => void, seedShaderModule: (label: string, module: ShaderModule) => void, seedMaterialShaderPipelineCache: (key: string, pso: RenderPipeline, group2Contract: PipelineGroup2Contract) => void, registerBuiltinTonemap: (source: string) => void,
|
|
48
|
+
/** Register the special FXAA pass' final-output policy params UBO. */
|
|
49
|
+
registerBuiltinFxaa: (source: string) => void, registerBuiltinTemporalPostProcesses: (entries: {
|
|
50
|
+
readonly motionBlur?: string;
|
|
51
|
+
readonly taaResolve?: string;
|
|
52
|
+
}) => void,
|
|
53
|
+
/** Install manifest-owned volume utility sources only after all four modules compile. */
|
|
54
|
+
setVolumetricFogShaderSources: (sources: VolumetricFogShaderSources) => void): Promise<PipelineState>;
|
|
55
|
+
//# sourceMappingURL=webgpu-ready.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgpu-ready.d.ts","sourceRoot":"","sources":["../../src/assembly/webgpu-ready.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAKV,cAAc,EACd,MAAM,EACN,SAAS,EAET,YAAY,EACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAM,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI9E,YAAY,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE1E,OAAO,KAAK,EAAE,iBAAiB,EAAkB,MAAM,yBAAyB,CAAC;AAwBjF,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,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AM,EAAE,MAAM,KAAK,IAAI;AAChD,sEAAsE;AACtE,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EAC7C,oCAAoC,EAAE,CAAC,OAAO,EAAE;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAK,IAAI;AACV,yFAAyF;AACzF,6BAA6B,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,IAAI,GAC3E,OAAO,CAAC,aAAa,CAAC,CAoxHxB"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { RhiCanvasContext, RhiDevice } from '@forgeax/engine-rhi';
|
|
2
|
+
import { RhiError } from '@forgeax/engine-rhi';
|
|
3
|
+
import type { ImportTransport } from '@forgeax/engine-types';
|
|
4
|
+
export type { MaterialShaderManifestEntry } from '@forgeax/engine-shader';
|
|
5
|
+
import type { DeviceResourceKind } from '../device/resource-types';
|
|
6
|
+
import { type RenderFeatureHost } from '../features/host';
|
|
7
|
+
import { HealthListenerRegistry, LostListenerRegistry, RhiErrorListenerRegistry } from '../lifecycle';
|
|
8
|
+
import type { RecoveryColdWorkGuard } from '../record/render-context';
|
|
9
|
+
import type { RenderDebugOverlay, RendererOptions, VolumetricFogShaderSources } from '../render-contract';
|
|
10
|
+
import type { RhiBackendPack } from './backend-contract';
|
|
11
|
+
import type { BundlerOptions } from './bundler-contract';
|
|
12
|
+
import type { RendererAssemblyImplementation } from './host-contract';
|
|
13
|
+
import type { MeshSsboGrowResult, MeshSsboState } from './mesh-ssbo-grow';
|
|
14
|
+
import { type RecoveryGuidance, type RecoveryPhase } from './renderer-lifecycle';
|
|
15
|
+
export type { BundlerOptions } from './bundler-contract';
|
|
16
|
+
export { assembleMaterialProjection } from './material/assembly';
|
|
17
|
+
export { projectMaterialPipeline, routeMaterialPipeline, updateMaterialRuntimeValues, } from './material/pipeline-projection';
|
|
18
|
+
export type { LayoutKind, MaterialShaderBindingContract, MaterialShaderVertexInputContract, } from './material-shader-policy';
|
|
19
|
+
export { allowsUnlitPreparedFallback, isSharedMaterialUserRegionCompatible, normalizeMaterialShaderVariantSet, resolveMaterialShaderBindingContract, resolveMaterialShaderVariantSet, resolveMaterialShaderVertexInputContract, selectNoColorPbrVariant, selectPipelineLayoutForVariant, shouldDeferMissingPreparedMaterialShader, } from './material-shader-policy';
|
|
20
|
+
export type { MeshSsboBufferWrapper, MeshSsboGrowController, MeshSsboGrowControllerInit, MeshSsboGrowDevice, MeshSsboGrowErrorRegistry, MeshSsboGrowResult, MeshSsboState, } from './mesh-ssbo-grow';
|
|
21
|
+
export { createMeshSsboGrowController, deriveStorageBufferCeiling, INITIAL_MESH_SSBO_SLOT_COUNT, requireMeshSsboBuffer, } from './mesh-ssbo-grow';
|
|
22
|
+
export { exposeRenderer } from './renderer-facade';
|
|
23
|
+
export { selectHdrpPbrPrewarmVariants, selectProbePrewarmVariants, selectSkinPrewarmVariants, selectStandardPbrTransmissionPrewarmVariants, } from './shader-prewarm-policy';
|
|
24
|
+
/**
|
|
25
|
+
* Bundler-layer injection accepted by `createRenderer` (and proxied by
|
|
26
|
+
* `createApp`) as the optional third argument.
|
|
27
|
+
*
|
|
28
|
+
* feat-20260608-create-app-param-surface-trim / M2 / D-3: aggregates the two
|
|
29
|
+
* host-injected build-tool channels:
|
|
30
|
+
*
|
|
31
|
+
* - shaderManifestUrl: the URL the host's vite-plugin-shader emit step
|
|
32
|
+
* wrote `manifest.json` to. When this field is omitted (or `bundler`
|
|
33
|
+
* itself is omitted), createRenderer falls back to
|
|
34
|
+
* '/shaders/manifest.json' (D-2 q5-A) so the LO 1.1 zero-config takeoff
|
|
35
|
+
* path keeps working without explicit injection. Tests can inject via a
|
|
36
|
+
* `data:application/json,...` URL to bypass fetch.
|
|
37
|
+
*
|
|
38
|
+
* - importTransport: dev-only ImportTransport forwarded verbatim to the
|
|
39
|
+
* AssetRegistry third ctor slot so DDC-miss assets can lazy-import.
|
|
40
|
+
* Absent => shipped form (a DDC miss fails fast with `asset-not-imported`).
|
|
41
|
+
*
|
|
42
|
+
* The interface is structurally shared with `@forgeax/engine-app` while this
|
|
43
|
+
* package keeps the renderer independent from the host package.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* Wire the spec `device.lost` Promise into the lost / error / health channels
|
|
47
|
+
* (research §F-4 / R2). A genuine device loss fans out through `errorRegistry`
|
|
48
|
+
* so the public `renderer.subscribe` error event triggers, and
|
|
49
|
+
* through `healthRegistry` so `health().reason` flips to `'device-lost'`
|
|
50
|
+
* (feat-20260622-s5 M1/M2). Explicit renderer teardown is observable through
|
|
51
|
+
* `onLost`, but is not a runtime error and must not manufacture an RhiError.
|
|
52
|
+
*
|
|
53
|
+
* Extracted to a single helper (SSOT) so the createRenderer assembly path AND
|
|
54
|
+
* the recover() rebuild path attach byte-identical fan-out to whichever device
|
|
55
|
+
* is current — recover() mints a fresh device whose own `lost` Promise must be
|
|
56
|
+
* re-wired to the SAME registries the host already subscribed to.
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* tryCreateWebGPURenderer returns three kinds of outcome (fix-f1 / w16):
|
|
60
|
+
* - `ok` → Renderer created successfully
|
|
61
|
+
* - `rhi-err` → RHI Result.err path (preserves the original RhiError
|
|
62
|
+
* for AI consumers to read; now includes context acquisition
|
|
63
|
+
* failures via pack.rhi.acquireCanvasContext)
|
|
64
|
+
* - `throw` → exception path (caught and wrapped by the caller as
|
|
65
|
+
* an Error)
|
|
66
|
+
*/
|
|
67
|
+
export type WebGPUOutcome = {
|
|
68
|
+
kind: 'ok';
|
|
69
|
+
renderer: RendererAssemblyImplementation;
|
|
70
|
+
} | {
|
|
71
|
+
kind: 'rhi-err';
|
|
72
|
+
error: RhiError;
|
|
73
|
+
} | {
|
|
74
|
+
kind: 'throw';
|
|
75
|
+
error: Error;
|
|
76
|
+
};
|
|
77
|
+
export declare function tryCreateWebGPURenderer(canvas: HTMLCanvasElement | OffscreenCanvas, options: RendererOptions | undefined, pack: RhiBackendPack, bundler: BundlerOptions | undefined): Promise<WebGPUOutcome>;
|
|
78
|
+
export interface WebGPURendererInternals {
|
|
79
|
+
canvas: HTMLCanvasElement | OffscreenCanvas;
|
|
80
|
+
device: RhiDevice;
|
|
81
|
+
context: RhiCanvasContext;
|
|
82
|
+
options: RendererOptions | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* feat-20260608-create-app-param-surface-trim / M2 / D-3: BundlerOptions
|
|
85
|
+
* forwarded verbatim from createRenderer's third arg. Carries
|
|
86
|
+
* shaderManifestUrl (host-injected vite-plugin-shader emit URL; absent =>
|
|
87
|
+
* createRenderer falls back to '/shaders/manifest.json') and the
|
|
88
|
+
* importTransport that previously rode a dedicated internal slot.
|
|
89
|
+
*/
|
|
90
|
+
bundler: BundlerOptions | undefined;
|
|
91
|
+
lostRegistry: LostListenerRegistry;
|
|
92
|
+
errorRegistry: RhiErrorListenerRegistry;
|
|
93
|
+
healthRegistry: HealthListenerRegistry;
|
|
94
|
+
/** M3 D-P4 auto-select pack — carries the dynamic-imported rhi-webgpu / rhi-wgpu singleton + optional async shader factory. */
|
|
95
|
+
pack: RhiBackendPack;
|
|
96
|
+
/**
|
|
97
|
+
* feat-20260604-hdr-equirect-cube-importer-loader M4 / w16 (D-3): the
|
|
98
|
+
* dev-only ImportTransport, forwarded verbatim from createRenderer to the
|
|
99
|
+
* AssetRegistry third ctor slot. `undefined` keeps the shipped form (DDC
|
|
100
|
+
* miss fails fast with `asset-not-imported`, AC-08).
|
|
101
|
+
*/
|
|
102
|
+
importTransport?: ImportTransport | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* feat-20260608-mesh-ssbo-dynamic-grow-l1-lift-1024-entity-cap M2 / T-M2-05:
|
|
105
|
+
* mesh-SSBO grow hook surfaced by `makeWebGPURenderer` after the controller
|
|
106
|
+
* is constructed. Undefined before `makeWebGPURenderer` runs; populated by
|
|
107
|
+
* the time the renderer is returned to the caller. M3's record stage reads
|
|
108
|
+
* this field via the runtime path that bridges into render-system-record.ts
|
|
109
|
+
* (the bridging plumbing is in M3's targetFiles).
|
|
110
|
+
*
|
|
111
|
+
* Returns `{ ok: true }` when the grow completed (or short-circuited
|
|
112
|
+
* idempotently); `{ ok: false, code }` with a fired structured error
|
|
113
|
+
* (`MeshSsboCeilingReachedError` or `MeshSsboCapacityExceededError`) when
|
|
114
|
+
* the request cannot be satisfied. Never throws (D-5).
|
|
115
|
+
*/
|
|
116
|
+
growMeshSsbo?: (neededSlots: number) => MeshSsboGrowResult;
|
|
117
|
+
/**
|
|
118
|
+
* feat-20260608-mesh-ssbo-dynamic-grow-l1-lift-1024-entity-cap M3 / T-M3-04:
|
|
119
|
+
* read-only handle to the grow controller's state (slotCount + wrapper
|
|
120
|
+
* refs), surfaced alongside `growMeshSsbo` so `ensureMeshSsboCapacity`
|
|
121
|
+
* (record-stage wiring) can short-circuit when slotCount already covers the
|
|
122
|
+
* frame's renderable count and so the dev-mode info log can report the
|
|
123
|
+
* before/after slot count transition. Undefined until buildReadyWebGPU
|
|
124
|
+
* has wired the controller; identity stable across grow events.
|
|
125
|
+
*/
|
|
126
|
+
meshSsboState?: MeshSsboState;
|
|
127
|
+
/** Host-owned producer features; created before device-bound assembly starts. */
|
|
128
|
+
featureHost?: RenderFeatureHost;
|
|
129
|
+
/** App-owned overlay capability read by the typed graph at frame time. */
|
|
130
|
+
debugOverlay?: RenderDebugOverlay;
|
|
131
|
+
/** Composed renderer utility sources installed atomically at build-ready. */
|
|
132
|
+
volumetricFogShaders?: VolumetricFogShaderSources | undefined;
|
|
133
|
+
gpuPassTimingSubmittedWork?: Promise<void> | undefined;
|
|
134
|
+
lossObserver: {
|
|
135
|
+
current?: (detail: string) => void;
|
|
136
|
+
};
|
|
137
|
+
generationState: {
|
|
138
|
+
current: number;
|
|
139
|
+
onStaleLoss?: () => void;
|
|
140
|
+
};
|
|
141
|
+
recoveryColdWorkGuard?: RecoveryColdWorkGuard | undefined;
|
|
142
|
+
getMaterialShaderUvSetCount?: (materialShaderId: string) => number | undefined;
|
|
143
|
+
}
|
|
144
|
+
export interface RecoveryFailureLocation {
|
|
145
|
+
readonly phase: RecoveryPhase;
|
|
146
|
+
readonly retryable: boolean;
|
|
147
|
+
readonly guidance: RecoveryGuidance;
|
|
148
|
+
readonly owner: string;
|
|
149
|
+
readonly resourceKind: DeviceResourceKind;
|
|
150
|
+
readonly cause: unknown;
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=webgpu-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgpu-renderer.d.ts","sourceRoot":"","sources":["../../src/assembly/webgpu-renderer.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAKV,gBAAgB,EAChB,SAAS,EACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAW,QAAQ,EAAoB,MAAM,qBAAqB,CAAC;AAS1E,OAAO,KAAK,EACV,eAAe,EAMhB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAG1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAYnE,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAUnF,OAAO,EAEL,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AA0CtB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EAMV,kBAAkB,EAGlB,eAAe,EAMf,0BAA0B,EAC3B,MAAM,oBAAoB,CAAC;AAe5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AA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QACf,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;KAC1B,CAAC;IACF,qBAAqB,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC1D,2BAA2B,CAAC,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAChF;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB"}
|
package/dist/authoring.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { GlyphText, SpritePlayback, setActiveCamera, spritePlaybackModeFromU32 } from './chunk-FJ6P52EE.mjs';
|
|
2
2
|
export { SpriteAnimation, SpriteInstances, SpriteRegionOverride, TileLayer, Tilemap, TilemapSort } from './chunk-JDWARUOI.mjs';
|
|
3
3
|
export { TransparentSort } from './chunk-RXZ3RGOU.mjs';
|
|
4
|
-
export { SPRITE_PREMULTIPLIED_ALPHA_BLEND } from './chunk-
|
|
4
|
+
export { SPRITE_PREMULTIPLIED_ALPHA_BLEND } from './chunk-YKB5DQV7.mjs';
|
|
5
5
|
import { ok } from '@forgeax/engine-types';
|
|
6
6
|
|
|
7
7
|
function createFullscreenRenderFeature(options) {
|
|
@@ -68,8 +68,8 @@ function cameraProjection(camera) {
|
|
|
68
68
|
projection,
|
|
69
69
|
camera.orthoLeft,
|
|
70
70
|
camera.orthoRight,
|
|
71
|
-
camera.orthoBottom,
|
|
72
71
|
camera.orthoTop,
|
|
72
|
+
camera.orthoBottom,
|
|
73
73
|
camera.near,
|
|
74
74
|
camera.far
|
|
75
75
|
);
|
|
@@ -137,7 +137,12 @@ function snapshotSubmittedTemporalView(view) {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
// src/temporal/taa-history-store.ts
|
|
140
|
+
var nextHistoryToken = 1;
|
|
140
141
|
var TaaHistoryStore = class {
|
|
142
|
+
token = nextHistoryToken++;
|
|
143
|
+
deviceGeneration = 0;
|
|
144
|
+
content = "uninitialized";
|
|
145
|
+
requestVersion = 0;
|
|
141
146
|
generation = 0;
|
|
142
147
|
seed = 0;
|
|
143
148
|
valid = false;
|
|
@@ -151,11 +156,18 @@ var TaaHistoryStore = class {
|
|
|
151
156
|
return {
|
|
152
157
|
generation,
|
|
153
158
|
seed,
|
|
154
|
-
commit: () => {
|
|
159
|
+
commit: (receipt) => {
|
|
155
160
|
if (state !== "active") return;
|
|
161
|
+
if (receipt !== void 0 && (!receipt.completed || receipt.deviceGeneration !== this.deviceGeneration)) {
|
|
162
|
+
state = "aborted";
|
|
163
|
+
this.attempt = "aborted";
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
156
166
|
state = "committed";
|
|
157
167
|
this.attempt = "committed";
|
|
158
168
|
this.valid = true;
|
|
169
|
+
this.content = "active";
|
|
170
|
+
this.requestVersion += 1;
|
|
159
171
|
this.generation += 1;
|
|
160
172
|
this.seed += 1;
|
|
161
173
|
this.resetReason = reason;
|
|
@@ -169,6 +181,7 @@ var TaaHistoryStore = class {
|
|
|
169
181
|
}
|
|
170
182
|
seedHistory(reason = "first-frame") {
|
|
171
183
|
this.valid = false;
|
|
184
|
+
this.content = "uninitialized";
|
|
172
185
|
this.resetReason = reason;
|
|
173
186
|
this.attempt = "none";
|
|
174
187
|
}
|
|
@@ -176,11 +189,27 @@ var TaaHistoryStore = class {
|
|
|
176
189
|
this.generation = 0;
|
|
177
190
|
this.seed = 0;
|
|
178
191
|
this.valid = false;
|
|
192
|
+
this.content = "uninitialized";
|
|
179
193
|
this.attempt = "none";
|
|
180
194
|
this.resetReason = reason;
|
|
181
195
|
}
|
|
196
|
+
recoverForGeneration(deviceGeneration) {
|
|
197
|
+
if (!Number.isSafeInteger(deviceGeneration) || deviceGeneration < 0) {
|
|
198
|
+
throw new RangeError("deviceGeneration must be a non-negative safe integer.");
|
|
199
|
+
}
|
|
200
|
+
this.deviceGeneration = deviceGeneration;
|
|
201
|
+
this.valid = false;
|
|
202
|
+
this.content = "uninitialized";
|
|
203
|
+
this.attempt = "none";
|
|
204
|
+
this.resetReason = "device-generation";
|
|
205
|
+
}
|
|
182
206
|
inspect() {
|
|
183
207
|
return {
|
|
208
|
+
token: this.token,
|
|
209
|
+
deviceGeneration: this.deviceGeneration,
|
|
210
|
+
content: this.content,
|
|
211
|
+
fallback: "neutral-texture",
|
|
212
|
+
requestVersion: this.requestVersion,
|
|
184
213
|
generation: this.generation,
|
|
185
214
|
seed: this.seed,
|
|
186
215
|
attempt: this.attempt,
|
|
@@ -277,7 +306,10 @@ var TemporalFrameCoordinator = class {
|
|
|
277
306
|
}
|
|
278
307
|
this.historyDirection = candidate.history.direction === "a-to-b" ? "b-to-a" : "a-to-b";
|
|
279
308
|
const historyAttempt = this.historyAttempts.get(candidate);
|
|
280
|
-
historyAttempt?.commit(
|
|
309
|
+
historyAttempt?.commit({
|
|
310
|
+
deviceGeneration: this.historyStore.inspect().deviceGeneration,
|
|
311
|
+
completed: true
|
|
312
|
+
});
|
|
281
313
|
this.coverage = classifySceneDataCoverage({
|
|
282
314
|
contributors: candidate.contributors,
|
|
283
315
|
requiredContributorIds: candidate.requiredContributorIds
|
|
@@ -381,5 +413,5 @@ var TemporalFrameCoordinator = class {
|
|
|
381
413
|
};
|
|
382
414
|
|
|
383
415
|
export { TEMPORAL_JITTER_SAMPLE_COUNT, TemporalFrameCoordinator, classifySceneDataCoverage, createTemporalCoverage, projectTemporalView, scanSceneDataCoverage, snapshotSubmittedTemporalView, temporalJitterSample, temporalViewId };
|
|
384
|
-
//# sourceMappingURL=chunk-
|
|
385
|
-
//# sourceMappingURL=chunk-
|
|
416
|
+
//# sourceMappingURL=chunk-GE3SDD72.mjs.map
|
|
417
|
+
//# sourceMappingURL=chunk-GE3SDD72.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/temporal/coverage.ts","../src/temporal/temporal-view.ts","../src/temporal/taa-history-store.ts","../src/temporal/frame-coordinator.ts"],"names":[],"mappings":";;;;AAqBO,SAAS,sBAAA,CAAuB,OAAe,MAAA,EAAkC;AACtF,EAAA,IAAI,CAAC,MAAA,CAAO,aAAA,CAAc,KAAK,CAAA,IAAK,SAAS,CAAA,EAAG,MAAM,IAAI,UAAA,CAAW,yBAAyB,CAAA;AAC9F,EAAA,IAAI,CAAC,MAAA,CAAO,aAAA,CAAc,MAAM,KAAK,MAAA,IAAU,CAAA;AAC7C,IAAA,MAAM,IAAI,WAAW,0BAA0B,CAAA;AACjD,EAAA,OAAO,MAAA,CAAO,MAAA,CAAO,EAAE,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,EAAA,GAAK,KAAA,GAAQ,MAAA,EAAQ,UAAA,EAAY,IAAA,EAAe,CAAA;AAC/F;AAOO,SAAS,0BAA0B,KAAA,EASxC;AACA,EAAA,MAAM,mBAAA,GAAsB,KAAA,CAAM,YAAA,CAAa,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,IAAA,KAAS,OAAO,CAAA,CAAE,GAAA,CAAI,CAAC,CAAA,KAAM,EAAE,EAAE,CAAA;AAChG,EAAA,MAAM,sBAAA,GAAyB,KAAA,CAAM,YAAA,CAClC,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,IAAA,KAAS,UAAU,CAAA,CACnC,GAAA,CAAI,CAAC,CAAA,KAAM,EAAE,EAAE,CAAA;AAClB,EAAA,MAAM,SAAA,GAAY,IAAI,GAAA,CAAI,KAAA,CAAM,YAAA,CAAa,IAAI,CAAC,CAAA,KAAM,CAAA,CAAE,EAAE,CAAC,CAAA;AAC7D,EAAA,MAAM,O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ACb,IAAA,IAAA,CAAK,QAAA,GAAW,MAAA;AAChB,IAAA,IAAA,CAAK,kBAAA,GAAqB,CAAA;AAC1B,IAAA,IAAA,CAAK,iBAAA,GAAoB,MAAA;AACzB,IAAA,IAAA,CAAK,gBAAA,GAAmB,QAAA;AACxB,IAAA,IAAA,CAAK,YAAA,CAAa,KAAA;AAAA,MAChB,MAAA,KAAW,KAAA,IAAS,MAAA,KAAW,eAAA,GAC3B,YAAA,GACA,MAAA,KAAW,QAAA,GACT,QAAA,GACA,MAAA,KAAW,mBAAA,IAAuB,MAAA,KAAW,aAAA,GAC3C,mBAAA,GACA;AAAA,KACV;AACA,IAAA,IAAA,CAAK,OAAA,GAAU,MAAA;AACf,IAAA,IAAA,CAAK,cAAA,GAAiB,MAAA;AACtB,IAAA,IAAA,CAAK,WAAA,GAAc,MAAA;AACnB,IAAA,IAAA,CAAK,QAAA,GAAW;AAAA,MACd,qBAAqB,EAAC;AAAA,MACtB,wBAAwB,EAAC;AAAA,MACzB,uBAAuB,EAAC;AAAA,MACxB,8BAAA,EAAgC;AAAA,KAClC;AAAA,EACF;AAAA,EAEQ,eAAe,KAAA,EAAoC;AACzD,IAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,IAAA,IAAQ,WAAW,KAAA,EAAO;AACnE,MAAA,MAAM,QAAS,KAAA,CAA8B,KAAA;AAC7C,MAAA,IAAI,UAAU,OAAA,IAAW,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,YAAY,KAAA,KAAU,QAAA;AAC7E,QAAA,OAAO,KAAA;AAAA,IACX;AACA,IAAA,OAAO,QAAA;AAAA,EACT;AACF","file":"chunk-GE3SDD72.mjs","sourcesContent":["import type { SceneDataLane, SceneDataSchemaId } from './scene-data';\n\nexport interface SceneDataCoverage {\n readonly schema: SceneDataSchemaId;\n readonly lane: SceneDataLane;\n readonly producerId: string;\n readonly complete: boolean;\n readonly contributorIds: readonly string[];\n readonly exactContributorIds: readonly string[];\n readonly reactiveContributorIds: readonly string[];\n readonly missingContributorIds: readonly string[];\n readonly omittedMissingContributorCount: number;\n}\n\nexport interface TemporalCoverage {\n readonly width: number;\n readonly height: number;\n readonly bytes: number;\n readonly fullScreen: true;\n}\n\nexport function createTemporalCoverage(width: number, height: number): TemporalCoverage {\n if (!Number.isSafeInteger(width) || width <= 0) throw new RangeError('width must be positive.');\n if (!Number.isSafeInteger(height) || height <= 0)\n throw new RangeError('height must be positive.');\n return Object.freeze({ width, height, bytes: 32 * width * height, fullScreen: true as const });\n}\n\nexport type SceneDataContributorKind = 'exact' | 'reactive';\nexport interface SceneDataContributor {\n readonly id: string;\n readonly kind: SceneDataContributorKind;\n}\nexport function classifySceneDataCoverage(input: {\n readonly contributors: readonly SceneDataContributor[];\n readonly requiredContributorIds: readonly string[];\n}): {\n readonly exactContributorIds: readonly string[];\n readonly reactiveContributorIds: readonly string[];\n readonly missingContributorIds: readonly string[];\n readonly omittedMissingContributorCount: number;\n readonly complete: boolean;\n} {\n const exactContributorIds = input.contributors.filter((c) => c.kind === 'exact').map((c) => c.id);\n const reactiveContributorIds = input.contributors\n .filter((c) => c.kind === 'reactive')\n .map((c) => c.id);\n const available = new Set(input.contributors.map((c) => c.id));\n const missing = input.requiredContributorIds.filter((id) => !available.has(id));\n return {\n exactContributorIds: Object.freeze(exactContributorIds),\n reactiveContributorIds: Object.freeze(reactiveContributorIds),\n missingContributorIds: Object.freeze(missing.slice(0, 32)),\n omittedMissingContributorCount: Math.max(0, missing.length - 32),\n complete: missing.length === 0,\n };\n}\nexport function scanSceneDataCoverage(input: {\n readonly schema: SceneDataSchemaId;\n readonly lane: SceneDataLane;\n readonly producerId: string;\n readonly contributorIds: readonly string[];\n readonly requiredContributorIds: readonly string[];\n}): SceneDataCoverage {\n const classification = classifySceneDataCoverage({\n contributors: input.contributorIds.map((id) => ({ id, kind: 'exact' as const })),\n requiredContributorIds: input.requiredContributorIds,\n });\n return Object.freeze({\n schema: input.schema,\n lane: input.lane,\n producerId: input.producerId,\n ...classification,\n contributorIds: Object.freeze([...input.contributorIds]),\n });\n}\n","import { mat4 } from '@forgeax/engine-math';\nimport type { CameraProjection } from '../components/camera';\nimport type { CameraSnapshot } from '../render-contract';\n\nexport const TEMPORAL_JITTER_SAMPLE_COUNT = 8;\n\nexport type TemporalViewResetReason =\n | 'first-frame'\n | 'camera-switch'\n | 'history-version-changed'\n | 'projection-kind-changed'\n | 'projection-range-changed';\n\nexport interface SubmittedTemporalView {\n readonly viewId: string;\n readonly historyVersion: number;\n readonly projection: CameraProjection;\n readonly near: number;\n readonly far: number;\n readonly jitterUv: readonly [number, number];\n readonly unjitteredViewProjection: Float32Array;\n}\n\nexport interface TemporalView {\n readonly viewId: string;\n readonly historyVersion: number;\n readonly temporalFrameIndex: number;\n readonly historyValid: boolean;\n readonly resetReason: TemporalViewResetReason | undefined;\n readonly currentJitterUv: readonly [number, number];\n readonly previousJitterUv: readonly [number, number];\n readonly currentJitteredViewProjection: Float32Array;\n readonly currentUnjitteredViewProjection: Float32Array;\n readonly previousUnjitteredViewProjection: Float32Array;\n readonly projection: CameraProjection;\n readonly near: number;\n readonly far: number;\n}\n\nexport interface TemporalViewInput {\n readonly camera: CameraSnapshot;\n readonly temporalFrameIndex: number;\n readonly surfaceWidth: number;\n readonly surfaceHeight: number;\n readonly lastSubmitted?: SubmittedTemporalView;\n}\n\nexport function temporalViewId(worldId: number, entityKey: number): string {\n const raw = entityKey >>> 0;\n const index = raw & 0x00ffffff;\n const generation = (raw >>> 24) & 0xff;\n return `${worldId}:${index}:${generation}`;\n}\n\nfunction halton(index: number, base: number): number {\n let result = 0;\n let fraction = 1 / base;\n let value = index;\n while (value > 0) {\n result += fraction * (value % base);\n value = Math.floor(value / base);\n fraction /= base;\n }\n return result;\n}\n\nexport function temporalJitterSample(temporalFrameIndex: number): readonly [number, number] {\n const sampleIndex =\n ((Math.trunc(temporalFrameIndex) % TEMPORAL_JITTER_SAMPLE_COUNT) +\n TEMPORAL_JITTER_SAMPLE_COUNT) %\n TEMPORAL_JITTER_SAMPLE_COUNT;\n const haltonIndex = sampleIndex + 1;\n return [halton(haltonIndex, 2) - 0.5, halton(haltonIndex, 3) - 0.5];\n}\n\nfunction temporalJitterUv(\n temporalFrameIndex: number,\n surfaceWidth: number,\n surfaceHeight: number,\n): readonly [number, number] {\n const sample = temporalJitterSample(temporalFrameIndex);\n return [sample[0] / Math.max(1, surfaceWidth), sample[1] / Math.max(1, surfaceHeight)];\n}\n\nfunction cameraProjection(camera: CameraSnapshot): Float32Array {\n const projection = mat4.create();\n if (camera.projection === 'orthographic') {\n mat4.orthographic(\n projection,\n camera.orthoLeft,\n camera.orthoRight,\n camera.orthoTop,\n camera.orthoBottom,\n camera.near,\n camera.far,\n );\n } else {\n mat4.perspective(projection, camera.fov, camera.aspect, camera.near, camera.far);\n }\n return projection;\n}\n\nfunction resetReason(\n current: CameraSnapshot,\n viewId: string,\n previous: SubmittedTemporalView | undefined,\n): TemporalViewResetReason | undefined {\n if (previous === undefined) return 'first-frame';\n if (previous.viewId !== viewId) return 'camera-switch';\n if (previous.historyVersion !== (current.historyVersion ?? 0)) {\n return 'history-version-changed';\n }\n if (previous.projection !== current.projection) return 'projection-kind-changed';\n if (!Object.is(previous.near, current.near) || !Object.is(previous.far, current.far)) {\n return 'projection-range-changed';\n }\n return undefined;\n}\n\nexport function projectTemporalView(input: TemporalViewInput): TemporalView {\n const { camera } = input;\n const viewId = temporalViewId(camera.worldId ?? 0, camera.entityKey ?? 0);\n const currentJitterUv = temporalJitterUv(\n input.temporalFrameIndex,\n input.surfaceWidth,\n input.surfaceHeight,\n );\n const view = mat4.invert(mat4.create(), camera.world);\n const projection = cameraProjection(camera);\n const currentUnjitteredViewProjection = mat4.multiply(mat4.create(), projection, view);\n const clipJitter = mat4.identity(mat4.create());\n clipJitter[12] = currentJitterUv[0] * 2;\n clipJitter[13] = currentJitterUv[1] * -2;\n const jitteredProjection = mat4.multiply(mat4.create(), clipJitter, projection);\n const currentJitteredViewProjection = mat4.multiply(mat4.create(), jitteredProjection, view);\n const reason = resetReason(camera, viewId, input.lastSubmitted);\n const historyValid = reason === undefined;\n return {\n viewId,\n historyVersion: camera.historyVersion ?? 0,\n temporalFrameIndex: input.temporalFrameIndex,\n historyValid,\n resetReason: reason,\n currentJitterUv,\n previousJitterUv: historyValid\n ? (input.lastSubmitted?.jitterUv ?? currentJitterUv)\n : currentJitterUv,\n currentJitteredViewProjection,\n currentUnjitteredViewProjection,\n previousUnjitteredViewProjection: historyValid\n ? (input.lastSubmitted?.unjitteredViewProjection ?? currentUnjitteredViewProjection)\n : currentUnjitteredViewProjection,\n projection: camera.projection,\n near: camera.near,\n far: camera.far,\n };\n}\n\nexport function snapshotSubmittedTemporalView(view: TemporalView): SubmittedTemporalView {\n return {\n viewId: view.viewId,\n historyVersion: view.historyVersion,\n projection: view.projection,\n near: view.near,\n far: view.far,\n jitterUv: [view.currentJitterUv[0], view.currentJitterUv[1]],\n unjitteredViewProjection: new Float32Array(view.currentUnjitteredViewProjection),\n };\n}\n","export type TaaHistoryResetReason =\n | 'first-frame'\n | 'camera-cut'\n | 'resize'\n | 'recover'\n | 'device-generation';\n\nexport interface TaaHistoryInspection {\n readonly token: number;\n readonly deviceGeneration: number;\n readonly content: 'uninitialized' | 'active';\n readonly fallback: 'neutral-texture';\n readonly requestVersion: number;\n readonly generation: number;\n readonly seed: number;\n readonly attempt: 'none' | 'active' | 'committed' | 'aborted';\n readonly valid: boolean;\n readonly resetReason: TaaHistoryResetReason | undefined;\n}\n\nexport interface TaaHistoryReceipt {\n readonly deviceGeneration: number;\n readonly completed: boolean;\n}\n\nexport interface TaaHistoryAttempt {\n readonly generation: number;\n readonly seed: number;\n commit(receipt?: TaaHistoryReceipt): void;\n abort(): void;\n}\n\nlet nextHistoryToken = 1;\n\n/** TAA-only history owner. No global registry or backend handle crosses this boundary. */\nexport class TaaHistoryStore {\n private readonly token = nextHistoryToken++;\n private deviceGeneration = 0;\n private content: TaaHistoryInspection['content'] = 'uninitialized';\n private requestVersion = 0;\n private generation = 0;\n private seed = 0;\n private valid = false;\n private attempt: TaaHistoryInspection['attempt'] = 'none';\n private resetReason: TaaHistoryResetReason | undefined;\n\n begin(reason: TaaHistoryResetReason | undefined = undefined): TaaHistoryAttempt {\n const generation = this.generation;\n const seed = this.seed;\n this.attempt = 'active';\n let state: 'active' | 'committed' | 'aborted' = 'active';\n return {\n generation,\n seed,\n commit: (receipt) => {\n if (state !== 'active') return;\n if (\n receipt !== undefined &&\n (!receipt.completed || receipt.deviceGeneration !== this.deviceGeneration)\n ) {\n state = 'aborted';\n this.attempt = 'aborted';\n return;\n }\n state = 'committed';\n this.attempt = 'committed';\n this.valid = true;\n this.content = 'active';\n this.requestVersion += 1;\n this.generation += 1;\n this.seed += 1;\n this.resetReason = reason;\n },\n abort: () => {\n if (state !== 'active') return;\n state = 'aborted';\n this.attempt = 'aborted';\n },\n };\n }\n\n seedHistory(reason: TaaHistoryResetReason = 'first-frame'): void {\n this.valid = false;\n this.content = 'uninitialized';\n this.resetReason = reason;\n this.attempt = 'none';\n }\n\n reset(reason: TaaHistoryResetReason): void {\n this.generation = 0;\n this.seed = 0;\n this.valid = false;\n this.content = 'uninitialized';\n this.attempt = 'none';\n this.resetReason = reason;\n }\n\n recoverForGeneration(deviceGeneration: number): void {\n if (!Number.isSafeInteger(deviceGeneration) || deviceGeneration < 0) {\n throw new RangeError('deviceGeneration must be a non-negative safe integer.');\n }\n this.deviceGeneration = deviceGeneration;\n this.valid = false;\n this.content = 'uninitialized';\n this.attempt = 'none';\n this.resetReason = 'device-generation';\n }\n\n inspect(): TaaHistoryInspection {\n return {\n token: this.token,\n deviceGeneration: this.deviceGeneration,\n content: this.content,\n fallback: 'neutral-texture',\n requestVersion: this.requestVersion,\n generation: this.generation,\n seed: this.seed,\n attempt: this.attempt,\n valid: this.valid,\n resetReason: this.resetReason,\n };\n }\n}\n","import { err, ok, type Result } from '@forgeax/engine-types';\nimport type { CameraSnapshot } from '../render-contract';\nimport { classifySceneDataCoverage, type SceneDataContributor } from './coverage';\nimport { type TaaHistoryAttempt, TaaHistoryStore } from './taa-history-store';\nimport {\n projectTemporalView,\n type SubmittedTemporalView,\n snapshotSubmittedTemporalView,\n type TemporalView,\n} from './temporal-view';\n\n/** The only stages that may publish a temporal frame. */\nexport type TemporalFrameStage = 'build' | 'encode' | 'finish' | 'submit';\n\nexport type TemporalFrameErrorCode = 'taa-unavailable' | 'temporal-active' | 'temporal-not-active';\n\nexport interface TemporalFrameError {\n readonly code: TemporalFrameErrorCode;\n readonly expected: string;\n readonly hint: string;\n readonly detail?: Readonly<Record<string, unknown>>;\n}\n\nexport interface TemporalFrameSnapshot<T = unknown> {\n readonly epoch: number;\n readonly previous: T | undefined;\n readonly historyAttempt: 'none' | 'active' | 'committed' | 'aborted';\n readonly attempt: 'none' | 'active' | 'committed' | 'aborted';\n readonly lastFailure: TemporalFrameStage | undefined;\n readonly coverage: {\n readonly exactContributorIds: readonly string[];\n readonly reactiveContributorIds: readonly string[];\n readonly missingContributorIds: readonly string[];\n readonly omittedMissingContributorCount: number;\n };\n}\n\nexport interface TemporalFrameBeginInput<T = unknown> {\n readonly current: T;\n readonly antialias: 'none' | 'fxaa' | 'msaa' | 'taa';\n /** Enables the shared transaction for a temporal feature without TAA. */\n readonly temporalDemand?: boolean;\n readonly available?: boolean;\n readonly contributors?: readonly SceneDataContributor[];\n readonly requiredContributorIds?: readonly string[];\n /** Projection produced before record uploads; it commits with the frame. */\n readonly temporalView?: TemporalView;\n}\n\nexport interface TemporalFrameCandidate<T = unknown> {\n readonly epoch: number;\n readonly current: T;\n readonly previous: T | undefined;\n readonly history: { readonly direction: 'a-to-b' | 'b-to-a'; readonly valid: boolean };\n readonly contributors: readonly SceneDataContributor[];\n readonly requiredContributorIds: readonly string[];\n readonly temporalView?: TemporalView;\n}\n\nexport interface TemporalFramePhases<T = unknown> {\n readonly build: () => T;\n readonly encode: (built: T) => void;\n readonly finish: () => void;\n readonly submit: () => void;\n}\n\nexport interface TemporalFrameReceipt<T = unknown> {\n readonly epoch: number;\n readonly previous: T;\n readonly historyDirection: 'a-to-b' | 'b-to-a';\n}\n\nexport type ReflectionFallbackTemporalReset =\n | { readonly reset: false }\n | { readonly reset: true; readonly reason: 'reflection-fallback-generation' };\n\n/** Maps committed producer generations into the existing temporal reset seam. */\nexport function resolveReflectionFallbackTemporalReset(\n previousGeneration: number | undefined,\n nextGeneration: number | undefined,\n): ReflectionFallbackTemporalReset {\n if (previousGeneration === undefined || nextGeneration === undefined) return { reset: false };\n return previousGeneration === nextGeneration\n ? { reset: false }\n : { reset: true, reason: 'reflection-fallback-generation' };\n}\n\n/**\n * Keeps SSR admission on the existing producer-generation reset seam. The\n * admission path never allocates or resolves temporal history itself.\n */\nexport function resolveSsrAdmissionTemporalReset(\n previousGeneration: number | undefined,\n nextGeneration: number | undefined,\n): ReflectionFallbackTemporalReset {\n return resolveReflectionFallbackTemporalReset(previousGeneration, nextGeneration);\n}\n\nfunction failure(code: TemporalFrameErrorCode, hint: string): TemporalFrameError {\n return {\n code,\n expected:\n code === 'taa-unavailable'\n ? 'TAA resources and capability are available'\n : 'one temporal frame is active',\n hint,\n };\n}\n\n/**\n * Renderer-owned temporal transaction. It has no graph or backend dependency:\n * graph assembly supplies the four phase callbacks and only submit publishes\n * the candidate snapshot.\n */\nexport class TemporalFrameCoordinator<T = unknown> {\n readonly historyStore: TaaHistoryStore;\n private epoch: number;\n private previous: T | undefined;\n private active: TemporalFrameCandidate<T> | undefined;\n private attempt: TemporalFrameSnapshot<T>['attempt'] = 'none';\n private historyAttempt: TemporalFrameSnapshot<T>['historyAttempt'] = 'none';\n private lastFailure: TemporalFrameStage | undefined;\n private historyDirection: 'a-to-b' | 'b-to-a' = 'a-to-b';\n private temporalFrameIndex = 0;\n private lastSubmittedView: SubmittedTemporalView | undefined;\n private coverage: TemporalFrameSnapshot<T>['coverage'] = {\n exactContributorIds: [],\n reactiveContributorIds: [],\n missingContributorIds: [],\n omittedMissingContributorCount: 0,\n };\n private readonly historyAttempts = new WeakMap<object, TaaHistoryAttempt>();\n\n constructor(\n initial: {\n readonly epoch?: number;\n readonly previous?: T;\n readonly historyStore?: TaaHistoryStore;\n } = {},\n ) {\n this.historyStore = initial.historyStore ?? new TaaHistoryStore();\n this.epoch = initial.epoch ?? 0;\n this.previous = initial.previous;\n }\n\n begin(input: TemporalFrameBeginInput<T>): Result<TemporalFrameCandidate<T>, TemporalFrameError> {\n const demanded = input.antialias === 'taa' || input.temporalDemand === true;\n if (!demanded) {\n return ok({\n epoch: this.epoch,\n current: input.current,\n previous: this.previous,\n history: { direction: this.historyDirection, valid: false },\n contributors: Object.freeze([...(input.contributors ?? [])]),\n requiredContributorIds: Object.freeze([...(input.requiredContributorIds ?? [])]),\n ...(input.temporalView === undefined ? {} : { temporalView: input.temporalView }),\n });\n }\n if (input.available === false) {\n return err(\n failure('taa-unavailable', 'enable rgba16float temporal targets and retry the frame'),\n );\n }\n if (this.active !== undefined) {\n return err(\n failure(\n 'temporal-active',\n 'commit or abort the active temporal frame before beginning another',\n ),\n );\n }\n const candidate: TemporalFrameCandidate<T> = {\n epoch: this.epoch + 1,\n current: input.current,\n previous: this.previous,\n history: { direction: this.historyDirection, valid: this.previous !== undefined },\n contributors: Object.freeze([...(input.contributors ?? [])]),\n requiredContributorIds: Object.freeze([...(input.requiredContributorIds ?? [])]),\n ...(input.temporalView === undefined ? {} : { temporalView: input.temporalView }),\n };\n if (input.antialias === 'taa') {\n this.historyAttempts.set(candidate, this.historyStore.begin());\n }\n this.active = candidate;\n this.attempt = 'active';\n this.historyAttempt = input.antialias === 'taa' ? 'active' : 'none';\n this.lastFailure = undefined;\n return ok(candidate);\n }\n\n commit(\n candidate: TemporalFrameCandidate<T>,\n ): Result<TemporalFrameReceipt<T>, TemporalFrameError> {\n if (this.active !== candidate) {\n return err(failure('temporal-not-active', 'commit the candidate returned by begin'));\n }\n this.epoch = candidate.epoch;\n this.previous = candidate.current;\n if (candidate.temporalView !== undefined) {\n this.lastSubmittedView = snapshotSubmittedTemporalView(candidate.temporalView);\n this.temporalFrameIndex += 1;\n }\n this.historyDirection = candidate.history.direction === 'a-to-b' ? 'b-to-a' : 'a-to-b';\n const historyAttempt = this.historyAttempts.get(candidate);\n historyAttempt?.commit({\n deviceGeneration: this.historyStore.inspect().deviceGeneration,\n completed: true,\n });\n this.coverage = classifySceneDataCoverage({\n contributors: candidate.contributors,\n requiredContributorIds: candidate.requiredContributorIds,\n });\n this.active = undefined;\n historyAttempt?.abort();\n this.historyAttempts.delete(candidate);\n this.attempt = 'committed';\n this.historyAttempt = historyAttempt === undefined ? 'none' : 'committed';\n return ok({\n epoch: this.epoch,\n previous: candidate.current,\n historyDirection: candidate.history.direction,\n });\n }\n\n abort(candidate: TemporalFrameCandidate<T>, stage: TemporalFrameStage = 'submit'): void {\n if (this.active !== candidate) return;\n this.historyAttempts.get(candidate)?.abort();\n this.historyAttempts.delete(candidate);\n this.active = undefined;\n this.attempt = 'aborted';\n this.historyAttempt = 'aborted';\n this.lastFailure = stage;\n }\n\n run(\n input: TemporalFrameBeginInput<T>,\n phases: TemporalFramePhases<T>,\n ): Result<TemporalFrameReceipt<T> | undefined, TemporalFrameError> {\n const started = this.begin(input);\n if (!started.ok) return started;\n const candidate = started.value;\n if (input.antialias !== 'taa' && input.temporalDemand !== true) return ok(undefined);\n try {\n const built = phases.build();\n phases.encode(built);\n phases.finish();\n phases.submit();\n } catch (cause) {\n const stage = this.stageFromError(cause);\n this.abort(candidate, stage);\n return err({\n code: 'temporal-not-active',\n expected: `temporal ${stage} succeeds before commit`,\n hint: 'inspect the underlying stage failure and retry the frame',\n detail: { stage, cause },\n });\n }\n return this.commit(candidate);\n }\n\n inspect(): TemporalFrameSnapshot<T> {\n return {\n epoch: this.epoch,\n previous: this.previous,\n historyAttempt: this.historyAttempt,\n attempt: this.attempt,\n lastFailure: this.lastFailure,\n coverage: this.coverage,\n };\n }\n\n /**\n * Derive the current/previous camera matrices without mutating history.\n * `commit()` is the only operation that publishes the returned view, so a\n * graph/finish/submit failure leaves the last successful view intact.\n */\n prepareTemporalView(\n camera: CameraSnapshot,\n surfaceWidth: number,\n surfaceHeight: number,\n ): TemporalView | undefined {\n const demanded =\n camera.antialias === 'taa' ||\n (camera.motionBlur?.shutterAngle !== undefined && camera.motionBlur.shutterAngle > 0);\n if (!demanded) return undefined;\n return projectTemporalView({\n camera,\n temporalFrameIndex: this.temporalFrameIndex,\n surfaceWidth,\n surfaceHeight,\n ...(this.lastSubmittedView === undefined ? {} : { lastSubmitted: this.lastSubmittedView }),\n });\n }\n\n reset(\n reason:\n | 'cut'\n | 'resize'\n | 'camera-switch'\n | 'detach'\n | 'recover'\n | 'device-loss'\n | 'device-generation' = 'recover',\n ): void {\n void reason;\n this.active = undefined;\n this.epoch = 0;\n this.previous = undefined;\n this.temporalFrameIndex = 0;\n this.lastSubmittedView = undefined;\n this.historyDirection = 'a-to-b';\n this.historyStore.reset(\n reason === 'cut' || reason === 'camera-switch'\n ? 'camera-cut'\n : reason === 'resize'\n ? 'resize'\n : reason === 'device-generation' || reason === 'device-loss'\n ? 'device-generation'\n : 'recover',\n );\n this.attempt = 'none';\n this.historyAttempt = 'none';\n this.lastFailure = undefined;\n this.coverage = {\n exactContributorIds: [],\n reactiveContributorIds: [],\n missingContributorIds: [],\n omittedMissingContributorCount: 0,\n };\n }\n\n private stageFromError(cause: unknown): TemporalFrameStage {\n if (typeof cause === 'object' && cause !== null && 'stage' in cause) {\n const stage = (cause as { stage?: unknown }).stage;\n if (stage === 'build' || stage === 'encode' || stage === 'finish' || stage === 'submit')\n return stage;\n }\n return 'submit';\n }\n}\n"]}
|