refactor(render): extract world scene frame owner

Move fallback and PView world drawing, shared alpha, particles, visibility, selection, and diagnostics behind focused frame owners. Make exceptional frames failure-atomic by restoring the shared GL baseline and preserving primary alpha failures through cleanup.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-22 07:22:09 +02:00
parent 85239fb373
commit 28e1cf8029
25 changed files with 2679 additions and 844 deletions

View file

@ -29,7 +29,7 @@ public sealed class GameWindowRenderLeafCompositionTests
"_renderFrameResources!.Prepare(frameInput);",
"_devToolsFramePresenter?.BeginFrame((float)deltaSeconds);",
"_renderWeatherFrame!.Tick(deltaSeconds);",
"_retailSelectionScene?.BeginFrame();");
"_worldSceneRenderer!.Render(frameInput);");
Assert.DoesNotContain("_wbDrawDispatcher?.BeginFrame(", source);
Assert.DoesNotContain("_wbMeshAdapter?.Tick();", source);
Assert.DoesNotContain("_particleRenderer?.BeginFrame(", source);
@ -126,12 +126,10 @@ public sealed class GameWindowRenderLeafCompositionTests
{
string source = GameWindowSource();
Assert.Contains("bool normalWorldDrawn = false;", source);
AssertAppearsInOrder(
source,
"if (IsLiveModeWaitingForLogin)",
"goto SkipWorldGeometry;",
"normalWorldDrawn = true;",
"_worldSceneRenderer!.Render(frameInput);",
"worldOutcome.NormalWorldDrawn;",
"bool screenshotCaptured = _frameScreenshots?.CapturePending() == true;",
"normalWorldDrawn),",
"screenshotCaptured)));");
@ -158,8 +156,9 @@ public sealed class GameWindowRenderLeafCompositionTests
Assert.Contains(
"new AcDream.App.Rendering.TerrainDrawDiagnosticsController(",
source);
Assert.Contains("_terrainDrawDiagnostics!.Begin();", source);
Assert.Contains("_terrainDrawDiagnostics.Complete();", source);
Assert.Contains("new AcDream.App.Rendering.WorldScenePassExecutor(", source);
Assert.DoesNotContain("_terrainDrawDiagnostics!.Begin();", source);
Assert.DoesNotContain("_terrainDrawDiagnostics.Complete();", source);
}
private static string GameWindowSource() => File.ReadAllText(Path.Combine(