fix(streaming): prepare quiesced destination entities
Separate loaded spatial residency from the world presentation gate so destination live objects acquire mesh owners behind portal space while drawing and simulation stay quiesced. Prevent unowned CPU-cache hits from recreating stale GPU staging work. Co-authored-by: Erik Nilsson <erikn@users.noreply.github.com>
This commit is contained in:
parent
e991eeca34
commit
91e82c3c68
6 changed files with 142 additions and 23 deletions
|
|
@ -435,6 +435,43 @@ public sealed class GpuWorldStateVisibilityTests
|
|||
Assert.Equal(0, state.PendingVisibilityTransitionCount);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void QuiescedDestinationProjection_AcquiresSpatialPresentationBeforeWorldReveal()
|
||||
{
|
||||
const uint landblock = 0x0101FFFFu;
|
||||
const uint cell = 0x01010001u;
|
||||
const uint guid = 0x70000021u;
|
||||
var availability = new WorldGenerationAvailabilityState();
|
||||
availability.Begin(7);
|
||||
var state = new GpuWorldState(availability: availability);
|
||||
state.AddLandblock(new LoadedLandblock(
|
||||
landblock,
|
||||
new LandBlock(),
|
||||
Array.Empty<WorldEntity>()));
|
||||
var runtime = new LiveEntityRuntime(
|
||||
state,
|
||||
new DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }));
|
||||
WorldSession.EntitySpawn spawn = Spawn(guid, cell);
|
||||
runtime.RegisterLiveEntity(spawn);
|
||||
var edges = new List<bool>();
|
||||
runtime.ProjectionVisibilityChanged += (_, visible) => edges.Add(visible);
|
||||
|
||||
runtime.MaterializeLiveEntity(
|
||||
guid,
|
||||
cell,
|
||||
id => Entity(id, guid));
|
||||
|
||||
Assert.False(state.IsLiveEntityVisible(guid));
|
||||
Assert.True(state.IsLiveEntityProjectionResident(guid));
|
||||
Assert.True(runtime.TryGetRecord(guid, out LiveEntityRecord record));
|
||||
Assert.True(record.IsSpatiallyVisible);
|
||||
Assert.Equal([true], edges);
|
||||
|
||||
Assert.True(availability.End(7));
|
||||
Assert.True(state.IsLiveEntityVisible(guid));
|
||||
Assert.True(record.IsSpatiallyVisible);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CopyLiveEntitiesNearLandblock_UsesBoundedNeighborhoodAndSkipsStatics()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue