fix(rendering): reconcile shadow roots from live runtime
Recover ordinary live roots from LiveEntityRuntime's canonical active spatial workset instead of relying on already-retained derived records. Keep attached children callback-authoritative, cache immutable selection geometry fingerprints, and pin zero-allocation retained update paths with regression tests. Release gate: 3,733 App tests / 3 skips; 8,217 complete-solution tests / 5 skips. Co-Authored-By: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
056bbd4efd
commit
91463db551
7 changed files with 272 additions and 15 deletions
|
|
@ -263,6 +263,48 @@ public sealed class StaticRenderProjectionJournalTests
|
|||
unchanged.ProjectionClass);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ActiveAnimatedSynchronization_ReusesRetainedJournalStorage()
|
||||
{
|
||||
const int count = 1_000;
|
||||
RenderSceneGeneration generation = Generation(9);
|
||||
var journal = new RenderProjectionJournal(generation);
|
||||
var statics = new StaticRenderProjectionJournal(journal);
|
||||
var animated = new WorldEntity[count];
|
||||
for (int index = 0; index < animated.Length; index++)
|
||||
animated[index] = Entity((uint)index + 1);
|
||||
LandblockBuild build = Build(
|
||||
LandblockId,
|
||||
animated,
|
||||
includeShell: false);
|
||||
statics.Reconcile(build, Publication(build));
|
||||
using var scene = new ArchRenderScene(generation);
|
||||
journal.DrainTo(scene);
|
||||
statics.SynchronizeActiveAnimatedSources(animated);
|
||||
journal.DrainTo(scene);
|
||||
for (int index = 0; index < animated.Length; index++)
|
||||
{
|
||||
animated[index].Rotation = Quaternion.CreateFromAxisAngle(
|
||||
Vector3.UnitZ,
|
||||
0.25f);
|
||||
}
|
||||
statics.SynchronizeActiveAnimatedSources(animated);
|
||||
journal.DrainTo(scene);
|
||||
for (int index = 0; index < animated.Length; index++)
|
||||
{
|
||||
animated[index].Rotation = Quaternion.CreateFromAxisAngle(
|
||||
Vector3.UnitZ,
|
||||
0.5f);
|
||||
}
|
||||
long before = GC.GetAllocatedBytesForCurrentThread();
|
||||
|
||||
statics.SynchronizeActiveAnimatedSources(animated);
|
||||
|
||||
long allocated = GC.GetAllocatedBytesForCurrentThread() - before;
|
||||
Assert.Equal(count, journal.Count);
|
||||
Assert.True(allocated == 0, $"Allocated {allocated:N0} bytes.");
|
||||
}
|
||||
|
||||
private static GpuLandblockSpatialPublication Publication(
|
||||
LandblockBuild build,
|
||||
bool requiresActivation = true) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue