fix(rendering): preserve canonical projection ownership
This commit is contained in:
parent
d8d9897376
commit
accd402dd7
2 changed files with 43 additions and 6 deletions
|
|
@ -522,13 +522,22 @@ internal sealed class CurrentRenderSceneOracle :
|
||||||
tuple.LandblockId);
|
tuple.LandblockId);
|
||||||
if (!_dispatcherProjectionByEntity.TryGetValue(
|
if (!_dispatcherProjectionByEntity.TryGetValue(
|
||||||
tuple.Entity,
|
tuple.Entity,
|
||||||
out CurrentRenderProjectionFingerprint projection)
|
out CurrentRenderProjectionFingerprint projection))
|
||||||
|| projection.LandblockId != cacheLandblockId)
|
{
|
||||||
|
// Logical projection identity remains the canonical owner
|
||||||
|
// captured by the partition. The dispatcher's cache hint is
|
||||||
|
// a separate routing fact and can intentionally be the
|
||||||
|
// temporary player-bucket landblock for outdoor objects.
|
||||||
|
// Conflating the two rewrote identity at this observer edge.
|
||||||
|
if (!_projectionByEntity.TryGetValue(
|
||||||
|
tuple.Entity,
|
||||||
|
out projection))
|
||||||
{
|
{
|
||||||
projection = CreateFingerprint(
|
projection = CreateFingerprint(
|
||||||
cacheLandblockId,
|
cacheLandblockId,
|
||||||
tuple.Entity,
|
tuple.Entity,
|
||||||
ProjectionClassOf(tuple.Entity));
|
ProjectionClassOf(tuple.Entity));
|
||||||
|
}
|
||||||
_dispatcherProjectionByEntity[tuple.Entity] = projection;
|
_dispatcherProjectionByEntity[tuple.Entity] = projection;
|
||||||
}
|
}
|
||||||
var candidate = new CurrentRenderDispatcherFingerprint(
|
var candidate = new CurrentRenderDispatcherFingerprint(
|
||||||
|
|
|
||||||
|
|
@ -344,6 +344,34 @@ public sealed class CurrentRenderSceneOracleTests
|
||||||
Assert.NotEqual(first.DispatcherDigest, reset.DispatcherDigest);
|
Assert.NotEqual(first.DispatcherDigest, reset.DispatcherDigest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void DispatcherTemporaryBucket_DoesNotRewriteProjectionOwner()
|
||||||
|
{
|
||||||
|
WorldEntity outdoor = Entity(
|
||||||
|
id: 61,
|
||||||
|
serverGuid: 0,
|
||||||
|
parentCell: null);
|
||||||
|
var oracle = new CurrentRenderSceneOracle();
|
||||||
|
var result = new InteriorEntityPartition.Result();
|
||||||
|
InteriorEntityPartition.Partition(
|
||||||
|
result,
|
||||||
|
[],
|
||||||
|
[Entry(LandblockA, outdoor)],
|
||||||
|
oracle);
|
||||||
|
|
||||||
|
oracle.BeginDispatcherFrame();
|
||||||
|
oracle.ObserveDispatcherDraw(
|
||||||
|
WbDrawDispatcher.EntitySet.All,
|
||||||
|
entitiesWalked: 1,
|
||||||
|
[(outdoor, 0, LandblockB)]);
|
||||||
|
|
||||||
|
CurrentRenderDispatcherFingerprint candidate =
|
||||||
|
Assert.Single(oracle.DispatcherCandidates);
|
||||||
|
Assert.Equal(LandblockA, candidate.Projection.LandblockId);
|
||||||
|
Assert.Equal(LandblockB, candidate.TupleLandblockId);
|
||||||
|
Assert.Equal(LandblockB, candidate.CacheLandblockId);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void DispatcherAbortDiscardsIncompleteCandidates()
|
public void DispatcherAbortDiscardsIncompleteCandidates()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue