fix(rendering): preserve exact scene traversal order
This commit is contained in:
parent
06e7754619
commit
e0f36caa70
12 changed files with 500 additions and 77 deletions
|
|
@ -254,8 +254,6 @@ internal sealed class RenderScenePViewFrameProductController :
|
|||
}
|
||||
}
|
||||
|
||||
_expected.Sort(CandidateKeyComparer.Instance);
|
||||
_actual.Sort(CandidateKeyComparer.Instance);
|
||||
RenderSceneHash128 expectedDigest = BuildDigest(_expected);
|
||||
RenderSceneHash128 actualDigest = BuildDigest(_actual);
|
||||
string? mismatch = CompareKeys();
|
||||
|
|
@ -641,8 +639,6 @@ internal sealed class RenderScenePViewFrameProductController :
|
|||
}
|
||||
}
|
||||
|
||||
_packedExpected.Sort(PackedInputKeyComparer.Instance);
|
||||
_packedActual.Sort(PackedInputKeyComparer.Instance);
|
||||
RenderSceneHash128 expectedDigest =
|
||||
BuildPackedInputDigest(_packedExpected);
|
||||
RenderSceneHash128 actualDigest =
|
||||
|
|
@ -873,44 +869,6 @@ internal sealed class RenderScenePViewFrameProductController :
|
|||
}
|
||||
}
|
||||
|
||||
private sealed class CandidateKeyComparer : IComparer<CandidateKey>
|
||||
{
|
||||
public static CandidateKeyComparer Instance { get; } = new();
|
||||
|
||||
private CandidateKeyComparer()
|
||||
{
|
||||
}
|
||||
|
||||
public int Compare(CandidateKey left, CandidateKey right)
|
||||
{
|
||||
int value = left.Route.CompareTo(right.Route);
|
||||
if (value != 0) return value;
|
||||
value = left.RouteIndex.CompareTo(right.RouteIndex);
|
||||
if (value != 0) return value;
|
||||
value = left.CellId.CompareTo(right.CellId);
|
||||
if (value != 0) return value;
|
||||
return left.ProjectionId.CompareTo(right.ProjectionId);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class PackedInputKeyComparer :
|
||||
IComparer<PackedInputKey>
|
||||
{
|
||||
public static PackedInputKeyComparer Instance { get; } = new();
|
||||
|
||||
private PackedInputKeyComparer()
|
||||
{
|
||||
}
|
||||
|
||||
public int Compare(PackedInputKey left, PackedInputKey right)
|
||||
{
|
||||
int value = left.DrawSequence.CompareTo(right.DrawSequence);
|
||||
if (value != 0) return value;
|
||||
value = left.ProjectionId.CompareTo(right.ProjectionId);
|
||||
if (value != 0) return value;
|
||||
return left.MeshRefIndex.CompareTo(right.MeshRefIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue