acdream/src/AcDream.App/Rendering/Wb/EnvCellMeshPreparationScheduler.cs
Erik 749e8ceeb1 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>
2026-07-18 21:35:16 +02:00

28 lines
993 B
C#

namespace AcDream.App.Rendering.Wb;
/// <summary>
/// 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
{
public static void Schedule(
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,
shell.CellStructure,
new List<ushort>(shell.Surfaces));
}
}
}