feat(rendering): compare scene-built PView candidates

Build a same-frame candidate product from incremental render-scene indices and compare its exact PView routes against the accepted current path without changing the production draw source.
This commit is contained in:
Erik 2026-07-25 00:12:53 +02:00
parent 8c638654be
commit e346f8bbaf
13 changed files with 1187 additions and 9 deletions

View file

@ -41,6 +41,7 @@ internal sealed record WorldLifecycleResourceSnapshot(
int MaterializedLiveEntities,
CurrentRenderSceneOracleSnapshot RenderSceneOracle,
RenderSceneShadowComparisonSnapshot RenderSceneShadow,
RenderFrameProductComparisonSnapshot RenderFrameProduct,
int PendingLiveTeardowns,
int PendingLandblockRetirements,
int ParticleEmitters,

View file

@ -43,6 +43,8 @@ internal sealed class WorldLifecycleResourceSnapshotSource
_renderSceneOracle;
private readonly IRenderSceneShadowSnapshotSource?
_renderSceneShadow;
private readonly IRenderFrameProductSnapshotSource?
_renderFrameProduct;
public WorldLifecycleResourceSnapshotSource(
GpuWorldState world,
@ -62,7 +64,8 @@ internal sealed class WorldLifecycleResourceSnapshotSource
IDatReaderWriter dats,
ResidencyManager residency,
ICurrentRenderSceneOracleSnapshotSource? renderSceneOracle = null,
IRenderSceneShadowSnapshotSource? renderSceneShadow = null)
IRenderSceneShadowSnapshotSource? renderSceneShadow = null,
IRenderFrameProductSnapshotSource? renderFrameProduct = null)
{
_world = world ?? throw new ArgumentNullException(nameof(world));
_animations = animations
@ -91,6 +94,7 @@ internal sealed class WorldLifecycleResourceSnapshotSource
?? throw new ArgumentNullException(nameof(residency));
_renderSceneOracle = renderSceneOracle;
_renderSceneShadow = renderSceneShadow;
_renderFrameProduct = renderFrameProduct;
}
public WorldLifecycleResourceSnapshot Capture(RenderFrameOutcome outcome)
@ -136,6 +140,9 @@ internal sealed class WorldLifecycleResourceSnapshotSource
RenderSceneShadow:
_renderSceneShadow?.CaptureCheckpointSnapshot()
?? RenderSceneShadowComparisonSnapshot.Disabled,
RenderFrameProduct:
_renderFrameProduct?.Snapshot
?? RenderFrameProductComparisonSnapshot.Disabled,
PendingLiveTeardowns: _liveEntities.PendingTeardownCount,
PendingLandblockRetirements: _streaming.PendingRetirementCount,
ParticleEmitters: _particles.ActiveEmitterCount,