Revert "perf(rendering): draw retained frame product"

This reverts commit ef1d263337.
This commit is contained in:
Erik 2026-07-25 06:28:31 +02:00
parent 624e1119ca
commit 2c848d4167
13 changed files with 268 additions and 1334 deletions

View file

@ -10,8 +10,7 @@ namespace AcDream.App.Rendering.Scene.Arch;
/// projection. Arch identities never leave this namespace; callers only see
/// generation-checked acdream value types.
///
/// Slice F introduced this owner in non-drawing shadow mode; Slice G supplies
/// its borrowed frame product to the production renderer.
/// Slice F1 deliberately leaves this owner unbound and non-drawing.
/// </summary>
internal sealed class ArchRenderScene : IRenderScene, IRenderSceneQuerySource
{
@ -36,7 +35,6 @@ internal sealed class ArchRenderScene : IRenderScene, IRenderSceneQuerySource
private ArchWorld _world;
private RenderProjectionCounts _counts;
private ulong _lastAppliedJournalSequence;
private ulong _indexRevision = 1;
private bool _disposed;
public ArchRenderScene(RenderSceneGeneration initialGeneration)
@ -227,7 +225,6 @@ internal sealed class ArchRenderScene : IRenderScene, IRenderSceneQuerySource
_counts = default;
_lastAppliedJournalSequence = 0;
Generation = replacementGeneration;
AdvanceIndexRevision();
}
public void Dispose()
@ -277,13 +274,6 @@ internal sealed class ArchRenderScene : IRenderScene, IRenderSceneQuerySource
_dirty.Count);
}
ulong IRenderSceneQuerySource.GetIndexRevision(
RenderSceneGeneration generation)
{
EnsureQueryGeneration(generation);
return _indexRevision;
}
bool IRenderSceneQuerySource.TryGet(
RenderSceneGeneration generation,
RenderProjectionId id,
@ -601,12 +591,6 @@ internal sealed class ArchRenderScene : IRenderScene, IRenderSceneQuerySource
in RenderProjectionRecord prior,
in RenderProjectionRecord current)
{
if (IndexMembershipEquals(in prior, in current))
{
SynchronizeDirtyIndex(in current);
return;
}
RemoveFromIndices(in prior);
AddToIndices(in current);
}
@ -651,7 +635,6 @@ internal sealed class ArchRenderScene : IRenderScene, IRenderSceneQuerySource
_lightCandidates.Add(record.Id);
if (record.DirtyMask != RenderDirtyMask.None)
_dirty.Add(record.Id);
AdvanceIndexRevision();
}
private void RemoveFromIndices(in RenderProjectionRecord record)
@ -667,46 +650,6 @@ internal sealed class ArchRenderScene : IRenderScene, IRenderSceneQuerySource
_dirty.Remove(record.Id);
RemoveCell(_cellStatics, record.Residency.FullCellId, record.Id);
RemoveCell(_cellDynamics, record.Residency.FullCellId, record.Id);
AdvanceIndexRevision();
}
private static bool IndexMembershipEquals(
in RenderProjectionRecord left,
in RenderProjectionRecord right)
{
const RenderProjectionFlags indexedFlags =
RenderProjectionFlags.Translucent
| RenderProjectionFlags.Selectable
| RenderProjectionFlags.LightCandidate
| RenderProjectionFlags.PortalStraddling
| RenderProjectionFlags.SpatiallyResident;
return left.ProjectionClass == right.ProjectionClass
&& left.Source.ParentCellId == right.Source.ParentCellId
&& left.Residency.FullCellId == right.Residency.FullCellId
&& (left.Flags & indexedFlags) == (right.Flags & indexedFlags)
&& left.MeshSet.MeshCount == right.MeshSet.MeshCount
&& left.SortKey == right.SortKey;
}
private void SynchronizeDirtyIndex(
in RenderProjectionRecord record)
{
if (record.DirtyMask == RenderDirtyMask.None)
_dirty.Remove(record.Id);
else
_dirty.Add(record.Id);
}
private void AdvanceIndexRevision()
{
if (_indexRevision == ulong.MaxValue)
{
throw new InvalidOperationException(
"Render-scene index revision space was exhausted.");
}
_indexRevision++;
}
private static bool IsDynamic(RenderProjectionClass projectionClass) =>