fix(streaming): preserve portal destination ownership
Detach old-world spatial ownership atomically, prioritize destination retirement dependencies, and reveal the viewport at the retail transition edge. Give private paperdoll views independent mesh ownership and retain dormant ACE entities so portal revisits preserve server objects without extending active GPU lifetimes.
This commit is contained in:
parent
2c848d4167
commit
823936ec31
57 changed files with 2551 additions and 324 deletions
|
|
@ -0,0 +1,53 @@
|
|||
using AcDream.App.Streaming;
|
||||
|
||||
namespace AcDream.App.Rendering;
|
||||
|
||||
/// <summary>
|
||||
/// Applies one reveal generation to every render-resource participant and
|
||||
/// restores their ordinary profile only when that exact generation ends.
|
||||
/// Replacing an active generation keeps priority continuously enabled.
|
||||
/// </summary>
|
||||
internal sealed class WorldRevealRenderResourceScheduler
|
||||
: IWorldRevealRenderResourceScheduler
|
||||
{
|
||||
private readonly Action<bool>[] _participants;
|
||||
private long _activeGeneration;
|
||||
|
||||
public WorldRevealRenderResourceScheduler(
|
||||
params Action<bool>[] participants)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(participants);
|
||||
if (participants.Length == 0)
|
||||
throw new ArgumentException(
|
||||
"At least one reveal upload participant is required.",
|
||||
nameof(participants));
|
||||
if (participants.Any(static participant => participant is null))
|
||||
throw new ArgumentException(
|
||||
"Reveal upload participants cannot contain null.",
|
||||
nameof(participants));
|
||||
|
||||
_participants = [.. participants];
|
||||
}
|
||||
|
||||
public void BeginDestinationReveal(long revealGeneration)
|
||||
{
|
||||
if (revealGeneration <= 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(revealGeneration));
|
||||
|
||||
_activeGeneration = revealGeneration;
|
||||
for (int i = 0; i < _participants.Length; i++)
|
||||
_participants[i](true);
|
||||
}
|
||||
|
||||
public void EndDestinationReveal(long revealGeneration)
|
||||
{
|
||||
if (revealGeneration <= 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(revealGeneration));
|
||||
if (_activeGeneration != revealGeneration)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < _participants.Length; i++)
|
||||
_participants[i](false);
|
||||
_activeGeneration = 0;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue