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:
Erik 2026-07-18 21:35:16 +02:00
parent 3971997689
commit 749e8ceeb1
225 changed files with 29107 additions and 3914 deletions

View file

@ -1,9 +1,11 @@
namespace AcDream.App.Rendering.Wb;
/// <summary>
/// Starts CPU mesh extraction for a completed EnvCell build without publishing
/// that build to the live renderer. ObjectMeshManager owns its thread-safe work
/// queue; the render-thread commit remains a small atomic state replacement.
/// Starts CPU mesh extraction after the completed EnvCell build has been
/// published and its geometry ids have acquired render ownership. This order
/// lets ObjectMeshManager cancel queued work as soon as a landblock leaves the
/// current streaming generation; stale portal destinations never keep decoder
/// jobs or surface lists alive.
/// </summary>
public static class EnvCellMeshPreparationScheduler
{
@ -11,8 +13,11 @@ public static class EnvCellMeshPreparationScheduler
EnvCellLandblockBuild build,
ObjectMeshManager meshManager)
{
var scheduled = new HashSet<ulong>();
foreach (var shell in build.Shells)
{
if (!scheduled.Add(shell.GeometryId))
continue;
_ = meshManager.PrepareEnvCellGeomMeshDataAsync(
shell.GeometryId,
shell.EnvironmentId,