fix(rendering): bound portal resource lifetime
Separate logical ownership, render publication, and GPU retirement across live entities, landblocks, particles, textures, mesh arenas, portal/UI teardown, and per-frame scratch storage. Add bounded DAT/texture caches, upload budgets, three-frame fence retirement, exact-incarnation appearance reconciliation, frame pacing, and extensive lifetime conformance coverage.\n\nThe seven-destination connected route now cuts peak working/private memory roughly in half, returns Caul to 125-153 FPS locally, and produces no WER or AMD reset.\n\nCo-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
3971997689
commit
749e8ceeb1
225 changed files with 29107 additions and 3914 deletions
|
|
@ -43,6 +43,7 @@ internal sealed class RemotePhysicsUpdater
|
|||
private readonly AcDream.Core.Physics.PhysicsEngine _physicsEngine;
|
||||
private readonly System.Func<uint, AcDream.Core.World.WorldEntity, (float Radius, float Height)> _getSetupCylinder;
|
||||
private readonly System.Action<uint, AnimatedEntity, RemoteMotion, System.Numerics.Vector3> _applyServerControlledVelocityCycle;
|
||||
private readonly List<AcDream.App.World.LiveEntityRecord> _spatialRemoteSnapshot = new();
|
||||
|
||||
internal RemotePhysicsUpdater(
|
||||
AcDream.Core.Physics.PhysicsEngine physicsEngine,
|
||||
|
|
@ -72,17 +73,26 @@ internal sealed class RemotePhysicsUpdater
|
|||
ArgumentNullException.ThrowIfNull(liveEntities);
|
||||
ArgumentNullException.ThrowIfNull(publishRootPose);
|
||||
|
||||
foreach (AcDream.App.World.LiveEntityRecord record in liveEntities.Records.ToArray())
|
||||
liveEntities.CopySpatialRemoteMotionRecordsTo(_spatialRemoteSnapshot);
|
||||
foreach (AcDream.App.World.LiveEntityRecord record in _spatialRemoteSnapshot)
|
||||
{
|
||||
if (record.ServerGuid == localPlayerServerGuid
|
||||
|| (record.FinalPhysicsState & AcDream.Core.Physics.PhysicsStateFlags.Hidden) == 0
|
||||
|| !liveEntities.ShouldAdvanceRootRuntime(record.ServerGuid)
|
||||
|| record.RemoteMotionRuntime is not RemoteMotion remote
|
||||
|| !liveEntities.IsCurrentSpatialRemoteMotion(record, remote)
|
||||
|| record.WorldEntity is not { } entity)
|
||||
continue;
|
||||
|
||||
TickHidden(remote, entity, dt);
|
||||
publishRootPose(entity);
|
||||
// PositionManager callbacks can rebucket, delete, or replace this
|
||||
// GUID. Publish only while the captured record/runtime pair still
|
||||
// owns a loaded spatial projection.
|
||||
if (liveEntities.IsCurrentSpatialRemoteMotion(record, remote)
|
||||
&& ReferenceEquals(record.WorldEntity, entity))
|
||||
{
|
||||
publishRootPose(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue