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
|
|
@ -178,6 +178,35 @@ internal readonly record struct RenderDegradeState(byte Level, uint Revision);
|
|||
|
||||
internal readonly record struct RenderSortKey(ulong Value);
|
||||
|
||||
/// <summary>
|
||||
/// Read-only seam over the spatial owner's exact resident traversal. The
|
||||
/// render scene consumes this derived order only; it does not acquire spatial
|
||||
/// or gameplay ownership.
|
||||
/// </summary>
|
||||
internal interface IRenderTraversalOrderSource
|
||||
{
|
||||
bool TryGetTraversalSortKey(
|
||||
WorldEntity entity,
|
||||
out RenderSortKey sortKey);
|
||||
}
|
||||
|
||||
internal static class RenderTraversalSortKey
|
||||
{
|
||||
public static RenderSortKey Compose(
|
||||
uint landblockOrder,
|
||||
int entityIndex)
|
||||
{
|
||||
if (landblockOrder == 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(landblockOrder));
|
||||
if (entityIndex < 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(entityIndex));
|
||||
|
||||
return new RenderSortKey(
|
||||
((ulong)landblockOrder << 32)
|
||||
| checked((uint)entityIndex));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Immutable source facts required to compare the derived presentation scene
|
||||
/// with the accepted current path. These are diagnostics/render inputs only;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue