@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,168 @@
|
|
|
1
|
+
import type { AssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
2
|
+
import type { PipelineLayout, Result, RhiDevice, ShaderModule } from '@forgeax/engine-rhi';
|
|
3
|
+
import { RhiError } from '@forgeax/engine-rhi';
|
|
4
|
+
import { type MaterialShaderManifestEntry, type ShaderCatalog, type ShaderCatalogDevice } from '@forgeax/engine-shader';
|
|
5
|
+
import type { ParamSchemaEntry } from '@forgeax/engine-types';
|
|
6
|
+
import type { RenderFeatureMaterialShaderBindingContract } from '../features/plan';
|
|
7
|
+
import type { RhiErrorListenerRegistry } from '../lifecycle';
|
|
8
|
+
/**
|
|
9
|
+
* Sync-shaped `ShaderCatalogDevice` adapter wrapping the backend pack's
|
|
10
|
+
* async `createShaderModule(rhiDevice, desc)`.
|
|
11
|
+
*
|
|
12
|
+
* Shape: fire-and-forget pre-bake — the first call for hash X returns
|
|
13
|
+
* `Result.err(RhiError)` (a pending signal) while kicking off the async
|
|
14
|
+
* createShaderModule + cache write; subsequent calls for the same hash hit
|
|
15
|
+
* the cache and return `Result.ok(ShaderModule)` (charter proposition 9
|
|
16
|
+
* graceful degradation).
|
|
17
|
+
*
|
|
18
|
+
* @placeholder M3 scope limit: the full async pre-bake wiring is delivered
|
|
19
|
+
* by the ECS-driven render pipeline (later closure). The current shape is
|
|
20
|
+
* already enough to support MVP-2.2 instance-per-engine + AI consumer
|
|
21
|
+
* onboarding (charter proposition 1 progressive disclosure / proposition 4
|
|
22
|
+
* explicit failure with retry guidance in the error hint).
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Extended ShaderCatalogDevice contract for engine internals: adds a
|
|
26
|
+
* `seedModule(label, module)` to populate the lazy adapter cache from an
|
|
27
|
+
* already-compiled module, so eager-built modules (PBR / unlit / shadow
|
|
28
|
+
* caster) and the lazy MaterialShader pipeline cache share one cache and
|
|
29
|
+
* the lazy path is hit-on-first-call (no 1-frame warmup) for engine-shipped
|
|
30
|
+
* shaders. Externally still typed as ShaderCatalogDevice (see callers in
|
|
31
|
+
* ShaderCatalog).
|
|
32
|
+
*/
|
|
33
|
+
export interface ShaderDeviceAdapterInternal extends ShaderCatalogDevice {
|
|
34
|
+
/**
|
|
35
|
+
* feat-20260609 R3-fixup: seed the adapter's moduleCache with an
|
|
36
|
+
* already-compiled ShaderModule under `label`. Used by the eager
|
|
37
|
+
* shadow_caster pre-bake so the lazy PSO build hit on
|
|
38
|
+
* `module-forgeax::default-shadow-caster` returns OK on frame 1.
|
|
39
|
+
*/
|
|
40
|
+
seedModule(label: string, module: ShaderModule): void;
|
|
41
|
+
invalidateModule(label: string): void;
|
|
42
|
+
}
|
|
43
|
+
type ShaderModuleAdapterMode = 'validated' | 'immediate';
|
|
44
|
+
export declare function makeShaderDeviceAdapter(rhiDevice: RhiDevice, _errorRegistry: RhiErrorListenerRegistry, asyncCreateShaderModule: ((device: RhiDevice, desc: {
|
|
45
|
+
code: string;
|
|
46
|
+
label?: string | undefined;
|
|
47
|
+
}) => Promise<Result<ShaderModule, RhiError>>) | undefined, immediateCreateShaderModule: ((device: RhiDevice, desc: {
|
|
48
|
+
code: string;
|
|
49
|
+
label?: string | undefined;
|
|
50
|
+
}) => Result<ShaderModule, RhiError>) | undefined, mode?: ShaderModuleAdapterMode): ShaderDeviceAdapterInternal;
|
|
51
|
+
/**
|
|
52
|
+
* Fallback path for the M3 D-P4 auto-select facade when the backend pack
|
|
53
|
+
* does not supply a top-level async `createShaderModule` (e.g. the rhi-wgpu
|
|
54
|
+
* path which routes through the synchronous `device.createShaderModule`
|
|
55
|
+
* entry, or an explicit escape-hatch instance that omits the async
|
|
56
|
+
* factory). The forgeax `RhiDevice` interface intentionally does not expose
|
|
57
|
+
* a sync `createShaderModule` (fix-f3; see packages/rhi/src/index.ts line
|
|
58
|
+
* 1164), so this helper performs a structural probe + returns a structured
|
|
59
|
+
* error when neither the async factory nor a structural sync entry exists
|
|
60
|
+
* (charter proposition 4 explicit failure baseline).
|
|
61
|
+
*/
|
|
62
|
+
export declare function invokeDeviceCreateShaderModule(rhiDevice: RhiDevice, desc: {
|
|
63
|
+
code: string;
|
|
64
|
+
label?: string | undefined;
|
|
65
|
+
}): Promise<Result<ShaderModule, RhiError>>;
|
|
66
|
+
/**
|
|
67
|
+
* bug-20260601-hello-tonemap-material-register M1: prepare engine-shipped
|
|
68
|
+
* material shaders (cap gate + manifest load + registration) before the
|
|
69
|
+
* renderer is returned so that `register<MaterialAsset>` referencing an
|
|
70
|
+
* engine shader (e.g. `forgeax::default-standard-pbr`) succeeds without
|
|
71
|
+
* waiting for `renderer.initialization` (plan-strategy D-1/D-2/D-5).
|
|
72
|
+
*
|
|
73
|
+
* Failures (cap-gate insufficient, manifest-malformed, shader-not-found)
|
|
74
|
+
* throw structured `RhiError` / `ShaderError` which propagate through
|
|
75
|
+
* `createRenderer`'s synchronous reject path (D-2 structured reject).
|
|
76
|
+
*/
|
|
77
|
+
export declare function prepareMaterialShaders(rhiDevice: RhiDevice, getShader: () => ShaderCatalog, assets: AssetRegistry, materialShaderUvSetCounts: Map<string, number>): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Per-variant PipelineLayout selector (M4.5 / D-10 option A).
|
|
80
|
+
*
|
|
81
|
+
* The HDRP variant (`CLUSTER_FORWARD_AVAILABLE=true` or canonical `''`
|
|
82
|
+
* all-true when the shader declares the cluster axis) needs the 7-slot
|
|
83
|
+
* group(2) BGL chain (`hdrpPbrPipelineLayout`); URP variants
|
|
84
|
+
* (`CLUSTER_FORWARD_AVAILABLE=false` / undefined / no axis) keep the
|
|
85
|
+
* 1-slot mesh-array BGL chain (`pbrPipelineLayout`).
|
|
86
|
+
*
|
|
87
|
+
* Returns `null` only when the URP fallback layout itself is null
|
|
88
|
+
* (Camera-only / empty-manifest path). When the HDRP layout is null but
|
|
89
|
+
* URP exists, the HDRP variant gracefully falls back to URP — the WGSL
|
|
90
|
+
* resolved upstream by `findVariantByKey` is the URP variant in that
|
|
91
|
+
* case (manifest entry with all-true definesKey === '' was registered
|
|
92
|
+
* with isHdrpActive=false at boot when storage-buffer caps are absent).
|
|
93
|
+
*
|
|
94
|
+
* Pure function — exported for unit-test access (M4.5 / w35).
|
|
95
|
+
*/
|
|
96
|
+
/**
|
|
97
|
+
* Closed enum of pipeline-layout kinds the selector can dispatch to.
|
|
98
|
+
*
|
|
99
|
+
* `pbr` — standard PBR (1-entry mesh-array BGL).
|
|
100
|
+
* `pbr-skin` — bug-20260611-skin-pipeline-layout: 2-entry mesh-array BGL
|
|
101
|
+
* (binding 0 meshes + binding 1 palette) for the `forgeax::pbr-skin`
|
|
102
|
+
* material shader.
|
|
103
|
+
* `hdrp-pbr` — feat-20260609 HDRP cluster-forward variant (7-slot group(2)
|
|
104
|
+
* BGL substituted at slot 2).
|
|
105
|
+
* `sprite-urp` — bug-20260708 M2 (c): sprite / sprite-lit shaders reuse
|
|
106
|
+
* the URP 1-slot mesh-array BGL (they don't declare
|
|
107
|
+
* CLUSTER_FORWARD_AVAILABLE) but their canonical all-true variant key
|
|
108
|
+
* `''` (`SPRITE_PASS_PER_INSTANCE_REGION_VARIANT_SET`) MUST NOT trigger
|
|
109
|
+
* the `variantSet===''` → HDRP branch of the selector. Callers
|
|
110
|
+
* (`buildPipelineContext`) resolve `sprite-urp` from the sprite
|
|
111
|
+
* `materialShaderId` and pass it through; the selector short-circuits
|
|
112
|
+
* to `pbrPipelineLayout` before the HDRP check.
|
|
113
|
+
*
|
|
114
|
+
* AC-09 grep gate: the selector body (`selectPipelineLayoutForVariant`)
|
|
115
|
+
* **MUST NOT** contain literal `'forgeax::pbr-skin'` (or another
|
|
116
|
+
* shader-id literal). The caller resolves `LayoutKind` upstream and passes
|
|
117
|
+
* the structured value through (charter P4 consistent abstraction). New
|
|
118
|
+
* material-shader layouts add a `LayoutKind` member + a PipelineState slot
|
|
119
|
+
* + a switch arm here in one cut (charter P3 extensibility).
|
|
120
|
+
*/
|
|
121
|
+
export type LayoutKind = 'pbr' | 'pbr-skin' | 'hdrp-pbr' | 'hdrp-skin' | 'sprite-urp' | 'unlit-urp';
|
|
122
|
+
export declare function isSharedMaterialUserRegionCompatible(paramSchema: readonly ParamSchemaEntry[]): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Select the PBR variant that matches a fallback mesh with no COLOR_0 input.
|
|
125
|
+
* Unknown/custom material IDs may still use the legacy PBR fallback, so that
|
|
126
|
+
* path must obey the same geometry-owned vertex-color axis as registered PBR.
|
|
127
|
+
*/
|
|
128
|
+
export declare function selectNoColorPbrVariant(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean, variantSet: string | undefined, extendedLightingShaderAvailable?: boolean, directionalPcssAvailable?: boolean, projectorAvailable?: boolean): MaterialShaderManifestEntry['variants'][number] | undefined;
|
|
129
|
+
export type MaterialShaderBindingContract = RenderFeatureMaterialShaderBindingContract;
|
|
130
|
+
export type MaterialShaderVertexInputContract = 'none' | 'render-material';
|
|
131
|
+
export declare function resolveMaterialShaderBindingContract(source: string): MaterialShaderBindingContract;
|
|
132
|
+
export declare function resolveMaterialShaderVertexInputContract(source: string): MaterialShaderVertexInputContract;
|
|
133
|
+
export declare function allowsUnlitPreparedFallback(depthFormatOverride: GPUTextureFormat | null | undefined, vertexLayout: string | undefined, materialShaderId?: string): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Prepared VFX draws own their vertex inputs and bind groups. A missing
|
|
136
|
+
* authored material shader is therefore retryable, but it is never safe to
|
|
137
|
+
* substitute the built-in PBR module: PBR declares mesh/instance groups that
|
|
138
|
+
* the VFX draw does not bind. Returning true keeps the feature on its
|
|
139
|
+
* structured next-frame recovery path instead of creating an invalid PSO.
|
|
140
|
+
*/
|
|
141
|
+
export declare function shouldDeferMissingPreparedMaterialShader(vertexLayout: string | undefined): boolean;
|
|
142
|
+
export declare function selectPipelineLayoutForVariant(state: {
|
|
143
|
+
readonly pbrPipelineLayout: PipelineLayout | null;
|
|
144
|
+
readonly pbrProbePipelineLayout?: PipelineLayout | null;
|
|
145
|
+
readonly hdrpPbrPipelineLayout: PipelineLayout | null;
|
|
146
|
+
readonly hdrpProbePbrPipelineLayout?: PipelineLayout | null;
|
|
147
|
+
readonly pbrSkinPipelineLayout: PipelineLayout | null;
|
|
148
|
+
readonly pbrSkinProbePipelineLayout?: PipelineLayout | null;
|
|
149
|
+
readonly hdrpSkinPipelineLayout?: PipelineLayout | null;
|
|
150
|
+
} | null, variantSet: string | undefined, layoutKind?: LayoutKind): PipelineLayout | null;
|
|
151
|
+
/**
|
|
152
|
+
* Resolve a requested material variant against the actual backend capabilities.
|
|
153
|
+
* Record callers use the native-capability request; the backend-owned axes
|
|
154
|
+
* must be rewritten before the request reaches shader lookup and PSO layout
|
|
155
|
+
* selection.
|
|
156
|
+
*/
|
|
157
|
+
export declare function resolveMaterialShaderVariantSet(requestedVariantSet: string | undefined, variants: ReadonlyArray<{
|
|
158
|
+
readonly defines: Readonly<Record<string, boolean>>;
|
|
159
|
+
}>, backendKind: RhiDevice['caps']['backendKind'], storageBuffer: boolean, maxSampledTexturesPerShaderStageOrProjectorAvailable?: number | boolean): string | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* Keep a single-source material on its canonical module identity. A manifest
|
|
162
|
+
* entry with no variants cannot consume a synthesized capability or geometry
|
|
163
|
+
* axis, so carrying one into the pipeline cache only creates an uncached lazy
|
|
164
|
+
* compile beside the prewarmed source module.
|
|
165
|
+
*/
|
|
166
|
+
export declare function normalizeMaterialShaderVariantSet(requestedVariantSet: string | undefined, manifestEntry: MaterialShaderManifestEntry | undefined): string | undefined;
|
|
167
|
+
export {};
|
|
168
|
+
//# sourceMappingURL=material-shader-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material-shader-policy.d.ts","sourceRoot":"","sources":["../../src/assembly/material-shader-policy.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAW,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAGL,KAAK,2BAA2B,EAChC,KAAK,aAAa,EAClB,KAAK,mBAAmB,EAEzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAA8B,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,kBAAkB,CAAC;AAEnF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAS7D;;;;;;;;;;;;;;;GAeG;AACH;;;;;;;;GAQG;AACH,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IACtD,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAED,KAAK,uBAAuB,GA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AC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC5D,QAAQ,CAAC,sBAAsB,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CACzD,GAAG,IAAI,EACR,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,UAAU,CAAC,EAAE,UAAU,GACtB,cAAc,GAAG,IAAI,CAyDvB;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,mBAAmB,EAAE,MAAM,GAAG,SAAS,EACvC,QAAQ,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACrD,CAAC,EACF,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,EAC7C,aAAa,EAAE,OAAO,EACtB,oDAAoD,CAAC,EAAE,MAAM,GAAG,OAAO,GACtE,MAAM,GAAG,SAAS,CAgEpB;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,mBAAmB,EAAE,MAAM,GAAG,SAAS,EACvC,aAAa,EAAE,2BAA2B,GAAG,SAAS,GACrD,MAAM,GAAG,SAAS,CAIpB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Result, RhiDevice, ShaderModule } from '@forgeax/engine-rhi';
|
|
2
|
+
import { RhiError } from '@forgeax/engine-rhi';
|
|
3
|
+
import type { ShaderCatalog } from '@forgeax/engine-shader';
|
|
4
|
+
type AsyncCreateShaderModule = (device: RhiDevice, desc: {
|
|
5
|
+
code: string;
|
|
6
|
+
label?: string | undefined;
|
|
7
|
+
}) => Promise<Result<ShaderModule, RhiError>>;
|
|
8
|
+
/**
|
|
9
|
+
* Prewarm producer-declared material shaders and all published capability
|
|
10
|
+
* variants before the first prepared frame. Variant labels mirror the lazy
|
|
11
|
+
* material pipeline adapter's module lookup contract.
|
|
12
|
+
*/
|
|
13
|
+
export declare function prewarmRequiredMaterialShaders({ rhiDevice, registry, asyncCreateShaderModule, requiredMaterialShaders, seedShaderModule, }: {
|
|
14
|
+
readonly rhiDevice: RhiDevice;
|
|
15
|
+
readonly registry: ShaderCatalog;
|
|
16
|
+
readonly asyncCreateShaderModule: AsyncCreateShaderModule | undefined;
|
|
17
|
+
readonly requiredMaterialShaders: readonly string[];
|
|
18
|
+
readonly seedShaderModule: (label: string, module: ShaderModule) => void;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=material-shader-prewarm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material-shader-prewarm.d.ts","sourceRoot":"","sources":["../../src/assembly/material-shader-prewarm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAK5D,KAAK,uBAAuB,GAAG,CAC7B,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,KAC/C,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE7C;;;;GAIG;AACH,wBAAsB,8BAA8B,CAAC,EACnD,SAAS,EACT,QAAQ,EACR,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,GACjB,EAAE;IACD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,uBAAuB,EAAE,uBAAuB,GAAG,SAAS,CAAC;IACtE,QAAQ,CAAC,uBAAuB,EAAE,SAAS,MAAM,EAAE,CAAC;IACpD,QAAQ,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;CAC1E,GAAG,OAAO,CAAC,IAAI,CAAC,CA0DhB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { MeshSsboCapacityExceededError, MeshSsboCeilingReachedError } from '@forgeax/engine-assets-runtime';
|
|
2
|
+
import type { Buffer } from '@forgeax/engine-rhi';
|
|
3
|
+
export declare const INITIAL_MESH_SSBO_SLOT_COUNT = 1024;
|
|
4
|
+
/**
|
|
5
|
+
* Derive a usable storage-buffer ceiling from device limits.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors the `SKIN_PALETTE_MAX_BINDING_BYTES` 0/undefined floor pattern
|
|
8
|
+
* (createRenderer.ts:4070-4073): when `maxStorageBufferBindingSize` is 0 or
|
|
9
|
+
* undefined (WebKit `downlevel_webgl2_defaults`), climb the fallback chain —
|
|
10
|
+
* `maxBufferSize` → `maxUniformBufferBindingSize` → WebGPU spec floor
|
|
11
|
+
* 134217728 (128 MiB).
|
|
12
|
+
*
|
|
13
|
+
* Pure helper — no device dependency, directly testable in node.
|
|
14
|
+
*/
|
|
15
|
+
export declare function deriveStorageBufferCeiling(limits: Readonly<{
|
|
16
|
+
maxStorageBufferBindingSize?: number;
|
|
17
|
+
maxBufferSize?: number;
|
|
18
|
+
maxUniformBufferBindingSize?: number;
|
|
19
|
+
}>): number;
|
|
20
|
+
/**
|
|
21
|
+
* Mesh + material buffer wrapper carrying the inner `Buffer` handle plus
|
|
22
|
+
* the byte-size at the time of allocation. The wrapper-object identity is
|
|
23
|
+
* stable across grow events — only `.buffer` and `.sizeInBytes` are mutated
|
|
24
|
+
* in place — so `PipelineState.meshStorageBuffer` / `materialUniformBuffer`
|
|
25
|
+
* fields capture the wrapper once and survive grow events without a re-bind
|
|
26
|
+
* cycle through the public Renderer surface (research §F8 R1).
|
|
27
|
+
*/
|
|
28
|
+
export interface MeshSsboBufferWrapper {
|
|
29
|
+
buffer: Buffer | null;
|
|
30
|
+
sizeInBytes: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function requireMeshSsboBuffer(wrapper: MeshSsboBufferWrapper): asserts wrapper is MeshSsboBufferWrapper & {
|
|
33
|
+
buffer: Buffer;
|
|
34
|
+
};
|
|
35
|
+
/** Closure-local grow state surfaced for spy assertions in unit tests. */
|
|
36
|
+
export interface MeshSsboState {
|
|
37
|
+
slotCount: number;
|
|
38
|
+
mesh: MeshSsboBufferWrapper;
|
|
39
|
+
material: MeshSsboBufferWrapper;
|
|
40
|
+
}
|
|
41
|
+
/** `growMeshSsbo` return shape (D-5: Result-like, never throws). */
|
|
42
|
+
export type MeshSsboGrowResult = {
|
|
43
|
+
readonly ok: true;
|
|
44
|
+
} | {
|
|
45
|
+
readonly ok: false;
|
|
46
|
+
readonly code: 'mesh-ssbo-ceiling-reached' | 'mesh-ssbo-capacity-exceeded';
|
|
47
|
+
/** Pre-grow slotCount — the caller can render up to this many slots (degraded subset). */
|
|
48
|
+
readonly degradedToSlotCount: number;
|
|
49
|
+
};
|
|
50
|
+
/** Minimal device surface the grow controller needs (mocked in unit tests). */
|
|
51
|
+
export interface MeshSsboGrowDevice {
|
|
52
|
+
readonly limits: {
|
|
53
|
+
readonly maxStorageBufferBindingSize: number;
|
|
54
|
+
};
|
|
55
|
+
readonly createBuffer: (descriptor: {
|
|
56
|
+
readonly label?: string;
|
|
57
|
+
readonly size: number;
|
|
58
|
+
readonly usage: number;
|
|
59
|
+
readonly mappedAtCreation?: boolean;
|
|
60
|
+
}) => Buffer;
|
|
61
|
+
}
|
|
62
|
+
/** Minimal error-registry surface (just `fire` — `RhiErrorListenerRegistry` matches). */
|
|
63
|
+
export interface MeshSsboGrowErrorRegistry {
|
|
64
|
+
fire: (e: MeshSsboCeilingReachedError | MeshSsboCapacityExceededError) => void;
|
|
65
|
+
}
|
|
66
|
+
export interface MeshSsboGrowControllerInit {
|
|
67
|
+
readonly device: MeshSsboGrowDevice;
|
|
68
|
+
readonly errorRegistry: MeshSsboGrowErrorRegistry;
|
|
69
|
+
readonly initialSlotCount: number;
|
|
70
|
+
readonly perEntityStride: number;
|
|
71
|
+
readonly meshUsage: number;
|
|
72
|
+
readonly materialUsage: number;
|
|
73
|
+
}
|
|
74
|
+
export interface MeshSsboGrowController {
|
|
75
|
+
readonly state: MeshSsboState;
|
|
76
|
+
/** Allocate the initial mesh + material buffer pair at `initialSlotCount`. */
|
|
77
|
+
readonly initialBuild: () => void;
|
|
78
|
+
/** Grow to satisfy `neededSlots`; idempotent + ceiling-aware. */
|
|
79
|
+
readonly growMeshSsbo: (neededSlots: number) => MeshSsboGrowResult;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Build a closure-scoped mesh-SSBO grow controller. Module-scope so unit
|
|
83
|
+
* tests (`__tests__/mesh-ssbo-grow.test.ts`) can construct it with a fake
|
|
84
|
+
* device + spy errorRegistry without spinning up the full WebGPU renderer
|
|
85
|
+
* (charter F2 minimal surface — the controller is the testable seam).
|
|
86
|
+
*/
|
|
87
|
+
export declare function createMeshSsboGrowController(init: MeshSsboGrowControllerInit): MeshSsboGrowController;
|
|
88
|
+
//# sourceMappingURL=mesh-ssbo-grow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-ssbo-grow.d.ts","sourceRoot":"","sources":["../../src/assembly/mesh-ssbo-grow.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAUlD,eAAO,MAAM,4BAA4B,OAAO,CAAC;AA8CjD;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,QAAQ,CAAC;IACf,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC,CAAC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AAW,0BAA0B;IACzC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,yBAAyB,CAAC;IAClD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC;IAClC,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,kBAAkB,CAAC;CACpE;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,0BAA0B,GAC/B,sBAAsB,CAuFxB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RhiDevice } from '@forgeax/engine-rhi';
|
|
2
|
+
import type { HealthListenerRegistry, LostListenerRegistry, RhiErrorListenerRegistry } from '../../lifecycle';
|
|
3
|
+
import type { RhiBackendPack } from '../backend-contract';
|
|
4
|
+
/** Wire one device's loss promise into the Renderer-owned observability channels. */
|
|
5
|
+
export declare function attachDeviceLostFanout(device: RhiDevice, pack: RhiBackendPack, registries: {
|
|
6
|
+
lostRegistry: LostListenerRegistry;
|
|
7
|
+
errorRegistry: RhiErrorListenerRegistry;
|
|
8
|
+
healthRegistry: HealthListenerRegistry;
|
|
9
|
+
generation: number;
|
|
10
|
+
currentGeneration: () => number;
|
|
11
|
+
onStaleLoss?: () => void;
|
|
12
|
+
onDeviceLost?: (detail: string) => void;
|
|
13
|
+
}): void;
|
|
14
|
+
//# sourceMappingURL=device-loss-fanout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-loss-fanout.d.ts","sourceRoot":"","sources":["../../../src/assembly/recovery/device-loss-fanout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EACV,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,qFAAqF;AACrF,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,cAAc,EACpB,UAAU,EAAE;IACV,YAAY,EAAE,oBAAoB,CAAC;IACnC,aAAa,EAAE,wBAAwB,CAAC;IACxC,cAAc,EAAE,sBAAsB,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,GACA,IAAI,CAkEN"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type Result } from '@forgeax/engine-types';
|
|
2
|
+
import { type DeviceResourceKind, type DeviceScope, type LifecycleCleanupFailure, type LifecycleResourceSpec } from '../../device/device-scope';
|
|
3
|
+
/** The private value published by one complete renderer device generation. */
|
|
4
|
+
export interface GenerationAggregate<TDevice = unknown, TContext = unknown, TPipeline = unknown, TProducerBindings = unknown, TGraph = unknown> {
|
|
5
|
+
readonly generation: number;
|
|
6
|
+
readonly scope: DeviceScope;
|
|
7
|
+
readonly device: TDevice;
|
|
8
|
+
readonly context: TContext;
|
|
9
|
+
readonly pipeline: TPipeline;
|
|
10
|
+
readonly producerBindings: TProducerBindings;
|
|
11
|
+
readonly graph: TGraph | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface GenerationAssemblyInput<TAggregate extends GenerationAggregate = GenerationAggregate> {
|
|
14
|
+
readonly scope: TAggregate['scope'];
|
|
15
|
+
readonly device: TAggregate['device'];
|
|
16
|
+
readonly context: TAggregate['context'];
|
|
17
|
+
readonly pipeline: TAggregate['pipeline'];
|
|
18
|
+
readonly producerBindings: TAggregate['producerBindings'];
|
|
19
|
+
readonly graph?: TAggregate['graph'];
|
|
20
|
+
readonly roots: readonly LifecycleResourceSpec<unknown>[];
|
|
21
|
+
}
|
|
22
|
+
export interface GenerationAssemblyFailure {
|
|
23
|
+
readonly code: 'generation-assembly-failed';
|
|
24
|
+
readonly generation: number;
|
|
25
|
+
readonly resourceKind: DeviceResourceKind;
|
|
26
|
+
readonly cause: unknown;
|
|
27
|
+
readonly cleanupFailures: readonly LifecycleCleanupFailure[];
|
|
28
|
+
}
|
|
29
|
+
export interface GenerationPublication<TAggregate> {
|
|
30
|
+
current: TAggregate;
|
|
31
|
+
}
|
|
32
|
+
export interface GenerationAllocator {
|
|
33
|
+
readonly activeGeneration: number;
|
|
34
|
+
next(): number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Build all device-bound roots before exposing their generation aggregate.
|
|
38
|
+
* LifecycleTransaction owns creation failure rollback; this function only
|
|
39
|
+
* projects its failure into the generation assembly boundary.
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildGenerationAggregate<TAggregate extends GenerationAggregate = GenerationAggregate>(input: GenerationAssemblyInput<TAggregate>): Promise<Result<TAggregate, GenerationAssemblyFailure>>;
|
|
42
|
+
/** Replace the owner slot only after the complete candidate has been checked. */
|
|
43
|
+
export declare function publishGeneration<TAggregate>(publication: GenerationPublication<TAggregate | undefined>, candidate: TAggregate, isPublishable: (candidate: TAggregate) => boolean): void;
|
|
44
|
+
/** Allocate unique candidate generations while leaving the active value unchanged. */
|
|
45
|
+
export declare function createGenerationAllocator(activeGeneration: number): GenerationAllocator;
|
|
46
|
+
//# sourceMappingURL=generation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generation.d.ts","sourceRoot":"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,CAAC,EAAE,CAAC;CAC3D;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,4BAA4B,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,eAAe,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAC9D;AAED,MAAM,WAAW,qBAAqB,CAAC,UAAU;IAC/C,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,IAAI,IAAI,MAAM,CAAC;CAChB;AA4BD;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,SAAS,mBAAmB,GAAG,mBAAmB,EAE5D,KAAK,EAAE,uBAAuB,CAAC,UAAU,CAAC,GACzC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,yBAAyB,CAAC,CAAC,CA0BxD;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,UAAU,EAC1C,WAAW,EAAE,qBAAqB,CAAC,UAAU,GAAG,SAAS,CAAC,EAC1D,SAAS,EAAE,UAAU,EACrB,aAAa,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,OAAO,GAChD,IAAI,CAKN;AAED,sFAAsF;AACtF,wBAAgB,yBAAyB,CAAC,gBAAgB,EAAE,MAAM,GAAG,mBAAmB,CASvF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type RhiAdapter, type RhiCanvasContext, type RhiDevice, RhiError, type Texture, type TextureView } from '@forgeax/engine-rhi';
|
|
2
|
+
import { type Result } from '@forgeax/engine-types';
|
|
3
|
+
import type { RhiBackendPack } from '../backend-contract';
|
|
4
|
+
import { type RecoveryContinuation, type RecoveryDeadline, type RecoveryPhase } from '../renderer-lifecycle';
|
|
5
|
+
export declare const STANDARD_PBR_REQUIRED_SAMPLED_TEXTURES = 17;
|
|
6
|
+
type ProbeFormat = 'rgba16float' | 'rgba8unorm';
|
|
7
|
+
/**
|
|
8
|
+
* Prove that a freshly acquired candidate device can execute and expose one
|
|
9
|
+
* render attachment before recovery publishes it. Device creation and a
|
|
10
|
+
* successful queue.submit are not sufficient evidence: a replacement device
|
|
11
|
+
* can accept those operations while its first observable frame remains
|
|
12
|
+
* empty. This probe intentionally has no shader, asset, graph, or surface
|
|
13
|
+
* dependency, so its result cleanly separates backend readiness from renderer
|
|
14
|
+
* graph publication.
|
|
15
|
+
*
|
|
16
|
+
* The null backend is structural-only and deliberately has no CPU readback
|
|
17
|
+
* implementation; its contract is already exercised by command-shape tests.
|
|
18
|
+
*/
|
|
19
|
+
export declare function probeCandidateDeviceExecution(device: RhiDevice): Promise<import('@forgeax/engine-types').Result<void, RhiError>>;
|
|
20
|
+
/**
|
|
21
|
+
* Exercise the actual RenderGraphBuilder/CompiledRenderGraph execution path
|
|
22
|
+
* against the candidate graph's physical color target. The graph is tiny and
|
|
23
|
+
* imported-target-only: it isolates pass resolution/encoding from the full
|
|
24
|
+
* renderer topology while preserving the exact candidate texture and view.
|
|
25
|
+
*/
|
|
26
|
+
export declare function probeCandidateGraphExecution(device: RhiDevice, target: {
|
|
27
|
+
readonly texture: Texture;
|
|
28
|
+
readonly view: TextureView;
|
|
29
|
+
readonly format: ProbeFormat;
|
|
30
|
+
}): Promise<import('@forgeax/engine-types').Result<void, RhiError>>;
|
|
31
|
+
export declare function deviceOptionsForAdapter(adapter: Pick<RhiAdapter, 'features' | 'limits'>): {
|
|
32
|
+
requiredFeatures?: GPUFeatureName[];
|
|
33
|
+
requiredLimits?: GPUDeviceDescriptor['requiredLimits'];
|
|
34
|
+
} | undefined;
|
|
35
|
+
export interface AcquiredDeviceGeneration {
|
|
36
|
+
readonly adapter: RhiAdapter;
|
|
37
|
+
readonly device: RhiDevice;
|
|
38
|
+
readonly context: RhiCanvasContext;
|
|
39
|
+
}
|
|
40
|
+
export interface DeviceGenerationAcquisitionFailure {
|
|
41
|
+
readonly stage: 'adapter' | 'device' | 'context';
|
|
42
|
+
readonly error: RhiError;
|
|
43
|
+
}
|
|
44
|
+
export interface RecoveryStepTimeout {
|
|
45
|
+
readonly phase: RecoveryPhase;
|
|
46
|
+
readonly elapsedMs: number;
|
|
47
|
+
readonly cause: RhiError;
|
|
48
|
+
}
|
|
49
|
+
export type RecoveryStepOutcome<T, E> = {
|
|
50
|
+
readonly kind: 'value';
|
|
51
|
+
readonly value: T;
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: 'error';
|
|
54
|
+
readonly error: E;
|
|
55
|
+
} | {
|
|
56
|
+
readonly kind: 'timeout';
|
|
57
|
+
readonly timeout: RecoveryStepTimeout;
|
|
58
|
+
};
|
|
59
|
+
export declare function runRecoveryStep<T, E>(operation: (continuation?: RecoveryContinuation) => Promise<Result<T, E>>, phase: RecoveryPhase, deadline: RecoveryDeadline | undefined, now?: () => number, continuation?: RecoveryContinuation): Promise<RecoveryStepOutcome<T, E>>;
|
|
60
|
+
/** Acquire the same backend generation inputs for boot and recovery. */
|
|
61
|
+
export declare function acquireDeviceGeneration(pack: RhiBackendPack, canvas: HTMLCanvasElement | OffscreenCanvas, deadline?: RecoveryDeadline, continuation?: RecoveryContinuation, onPhase?: (phase: RecoveryPhase) => void): Promise<Result<AcquiredDeviceGeneration, DeviceGenerationAcquisitionFailure>>;
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=recovery-attempt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery-attempt.d.ts","sourceRoot":"","sources":["../../../src/assembly/recovery/recovery-attempt.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAC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CAAC,CAAC,CAmE/E"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { AssetRegistry, MipmapShaderModuleFactory } from '@forgeax/engine-assets-runtime';
|
|
2
|
+
import { DynamicTextureStore } from '@forgeax/engine-assets-runtime';
|
|
3
|
+
import type { BindGroupLayout, PipelineLayout, RenderPipeline, RhiCanvasContext, RhiDevice } from '@forgeax/engine-rhi';
|
|
4
|
+
import { type Result } from '@forgeax/engine-rhi';
|
|
5
|
+
import type { MaterialShaderManifestEntry, ShaderCatalog } from '@forgeax/engine-shader';
|
|
6
|
+
import type { ParamSchemaEntry } from '@forgeax/engine-types';
|
|
7
|
+
import { DeviceScope } from '../../device/device-scope';
|
|
8
|
+
import { GpuResidencyCache } from '../../device/gpu-residency';
|
|
9
|
+
import { type RecoverFailure } from '../../errors/recover';
|
|
10
|
+
import type { PipelineState, RecoveryColdWorkGuard, RenderSystemInternals } from '../../record/render-context';
|
|
11
|
+
import type { RecoveryGraphCandidate, RecoveryPostProcessResources, RecoveryRootBundle, RenderSystem } from '../../render-system';
|
|
12
|
+
import type { RhiBackendPack } from '../backend-contract';
|
|
13
|
+
import { type LayoutKind, type MaterialShaderBindingContract, type ShaderDeviceAdapterInternal } from '../material-shader-policy';
|
|
14
|
+
import type { MeshSsboGrowResult, MeshSsboState } from '../mesh-ssbo-grow';
|
|
15
|
+
import type { RecoveryContinuation, RecoveryDeadline, RecoveryPhase } from '../renderer-lifecycle';
|
|
16
|
+
import type { RecoveryFailureLocation, WebGPURendererInternals } from '../webgpu-renderer';
|
|
17
|
+
import { type GenerationAggregate } from './generation';
|
|
18
|
+
type RendererShaderState = {
|
|
19
|
+
readonly device: RhiDevice;
|
|
20
|
+
shaderInstance: ShaderCatalog | null;
|
|
21
|
+
sharedShaderModuleAdapter: ShaderDeviceAdapterInternal | null;
|
|
22
|
+
sharedImmediateShaderModuleAdapter: ShaderDeviceAdapterInternal | null;
|
|
23
|
+
};
|
|
24
|
+
type PerShaderMaterialLayoutCacheEntry = {
|
|
25
|
+
readonly source: string;
|
|
26
|
+
readonly paramSchema: readonly ParamSchemaEntry[];
|
|
27
|
+
readonly layoutKind: LayoutKind;
|
|
28
|
+
readonly layout: {
|
|
29
|
+
materialBgl: BindGroupLayout;
|
|
30
|
+
pipelineLayout: PipelineLayout;
|
|
31
|
+
} | null;
|
|
32
|
+
};
|
|
33
|
+
type RendererPipelineCacheState = {
|
|
34
|
+
materialShaderPipelineCache: Map<string, RenderPipeline>;
|
|
35
|
+
materialShaderManifestEntryCache: Map<string, MaterialShaderManifestEntry>;
|
|
36
|
+
materialShaderVariantResolutionCache: WeakMap<object, Map<string, string | undefined>>;
|
|
37
|
+
group0MaterialLayout: {
|
|
38
|
+
materialBgl: BindGroupLayout;
|
|
39
|
+
pipelineLayout: PipelineLayout;
|
|
40
|
+
} | null;
|
|
41
|
+
viewOnlyMaterialPipelineLayout: PipelineLayout | null;
|
|
42
|
+
viewAndSceneDepthMaterialPipelineLayout: PipelineLayout | null;
|
|
43
|
+
group0ResourceLayouts: Map<string, {
|
|
44
|
+
materialBgl: BindGroupLayout;
|
|
45
|
+
pipelineLayout: PipelineLayout;
|
|
46
|
+
}>;
|
|
47
|
+
preparedMaterialPipelineLayoutCache: Map<string, PipelineLayout>;
|
|
48
|
+
perShaderMaterialLayoutCache: Map<string, PerShaderMaterialLayoutCacheEntry>;
|
|
49
|
+
materialShaderBindingContractCache: Map<string, {
|
|
50
|
+
source: string;
|
|
51
|
+
contract: MaterialShaderBindingContract;
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
type RendererCandidateState = {
|
|
55
|
+
readonly device: RhiDevice;
|
|
56
|
+
readonly context: RhiCanvasContext;
|
|
57
|
+
readonly scope: DeviceScope;
|
|
58
|
+
readonly gpuStore: GpuResidencyCache;
|
|
59
|
+
readonly dynamicTextureStore: DynamicTextureStore;
|
|
60
|
+
readonly shaderState: RendererShaderState;
|
|
61
|
+
readonly pipelineCacheState: RendererPipelineCacheState;
|
|
62
|
+
readonly materialShaderUvSetCounts: Map<string, number>;
|
|
63
|
+
pipelineState: PipelineState | null;
|
|
64
|
+
emptyPostProcessBgl: BindGroupLayout | null;
|
|
65
|
+
growMeshSsbo: ((neededSlots: number) => MeshSsboGrowResult) | undefined;
|
|
66
|
+
meshSsboState: MeshSsboState | undefined;
|
|
67
|
+
};
|
|
68
|
+
type RendererGenerationBindings = {
|
|
69
|
+
readonly gpuStore: GpuResidencyCache;
|
|
70
|
+
readonly dynamicTextureStore: DynamicTextureStore;
|
|
71
|
+
readonly shaderState: RendererShaderState;
|
|
72
|
+
readonly pipelineCacheState: RendererPipelineCacheState;
|
|
73
|
+
readonly materialShaderUvSetCounts: Map<string, number>;
|
|
74
|
+
readonly emptyPostProcessBgl: BindGroupLayout | null;
|
|
75
|
+
readonly growMeshSsbo: ((neededSlots: number) => MeshSsboGrowResult) | undefined;
|
|
76
|
+
readonly meshSsboState: MeshSsboState | undefined;
|
|
77
|
+
};
|
|
78
|
+
type RendererGeneration = GenerationAggregate<RhiDevice, RhiCanvasContext, PipelineState, RendererGenerationBindings, undefined>;
|
|
79
|
+
export interface RendererRecoveryDependencies {
|
|
80
|
+
readonly isDisposed: () => boolean;
|
|
81
|
+
readonly internals: WebGPURendererInternals;
|
|
82
|
+
readonly getActiveDeviceScope: () => DeviceScope;
|
|
83
|
+
readonly getActiveShaderState: () => RendererShaderState;
|
|
84
|
+
readonly getMaterialShaderUvSetCounts: () => Map<string, number>;
|
|
85
|
+
readonly createRendererPipelineCacheState: () => RendererPipelineCacheState;
|
|
86
|
+
readonly getCandidateBuildState: () => RendererCandidateState | undefined;
|
|
87
|
+
readonly setCandidateBuildState: (state: RendererCandidateState | undefined) => void;
|
|
88
|
+
readonly getCandidateShaderState: () => RendererShaderState | undefined;
|
|
89
|
+
readonly setCandidateShaderState: (state: RendererShaderState | undefined) => void;
|
|
90
|
+
readonly getCandidatePipelineCacheState: () => RendererPipelineCacheState | undefined;
|
|
91
|
+
readonly setCandidatePipelineCacheState: (state: RendererPipelineCacheState | undefined) => void;
|
|
92
|
+
readonly getCandidateMaterialShaderUvSetCounts: () => Map<string, number> | undefined;
|
|
93
|
+
readonly setCandidateMaterialShaderUvSetCounts: (state: Map<string, number> | undefined) => void;
|
|
94
|
+
readonly setCandidateEmptyPostProcessBgl: (layout: BindGroupLayout | null | undefined) => void;
|
|
95
|
+
readonly getShader: () => ShaderCatalog;
|
|
96
|
+
readonly assets: AssetRegistry;
|
|
97
|
+
readonly adaptMipmapShaderModuleFactory: (factory: RhiBackendPack['createShaderModule']) => MipmapShaderModuleFactory | undefined;
|
|
98
|
+
readonly buildPipeline: (scope?: DeviceScope, device?: RhiDevice, residencyStore?: GpuResidencyCache) => Promise<PipelineState>;
|
|
99
|
+
readonly getMaterialShaderPipeline: NonNullable<RenderSystemInternals['getMaterialShaderPipeline']>;
|
|
100
|
+
readonly getMaterialShaderPipelineEntry: NonNullable<RenderSystemInternals['getMaterialShaderPipelineEntry']>;
|
|
101
|
+
readonly getCachedMaterialShaderBindingContract: NonNullable<RenderSystemInternals['getMaterialShaderBindingContract']>;
|
|
102
|
+
readonly getParamSchema: NonNullable<RenderSystemInternals['getParamSchema']>;
|
|
103
|
+
readonly getMaterialBindGroupLayout: NonNullable<RenderSystemInternals['getMaterialBindGroupLayout']>;
|
|
104
|
+
readonly metrics: RenderSystemInternals['metrics'];
|
|
105
|
+
readonly buildPostProcessPipeline: NonNullable<RenderSystemInternals['buildPostProcessPipeline']>;
|
|
106
|
+
readonly renderSystem: RenderSystem;
|
|
107
|
+
readonly createRecoveryFailureLocation: (phase: RecoveryPhase, cause: unknown, overrides?: Partial<Omit<RecoveryFailureLocation, 'phase' | 'cause'>>) => RecoveryFailureLocation;
|
|
108
|
+
readonly publishAndRetireRendererGeneration: (candidate: RendererGeneration, candidatePostProcessResources: RecoveryPostProcessResources, recoveryRootBundle: RecoveryRootBundle, recoveryGraphCandidate: RecoveryGraphCandidate | undefined, recoveryColdWorkGuard: RecoveryColdWorkGuard) => void;
|
|
109
|
+
}
|
|
110
|
+
export interface RendererRecovery {
|
|
111
|
+
recoverOnce(deadline: RecoveryDeadline, deadlineExpired: (phase: RecoveryPhase) => boolean, setCandidateCleanup: (cleanup: () => void) => void, continuation: RecoveryContinuation, setRecoveryPhase: (phase: RecoveryPhase) => void, onRootsCommitted: (count: number) => void, onFailure: (failure: RecoveryFailureLocation) => void): Promise<Result<void, RecoverFailure>>;
|
|
112
|
+
}
|
|
113
|
+
export declare function createRendererRecovery(deps: RendererRecoveryDependencies): RendererRecovery;
|
|
114
|
+
export {};
|
|
115
|
+
//# sourceMappingURL=renderer-recover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-recover.d.ts","sourceRoot":"","sources":["../../../src/assembly/recovery/renderer-recover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC/F,OAAO,EAA6B,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAChG,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,SAAS,EACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAW,KAAK,MAAM,EAAY,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,KAAK,EAAU,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAQzE,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,sBAAsB,EACtB,4BAA4B,EAC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AAsB,CAAC,IAAI,EAAE,4BAA4B,GAAG,gBAAgB,CAitB3F"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type RendererOperationCause } from '../errors/render';
|
|
2
|
+
import type { Renderer, RenderProfile } from '../render-contract';
|
|
3
|
+
import type { RendererHostImplementation } from './host-contract';
|
|
4
|
+
/** Narrow the concrete host to the lease/receipt-only public contract. */
|
|
5
|
+
export declare function exposeRenderer(renderer: RendererHostImplementation): Renderer;
|
|
6
|
+
export declare function toError(value: unknown): Error;
|
|
7
|
+
export declare function structuredRendererCause(cause: unknown, operation: string): RendererOperationCause;
|
|
8
|
+
export declare function validateRenderProfile(profile: RenderProfile): string | undefined;
|
|
9
|
+
export declare function freezeRenderProfile(profile: RenderProfile): RenderProfile;
|
|
10
|
+
//# sourceMappingURL=renderer-facade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-facade.d.ts","sourceRoot":"","sources":["../../src/assembly/renderer-facade.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,sBAAsB,EAE5B,MAAM,kBAAkB,CAAC;AAM1B,OAAO,KAAK,EACV,QAAQ,EAKR,aAAa,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAGlE,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,QAAQ,EAAE,0BAA0B,GAAG,QAAQ,CAoL7E;AAMD,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAG7C;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,sBAAsB,CA0BjG;AA2DD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CA4BhF;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAKzE"}
|
|
@@ -23,7 +23,24 @@ export interface RendererFrameTransactionSteps<T> {
|
|
|
23
23
|
readonly submit: (candidate: T) => RendererFrameStageResult<void>;
|
|
24
24
|
readonly commit: (candidate: T) => void;
|
|
25
25
|
readonly abort?: (failure: RendererFrameStageFailure) => void;
|
|
26
|
+
readonly generationFence?: RendererGenerationFence;
|
|
26
27
|
}
|
|
28
|
+
export interface RendererGenerationFence {
|
|
29
|
+
readonly capturedGeneration: number;
|
|
30
|
+
readonly currentGeneration: () => number;
|
|
31
|
+
}
|
|
32
|
+
export type ContinuationKind = 'readback' | 'query' | 'mapAsync' | 'queue-completion';
|
|
33
|
+
export interface ContinuationTerminationReason {
|
|
34
|
+
readonly code: 'device-lost' | 'disposed' | 'stale-generation';
|
|
35
|
+
readonly detail?: unknown;
|
|
36
|
+
}
|
|
37
|
+
export interface ContinuationTerminator {
|
|
38
|
+
terminate(reason: ContinuationTerminationReason): boolean;
|
|
39
|
+
promise(): Promise<ContinuationTerminationReason>;
|
|
40
|
+
isTerminated(): boolean;
|
|
41
|
+
guard(kind: ContinuationKind): boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare function createContinuationTerminator(): ContinuationTerminator;
|
|
27
44
|
/**
|
|
28
45
|
* Run the four renderer stages behind one commit barrier. A stage can expose
|
|
29
46
|
* only a structured failure; the candidate is never published until submit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-frame-transaction.d.ts","sourceRoot":"","sources":["../../src/assembly/renderer-frame-transaction.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,SAAS,EAAE,CAAC,EACZ,OAAO,GAAE,MAAM,IAAsB,GACpC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