@forgeax/engine-render 0.1.26 → 0.1.28
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 +215 -0
- package/dist/assembly/dynamic-geometry-host.d.ts +31 -0
- package/dist/assembly/dynamic-geometry-host.d.ts.map +1 -0
- package/dist/assembly/host-contract.d.ts +11 -0
- package/dist/assembly/host-contract.d.ts.map +1 -1
- package/dist/assembly/renderer-facade.d.ts.map +1 -1
- package/dist/assembly/webgpu-renderer.d.ts.map +1 -1
- package/dist/authoring.mjs +2 -2
- package/dist/{chunk-FJ6P52EE.mjs → chunk-ILQ5MEZF.mjs} +3 -17
- package/dist/chunk-ILQ5MEZF.mjs.map +1 -0
- package/dist/{chunk-HKXTW355.mjs → chunk-IQMKJLNU.mjs} +3 -3
- package/dist/{chunk-HKXTW355.mjs.map → chunk-IQMKJLNU.mjs.map} +1 -1
- package/dist/{chunk-KM2NOX2I.mjs → chunk-J52NMQKR.mjs} +462 -6
- package/dist/chunk-J52NMQKR.mjs.map +1 -0
- package/dist/{chunk-ZZ4YQ474.mjs → chunk-J6KACNOH.mjs} +2 -2
- package/dist/{chunk-ZZ4YQ474.mjs.map → chunk-J6KACNOH.mjs.map} +1 -1
- package/dist/{chunk-ADHHVYLW.mjs → chunk-JAASCMXA.mjs} +3 -3
- package/dist/{chunk-ADHHVYLW.mjs.map → chunk-JAASCMXA.mjs.map} +1 -1
- package/dist/{chunk-TMIASV2N.mjs → chunk-MBU4ZVE7.mjs} +20 -12
- package/dist/chunk-MBU4ZVE7.mjs.map +1 -0
- package/dist/{chunk-E34VL5VI.mjs → chunk-MYJ5RPJO.mjs} +3 -3
- package/dist/{chunk-E34VL5VI.mjs.map → chunk-MYJ5RPJO.mjs.map} +1 -1
- package/dist/{chunk-JDWARUOI.mjs → chunk-RBDBZ5R7.mjs} +17 -3
- package/dist/chunk-RBDBZ5R7.mjs.map +1 -0
- package/dist/{chunk-YUQXSEHG.mjs → chunk-VSL23LZE.mjs} +26 -12
- package/dist/chunk-VSL23LZE.mjs.map +1 -0
- package/dist/construct-renderer.mjs +862 -106
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/gpu-residency.d.ts +10 -5
- package/dist/device/gpu-residency.d.ts.map +1 -1
- package/dist/device/mesh-residency-lifetime.d.ts +21 -0
- package/dist/device/mesh-residency-lifetime.d.ts.map +1 -0
- package/dist/dynamic-geometry.d.ts +125 -0
- package/dist/dynamic-geometry.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +7 -6
- package/dist/index.mjs.map +1 -1
- package/dist/internal.mjs +7 -7
- package/dist/record/frame.d.ts +1 -1
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/render-context.d.ts +2 -0
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/render-contract.d.ts +12 -0
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-system-extract-tail.d.ts.map +1 -1
- package/dist/render-system-extract.d.ts +6 -0
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system.d.ts +7 -0
- package/dist/render-system.d.ts.map +1 -1
- package/dist/temporal/index.mjs +4 -4
- package/package.json +20 -20
- package/src/__tests__/dynamic-geometry-host.unit.test.ts +1123 -0
- package/src/__tests__/dynamic-geometry.unit.test.ts +233 -0
- package/src/__tests__/factory-contract.integration.test.ts +6 -14
- package/src/__tests__/mesh-submission-lifetime.unit.test.ts +53 -0
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +1 -1
- package/src/assembly/dynamic-geometry-host.ts +839 -0
- package/src/assembly/host-contract.ts +26 -0
- package/src/assembly/renderer-facade.ts +17 -0
- package/src/assembly/webgpu-renderer.ts +49 -2
- package/src/components/sprite-animation.ts +1 -1
- package/src/device/gpu-residency.ts +62 -62
- package/src/device/mesh-residency-lifetime.ts +73 -0
- package/src/dynamic-geometry.ts +736 -0
- package/src/index.ts +16 -0
- package/src/record/__tests__/standard-pbr-ubo-layout.unit.test.ts +68 -1
- package/src/record/frame.ts +2 -0
- package/src/record/main-pass-geometry.ts +13 -4
- package/src/record/main-pass-sprite-draws.ts +2 -0
- package/src/record/render-context.ts +2 -0
- package/src/record/typed-frame-graph.ts +2 -9
- package/src/render-contract.ts +24 -0
- package/src/render-system-extract-tail.ts +3 -2
- package/src/render-system-extract.ts +30 -1
- package/src/render-system.ts +42 -0
- package/dist/chunk-FJ6P52EE.mjs.map +0 -1
- package/dist/chunk-JDWARUOI.mjs.map +0 -1
- package/dist/chunk-KM2NOX2I.mjs.map +0 -1
- package/dist/chunk-TMIASV2N.mjs.map +0 -1
- package/dist/chunk-YUQXSEHG.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1358,3 +1358,218 @@ detached facts only: no live GPU handle, second owner, or second ledger is expos
|
|
|
1358
1358
|
Missing or mismatched receipts remain
|
|
1359
1359
|
`fallback-only` with zero SSR work; SSR v1, Hi-Z, ray marching, temporal resolve,
|
|
1360
1360
|
compose, and history are out of scope.
|
|
1361
|
+
## Standard dynamic MeshAsset candidates
|
|
1362
|
+
|
|
1363
|
+
The Renderer owns one bounded candidate lifecycle for geometry produced by an
|
|
1364
|
+
external consumer. The payload is the existing `MeshAsset` contract, not a
|
|
1365
|
+
voxel-specific asset kind. The consumer remains the World shared-reference
|
|
1366
|
+
owner and publishes `MeshFilter` / `MeshRenderer` through the ordinary ECS
|
|
1367
|
+
write barrier; the Renderer owns GPU residency, device generation, frame
|
|
1368
|
+
receipt, and delayed retirement.
|
|
1369
|
+
|
|
1370
|
+
```ts
|
|
1371
|
+
import type { MeshAsset } from '@forgeax/engine-types';
|
|
1372
|
+
import { FixedTime, type World } from '@forgeax/engine-ecs';
|
|
1373
|
+
import { Transform } from '@forgeax/engine-scene';
|
|
1374
|
+
import { MeshFilter, MeshRenderer } from '@forgeax/engine-render';
|
|
1375
|
+
import type { FrameCamera, FrameEnvironment, Renderer } from '@forgeax/engine-render';
|
|
1376
|
+
|
|
1377
|
+
declare const renderer: Renderer;
|
|
1378
|
+
declare const world: World;
|
|
1379
|
+
declare const mesh: MeshAsset;
|
|
1380
|
+
declare const camera: FrameCamera;
|
|
1381
|
+
declare const environment: FrameEnvironment;
|
|
1382
|
+
|
|
1383
|
+
// Attach first: the Renderer owns the lease/generation boundary, while the
|
|
1384
|
+
// World remains the MeshAsset handle and ECS scene owner.
|
|
1385
|
+
const attached = renderer.attach(world);
|
|
1386
|
+
if (!attached.ok) throw attached.error;
|
|
1387
|
+
const meshHandle = world.allocSharedRef('MeshAsset', mesh);
|
|
1388
|
+
const entity = world
|
|
1389
|
+
.spawn(
|
|
1390
|
+
{ component: Transform, data: {} },
|
|
1391
|
+
{ component: MeshFilter, data: { assetHandle: meshHandle } },
|
|
1392
|
+
{ component: MeshRenderer, data: { materials: [] } },
|
|
1393
|
+
)
|
|
1394
|
+
.unwrap();
|
|
1395
|
+
const fixedStep = world.getResource(FixedTime).tick;
|
|
1396
|
+
const prepared = renderer.prepareDynamicGeometry({
|
|
1397
|
+
world,
|
|
1398
|
+
entity,
|
|
1399
|
+
mesh,
|
|
1400
|
+
meshHandle,
|
|
1401
|
+
// Must match a live material handle/source slot; this mesh uses its default.
|
|
1402
|
+
materialIdentity: 'default',
|
|
1403
|
+
revision: 4,
|
|
1404
|
+
topologyRevision: 2,
|
|
1405
|
+
// For paired physics use the admission example below, not this draw-only path.
|
|
1406
|
+
});
|
|
1407
|
+
if (!prepared.ok) {
|
|
1408
|
+
// Branch on prepared.error.code; the previous visible mesh is retained.
|
|
1409
|
+
} else {
|
|
1410
|
+
// ECS FixedTime is the ordering proof for this render-only revision.
|
|
1411
|
+
const accepted = renderer.acceptDynamicGeometry(prepared.value, {
|
|
1412
|
+
world,
|
|
1413
|
+
fixedStep,
|
|
1414
|
+
});
|
|
1415
|
+
if (accepted.ok) {
|
|
1416
|
+
const frame = renderer.draw({
|
|
1417
|
+
leases: [attached.value],
|
|
1418
|
+
camera,
|
|
1419
|
+
environment,
|
|
1420
|
+
fixedStep,
|
|
1421
|
+
});
|
|
1422
|
+
if (frame.ok) {
|
|
1423
|
+
const geometryReceipt = renderer.dynamicGeometryReceipt(accepted.value);
|
|
1424
|
+
// geometryReceipt.frame.frameId === frame.value.frameId for this
|
|
1425
|
+
// generation; geometryReceipt.frame.completed fences GPU retirement.
|
|
1426
|
+
void geometryReceipt;
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
```
|
|
1431
|
+
|
|
1432
|
+
The entity must already carry `Transform`, a live `MeshFilter`, and a
|
|
1433
|
+
`MeshRenderer` when the candidate is prepared and accepted; these are the same
|
|
1434
|
+
ECS prerequisites used by the render extraction query. Preparation records the
|
|
1435
|
+
old `MeshFilter.assetHandle` and stages the new standard handle without changing
|
|
1436
|
+
the visible ECS binding. Acceptance is the one ECS write-barrier that swaps in
|
|
1437
|
+
the candidate. If acceptance or GPU preparation fails, the old binding remains;
|
|
1438
|
+
cancelling an accepted candidate swaps that old handle back, and refuses to
|
|
1439
|
+
overwrite a newer external binding. The Renderer host reads
|
|
1440
|
+
`World.FixedTime.tick` itself; a caller-supplied `{ world, fixedStep }` object
|
|
1441
|
+
cannot bind an unrelated World or step. Preparation may precede acceptance by
|
|
1442
|
+
multiple fixed steps; acceptance records the actual current tick. If
|
|
1443
|
+
`physicsEntity` is supplied, acceptance requires that entity's active paired
|
|
1444
|
+
`PhysicsWorld` admission to match the revision and current step. An already
|
|
1445
|
+
published physics result is deliberately insufficient: it cannot roll back if
|
|
1446
|
+
geometry now fails. A
|
|
1447
|
+
candidate that is not present in the ECS render snapshot at the successful draw
|
|
1448
|
+
is left accepted without a receipt; the receipt is issued only after the
|
|
1449
|
+
submitted record stage consumed the live binding.
|
|
1450
|
+
|
|
1451
|
+
### Paired physics admission
|
|
1452
|
+
|
|
1453
|
+
Prepare both domain candidates invisibly, with matching revision and the geometry
|
|
1454
|
+
candidate's `physicsEntity` naming the physical parent. Queue the physical candidate
|
|
1455
|
+
with one synchronous geometry commit. The existing Physics fixed-step owner runs it
|
|
1456
|
+
after native staging and before step/writeback/publication; no second clock or queue
|
|
1457
|
+
is created. A refused geometry commit restores the old native state. Physics queries,
|
|
1458
|
+
mutations and Renderer draw are refused during this borrowed admission interval.
|
|
1459
|
+
|
|
1460
|
+
```ts
|
|
1461
|
+
import { err, ok } from '@forgeax/engine-types';
|
|
1462
|
+
import { FixedTime } from '@forgeax/engine-ecs';
|
|
1463
|
+
|
|
1464
|
+
physics.admitDerivedShapeCandidate(physicsCandidate, () => {
|
|
1465
|
+
const admitted = renderer.acceptDynamicGeometry(geometryCandidate, {
|
|
1466
|
+
world,
|
|
1467
|
+
fixedStep: world.getResource(FixedTime).tick,
|
|
1468
|
+
});
|
|
1469
|
+
if (!admitted.ok) return err(admitted.error);
|
|
1470
|
+
acceptedGeometry = admitted.value;
|
|
1471
|
+
return ok(undefined);
|
|
1472
|
+
}).unwrap();
|
|
1473
|
+
// Normal World FixedUpdate performs admission, physics step and writeback.
|
|
1474
|
+
// After World.update succeeds, inspect Physics publication/failure and draw.
|
|
1475
|
+
```
|
|
1476
|
+
|
|
1477
|
+
The commit must return immediately after its complete binding change, without
|
|
1478
|
+
additional fallible work. On physical preparation/native failure it is not called;
|
|
1479
|
+
cancel the still-prepared geometry using its normal owner. On a refused commit,
|
|
1480
|
+
inspect `getDerivedFailure` and cancel that prepared geometry. Success publication
|
|
1481
|
+
remains after physics writeback and the real Renderer submission, not callback return.
|
|
1482
|
+
|
|
1483
|
+
`meshHandle` is mandatory on the public Renderer path. The pure
|
|
1484
|
+
`createDynamicGeometryLifecycle` helper may omit it for CPU-only validation, in
|
|
1485
|
+
which case `gpuReady` is false and no Renderer receipt can be produced. The
|
|
1486
|
+
attached Renderer uses the existing `GpuResidencyCache.ensureResident` path
|
|
1487
|
+
before acceptance; its failure is `dynamic-geometry-gpu-failed`, while a
|
|
1488
|
+
missing handle is the distinct `dynamic-geometry-gpu-not-ready` error. The
|
|
1489
|
+
handle is never minted by the Renderer and no RHI buffer or queue escapes the
|
|
1490
|
+
host. A supplied `materialIdentity` must match a live MeshRenderer slot or the
|
|
1491
|
+
MeshAsset material-slot source key; otherwise the host returns structured
|
|
1492
|
+
`dynamic-geometry-invalid`. The normal draw path consumes the accepted standard
|
|
1493
|
+
handle from `MeshFilter`, so main, depth, shadow, and motion/history share one
|
|
1494
|
+
committed geometry identity. The lifecycle also bounds aggregate typed-geometry
|
|
1495
|
+
bytes (`inspect().meshBytes` / `maxMeshBytes`) in addition to candidate count.
|
|
1496
|
+
|
|
1497
|
+
```mermaid
|
|
1498
|
+
stateDiagram-v2
|
|
1499
|
+
[*] --> prepared: prepare
|
|
1500
|
+
prepared --> accepted: accept
|
|
1501
|
+
prepared --> cancelled: cancel / generation loss
|
|
1502
|
+
accepted --> published: successful draw FrameReceipt
|
|
1503
|
+
published --> retired: receipt-safe retirement
|
|
1504
|
+
accepted --> cancelled: detach / World teardown
|
|
1505
|
+
```
|
|
1506
|
+
|
|
1507
|
+
`DynamicGeometryCandidate` is a short-lived credential bound to the attached
|
|
1508
|
+
World object, live ECS entity, lifecycle owner identity, candidate revision,
|
|
1509
|
+
copied MeshAsset, material identity, and active device generation. A Renderer
|
|
1510
|
+
acceptance records the attached World's `FixedTime` ordering and performs the
|
|
1511
|
+
binding swap; a candidate with `physicsEntity` also records that entity's
|
|
1512
|
+
PhysicsWorld admission step. A frame publishes only candidates for the
|
|
1513
|
+
drawn lease Worlds whose candidate step is no newer than the actual World
|
|
1514
|
+
`FixedTime.tick`, and whose PhysicsWorld publication has the exact candidate
|
|
1515
|
+
revision. The optional frame `fixedStep` is checked against that World tick; it
|
|
1516
|
+
is an assertion, not a second clock. Thus a multi-fixed-step host frame can
|
|
1517
|
+
issue one receipt for the latest submitted frame without dropping an accepted
|
|
1518
|
+
candidate, while a successful draw for another World cannot publish an
|
|
1519
|
+
arbitrary credential. The public attached-Renderer receipt carries
|
|
1520
|
+
`recordStageConsumed: true` and the embedded `frame.completed` fence, making it
|
|
1521
|
+
a real record/submit proof, not a non-empty handle or counter. The detached
|
|
1522
|
+
`createDynamicGeometryLifecycle` helper may intentionally publish a CPU-only
|
|
1523
|
+
receipt with `recordStageConsumed: false`; that helper is not a Renderer draw
|
|
1524
|
+
path and must not be used as GPU evidence.
|
|
1525
|
+
|
|
1526
|
+
`dynamicGeometryReceipt(candidate)` is present only after the accepted candidate
|
|
1527
|
+
is published by a successful `FrameReceipt`; it carries the same `frameId`,
|
|
1528
|
+
`deviceGeneration`, preparation fixed step, and actual publication fixed step.
|
|
1529
|
+
A topology revision invalidates lower-revision prepared/accepted candidates for the same entity and
|
|
1530
|
+
marks older published history invalid, but retains each published receipt's
|
|
1531
|
+
completion fence; an already-published credential remains until an explicit
|
|
1532
|
+
retire can release its GPU owner after that fence resolves. Each later
|
|
1533
|
+
record-stage consumption emits a refreshed receipt and adds its
|
|
1534
|
+
`FrameReceipt.frame.completed` fence, so retirement waits for every observed
|
|
1535
|
+
in-flight frame (resolved or rejected), not only the latest receipt. The
|
|
1536
|
+
attached host revalidates the live `(World, entity, MeshFilter)` binding for
|
|
1537
|
+
each candidate, so a topology change on entity B does not suppress a real
|
|
1538
|
+
record-stage use of still-live entity A; only the candidate/entity whose
|
|
1539
|
+
binding changed is refused.
|
|
1540
|
+
The shared `GpuResidencyCache` owns allocation leases and submission fences.
|
|
1541
|
+
A lease captures the concrete GPU allocation, not a reusable World handle slot;
|
|
1542
|
+
cancelling B cannot invalidate a resource still used by A. Every submitted
|
|
1543
|
+
frame conservatively fences all resident meshes, including ordinary, shadow-only
|
|
1544
|
+
and cached GPU-driven uses, independently of publication or history validity.
|
|
1545
|
+
In-place mesh invalidation immediately allows a new upload while old submitted
|
|
1546
|
+
buffers retire behind their own completion. An accepted topology change resets
|
|
1547
|
+
the existing temporal history owner before the next draw. The candidate's World
|
|
1548
|
+
reference is also retained through completion so its handle slot cannot be reused.
|
|
1549
|
+
The detached inspection reports both history invalidation and concrete
|
|
1550
|
+
candidate invalidation. Stale revisions, cross-World/lifecycle candidates, old
|
|
1551
|
+
generations, invalid GPU readiness, invalid ordering, duplicate acceptance,
|
|
1552
|
+
unknown retirement, and bounded in-flight count/byte overflow are structured
|
|
1553
|
+
`DynamicGeometryError` results. Cancelling or invalidating work leaves the last
|
|
1554
|
+
published candidate untouched, cleans candidate-only residency when no other
|
|
1555
|
+
ECS entity or candidate shares the handle, and never releases a caller-owned
|
|
1556
|
+
shared reference. Call `retireDynamicGeometry` only after the receipt-bound
|
|
1557
|
+
consumer no longer needs the old geometry, then release the World shared
|
|
1558
|
+
reference through its normal owner. Retirement is a logical state transition
|
|
1559
|
+
first: the attached host keeps the candidate count and typed mesh bytes in the
|
|
1560
|
+
bounded budget until all receipt fences resolve and the candidate's shared GPU
|
|
1561
|
+
lease is released. If the candidate is still the live `MeshFilter`, retirement
|
|
1562
|
+
returns `dynamic-geometry-invalid` without deleting its receipt or GPU owner;
|
|
1563
|
+
swap the binding through ECS first so the completion fence can safely retire it.
|
|
1564
|
+
The pure lifecycle exposes `finalizeRetirement` for its owner to release that
|
|
1565
|
+
deferred count/byte reservation after cleanup.
|
|
1566
|
+
|
|
1567
|
+
This seam intentionally does not add a second asset registry, Pack kind,
|
|
1568
|
+
RenderFeature, worker, or frame clock. Asset ownership is SSOT: the producer
|
|
1569
|
+
owns sourceKey/GUID and Cooked Pack payloads, Catalog is only the projection,
|
|
1570
|
+
the runtime `AssetRegistry` resolves GUIDs, and the World owns the shared
|
|
1571
|
+
`MeshAsset` handle. `world.allocSharedRef` is the only handle creation in this
|
|
1572
|
+
example; Renderer never registers or mints an asset. Provider/Catalog/GUID cold
|
|
1573
|
+
loading therefore continues through the existing route; a producer that needs
|
|
1574
|
+
a custom voxel artifact owns that schema and loader outside the Engine, while
|
|
1575
|
+
its projected standard mesh enters this candidate path.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { World } from '@forgeax/engine-ecs';
|
|
2
|
+
import { type Result } from '@forgeax/engine-types';
|
|
3
|
+
import type { GpuResidencyCache } from '../device/gpu-residency';
|
|
4
|
+
import { type DynamicGeometryCandidate, DynamicGeometryError, type DynamicGeometryLifecycle, type DynamicGeometryOrdering, type DynamicGeometryPrepareInput, type DynamicGeometryReceipt } from '../dynamic-geometry';
|
|
5
|
+
export interface DynamicGeometryHostImplementation {
|
|
6
|
+
prepareDynamicGeometry(input: DynamicGeometryPrepareInput): Result<DynamicGeometryCandidate, DynamicGeometryError>;
|
|
7
|
+
acceptDynamicGeometry(candidate: DynamicGeometryCandidate, ordering: DynamicGeometryOrdering): Result<DynamicGeometryCandidate, DynamicGeometryError>;
|
|
8
|
+
dynamicGeometryReceipt(candidate: DynamicGeometryCandidate): DynamicGeometryReceipt | undefined;
|
|
9
|
+
cancelDynamicGeometry(candidate: DynamicGeometryCandidate): Result<void, DynamicGeometryError>;
|
|
10
|
+
retireDynamicGeometry(candidate: DynamicGeometryCandidate): Result<void, DynamicGeometryError>;
|
|
11
|
+
/** @internal Detach cleanup keeps candidate GPU residency receipt-safe. */
|
|
12
|
+
invalidateDynamicGeometryWorld(world: World): void;
|
|
13
|
+
/** Publish only candidates consumed by the attached ECS render snapshot. */
|
|
14
|
+
publishDynamicGeometry(frame: {
|
|
15
|
+
readonly frameId: number;
|
|
16
|
+
readonly deviceGeneration: number;
|
|
17
|
+
readonly completed?: Promise<unknown>;
|
|
18
|
+
}, worlds?: readonly object[], fixedStep?: number): readonly DynamicGeometryReceipt[];
|
|
19
|
+
}
|
|
20
|
+
export declare function createDynamicGeometryHost(options: {
|
|
21
|
+
readonly lifecycle: DynamicGeometryLifecycle;
|
|
22
|
+
readonly attachedWorlds: ReadonlySet<World>;
|
|
23
|
+
/** Resolve the store owned by the current Renderer device generation. */
|
|
24
|
+
readonly getGpuStore: () => GpuResidencyCache;
|
|
25
|
+
readonly currentGeneration: () => number;
|
|
26
|
+
/** Renderer record-stage proof for the most recently submitted frame. */
|
|
27
|
+
readonly isConsumedByRenderFrame: (candidate: DynamicGeometryCandidate) => boolean;
|
|
28
|
+
/** Existing temporal owner discards the old surface history after an ECS swap. */
|
|
29
|
+
readonly onTopologyChanged?: () => void;
|
|
30
|
+
}): DynamicGeometryHostImplementation;
|
|
31
|
+
//# sourceMappingURL=dynamic-geometry-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-geometry-host.d.ts","sourceRoot":"","sources":["../../src/assembly/dynamic-geometry-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI/D,OAAO,EAAoB,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EACL,KAAK,wBAAwB,EAC7B,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAE5B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,iCAAiC;IAChD,sBAAsB,CACpB,KAAK,EAAE,2BAA2B,GACjC,MAAM,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAC;IAC1D,qBAAqB,CACnB,SAAS,EAAE,wBAAwB,EACnC,QAAQ,EAAE,uBAAuB,GAChC,MAAM,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAC;IAC1D,sBAAsB,CAAC,SAAS,EAAE,wBAAwB,GAAG,sBAAsB,GAAG,SAAS,CAAC;IAChG,qBAAqB,CAAC,SAAS,EAAE,wBAAwB,GAAG,MAAM,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IAC/F,qBAAqB,CAAC,SAAS,EAAE,wBAAwB,GAAG,MAAM,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IAC/F,2EAA2E;IAC3E,8BAA8B,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACnD,4EAA4E;IAC5E,sBAAsB,CACpB,KAAK,EAAE;QACL,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;QAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;KACvC,EACD,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,EAC1B,SAAS,CAAC,EAAE,MAAM,GACjB,SAAS,sBAAsB,EAAE,CAAC;CACtC;AAqID,wBAAgB,yBAAyB,CAAC,OAAO,EAAE;IACjD,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC;IAC7C,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5C,yEAAyE;IACzE,QAAQ,CAAC,WAAW,EAAE,MAAM,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,MAAM,CAAC;IACzC,yEAAyE;IACzE,QAAQ,CAAC,uBAAuB,EAAE,CAAC,SAAS,EAAE,wBAAwB,KAAK,OAAO,CAAC;IACnF,kFAAkF;IAClF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CACzC,GAAG,iCAAiC,CA6oBpC"}
|
|
@@ -2,6 +2,7 @@ import type { AssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
|
2
2
|
import type { World } from '@forgeax/engine-ecs';
|
|
3
3
|
import type { Result, RhiDevice, RhiError, ShaderModule } from '@forgeax/engine-rhi';
|
|
4
4
|
import type { RenderPipelineAsset } from '@forgeax/engine-types';
|
|
5
|
+
import type { DynamicGeometryCandidate, DynamicGeometryError, DynamicGeometryOrdering, DynamicGeometryPrepareInput, DynamicGeometryReceipt } from '../dynamic-geometry';
|
|
5
6
|
import type { RecoverFailure } from '../errors/recover';
|
|
6
7
|
import type { ObservationUnavailableError, RenderError } from '../errors/render';
|
|
7
8
|
import type { RenderFeature, RenderFeatureDiagnostics } from '../features/types';
|
|
@@ -32,6 +33,16 @@ export type RendererHostEventListener = (event: RendererHostEvent) => void;
|
|
|
32
33
|
*/
|
|
33
34
|
export interface RendererHostImplementation {
|
|
34
35
|
attach(world: World): RenderResult<RenderWorldLease, RenderError>;
|
|
36
|
+
prepareDynamicGeometry(input: DynamicGeometryPrepareInput): Result<DynamicGeometryCandidate, DynamicGeometryError>;
|
|
37
|
+
acceptDynamicGeometry(candidate: DynamicGeometryCandidate, ordering: DynamicGeometryOrdering): Result<DynamicGeometryCandidate, DynamicGeometryError>;
|
|
38
|
+
dynamicGeometryReceipt(candidate: DynamicGeometryCandidate): DynamicGeometryReceipt | undefined;
|
|
39
|
+
cancelDynamicGeometry(candidate: DynamicGeometryCandidate): Result<void, DynamicGeometryError>;
|
|
40
|
+
retireDynamicGeometry(candidate: DynamicGeometryCandidate): Result<void, DynamicGeometryError>;
|
|
41
|
+
publishDynamicGeometry(frame: {
|
|
42
|
+
readonly frameId: number;
|
|
43
|
+
readonly deviceGeneration: number;
|
|
44
|
+
readonly completed?: Promise<unknown>;
|
|
45
|
+
}, worlds?: readonly object[], fixedStep?: number): readonly DynamicGeometryReceipt[];
|
|
35
46
|
createRenderTarget(descriptor: RenderTargetDescriptor): RenderResult<RenderTarget, RenderError>;
|
|
36
47
|
resizeRenderTarget(target: RenderTarget, descriptor: RenderTargetDescriptor): RenderResult<void, RenderError>;
|
|
37
48
|
createRenderTargetTextureSource(target: RenderTarget, options: RenderTargetTextureSourceOptions): RenderResult<RenderTargetTextureSource, RenderError>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-contract.d.ts","sourceRoot":"","sources":["../../src/assembly/host-contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,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AAO,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;IAChG,sBAAsB,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;IAClG,QAAQ,CAAC,eAAe,EAAE;QAAE,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC;CAClG;AAED,iFAAiF;AACjF,MAAM,WAAW,8BACf,SAAQ,0BAA0B,EAChC,yBAAyB;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-facade.d.ts","sourceRoot":"","sources":["../../src/assembly/renderer-facade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderer-facade.d.ts","sourceRoot":"","sources":["../../src/assembly/renderer-facade.ts"],"names":[],"mappings":"AAWA,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,CAgM7E;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-renderer.d.ts","sourceRoot":"","sources":["../../src/assembly/webgpu-renderer.ts"],"names":[],"mappings":"AAkCA,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;
|
|
1
|
+
{"version":3,"file":"webgpu-renderer.d.ts","sourceRoot":"","sources":["../../src/assembly/webgpu-renderer.ts"],"names":[],"mappings":"AAkCA,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;AAG/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;AAGzD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAoBtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;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,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,5 +1,5 @@
|
|
|
1
|
-
export { GlyphText, SpritePlayback,
|
|
2
|
-
export { SpriteAnimation, SpriteInstances, SpriteRegionOverride, TileLayer, Tilemap, TilemapSort } from './chunk-
|
|
1
|
+
export { GlyphText, SpritePlayback, spritePlaybackModeFromU32 } from './chunk-ILQ5MEZF.mjs';
|
|
2
|
+
export { SpriteAnimation, SpriteInstances, SpriteRegionOverride, TileLayer, Tilemap, TilemapSort, setActiveCamera } from './chunk-RBDBZ5R7.mjs';
|
|
3
3
|
export { TransparentSort } from './chunk-RXZ3RGOU.mjs';
|
|
4
4
|
export { SPRITE_PREMULTIPLIED_ALPHA_BLEND } from './chunk-GF523LHF.mjs';
|
|
5
5
|
import { ok } from '@forgeax/engine-types';
|
|
@@ -27,20 +27,6 @@ function spritePlaybackModeFromU32(value) {
|
|
|
27
27
|
return value === SPRITE_PLAYBACK_MODE_CLAMP ? "clamp" : "loop";
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (!world.hasResource(ACTIVE_CAMERA_KEY)) return void 0;
|
|
34
|
-
return world.getResource(ACTIVE_CAMERA_KEY);
|
|
35
|
-
}
|
|
36
|
-
function setActiveCamera(world, entity) {
|
|
37
|
-
world.insertResource(ACTIVE_CAMERA_KEY, { entity });
|
|
38
|
-
}
|
|
39
|
-
function selectActiveCameraIndex(cameraEntities, activeEntity) {
|
|
40
|
-
if (activeEntity === void 0) return -1;
|
|
41
|
-
return cameraEntities.indexOf(activeEntity);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { GlyphText, SpritePlayback, getActiveCamera, selectActiveCameraIndex, setActiveCamera, spritePlaybackModeFromU32 };
|
|
45
|
-
//# sourceMappingURL=chunk-FJ6P52EE.mjs.map
|
|
46
|
-
//# sourceMappingURL=chunk-FJ6P52EE.mjs.map
|
|
30
|
+
export { GlyphText, SpritePlayback, spritePlaybackModeFromU32 };
|
|
31
|
+
//# sourceMappingURL=chunk-ILQ5MEZF.mjs.map
|
|
32
|
+
//# sourceMappingURL=chunk-ILQ5MEZF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/glyph-text.ts","../src/components/sprite-playback-mode.ts"],"names":[],"mappings":";;;AAkDO,IAAM,SAAA,GAAY,gBAAgB,WAAA,EAAa;AAAA;AAAA;AAAA,EAGpD,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,mBAAA;AAAA,IACN,OAAA,EAAS,CAAA;AAAA,IACT,mBAAA,EAAqB;AAAA,GACvB;AAAA,EACA,IAAA,EAAM,EAAE,IAAA,EAAM,QAAA,EAAU,SAAS,EAAA,EAAG;AAAA,EACpC,QAAA,EAAU,EAAE,IAAA,EAAM,KAAA,EAAO,SAAS,EAAA,EAAG;AAAA;AAAA;AAAA,EAGrC,KAAA,EAAO,EAAE,IAAA,EAAM,eAAA,EAAiB,OAAA,EAAS,IAAI,YAAA,CAAa,CAAC,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAC,CAAC,CAAA;AACxE,CAAC;;;ACXM,IAAM,yBAAA,GAA4B,CAAA;AAGlC,IAAM,0BAAA,GAA6B,CAAA;AAGnC,IAAM,cAAA,GAAiB,OAAO,MAAA,CAAO;AAAA,EAC1C,IAAA,EAAM,yBAAA;AAAA,EACN,KAAA,EAAO;AACT,CAAU;AAeH,SAAS,0BAA0B,KAAA,EAAmC;AAC3E,EAAA,OAAO,KAAA,KAAU,6BAA6B,OAAA,GAAU,MAAA;AAC1D","file":"chunk-ILQ5MEZF.mjs","sourcesContent":["// @forgeax/engine-runtime - GlyphText component (feat-20260531-world-space-msdf-text-rendering M4 / w14).\n//\n// `GlyphText` is the authoring source component for world-space MSDF text\n// (requirements AC-06 / §domain model). It carries ONLY authoring data; the\n// glyph quad baking + MeshFilter / MeshRenderer attachment is the job of the\n// `glyphTextLayoutSystem` (plan-strategy D-2: GlyphText is pure authoring\n// data, baking is a system responsibility). There is NO `TextLayoutAsset`\n// intermediate (OOS-5) -- layout output lives directly in a baked MeshAsset.\n//\n// Naming: single-semantic component drops the `Component` suffix\n// (AGENTS.md §Component naming rule #1 -- Transform / Camera / GlyphText).\n//\n// Schema vocab:\n// - `fontHandle: 'shared<FontAsset>'` -> `Handle<'FontAsset', 'shared'>`\n// (u32-stored; AssetRegistry owns the FontAsset lifecycle). AI users\n// obtain the handle via `assets.loadByGuid<FontAsset>(guid)`.\n// - `text: 'string'` -> native JS string (UniqueRefStore-backed, same\n// dispatch as `Name.value`).\n// - `fontSize: 'f32'` -> layout scale applied to the FontAsset metrics.\n// - `color: 'array<f32, 4>'` -> linear-space rgba tint (feat-20260709 M3:\n// collapsed from four `colorR/G/B/A` scalar columns into one inline\n// stride-4 SoA column, mirroring the DirectionalLight direction/color\n// idiom). Explicit layer-2 default [1,1,1,1] (opaque white).\n//\n// charter mapping: P1 (single import surface from `@forgeax/engine-render`,\n// co-located with `glyphTextLayoutSystem` that consumes it) + P3\n// (machine-readable schema literal) + P5 (consistent abstraction: same\n// `'shared<T>'` idiom as MeshFilter.assetHandle / MeshRenderer.materials).\n\nimport { defineComponent } from '@forgeax/engine-ecs';\n\n/**\n * Glyph text authoring component (world-space MSDF text).\n *\n * Spawn an entity with a `GlyphText` and the `glyphTextLayoutSystem`\n * (auto-wired by `createRenderer` / `createApp`) lays out the glyph quads,\n * bakes a `MeshAsset`, and attaches `MeshFilter` + `MeshRenderer` on the\n * next frame (Commands-deferred). Mutating `text` / `fontSize` / `color`\n * re-bakes the mesh in place (plan-strategy D-1 updateMesh; registry size\n * unchanged, AC-08).\n *\n * @example Spawn a world-space label:\n * import { GlyphText } from '@forgeax/engine-render/authoring';\n * const font = (await assets.loadByGuid(fontGuid)).unwrap();\n * world.spawn({\n * component: GlyphText,\n * data: { fontHandle: font, text: 'Hello', fontSize: 32,\n * color: [1, 1, 1, 1] },\n * });\n */\nexport const GlyphText = defineComponent('GlyphText', {\n // The layout/render owner re-resolves the font asset on the target world;\n // authoring text and style remain portable simulation state.\n fontHandle: {\n type: 'shared<FontAsset>',\n default: 0 as never,\n simulationTransient: true,\n },\n text: { type: 'string', default: '' },\n fontSize: { type: 'f32', default: 16 },\n // color carries an explicit layer-2 default [1,1,1,1] (opaque white); the\n // array layer-3 fallback is all-zero, so the default MUST be explicit (D-5).\n color: { type: 'array<f32, 4>', default: new Float32Array([1, 1, 1, 1]) },\n});\n","// @forgeax/engine-runtime - SpritePlaybackMode (u32 column encoding + mapper).\n//\n// SSOT for the SpriteAnimation.playbackMode ECS column (M2 T-12) and the\n// runtime tick-system branch selector (M4 T-23). The shape mirrors the M1\n// `Tonemap` block in `./camera.ts:72-90` (TONEMAP_NONE = 0 /\n// TONEMAP_REINHARD_EXTENDED = 1 + `type Tonemap = 'none' |\n// 'reinhard-extended'` + `tonemapFromF32`) for charter P4 consistent\n// abstraction — AI users keep one mental model across all u32-encoded\n// closed-union schema columns.\n//\n// Why `'u32'` + constant + mapper instead of a string-literal column?\n// ECS schema whitelist `SchemaFieldType` (packages/ecs/src/component.ts\n// section schema-field-type) does not accept string-literal unions\n// (research F-2 + F-5). Storing a u32 + translating to a closed\n// `'loop' | 'clamp'` literal union at the tick-system seam preserves\n// AI-user-facing narrowing (`switch (mode) { case 'loop': ... }`)\n// without forcing the ECS column to learn a new field-type vocabulary.\n//\n// Naming convention (plan-strategy section 8.command naming):\n// SPRITE_PLAYBACK_MODE_LOOP / SPRITE_PLAYBACK_MODE_CLAMP mirror M1\n// TONEMAP_* / TRANSPARENT_SORT_MODE_*. `spritePlaybackModeFromU32`\n// mirrors `tonemapFromF32` / `cameraProjectionFromF32`. AI users\n// discover the trio via single-import barrel re-export from\n// `@forgeax/engine-runtime` (wired in by M2 T-13).\n//\n// Anchors: plan-strategy section 2 D-5 + section 3.1 PR block SPM +\n// section 4 risk R-SCHEMA-1 reaction; research F-2 + F-5;\n// requirements section AC-02 + section 2.3 playbackMode row;\n// plan-tasks.json T-07 acceptanceCheck (rg\n// \"SPRITE_PLAYBACK_MODE_LOOP|SPRITE_PLAYBACK_MODE_CLAMP|\n// spritePlaybackModeFromU32\" >= 3 hits in this file).\n\n/**\n * Playback mode discriminator literal union (requirements section AC-02 +\n * section 2.3). Two members for the MVP:\n *\n * `'loop'` — `currentFrame = (currentFrame + 1) % frameCount`; the\n * sprite-animation-tick system wraps the index when\n * `accumDt >= frameDuration` (default for hello-sprite-\n * atlas demo \"100 sprites synchronised walk cycle\").\n * `'clamp'` — `currentFrame = min(currentFrame + 1, frameCount - 1)`;\n * holds the last frame for death / terminator-animation\n * style sequences (requirements section 2.5 q8 lock).\n *\n * Future modes (`'pingpong'`, reverse playback, arbitrary frame index\n * jumps) are deferred per requirements OOS-03. The closed union shape\n * leaves room for additive growth without breaking the u32 enum encoding\n * (plan-strategy section 2 D-5).\n */\nexport type SpritePlaybackMode = 'loop' | 'clamp';\n\n/** Numeric encoding of the loop playback mode (schema value for `playbackMode`). */\nexport const SPRITE_PLAYBACK_MODE_LOOP = 0 as const;\n\n/** Numeric encoding of the clamp playback mode (schema value for `playbackMode`). */\nexport const SPRITE_PLAYBACK_MODE_CLAMP = 1 as const;\n\n/** Grouped authoring values; the numeric ECS encoding stays owner-local. */\nexport const SpritePlayback = Object.freeze({\n loop: SPRITE_PLAYBACK_MODE_LOOP,\n clamp: SPRITE_PLAYBACK_MODE_CLAMP,\n} as const);\n\n/**\n * Map a `SpriteAnimation.playbackMode` numeric column value to the closed\n * `SpritePlaybackMode` string-literal union. The defensive fallback mirrors\n * `cameraProjectionFromF32` / `tonemapFromF32` precedent — a value other\n * than `SPRITE_PLAYBACK_MODE_CLAMP` (1) maps to `'loop'`, so stale or\n * uninitialised entities surface a predictable playback shape through the\n * tick-system query (rather than throwing or returning `undefined`).\n * Validation of `playbackMode` happens at schema-write time, not here.\n *\n * The tick-system in M4 T-23 (`spriteAnimationTickSystem`) consumes the\n * return value via `switch (mode) { case 'loop': ...; case 'clamp': ... }`\n * to pick the per-branch frame-advance arithmetic.\n */\nexport function spritePlaybackModeFromU32(value: number): SpritePlaybackMode {\n return value === SPRITE_PLAYBACK_MODE_CLAMP ? 'clamp' : 'loop';\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LifecycleConstructionError, RenderTargetDescriptorInvalidError } from './chunk-
|
|
1
|
+
import { LifecycleConstructionError, RenderTargetDescriptorInvalidError } from './chunk-J6KACNOH.mjs';
|
|
2
2
|
import { ok, err, derive } from '@forgeax/engine-types';
|
|
3
3
|
import '@forgeax/engine-rhi';
|
|
4
4
|
import { vec3 } from '@forgeax/engine-math';
|
|
@@ -1190,5 +1190,5 @@ function selectPasses(passes, selector) {
|
|
|
1190
1190
|
}
|
|
1191
1191
|
|
|
1192
1192
|
export { COOKIE_MATRIX_BYTES, COOKIE_SLICE_CAPACITY, COOKIE_SLICE_SIZE, DeviceScope, EXTENDED_LIGHTING_REQUIRED_SAMPLED_TEXTURES, EXTENDED_LIGHTING_TOPOLOGY, GPU_BUFFER_USAGE_COPY_DST, GPU_BUFFER_USAGE_COPY_SRC, GPU_BUFFER_USAGE_INDEX, GPU_BUFFER_USAGE_INDIRECT, GPU_BUFFER_USAGE_MAP_READ, GPU_BUFFER_USAGE_QUERY_RESOLVE, GPU_BUFFER_USAGE_STORAGE, GPU_BUFFER_USAGE_UNIFORM, GPU_BUFFER_USAGE_VERTEX, GPU_SHADER_STAGE_COMPUTE, GPU_SHADER_STAGE_FRAGMENT, GPU_SHADER_STAGE_VERTEX, IES_SLICE_CAPACITY, IES_SLICE_HEIGHT, IES_SLICE_WIDTH, LifecycleTransaction, PROBE_BLEND_RECORD_BYTE_SIZE, PROBE_BLEND_RECORD_CAPACITY, PROBE_BLEND_RECORD_STRIDE, SHADOW_CASTER_SHADER_ID, SKIN_MATERIAL_SHADER_ID, SPRITE_PASS_PER_INSTANCE_REGION_VARIANT_SET, buildBindGroupLayoutDescriptor, buildPbrMaterialUserRegionEntries, buildPbrPipelineLayouts, buildPbrSkinLayouts, createHdrpBindGroupLayoutDescriptor, createHdrpSkinBindGroupLayoutDescriptor, createPbrSkinMeshBindGroupEntries, createRenderTargetMaterialSource, deriveExtendedLightingCapability, extendedLightingSampledTextureCapacityAvailable, getOpaqueResourceIdentity, getTextureIdentity, instanceCollectionCacheKey, isCanonicalStandardPbrMaterialShader, isStandardPbrMaterialShader, isStandardPbrSkinMaterialShader, makeZeroCameraFallbackSnapshot, matchPass, materialBindGroupLayoutIdentity, pbrSkinMeshDynamicOffsets, physicalTextureFields, probeBlendRecordOffset, resolvePipelineGroup2Contract, resolveRenderTargetMaterialSource, selectPasses, shadowCasterVariantSet, validateGraphTargetCaptureReadback, worldEntityKey };
|
|
1193
|
-
//# sourceMappingURL=chunk-
|
|
1194
|
-
//# sourceMappingURL=chunk-
|
|
1193
|
+
//# sourceMappingURL=chunk-IQMKJLNU.mjs.map
|
|
1194
|
+
//# sourceMappingURL=chunk-IQMKJLNU.mjs.map
|